@arcgis/portal-components 5.0.0-next.130 → 5.0.0-next.131
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/dist/cdn/{TAXP6R2V.js → 5B2STDJN.js} +2 -2
- package/dist/cdn/{652FN34L.js → AZT7OUUX.js} +1 -1
- package/dist/cdn/{L65QEUTQ.js → BA64YMT3.js} +2 -2
- package/dist/cdn/{ED3DTJE2.js → BO5HDOU6.js} +2 -2
- package/dist/cdn/{TE2R2GXI.js → F4TYC7FY.js} +2 -2
- package/dist/cdn/{JWB6OMHQ.js → FQEFBWYX.js} +1 -1
- package/dist/cdn/{VJAE2RWH.js → GCAU4MAN.js} +2 -2
- package/dist/cdn/{DEHRKWFH.js → H5DKVLEB.js} +2 -2
- package/dist/cdn/{CJPXKRMI.js → PABZQOG5.js} +2 -2
- package/dist/cdn/{Q5YHXBL4.js → QX3GG75A.js} +2 -2
- package/dist/cdn/{FYKU2XYE.js → TGXOKY5O.js} +2 -2
- package/dist/cdn/{2KZZPVXE.js → TQPOVCOU.js} +2 -2
- package/dist/cdn/{OMZVSMZD.js → WMSJASDA.js} +2 -2
- package/dist/cdn/{QBACE6MQ.js → X3F5IZWT.js} +2 -2
- package/dist/cdn/{MNAVANS5.js → YUN26ABC.js} +2 -2
- package/dist/cdn/ZN4WBK5W.js +6 -0
- package/dist/cdn/{DS7M5QVJ.js → ZWMYJR2S.js} +1 -1
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/common.js +1 -1
- package/dist/chunks/fieldAddDelete.js +1 -1
- package/dist/chunks/item.js +1 -1
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/requests.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
- package/dist/components/arcgis-portal-extent-picker/customElement.js +1 -1
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
- package/dist/components/arcgis-portal-field-delete/customElement.js +1 -1
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +1 -1
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +4 -4
- package/dist/cdn/3E2C5GC4.js +0 -4
- package/dist/cdn/3TVMBNSG.js +0 -4
- package/dist/cdn/5IVNTZIK.js +0 -4
- package/dist/cdn/5N7A6QPT.js +0 -4
- package/dist/cdn/73Y4DGUS.js +0 -4
- package/dist/cdn/BBVYKMTF.js +0 -4
- package/dist/cdn/HDBWKON4.js +0 -4
- package/dist/cdn/MEPRQCQD.js +0 -6
- package/dist/cdn/MJSDZEEP.js +0 -4
- package/dist/cdn/MMJY4UUQ.js +0 -4
- package/dist/cdn/MVFEDTNC.js +0 -4
- package/dist/cdn/NPVRYPWN.js +0 -4
- package/dist/cdn/PVY7S6MU.js +0 -6
- package/dist/cdn/U45XPLZN.js +0 -4
- package/dist/cdn/XFE2JKC3.js +0 -4
- package/dist/cdn/YBV7UFLL.js +0 -4
- package/dist/cdn/YVA74N2A.js +0 -4
- package/dist/cdn/ZXDJCERM.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import a from"./DS7M5QVJ.js";import{b as q}from"./VJAE2RWH.js";import{a as G}from"./ZXDJCERM.js";import"./5N7A6QPT.js";import{G as C,H as P,I as B,M as A,O as W,h as j,j as g,n as N,p as S,q as J,u as E}from"./MEPRQCQD.js";export default $arcgis.t(([le,Ie,ve,Fe,x,I,ce,pe,L,ee,$,{a:T,b:z,c:V,d:U,e:_,f:H,g:K,h:Q,i:X,j:Y,k:Z}])=>{var k=(i=>(i.expression="expression/",i.raster="Raster.",i.relationship="relationships/",i))(k||{}),fe=["feature"];function O(i){return"fieldConfigurations"in i&&fe.includes(i.type)}function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(k.expression)){let a=t.get(s);return a?.title?a.title:s}else return O(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function se(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let a=e.get(i);s=a.type?a.type.toLowerCase():""}else if(t.has(i)){let a=t.get(i);s=a.returnType?a.returnType.toLowerCase():""}else s="number";return s}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function ae(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${k.expression}${t.name}`;e.set(s,t)}),e}async function me(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,a=s?.layer;a?.portalItem&&a.url.includes("https://demographics")&&a.url.includes(".arcgis.com")?a.portalItem?.fetchData().then(r=>{if(r?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=r.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(r=>{t(new Error(r))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function re(i,e,t,s){if(!t)return!1;let a=["feature","oriented-imagery"].includes(e.type),r=s?.item??e.portalItem,o=e.sourceJSON;if(!a||!r||!r.portal.user||!_(r)||U(r)||H(r)||K(o)||r.portal.isPortal&&V(r)||["oid","global-id","geometry"].includes(t.type)||await ue(e,t.name,s))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,n=c?.shapeAreaFieldName;if(d(p,t.name)||d(n,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!s?.ignoreLayerRenderer&&e.featureReduction){let m=new Set;if(await I.collectFeatureReductionFields(m,e,e.featureReduction),Array.from(m).some(w=>d(w,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(m=>d(m,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let m=e.labelingInfo?.map(w=>w.labelExpressionInfo?.expression);if(m&&((await I.getExpressionFields(e,m)).some(w=>d(w,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(m=>d(m,t.name))||await ge(e,t,s)||await ye(e,t))return!1;if(await be(e,t))return await Promise.resolve(!1);if(await we(e,t))return await Promise.resolve(!1);if(he(i,e,t)||e.relationships?.map(m=>m.keyField)?.some(m=>d(m,t.name)))return!1;let f=z(r,r.portal.user),v=s?.userItemInfo?.userGroups??await Q(e)??[],h=s?.userItemInfo?.itemGroups??await X(e)??[],b=Z(v,h);if(!f&&!b)return!1;let y=s?.userItemInfo?.relatedItems??await Y(r.id,r.portal,{relationshipType:"Service2Service"});return!(y?.data?.relatedItems&&y.data.relatedItems.some(m=>["WMTS","Map Service","Vector Tile Service"].includes(m.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`,a=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await ee(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return a?a.some(r=>r.fields.some(o=>d(o,e))):!1}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let a=s.layers?.find(r=>r.id===e.id);if(a){let r=a?.field?.name;if(r)return d(r,t.name)}}return!1}async function oe(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(o=>F(o.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(o=>F(o.where));if(!s?.length)return!1;let a=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],r=!1;for(let o=0;o<a.length;o++){let c=a[o].fieldNames?.some(p=>d(p,e.name));if(!r&&c){r=!0;break}}return await Promise.resolve(r)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let a=`${T(s.portal)}content/items/${s.id}/data`,r=(t?.userItemInfo?.itemData??await ee(a,{query:{f:"json"},responseType:"json"}))?.data;if(!r)return!1;if(r?.layers){let o=r.layers.find(l=>l.id===i.layerId),c=o?.layerDefinition?.drawingInfo?.renderer,p=o?.layerDefinition?.featureReduction,n=o?.layerDefinition?.definitionExpression;if(!c&&!p&&!n)return!1;if(!t?.ignoreItemRenderer&&c){let l=L.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await ne(i,e,p)||n&&(await $.parseWhereClause(n,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ye(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,a=t?.featureReduction;if(!s&&!a)return!1;if(s){let r=L.fromJSON(s);if((await I.getRendererFields(r,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(a&&await ne(i,e,a))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(a=>a.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(a=>d(a,e.name)))return await Promise.resolve(!0);if(await oe(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function we(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function ne(i,e,t){let s=t.type==="binning"?ce.fromJSON(t):pe.fromJSON(t),a=new Set;return await I.collectFeatureReductionFields(a,i,s),!!Array.from(a).some(r=>d(r,e.name))}var u=new Map;u.set("oid","key");u.set("guid","key");u.set("global-id","key");u.set("blob","binary");u.set("integer","integer");u.set("small-integer","integer");u.set("big-integer","integer");u.set("single","number");u.set("double","number");u.set("long","number");u.set("number","number");u.set("date","date-time");u.set("date-only","calendar");u.set("time-only","clock");u.set("timestamp-offset","time-zone");u.set("string","string");var Ne=({fieldType:i})=>g`<calcite-icon scale=s .icon=${u.get(i)}></calcite-icon>`,Ee=j`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,M=class extends B{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=G({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new q(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||N("error",this,S("layer")),F(t)||N("error",this,S("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=E(),this.arcgisClose=E(),this.arcgisBeforeDelete=E(),this.arcgisFieldsDeleted=E()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(r=>s.includes(r.name));let a=s.some(r=>!e.fields.find(o=>o.name===r));if(!this.layerFields?.length||a)this.fieldsAreDeletable=!1;else{let r=await Promise.all(this.layerFields.map(async o=>await re(t,e,o,this.options)));if(this.fieldsAreDeletable=r.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=ae(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Fe.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let a=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(r=>r.fieldName===e);return a?te(t,a,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return O(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,a={fields:t.map(o=>({name:o}))},r={deleteFromDefinition:JSON.stringify(a)};await x(s,{query:{...r,f:"json",async:!1},method:"post",responseType:"json"}).then(async o=>{if(o.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(n=>{e.type==="feature"&&e.floorInfo?.floorField===n&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let n=p.data;this.currentLayerInfo=p.data,n&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{n.templates?.length?n.templates.forEach(f=>delete f.prototype.attributes[l]):n.types?.forEach(f=>{f.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(n))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(a=>{a.templates=this.updateTemplatesList(a.templates),this.addType(t,a)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,a=[];return(e??[]).forEach(r=>{let o=new Ie;o.description=r.description??"",o.name=r.name||s.newFeature,o.drawingTool=r.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let f=0;f<r.prototype.attributes.length;f++)if(r.prototype.attributes[f]===n.name){l=!0,c[n.name]=r.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,a.push(o)}),a}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,a={templates:e.templates,types:e.types},r=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(a)};await x(r,{query:{...o,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${T(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(n=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==n)),t.popupTemplate?.content?.forEach((l,f)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[f].fieldInfos=(t.popupTemplate?.content)[f].fieldInfos?.filter(v=>v.fieldName!==n))})}),t.attributeTableTemplate){let n=t.attributeTableTemplate.clone();n.elements=n.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),n.orderByFields=n.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=n}if(t.fieldConfigurations?.length){let n=le.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=n}await x(p,{query:{f:"json"},responseType:"json"}).then(async n=>{let l=n.data;if(l?.layers||l?.tables){let f=t.isTable,v=f?l.tables:l.layers,h=v?.find(b=>b.id===t.layerId);if(s.forEach(b=>{h?.attributeTableInfo?.attributeTableElements&&(h.attributeTableInfo.attributeTableElements=h.attributeTableInfo.attributeTableElements.filter(y=>!(y.type==="field"&&y.fieldName===b)),h.attributeTableInfo.orderByFields=h.attributeTableInfo.orderByFields.filter(y=>y.field!==b))}),h?.layerDefinition?.fieldConfigurations&&(h.layerDefinition.fieldConfigurations=h.layerDefinition.fieldConfigurations.filter(b=>!s.includes(b.name))),h?.popupInfo){s.forEach(w=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(D=>D.fieldName!==w),h.popupInfo.popupElements?.forEach((D,R)=>{D.type==="fields"&&D.fieldInfos&&(h.popupInfo.popupElements[R].fieldInfos=h.popupInfo.popupElements[R].fieldInfos.filter(de=>de.fieldName!==w))})});let b=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,y={};f?(y.tables=v,l.layers&&(y.layers=l.layers)):(y.layers=v,l.tables&&(y.tables=l.tables));let m={f:"json",text:JSON.stringify(y)};await x(b,{query:{...m},method:"post",responseType:"json"}).then(w=>{w.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else n.httpStatus===200&&(!n.data||JSON.stringify(n.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=A(g`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(g`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(g`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&g`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:s,deleteInProgress:a}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,J("fieldNames"))),g`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${s?.length===1?e.deleteField:e.deleteFields} ${P(this.dialogNode)}>${t?g`<div class=${`dialog-content-wrapper ${a?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return g`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return g`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:a,messages:r}=this;return g`<calcite-list .label=${r.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return g`<calcite-list-item .label=${this.getFieldLabel(o)} .description=${`{${o}}`} .value=${o} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:se(o,s,a)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return g`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${P(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return g`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:a}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,a.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};W("arcgis-portal-field-delete",M);return M},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql",a)
|
|
3
|
+
v5.0.0-next.131 */
|
|
4
|
+
import a from"./ZWMYJR2S.js";import{b as q}from"./GCAU4MAN.js";import{a as G}from"./5B2STDJN.js";import"./TGXOKY5O.js";import{G as C,H as P,I as B,M as A,O as W,h as j,j as g,n as N,p as S,q as J,u as E}from"./ZN4WBK5W.js";export default $arcgis.t(([le,Ie,ve,Fe,x,I,ce,pe,L,ee,$,{a:T,b:z,c:V,d:U,e:_,f:H,g:K,h:Q,i:X,j:Y,k:Z}])=>{var k=(i=>(i.expression="expression/",i.raster="Raster.",i.relationship="relationships/",i))(k||{}),fe=["feature"];function O(i){return"fieldConfigurations"in i&&fe.includes(i.type)}function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(k.expression)){let a=t.get(s);return a?.title?a.title:s}else return O(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function se(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let a=e.get(i);s=a.type?a.type.toLowerCase():""}else if(t.has(i)){let a=t.get(i);s=a.returnType?a.returnType.toLowerCase():""}else s="number";return s}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function ae(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${k.expression}${t.name}`;e.set(s,t)}),e}async function me(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,a=s?.layer;a?.portalItem&&a.url.includes("https://demographics")&&a.url.includes(".arcgis.com")?a.portalItem?.fetchData().then(r=>{if(r?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=r.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(r=>{t(new Error(r))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function re(i,e,t,s){if(!t)return!1;let a=["feature","oriented-imagery"].includes(e.type),r=s?.item??e.portalItem,o=e.sourceJSON;if(!a||!r||!r.portal.user||!_(r)||U(r)||H(r)||K(o)||r.portal.isPortal&&V(r)||["oid","global-id","geometry"].includes(t.type)||await ue(e,t.name,s))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,n=c?.shapeAreaFieldName;if(d(p,t.name)||d(n,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!s?.ignoreLayerRenderer&&e.featureReduction){let m=new Set;if(await I.collectFeatureReductionFields(m,e,e.featureReduction),Array.from(m).some(w=>d(w,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(m=>d(m,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let m=e.labelingInfo?.map(w=>w.labelExpressionInfo?.expression);if(m&&((await I.getExpressionFields(e,m)).some(w=>d(w,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(m=>d(m,t.name))||await ge(e,t,s)||await ye(e,t))return!1;if(await be(e,t))return await Promise.resolve(!1);if(await we(e,t))return await Promise.resolve(!1);if(he(i,e,t)||e.relationships?.map(m=>m.keyField)?.some(m=>d(m,t.name)))return!1;let f=z(r,r.portal.user),v=s?.userItemInfo?.userGroups??await Q(e)??[],h=s?.userItemInfo?.itemGroups??await X(e)??[],b=Z(v,h);if(!f&&!b)return!1;let y=s?.userItemInfo?.relatedItems??await Y(r.id,r.portal,{relationshipType:"Service2Service"});return!(y?.data?.relatedItems&&y.data.relatedItems.some(m=>["WMTS","Map Service","Vector Tile Service"].includes(m.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`,a=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await ee(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return a?a.some(r=>r.fields.some(o=>d(o,e))):!1}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let a=s.layers?.find(r=>r.id===e.id);if(a){let r=a?.field?.name;if(r)return d(r,t.name)}}return!1}async function oe(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(o=>F(o.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(o=>F(o.where));if(!s?.length)return!1;let a=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],r=!1;for(let o=0;o<a.length;o++){let c=a[o].fieldNames?.some(p=>d(p,e.name));if(!r&&c){r=!0;break}}return await Promise.resolve(r)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let a=`${T(s.portal)}content/items/${s.id}/data`,r=(t?.userItemInfo?.itemData??await ee(a,{query:{f:"json"},responseType:"json"}))?.data;if(!r)return!1;if(r?.layers){let o=r.layers.find(l=>l.id===i.layerId),c=o?.layerDefinition?.drawingInfo?.renderer,p=o?.layerDefinition?.featureReduction,n=o?.layerDefinition?.definitionExpression;if(!c&&!p&&!n)return!1;if(!t?.ignoreItemRenderer&&c){let l=L.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await ne(i,e,p)||n&&(await $.parseWhereClause(n,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ye(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,a=t?.featureReduction;if(!s&&!a)return!1;if(s){let r=L.fromJSON(s);if((await I.getRendererFields(r,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(a&&await ne(i,e,a))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(a=>a.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(a=>d(a,e.name)))return await Promise.resolve(!0);if(await oe(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function we(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function ne(i,e,t){let s=t.type==="binning"?ce.fromJSON(t):pe.fromJSON(t),a=new Set;return await I.collectFeatureReductionFields(a,i,s),!!Array.from(a).some(r=>d(r,e.name))}var u=new Map;u.set("oid","key");u.set("guid","key");u.set("global-id","key");u.set("blob","binary");u.set("integer","integer");u.set("small-integer","integer");u.set("big-integer","integer");u.set("single","number");u.set("double","number");u.set("long","number");u.set("number","number");u.set("date","date-time");u.set("date-only","calendar");u.set("time-only","clock");u.set("timestamp-offset","time-zone");u.set("string","string");var Ne=({fieldType:i})=>g`<calcite-icon scale=s .icon=${u.get(i)}></calcite-icon>`,Ee=j`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,M=class extends B{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=G({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new q(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||N("error",this,S("layer")),F(t)||N("error",this,S("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=E(),this.arcgisClose=E(),this.arcgisBeforeDelete=E(),this.arcgisFieldsDeleted=E()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(r=>s.includes(r.name));let a=s.some(r=>!e.fields.find(o=>o.name===r));if(!this.layerFields?.length||a)this.fieldsAreDeletable=!1;else{let r=await Promise.all(this.layerFields.map(async o=>await re(t,e,o,this.options)));if(this.fieldsAreDeletable=r.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=ae(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Fe.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let a=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(r=>r.fieldName===e);return a?te(t,a,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return O(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,a={fields:t.map(o=>({name:o}))},r={deleteFromDefinition:JSON.stringify(a)};await x(s,{query:{...r,f:"json",async:!1},method:"post",responseType:"json"}).then(async o=>{if(o.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(n=>{e.type==="feature"&&e.floorInfo?.floorField===n&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let n=p.data;this.currentLayerInfo=p.data,n&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{n.templates?.length?n.templates.forEach(f=>delete f.prototype.attributes[l]):n.types?.forEach(f=>{f.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(n))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(a=>{a.templates=this.updateTemplatesList(a.templates),this.addType(t,a)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,a=[];return(e??[]).forEach(r=>{let o=new Ie;o.description=r.description??"",o.name=r.name||s.newFeature,o.drawingTool=r.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let f=0;f<r.prototype.attributes.length;f++)if(r.prototype.attributes[f]===n.name){l=!0,c[n.name]=r.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,a.push(o)}),a}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,a={templates:e.templates,types:e.types},r=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(a)};await x(r,{query:{...o,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${T(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(n=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==n)),t.popupTemplate?.content?.forEach((l,f)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[f].fieldInfos=(t.popupTemplate?.content)[f].fieldInfos?.filter(v=>v.fieldName!==n))})}),t.attributeTableTemplate){let n=t.attributeTableTemplate.clone();n.elements=n.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),n.orderByFields=n.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=n}if(t.fieldConfigurations?.length){let n=le.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=n}await x(p,{query:{f:"json"},responseType:"json"}).then(async n=>{let l=n.data;if(l?.layers||l?.tables){let f=t.isTable,v=f?l.tables:l.layers,h=v?.find(b=>b.id===t.layerId);if(s.forEach(b=>{h?.attributeTableInfo?.attributeTableElements&&(h.attributeTableInfo.attributeTableElements=h.attributeTableInfo.attributeTableElements.filter(y=>!(y.type==="field"&&y.fieldName===b)),h.attributeTableInfo.orderByFields=h.attributeTableInfo.orderByFields.filter(y=>y.field!==b))}),h?.layerDefinition?.fieldConfigurations&&(h.layerDefinition.fieldConfigurations=h.layerDefinition.fieldConfigurations.filter(b=>!s.includes(b.name))),h?.popupInfo){s.forEach(w=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(D=>D.fieldName!==w),h.popupInfo.popupElements?.forEach((D,R)=>{D.type==="fields"&&D.fieldInfos&&(h.popupInfo.popupElements[R].fieldInfos=h.popupInfo.popupElements[R].fieldInfos.filter(de=>de.fieldName!==w))})});let b=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,y={};f?(y.tables=v,l.layers&&(y.layers=l.layers)):(y.layers=v,l.tables&&(y.tables=l.tables));let m={f:"json",text:JSON.stringify(y)};await x(b,{query:{...m},method:"post",responseType:"json"}).then(w=>{w.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else n.httpStatus===200&&(!n.data||JSON.stringify(n.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=A(g`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(g`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=A(g`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&g`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:s,deleteInProgress:a}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,J("fieldNames"))),g`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${s?.length===1?e.deleteField:e.deleteFields} ${P(this.dialogNode)}>${t?g`<div class=${`dialog-content-wrapper ${a?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return g`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return g`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:a,messages:r}=this;return g`<calcite-list .label=${r.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return g`<calcite-list-item .label=${this.getFieldLabel(o)} .description=${`{${o}}`} .value=${o} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:se(o,s,a)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return g`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${P(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return g`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:a}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,a.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};W("arcgis-portal-field-delete",M);return M},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql",a)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
+
v5.0.0-next.131 */
|
|
4
|
+
var Y=globalThis,Z=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Rt=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Rt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Rt.set(e,t))}return t}toString(){return this.cssText}},Mt=o=>new k(typeof o=="string"?o:o+"",void 0,gt),Ee=(o,...t)=>{let e=o.length===1?o[0]:t.reduce(((s,r,i)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+o[i+1]),o[0]);return new k(e,o,gt)},It=(o,t)=>{if(Z)o.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),r=Y.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,o.appendChild(s)}},vt=Z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Mt(e)})(o):o;var{is:$e,defineProperty:be,getOwnPropertyDescriptor:_e,getOwnPropertyNames:Ae,getOwnPropertySymbols:Ce,getPrototypeOf:we}=Object,tt=globalThis,kt=tt.trustedTypes,Oe=kt?kt.emptyScript:"",Te=tt.reactiveElementPolyfillSupport,j=(o,t)=>o,X={toAttribute(o,t){switch(t){case Boolean:o=o?Oe:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},H=(o,t)=>!$e(o,t),jt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:H};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var _=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&be(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){let{get:r,set:i}=_e(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let a=r?.call(this);i?.call(this,n),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static _$Ei(){if(this.hasOwnProperty(j("elementProperties")))return;let t=we(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(j("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j("properties"))){let e=this.properties,s=[...Ae(e),...Ce(e)];for(let r of s)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let r of s)e.unshift(vt(r))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return It(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){let i=(s.converter?.toAttribute!==void 0?s.converter:X).toAttribute(e,s.type);this._$Em=t,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,e){let s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let i=s.getPropertyOptions(r),n=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:X;this._$Em=r,this[r]=n.fromAttribute(e,i.type)??this._$Ej?.get(r)??null,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let r=this.constructor,i=this[t];if(s??=r.getPropertyOptions(t),!((s.hasChanged??H)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:i},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),i!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[r,i]of s){let{wrapped:n}=i,a=this[r];n!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,i,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[j("elementProperties")]=new Map,_[j("finalized")]=new Map,Te?.({ReactiveElement:_}),(tt.reactiveElementVersions??=[]).push("2.1.0");var $t=globalThis,et=$t.trustedTypes,Ht=et?et.createPolicy("lit-html",{createHTML:o=>o}):void 0,bt="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,_t="?"+A,Se=`<${_t}>`,T=document,z=()=>T.createComment(""),B=o=>o===null||typeof o!="object"&&typeof o!="function",At=Array.isArray,qt=o=>At(o)||typeof o?.[Symbol.iterator]=="function",Et=`[
|
|
5
|
+
\f\r]`,V=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vt=/-->/g,zt=/>/g,w=RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^
|
|
6
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,Wt=/"/g,Gt=/^(?:script|style|textarea|title)$/i,Ct=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),ds=Ct(1),ps=Ct(2),us=Ct(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Ft=new WeakMap,O=T.createTreeWalker(T,129);function Kt(o,t){if(!At(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}var Qt=(o,t)=>{let e=o.length-1,s=[],r,i=t===2?"<svg>":t===3?"<math>":"",n=V;for(let a=0;a<e;a++){let c=o[a],l,u,h=-1,y=0;for(;y<c.length&&(n.lastIndex=y,u=n.exec(c),u!==null);)y=n.lastIndex,n===V?u[1]==="!--"?n=Vt:u[1]!==void 0?n=zt:u[2]!==void 0?(Gt.test(u[2])&&(r=RegExp("</"+u[2],"g")),n=w):u[3]!==void 0&&(n=w):n===w?u[0]===">"?(n=r??V,h=-1):u[1]===void 0?h=-2:(h=n.lastIndex-u[2].length,l=u[1],n=u[3]===void 0?w:u[3]==='"'?Wt:Bt):n===Wt||n===Bt?n=w:n===Vt||n===zt?n=V:(n=w,r=void 0);let g=n===w&&o[a+1].startsWith("/>")?" ":"";i+=n===V?c+Se:h>=0?(s.push(l),c.slice(0,h)+bt+c.slice(h)+A+g):c+A+(h===-2?a:g)}return[Kt(o,i+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},W=class o{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let i=0,n=0,a=t.length-1,c=this.parts,[l,u]=Qt(t,e);if(this.el=o.createElement(l,s),O.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=O.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let h of r.getAttributeNames())if(h.endsWith(bt)){let y=u[n++],g=r.getAttribute(h).split(A),C=/([.?@])?(.*)/.exec(y);c.push({type:1,index:i,name:C[2],strings:g,ctor:C[1]==="."?ot:C[1]==="?"?rt:C[1]==="@"?it:P}),r.removeAttribute(h)}else h.startsWith(A)&&(c.push({type:6,index:i}),r.removeAttribute(h));if(Gt.test(r.tagName)){let h=r.textContent.split(A),y=h.length-1;if(y>0){r.textContent=et?et.emptyScript:"";for(let g=0;g<y;g++)r.append(h[g],z()),O.nextNode(),c.push({type:2,index:++i});r.append(h[y],z())}}}else if(r.nodeType===8)if(r.data===_t)c.push({type:2,index:i});else{let h=-1;for(;(h=r.data.indexOf(A,h+1))!==-1;)c.push({type:7,index:i}),h+=A.length-1}i++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){if(t===f)return t;let r=s!==void 0?e._$Co?.[s]:e._$Cl,i=B(t)?void 0:t._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(o),r._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=r:e._$Cl=r),r!==void 0&&(t=S(o,r._$AS(o,t.values),r,s)),t}var st=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??T).importNode(e,!0);O.currentNode=r;let i=O.nextNode(),n=0,a=0,c=s[0];for(;c!==void 0;){if(n===c.index){let l;c.type===2?l=new U(i,i.nextSibling,this,t):c.type===1?l=new c.ctor(i,c.name,c.strings,this,t):c.type===6&&(l=new nt(i,this,t)),this._$AV.push(l),c=s[++a]}n!==c?.index&&(i=O.nextNode(),n++)}return O.currentNode=T,r}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},U=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),B(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=W.createElement(Kt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{let i=new st(r,this),n=i.u(this.options);i.p(e),this.T(n),this._$AH=i}}_$AC(t){let e=Ft.get(t.strings);return e===void 0&&Ft.set(t.strings,e=new W(t)),e}k(t){At(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,r=0;for(let i of t)r===e.length?e.push(s=new o(this.O(z()),this.O(z()),this,this.options)):s=e[r],s._$AI(i),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,i){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,r){let i=this.strings,n=!1;if(i===void 0)t=S(this,t,e,0),n=!B(t)||t!==this._$AH&&t!==f,n&&(this._$AH=t);else{let a=t,c,l;for(t=i[0],c=0;c<i.length-1;c++)l=S(this,a[s+c],e,c),l===f&&(l=this._$AH[c]),n||=!B(l)||l!==this._$AH[c],l===d?t=d:t!==d&&(t+=(l??"")+i[c+1]),this._$AH[c]=l}n&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ot=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},rt=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},it=class extends P{constructor(t,e,s,r,i){super(t,e,s,r,i),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let s=this._$AH,r=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==d&&(s===d||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},nt=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Jt={M:bt,P:A,A:_t,C:1,L:Qt,R:st,D:qt,V:S,I:U,H:P,N:rt,U:it,B:ot,F:nt},Pe=$t.litHtmlPolyfillSupport;Pe?.(W,U),($t.litHtmlVersions??=[]).push("3.3.0");var at=(o,t,e)=>{let s=e?.renderBefore??t,r=s._$litPart$;if(r===void 0){let i=e?.renderBefore??null;s._$litPart$=r=new U(t.insertBefore(z(),i),i,void 0,e??{})}return r._$AI(o),r};var wt=globalThis,$=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=at(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};$._$litElement$=!0,$.finalized=!0,wt.litElementHydrateSupport?.({LitElement:$});var Ne=wt.litElementPolyfillSupport;Ne?.({LitElement:$});(wt.litElementVersions??=[]).push("4.2.0");var Yt=new Set,Zt;var Xt=o=>typeof o=="string"?o:"el"in o?o.el.localName:"localName"in o?o.localName:o.declaredClass,Os=(o,t,e,s)=>{let r=Xt(t);if(s?.once){let n=`${o}${r}${e}`;if(Yt.has(n))return;Yt.add(n)}let i;if(s?.detail){i={};for(let[n,a]of Object.entries(s.detail))if((typeof a=="object"||typeof a=="function")&&a!==null){let c=new WeakRef(a);Object.defineProperty(i,n,{get(){return c.deref()}})}else i[n]=a;Zt?.log.interceptors?.forEach(n=>n(o,r,e,i)),console[o](`[${r}]: ${e}`,i)}else Zt?.log.interceptors?.forEach(n=>n(o,r,e)),console[o](`[${r}]: ${e}`)},te=o=>{let t=`[${Xt(o)}] `;return e=>{let s=e instanceof Error&&e.message?e:new Error(String(e));s.message=`${t}${s.message}`,setTimeout(()=>{throw e})}},Ts=o=>`The property \`${o.toString()}\` is required but missing.`,Ss=o=>`The property \`${o.toString()}\` is empty but must have at least one element.`;var p=(o,t,...e)=>{try{return o?.call(t,...e)}catch(s){console.error(s,o)}},F=async(o,t,...e)=>{try{return await o?.call(t,...e)}catch(s){console.error(s,o)}};var G=Symbol.for("controller"),xe=o=>typeof o=="object"&&o!==null&&(G in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),xs=o=>typeof o?.then=="function";var q,x=o=>{q!==o&&(q=o,queueMicrotask(()=>q===o?q=void 0:0))},K=o=>q,N=[],ee=o=>{if(o===void 0){N=[];return}let t=N.indexOf(o);N=t===-1?[...N,o]:N.slice(0,t+1),queueMicrotask(()=>N=[])},se=()=>N,R,Ds=o=>{R!==o&&(R=o,queueMicrotask(()=>R===o?R=void 0:0))},De=()=>{let o=R;return R=void 0,o},oe=async(o,t)=>{let e=lt(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(r=>t(r,s))}return e.exports},re=async o=>{let t=lt(o);return await t.ready,t},lt=o=>{let e=K().manager.X(o);if(e!==void 0)return e;if(xe(o))return o;let s=De();if(s!==void 0)return s},ct=!1,Ls=o=>{ct=!0;try{return o()}finally{ct=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}},ie=(o,t)=>{let e=t>Le?Ue:t/Re,s=0,r=setInterval(()=>{s+=e,s>=t&&(clearInterval(r),o())},e);return r},Le=4e3,Ue=2e3,Re=4;var Me=(o,t,e)=>{let s=Object.keys(o),r=s.length;M===void 0&&queueMicrotask(I),M??=new Map;let i=M.get(o);return i===void 0&&(i={callbacks:[],keyCount:r},M.set(o,i)),i.keyCount!==r&&(i.callbacks.forEach(n=>n(s)),i.callbacks=[],i.keyCount=r),i.callbacks.push(n=>{let a=l=>p(t,null,l),c=n[r];c===void 0?a(void 0):o[c]===e?a(c):a(void 0)}),e},M,I=()=>{M?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),M=void 0},Ie=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((r,i)=>p(t,void 0,e===i?r:void 0)),e},ke=(o=[K(),...se()],t,e)=>{let s=Array.isArray(o)?o:[o],r=s.length+1,i=n=>{r-=1,n!==void 0&&(r=Math.min(r,0)),r===0&&t(n)};s.forEach(n=>Me(n,a=>i(a===void 0?void 0:{key:a,host:n,isReactive:!1}),e));for(let n of s)if("manager"in n&&n.manager.component===n){Ie(n,a=>i(a===void 0?void 0:{key:a,host:n,isReactive:!0}),e);break}return e},je=(o="",t={},e=K())=>{let s={emit:r=>{o===""&&I();let i=new CustomEvent(o,{detail:r,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(i),i}};return o===""&&ke(void 0,r=>o=r.key,s),s},He=je.bind(null,""),ce;ce=G;var Ot=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#r=[],this.#i=[],this.#c=[],this.#l=[],this.#p=[],this.#h=[],this.#d=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[ce]=!0,this.#a=[];let e=this,s=t??K(new.target.name);e.#o=s,e.ready=e.P.promise,e.#n=ae(e),e.component=s,e.#o.addController(e),e.#o.manager===void 0||(ee(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#r;#i;#c;#l;#p;#h;#d;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#d&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(te(this.#o))}#n;get exports(){return this.#n}set exports(t){let e=this.#n;e!==t&&(this.#n=t,this.#a.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#n=e?ae(t):t,this.#a.forEach(p)}#a;watchExports(t){let e=()=>t(this.#n);return this.#a.push(e),()=>void this.#a.splice(this.#a.indexOf(e),1)}get use(){return x(this.#o),oe}get useRef(){return x(this.#o),re}get useRefSync(){return x(this.#o),lt}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#r.push(t)}onUpdate(t){this.#i.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#p.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#h.forEach(p),t.#h=[]}async triggerLoad(){if(this.#d)return;this.#d=!0;let t=this;t.hostLoad&&await F(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(F)),this.P.resolve(this.#n)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#r.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#i.forEach(ne,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(ne,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#p.forEach(this.#u,this)}#u(t){x(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(r=>{typeof r=="function"?this.#h.push(r):typeof r=="object"&&typeof r.remove=="function"&&this.#h.push(r.remove)})}};function ne(o){p(o,void 0,this)}var le=Ot,ae=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,r,i){if(!((r==="exports"||r==="_exports")&&r in s&&s[r]===e)&&(r in s||r in Promise.prototype||typeof r=="symbol"))return typeof s=="function"?s[r]:Reflect.get(s,r,i)}},e=new Proxy(o,t);return e};var{I:Ve}=Jt;var ht=o=>o.strings===void 0,he=()=>document.createComment(""),Ws=(o,t,e)=>{let s=o._$AA.parentNode,r=t===void 0?o._$AB:t._$AA;if(e===void 0){let i=s.insertBefore(he(),r),n=s.insertBefore(he(),r);e=new Ve(i,n,o,o.options)}else{let i=e._$AB.nextSibling,n=e._$AM,a=n!==o;if(a){let c;e._$AQ?.(o),e._$AM=o,e._$AP!==void 0&&(c=o._$AU)!==n._$AU&&e._$AP(c)}if(i!==r||a){let c=e._$AA;for(;c!==i;){let l=c.nextSibling;s.insertBefore(c,r),c=l}}}return e},Fs=(o,t,e=o)=>(o._$AI(t,e),o),ze={},de=(o,t=ze)=>o._$AH=t,qs=o=>o._$AH,Gs=o=>{o._$AP?.(!1,!0);let t=o._$AA,e=o._$AB.nextSibling;for(;t!==e;){let s=t.nextSibling;t.remove(),t=s}};var m={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},E=o=>(...t)=>({_$litDirective$:o,values:t}),v=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var Q=(o,t)=>{let e=o._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),Q(s,t);return!0},dt=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while(e?.size===0)},pe=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),Fe(t)}};function Be(o){this._$AN!==void 0?(dt(this),this._$AM=o,pe(this)):this._$AM=o}function We(o,t=!1,e=0){let s=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(s))for(let i=e;i<s.length;i++)Q(s[i],!1),dt(s[i]);else s!=null&&(Q(s,!1),dt(s));else Q(this,o)}var Fe=o=>{o.type==m.CHILD&&(o._$AP??=We,o._$AQ??=Be)},pt=class extends v{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),pe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Q(this,t),dt(this))}setValue(t){if(ht(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var oo=()=>new St,St=class{},Tt=new WeakMap,Pt=E(class extends pt{render(o){return d}update(o,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=o.options?.host,this.rt(this.ct=o.element)),d}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=Tt.get(t);e===void 0&&(e=new WeakMap,Tt.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){return typeof this.G=="function"?Tt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var ut=o=>o.replace(Ge,(t,e)=>`${e===0?"":"-"}${t.toLowerCase()}`),Ge=/[A-Z]+(?![a-z])|[A-Z]/gu;var go="randomUUID"in crypto;var xt=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},Dt={};function Lt(){}var Ke=(o,t)=>function(s,r){if(!globalThis.customElements)return;let n=(r??s??{}).resourcesUrl;n&&o.setAssetPath(n);for(let[a,[c,l=""]]of Object.entries(t)){if(customElements.get(a))continue;let[u,h,y]=l.split(";"),g=u?u?.split(",").map(Qe):void 0,C=g?.map(([L])=>L),D=class extends Nt{static{this.observedAttributes=g?.map(([,L])=>L).filter(L=>L!=="")}static{this.C=C}static{this.E=h?h?.split(","):void 0}static{this.D=y?.split(",")}static{this.L=a}static{this.K=o}constructor(){!D.B&&(D.B=c(),D.F()),super()}};customElements.define(a,D)}},ft=Object.defineProperty,Qe=o=>{let t=o.split(":");return t.length===1?[t[0],ut(t[0])]:t},Je=globalThis.HTMLElement??Lt,Nt=class extends Je{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#r({a:e.A}):e.B.then(async s=>{await e.K.p,t.#r(await(s.default?.then(r=>typeof r=="function"?{a:r}:r)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ft(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ft(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ft(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=xt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#r(t){let e=this.constructor,s=e.L,r=this.#e,i=Object.values(t).find(h=>h.L===s),n=`${s}--lazy`,a=i;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Ze(a),!e.A&&(e.A=i,customElements.define(n,i)),i.N=this;let l=document.createElement(n);i.N=void 0,this.#t=l,this.#e=l,this.#s.forEach(h=>l.attributeChangedCallback(h,null,this.getAttribute(h))),Object.entries(r).forEach(Ye,l);let u=this.isConnected;(u||this.G)&&(l.connectedCallback?.(),u||l.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function Ye([o,t]){this[o]=t}var Ze=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(r,i){e.setAttribute.call(this.el,r,i)},t.removeAttribute=function(r){e.removeAttribute.call(this.el,r)},ft(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var mt=class extends le{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=yt in t&&typeof t.destroy=="function",$.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${yt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),I();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),x(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>void this.#e.destroy();this.#t=ie(t,Xe)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(r=>r(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},Xe=1e3,yt="autoDestroyDisabled";var fe=E(class extends v{constructor(o){if(super(o),o.type!==m.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter((t=>o[t])).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter((s=>s!==""))));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let r=!!t[s];r===this.st.has(s)||this.nt?.has(s)||(r?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var me="important",ts=" !"+me,ye=E(class extends v{constructor(o){if(super(o),o.type!==m.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce(((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let r=t[s];if(r!=null){this.ft.add(s);let i=typeof r=="string"&&r.endsWith(ts);s.includes("-")||i?e.setProperty(s,i?r.slice(0,-11):r,i?me:""):e[s]=r}}return f}});var es=E(class extends v{constructor(o){if(super(o),o.type!==m.PROPERTY&&o.type!==m.ATTRIBUTE&&o.type!==m.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ht(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===m.PROPERTY){if(t===e[s])return f}else if(o.type===m.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===m.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return de(o),t}});var ge=class o extends ${constructor(){super(),this.M=[],this.manager=new mt(this);let t=this,e=t.constructor,s=e.N,r=e.K.o,i=o.prototype.shouldUpdate;t.#r=s?.H??new b,t.I=s?.I??new b,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=Lt,t.shouldUpdate!==i&&(t.#e=t.shouldUpdate,t.shouldUpdate=i),r&&(t.#t=new Map,e.elementProperties.forEach((n,a)=>t.#t.set(a,r()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===Dt;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,r=Array.isArray(e)?e[1]:void 0,i=r?.hasChanged??H,n={attribute:s&1&&typeof t=="string"?ut(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),c:!1,...r,hasChanged(a,c){let l=i(a,c);return n.c=l,l}};super.createProperty(t,n)}static getPropertyDescriptor(t,e,s){let r=this.K,i=super.getPropertyDescriptor(t,e,s);return s.d=i,{...i,get(){return r.t?.(this.#t.get(t)),i.get?.call(this)},set(n){let a=this.manager;if(s.readOnly&&!ct&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${n}"`);i.set.call(this,n??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(I(),a?.S(t,n))}}}static{this.lumina=!0}#t;#e;#s;#r;#i;connectedCallback(){if(this.el.hasAttribute("defer-hydration"))return;let t=this.constructor.K.c?.(()=>this.requestUpdate());this.#i=t;let e=!this.manager.connectedCalled;super.connectedCallback(),e?queueMicrotask(()=>this.#l().catch(s=>{this.#r.reject(s),setTimeout(()=>{throw s})})):t&&this.requestUpdate()}#c(t){try{this.#i.clear(),this.constructor.K.r(this.#i,()=>super.update(t))}catch(e){throw this.#i.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#i?.destroy(),this.#i=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,i=t??(s===Dt?this.el:this.el.attachShadow(s));if(this.isConnected){let n=i.getRootNode();n.adoptedStyleSheets=[...n.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return i}async#l(){let t=this.el.G??xt(this.el);t&&await t;let e=[];for(let r of this.M)"triggerLoad"in r?e.push(r.triggerLoad()):e.push(F(r.hostLoad,r));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(r=>r.has(yt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await Promise.resolve();let s=this.J.filter(r=>!r.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async r=>await r.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let r of this.M)"triggerLoaded"in r?r.triggerLoaded():p(r.hostLoaded,r);this.loaded?.(),this.#r.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#i?this.#c(t):super.update(t)}listen(t,e,s){let r=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,r,s),()=>this.el.removeEventListener(t,r,s)))}listenOn(t,e,s,r){let i=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,i,r),()=>t.removeEventListener(e,i,r)))}async componentOnReady(){return await this.#r.promise,this}addController(t){this.M.push(t),!(G in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var ve=o=>{let t,e=r=>{t=new URL(r,globalThis.location?.href||void 0).href},s={...o,getAssetPath(r){let i=new URL(r,t);return i.origin!==globalThis.location?.origin?i.href:i.pathname},setAssetPath:e,customElement(r,i){i.K=s,i.L=r,customElements.get(r)||customElements.define(r,i)}};return e(o.defaultAssetPath),s};var Or=o=>typeof o=="object"&&o!=null?fe(o):o,Tr=o=>typeof o=="object"&&o!=null?ye(o):o;var Ut=class extends v{#t;#e;constructor(t){super(t);let e=this;this.#e=function(r){return e.#t.call(this,r)}}render(t){return typeof t=="function"?(this.#t=t,Pt(this.#e)):Pt(t)}},Sr=E(Ut);var Pr=d;var Nr=o=>{let t=document.createElement("div");return at(o,t),t.firstElementChild};var J=ve({defaultAssetPath:"https://jsdev.arcgis.com/5.0.0-next/portal-components/",hydratedAttribute:"hydrated"}),{customElement:Rr,getAssetPath:Mr,setAssetPath:Ir}=J;J.t=void 0;J.o=void 0;J.c=void 0;J.r=void 0;export{xs as a,x as b,K as c,ee as d,se as e,Ds as f,Ls as g,Ee as h,H as i,ds as j,f as k,d as l,b as m,Os as n,te as o,Ts as p,Ss as q,Ie as r,ke as s,je as t,He as u,Ot as v,le as w,Ke as x,m as y,E as z,v as A,Ws as B,Fs as C,de as D,qs as E,Gs as F,oo as G,Pt as H,ge as I,Or as J,Tr as K,Pr as L,Nr as M,J as N,Rr as O,Mr as P};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
3
|
+
v5.0.0-next.131 */
|
|
4
4
|
export default $arcgis.t(([i])=>{var p=e=>e&&!e.endsWith("/")?`${e}/`:e;function a(e){return p(e.restUrl)}function f(e,t){return u(e,t)||m(e,t)}function u(e,t){return e.owner===t.username}function m(e,t){let n=e.owner,r=e.itemControl==="admin",s=["esri_livingatlas","esri_demographics","esri_boundaries"];return e.portal?.isPortal&&!u(e,t)&&r&&n?.includes("esri_")&&!s.includes(n)?!1:r}function w(e){return e.typeKeywords?.includes("Spatiotemporal")}function h(e){return e.typeKeywords?.includes("View Service")}function v(e){return e.typeKeywords?.includes("Hosted Service")}function g(e){return e.typeKeywords?.includes("Multi Services View")}function j(e){return e?.hasViews&&!e.sourceSchemaChangesAllowed}async function P(e){let t=e?.portalItem;if(!t)return await Promise.resolve(null);let n=t.portal;if(n?.user){let r=`${a(n)}community/users/${n.user.username}`;return await i(r,{query:{f:"json",token:t.portal.credential?.token},responseType:"json"}).then(async s=>{let o=s.data?.groups??[];return await Promise.resolve(o)},async()=>await Promise.reject(new Error("Failed to fetch user groups")))}return await Promise.resolve(null)}async function $(e){let t=e?.portalItem;if(!t)return await Promise.resolve(null);let n=t.portal,r=`${a(n)}content/items/${t.id}/groups`;return await i(r,{query:{f:"json",token:t.portal.credential?.token},responseType:"json"}).then(async s=>{let o=s.data?.admin??[],c=s.data?.member??[],l=s.data?.other??[],d=[...o,...c,...l];return await Promise.resolve(d)},async()=>await Promise.reject(new Error("Failed to fetch item groups")))}async function S(e,t,{relationshipType:n,direction:r}){let s=`${a(t)}content/items/${e}/relatedItems`;return await i(s,{query:{f:"json",relationshipType:n,direction:r},responseType:"json"})}function T(e,t){return e?.some(n=>t?.some(r=>n.id===r.id&&n.capabilities.includes("updateitemcontrol")))}return{a:a,b:f,c:w,d:h,e:v,f:g,g:j,h:P,i:$,j:S,k:T}},"request")
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{N as t,x as e}from"./
|
|
3
|
+
v5.0.0-next.131 */
|
|
4
|
+
import{N as t,x as e}from"./ZN4WBK5W.js";var i=e(t,{"arcgis-portal-classification-banner":[()=>import("./F4TYC7FY.js"),"autoDestroyDisabled,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./H5DKVLEB.js"),"autoDestroyDisabled,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./X3F5IZWT.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./BA64YMT3.js"),"attribute:,attributeKey,isRequiredErrors:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./WMSJASDA.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./TQPOVCOU.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./YUN26ABC.js"),"config:,fieldNames:,layer:,mapView:,options:"],"arcgis-portal-replacement-item-redirect":[()=>import("./BO5HDOU6.js"),"itemId,portal:,user:;setFocus"]});i({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-replacement-item-redirect){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,t)
|
package/dist/chunks/common.js
CHANGED
|
@@ -2,7 +2,7 @@ import i from "@arcgis/core/request.js";
|
|
|
2
2
|
import { once as l } from "@arcgis/core/core/reactiveUtils.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.131 */
|
|
6
6
|
const U = (t, e, s) => {
|
|
7
7
|
let r = d(
|
|
8
8
|
t,
|
|
@@ -7,7 +7,7 @@ import * as L from "@arcgis/core/core/sql.js";
|
|
|
7
7
|
import { i as J, a as N, l as T, b as G, c as H, u as P, d as E, e as D, f as V, h as C, g as z } from "./item.js";
|
|
8
8
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
9
9
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
10
|
-
v5.0.0-next.
|
|
10
|
+
v5.0.0-next.131 */
|
|
11
11
|
var O = /* @__PURE__ */ ((r) => (r.expression = "expression/", r.raster = "Raster.", r.relationship = "relationships/", r))(O || {});
|
|
12
12
|
const K = ["feature"];
|
|
13
13
|
function X(r) {
|
package/dist/chunks/item.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import i from "@arcgis/core/request.js";
|
|
2
2
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
-
v5.0.0-next.
|
|
4
|
+
v5.0.0-next.131 */
|
|
5
5
|
const m = (e) => e && !e.endsWith("/") ? `${e}/` : e;
|
|
6
6
|
function a(e) {
|
|
7
7
|
return m(e.restUrl);
|
|
@@ -6,7 +6,7 @@ import { makeAccessorController as C } from "@arcgis/lumina/controllers/accessor
|
|
|
6
6
|
import { Task as v } from "@lit/task";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.131 */
|
|
10
10
|
var w = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (i, a, s, t) => {
|
|
11
11
|
for (var r = t > 1 ? void 0 : t ? g(a, s) : a, l = i.length - 1, c; l >= 0; l--)
|
|
12
12
|
(c = i[l]) && (r = (t ? c(a, s, r) : c(r)) || r);
|
package/dist/chunks/requests.js
CHANGED
|
@@ -2,7 +2,7 @@ import n from "@arcgis/core/request.js";
|
|
|
2
2
|
import { once as c } from "@arcgis/core/core/reactiveUtils.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.131 */
|
|
6
6
|
async function f(s, t) {
|
|
7
7
|
const i = `${s}/portals/self/classification/classificationSchema`, e = {};
|
|
8
8
|
try {
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -3,7 +3,7 @@ import { makeRuntime as e } from "@arcgis/lumina";
|
|
|
3
3
|
import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
4
4
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
5
5
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
6
|
-
v5.0.0-next.
|
|
6
|
+
v5.0.0-next.131 */
|
|
7
7
|
const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/5.0.0-next/portal-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: d, setAssetPath: i } = t;
|
|
8
8
|
t.t = s;
|
|
9
9
|
t.o = r;
|
package/dist/chunks/useT9n.js
CHANGED
|
@@ -2,7 +2,7 @@ import { makeT9nController as o } from "@arcgis/lumina/controllers";
|
|
|
2
2
|
import { g as t } from "./runtime.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.131 */
|
|
6
6
|
const s = o(t);
|
|
7
7
|
export {
|
|
8
8
|
s as u
|
|
@@ -6,7 +6,7 @@ import { css as h, html as s } from "lit";
|
|
|
6
6
|
import { rethrowError as o } from "@arcgis/toolkit/log";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.131 */
|
|
10
10
|
const m = h`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`;
|
|
11
11
|
class p extends l {
|
|
12
12
|
constructor() {
|
|
@@ -13,7 +13,7 @@ import { watch as _ } from "@arcgis/core/core/reactiveUtils.js";
|
|
|
13
13
|
import { r as D } from "../../chunks/requests.js";
|
|
14
14
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
15
15
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
16
|
-
v5.0.0-next.
|
|
16
|
+
v5.0.0-next.131 */
|
|
17
17
|
async function T({
|
|
18
18
|
portalClassificationSchema: a,
|
|
19
19
|
itemClassification: t
|
|
@@ -7,7 +7,7 @@ import { u as d, r as v } from "../../chunks/requests.js";
|
|
|
7
7
|
import { g as h } from "../../chunks/common.js";
|
|
8
8
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
9
9
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
10
|
-
v5.0.0-next.
|
|
10
|
+
v5.0.0-next.131 */
|
|
11
11
|
const m = r`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: "var(--calcite-color-foreground-2)"}.save-new-favorite-button{display:flex;justify-content:flex-end;margin-top:.25rem;margin-bottom:1rem}.classification-favorite-item{display:flex;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--calcite-color-border-1)}.classification-favorite-list,.classification-favorite-input-section{margin:1.75rem 1rem}`;
|
|
12
12
|
class C extends n {
|
|
13
13
|
constructor() {
|
|
@@ -5,7 +5,7 @@ import { css as d, html as i } from "lit";
|
|
|
5
5
|
import { u as h } from "../../chunks/useT9n.js";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.131 */
|
|
9
9
|
const m = d`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;
|
|
10
10
|
function l(n, e) {
|
|
11
11
|
return n.uiElement === e;
|
|
@@ -26,7 +26,7 @@ import { createRef as d, ref as x } from "lit/directives/ref.js";
|
|
|
26
26
|
import { u as B } from "../../chunks/useT9n.js";
|
|
27
27
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
28
28
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
29
|
-
v5.0.0-next.
|
|
29
|
+
v5.0.0-next.131 */
|
|
30
30
|
const W = F`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`;
|
|
31
31
|
class J {
|
|
32
32
|
constructor(t) {
|
|
@@ -5,7 +5,7 @@ import { css as h, html as o } from "lit";
|
|
|
5
5
|
import { useDirection as m } from "@arcgis/lumina/controllers";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.131 */
|
|
9
9
|
const g = h`.coord-field{margin-bottom:var(--calcite-spacing-sm)}.coord-label{display:block;margin-bottom:var(--calcite-spacing-sm);font-size:14px}.coordinate-input{width:100%;block-size:var(--calcite-spacing-xxxl);box-sizing:border-box;padding-inline:var(--calcite-spacing-md);font-size:14px;color:var(--calcite-color-text-3);outline-color:var(--calcite-color-brand)}.coordinate-input--error{border:1px solid var(--calcite-color-status-danger)}.coord-error-message{position:relative;max-width:100%;margin:var(--calcite-spacing-sm) 0;display:flex;font-size:14px;padding:6px 7px;background-color:var(--calcite-color-foreground-1);border:1px solid var(--calcite-color-status-danger);box-shadow:0 1px 2px #00000054}.coord-error-message:before{pointer-events:none;content:"";position:absolute;left:11px;top:-16px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-status-danger)}.coord-error-message:after{position:absolute;pointer-events:none;content:"";left:11px;top:-15px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-foreground-1)}.is-rtl .coord-error-message:before,.is-rtl .coord-error-message:after{left:initial;right:11px}.coord-error-message calcite-icon{color:var(--calcite-color-status-danger)}.coord-error-message__text{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm);line-height:var(--calcite-spacing-xl)}`;
|
|
10
10
|
class v extends u {
|
|
11
11
|
constructor() {
|
|
@@ -14,7 +14,7 @@ import { u as V } from "../../chunks/useT9n.js";
|
|
|
14
14
|
import { log as b, composeMissingPropertyMessage as C, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
|
|
15
15
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
16
16
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
17
|
-
v5.0.0-next.
|
|
17
|
+
v5.0.0-next.131 */
|
|
18
18
|
const n = /* @__PURE__ */ new Map();
|
|
19
19
|
n.set("oid", "key");
|
|
20
20
|
n.set("guid", "key");
|
|
@@ -8,7 +8,7 @@ import y from "@arcgis/core/identity/IdentityManager.js";
|
|
|
8
8
|
import { css as A, html as o } from "lit";
|
|
9
9
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
10
10
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
11
|
-
v5.0.0-next.
|
|
11
|
+
v5.0.0-next.131 */
|
|
12
12
|
function T(e, t) {
|
|
13
13
|
return t && (b(e, t) || ["update", "admin"].includes(e.itemControl));
|
|
14
14
|
}
|
package/dist/docs/api.json
CHANGED
package/dist/docs/docs.json
CHANGED
package/dist/docs/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@arcgis/portal-components",
|
|
4
|
-
"version": "5.0.0-next.
|
|
4
|
+
"version": "5.0.0-next.131",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { g as a, s as t } from "./chunks/runtime.js";
|
|
|
2
2
|
import { c as o, a as r } from "./chunks/fieldAddDelete.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.131 */
|
|
6
6
|
export {
|
|
7
7
|
o as canAddField,
|
|
8
8
|
r as canDeleteField,
|
package/dist/loader.js
CHANGED
|
@@ -2,7 +2,7 @@ import { r as e } from "./chunks/runtime.js";
|
|
|
2
2
|
import { makeDefineCustomElements as t } from "@arcgis/lumina";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.131 */
|
|
6
6
|
const r = t(e, {
|
|
7
7
|
"arcgis-portal-classification-banner": [() => import("./components/arcgis-portal-classification-banner/customElement.js"), "autoDestroyDisabled,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],
|
|
8
8
|
"arcgis-portal-classification-config": [() => import("./components/arcgis-portal-classification-config/customElement.js"), "autoDestroyDisabled,portalItem:,status,valid,values;destroy,resetForm,validateForm"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/portal-components",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.131",
|
|
4
4
|
"description": "ArcGIS Portal Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@arcgis/app-components": "~4.15.9",
|
|
42
|
+
"@arcgis/lumina": "5.0.0-next.131",
|
|
43
|
+
"@arcgis/toolkit": "5.0.0-next.131",
|
|
42
44
|
"@lit/task": "^1.0.3",
|
|
43
45
|
"lit": "^3.3.0",
|
|
44
|
-
"tslib": "^2.8.1"
|
|
45
|
-
"@arcgis/lumina": "5.0.0-next.130",
|
|
46
|
-
"@arcgis/toolkit": "5.0.0-next.130"
|
|
46
|
+
"tslib": "^2.8.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@arcgis/core": ">=5.0.0-next.62 <5.1",
|
package/dist/cdn/3E2C5GC4.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.128 */
|
|
4
|
-
import{c as m}from"./FYKU2XYE.js";import{G as d,H as p,I as u,J as s,L as o,O as h,h as n,j as a,u as c}from"./PVY7S6MU.js";var v=n`.coord-field{margin-bottom:var(--calcite-spacing-sm)}.coord-label{display:block;margin-bottom:var(--calcite-spacing-sm);font-size:14px}.coordinate-input{width:100%;block-size:var(--calcite-spacing-xxxl);box-sizing:border-box;padding-inline:var(--calcite-spacing-md);font-size:14px;color:var(--calcite-color-text-3);outline-color:var(--calcite-color-brand)}.coordinate-input--error{border:1px solid var(--calcite-color-status-danger)}.coord-error-message{position:relative;max-width:100%;margin:var(--calcite-spacing-sm) 0;display:flex;font-size:14px;padding:6px 7px;background-color:var(--calcite-color-foreground-1);border:1px solid var(--calcite-color-status-danger);box-shadow:0 1px 2px #00000054}.coord-error-message:before{pointer-events:none;content:"";position:absolute;left:11px;top:-16px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-status-danger)}.coord-error-message:after{position:absolute;pointer-events:none;content:"";left:11px;top:-15px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-foreground-1)}.is-rtl .coord-error-message:before,.is-rtl .coord-error-message:after{left:initial;right:11px}.coord-error-message calcite-icon{color:var(--calcite-color-status-danger)}.coord-error-message__text{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm);line-height:var(--calcite-spacing-xl)}`,l=class extends u{constructor(){super(...arguments),this._direction=m(),this.inputEl=d(),this.isInvalid=!1,this.currentError="",this.inputValue="",this.label="",this.value="",this.errorMessage="",this.min=-180,this.max=180,this.validateRelated=()=>!0,this.relatedErrorMessage="",this.inputId="",this.arcgisCoordChange=c()}static{this.properties={isInvalid:16,currentError:16,inputValue:16,label:1,value:1,errorMessage:1,min:9,max:9,validateRelated:0,relatedErrorMessage:1,inputId:1}}static{this.styles=v}checkRelatedField(){return!this.inputValue||!this.isInvalid||!this.validate(this.inputValue)?"":this.inputValue}isValid(){return!this.isInvalid}setFocus(){this.inputEl.value?.focus()}willUpdate(t){t.has("value")&&this.validate(t.get("value"))}isValidCoord(t,r,i){if(!t?.match(/^-?[0-9]*(\.|,)?[0-9]+$/u))return!1;let e=this.parseNumber(t);return e>=r&&e<=i}validate(t){if(this.isInvalid=!this.isValidCoord(t,this.min,this.max),this.isInvalid)return this.currentError=this.errorMessage,!1;let r=this.parseNumber(t);return this.isInvalid=!this.validateRelated(r),this.isInvalid?(this.currentError=this.relatedErrorMessage,!1):!0}parseNumber(t){let r=`-${Array.from({length:10},(e,g)=>g.toString()).join("")}`,i=t.replace(",",".");return i=Array.from(i).filter(e=>r.includes(e)||e===".").join(""),parseFloat(i)}render(){return a`<div class=${s({"coord-field":!0,"is-rtl":this._direction==="rtl"})}><label class="coord-label" for=${this.inputId??o}>${this.label}</label><calcite-input-number number-button-type=none id=${this.inputId??o} class=${s({"coordinate-input":!0})} .value=${`${this.parseNumber(this.value)}`} @calciteInputNumberChange=${t=>{this.inputValue=t.target.value,this.validate(this.inputValue)&&this.arcgisCoordChange.emit(this.inputValue)}} .status=${this.isInvalid?"invalid":"valid"} ${p(this.inputEl)}></calcite-input-number>${this.isInvalid&&a`<div class="coord-error-message"><calcite-icon icon=exclamation-mark-triangle scale=s></calcite-icon><div class="coord-error-message__text">${this.currentError}</div></div>`||""}</div>`}};h("arcgis-portal-extent-picker-coord-field",l);export{l as ArcgisPortalExtentPickerCoordField};
|
package/dist/cdn/3TVMBNSG.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.128 */
|
|
4
|
-
import{i as o}from"./PVY7S6MU.js";var c={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},n=Symbol(),e=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??u,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t)}async run(t){let s,r;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let a=!1;try{s=await this.v(t,{signal:this.q.signal})}catch(l){a=!0,r=l}if(this.p===i){if(s===n)this.i=0;else{if(a===!1){try{this.k?.(s)}catch{}this.i=2,this.o?.(s)}else{try{this.A?.(r)}catch{}this.i=3,this.h?.(r)}this.u=s,this.l=r}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},u=(h,t)=>h===t||h.length===t.length&&h.every(((s,r)=>!o(s,t[r])));export{c as a,e as b};
|
package/dist/cdn/5IVNTZIK.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.128 */
|
|
4
|
-
export default $arcgis.t(([n,{once:c}])=>{async function u(r,e){let s=`${r}/portals/self/classification/classificationSchema`,t={};try{let a=(await n(s,{query:{f:"json"},signal:e})).data;if(typeof a=="object"&&a!==null&&"classificationSchema"in a)t.result=a.classificationSchema;else throw new Error("Invalid response format received from the classification schema endpoint")}catch(a){t.error=a}return t}async function d(r,e,s){let t=`${r}/portals/self/classification/validateClassification`,a={classificationValue:JSON.stringify(e),f:"json"},i={};try{let o=await n(t,{query:a,method:"post",signal:s.signal});i.result=o.data}catch(o){console.error(o),i.error=o}return i}async function y(r){if(!r)return;r.loaded||await r.load();let e=r.portal.user??await c(()=>r?.portal.user);if(!e)return;let s=`${r.portal.restUrl}/community/users/${e.username}/resources/classification_favorites`,t={};try{let a=await n(s,{query:{f:"json"}});t.result=a.data}catch(a){console.error(a),t.error=a}return t}async function m(r,e){if(!r)return;r.loaded||await r.load();let s=r.portal.user??await c(()=>r?.portal.user);if(!s)return;let t=`${r.portal.restUrl}/community/users/${s.username}/addResource`,a={},i={f:"json",key:"classification_favorites",text:JSON.stringify({favorites:e}),access:"UserPrivateAllApps"};try{let o=await n(t,{query:i,method:"post"});a.result=o.data.success}catch(o){console.error(o),a.error=o}return a}return{a:u,b:d,c:y,d:m}},"request","core/reactiveUtils")
|
package/dist/cdn/5N7A6QPT.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.127 */
|
|
4
|
-
import{a as O,b as P,c as N,d as g,e as v,f as A,g as T,n as b,s as E,t as $,v as k}from"./MEPRQCQD.js";var V=(e,s)=>{let t=e;for(;t;){if(t===s)return!0;if(!t.parentNode)return!1;t.parentNode instanceof ShadowRoot?t=t.parentNode.host:t=t.parentNode}return!1},h=(e,s,t)=>{let o=R(s).subscribe;return o(n=>{n.some(i=>V(e,i.target))&&t()})},y={},R=e=>{let s=e.join(","),t=y[s];if(t!==void 0)return t;let o=new Set,n=new MutationObserver(i=>o.forEach(a=>a(i)));globalThis.document&&n.observe(document.documentElement,{attributes:!0,attributeFilter:e,subtree:!0});let r={subscribe:i=>(o.add(i),()=>{o.delete(i),o.size===0&&(n.disconnect(),y[s]=void 0)})};return y[s]=r,r},U=(e,s)=>{let t=e;for(;t;){let o=t.closest?.(s);if(o)return o;let n=t.getRootNode?.();if(n===globalThis.document)return;t=n.host}};var f=(e,s,t)=>U(e,`[${s}]`)?.getAttribute(s)??t;var M=e=>(...s)=>{let t=v(),o=new e(...s),n=o.exports;g(t.at(-1));let r=o.component.manager;r.W(o,n),o.watchExports(r.W.bind(r,o)),A(o);let i=[o.component,...t].reverse();return E(i,a=>a===void 0?void 0:G(o,a,n),n)},G=(e,{host:s,key:t,isReactive:o},n)=>{let r=s,i=r[t]!==e.exports,a=r[t]!==n,c=n!==e.exports;if(i&&!a&&c&&(r[t]=e.exports),s===e.component){if(o){let l=e.component.manager;a&&l.W(e,r[t]),e.onUpdate(d=>{if(d.has(t)){let w=r[t];w!==e.exports&&l.W(e,w)}})}e.O=o?void 0:t}let u=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(u?T(()=>{r[t]=e.exports}):r[t]=e.exports)})};var W="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),H=new Set(W),m="en",K={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},I=async(e,s,t="")=>{let o=`${s}/${t}`,n=`${o}${e}.json`;return C[n]??(C[n]=_(e,o)),await C[n]},C={},_=async(e,s)=>{let t=`${s}${e}.json`;try{let o=await fetch(t);if(o.ok)return await o.json()}catch(o){return b("error","intl",`An unknown error occurred while fetching localization strings at ${t}`,{detail:{error:o}}),{}}return e===m?{}:await _(m,s)},x=e=>{let s=f(e,"lang",globalThis.navigator?.language||m);return{lang:s,t9nLocale:D(s)}},D=e=>{let[s,t]=e.split("-"),o=s.toLowerCase(),n=o;return t&&(n=`${o}-${t.toUpperCase()}`),n=K[n]??n,H.has(n)?n:t?D(o):m},S=(e,s,t,o)=>{let n,r=()=>q(e,s(),o).then(i=>{(n?.lang!==i.lang||n.t9nLocale!==i.t9nLocale||n.t9nStrings!==i.t9nStrings)&&t(i),n=i}).catch(i=>{b("error","intl","Error updating component locale state",{detail:{error:i}})});return queueMicrotask(r),h(e,["lang"],r)},q=async(e,s,t=e.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:n}=x(e),r=`${s}/${t}/t9n`,a=t===null?{}:await I(n,r,"messages.");return{lang:o,t9nLocale:n,t9nStrings:a}};var F=e=>B(void 0,e);var L=class extends k{constructor(s,t){super(s);let o=this.exports;try{P(this.component);let n=t(this.component,this),r=this.exports!==o;if(O(n)){r||this.setProvisionalExports(n);let i=n.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this.P.reject(a)});this.onLoad(async()=>await i)}else(!r||n!==void 0)&&(this.exports=n),queueMicrotask(()=>super.catchUpLifecycle())}catch(n){this.P.reject(n)}}catchUpLifecycle(){}},B=M(L);var j="ltr",dt=()=>F((e,s)=>{s.exports=j,s.onLifecycle(()=>{let t=()=>{let o=f(e.el,"dir",j);s.exports=o==="rtl"?"rtl":"ltr"};return t(),h(e.el,["dir"],t)})}),ht=e=>(s={})=>F((t,o)=>{let n=x(t.el),r={_lang:n.lang,_t9nLocale:n.t9nLocale,_loading:!0},i=t;o.onLifecycle(()=>S(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:p,lang:u})=>{let l={...p,_lang:u,_t9nLocale:c,_loading:!1};o.exports=l;let d=p.componentLabel;typeof d=="string"&&"label"in t&&t.label==null&&(t.label??=d),a(i.messageOverrides)},s.name));let a=c=>{let p=o.exports,u=p._original??p,l=z(u,c);c&&(l._original=u),o.exports=l};return"messageOverrides"in i&&o.onUpdate(c=>{c.has("messageOverrides")&&a(i.messageOverrides)}),s.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),z=(e,s)=>{if(!s)return e;let t={...e};return Object.entries(s).forEach(([o,n])=>{e[o]!==void 0&&(typeof n=="object"?t[o]=z(e[o],n):t[o]=n??e[o])}),t},ft=e=>X,J="arcgisPropertyChange",X=(...e)=>{let s=N(),t=$(J,void 0,s),o=!0;return s.manager.onUpdated(n=>{if(o||!s.el.isConnected){o=!1;return}for(let r of e)n.has(r)&&t.emit({name:r})}),t};export{M as a,U as b,dt as c,ht as d,ft as e};
|
package/dist/cdn/73Y4DGUS.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.127 */
|
|
4
|
-
import b from"./U45XPLZN.js";import a from"./JWB6OMHQ.js";import"./VJAE2RWH.js";import{a as h}from"./ZXDJCERM.js";import"./5N7A6QPT.js";import{I as n,K as c,O as l,h as e,j as s,o}from"./MEPRQCQD.js";export default $arcgis.t(([,{a:f,b:d}])=>{var p=e`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`,r=class extends n{constructor(){super(...arguments),this.classificationModel=f(this),this.messages=h(),this._classificationDataTask=d(this),this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.status=this.classificationModel.status,this.missingExistingClassification=!1,this.variant="full",this.autoDestroyDisabled=!1,this.validationErrors=""}static{this.properties={portalClassificationSchema:16,status:16,itemClassification:16,portalItem:0,missingExistingClassification:5,variant:1,autoDestroyDisabled:5,validationErrors:1}}static{this.styles=p}async destroy(){await this.manager.destroy()}willUpdate(a){if(a.has("portalItem")){let{portalItem:i}=this;i?.load().then(()=>{i?.id&&i?.loaded&&i?.classification&&!this.missingExistingClassification?this.classificationModel.validateClassification(this.variant==="preview"?null:i.id,i.classification,i?.portal.restUrl).catch(o(this)).then(t=>{this.validationErrors=t??""}):this.validationErrors=""}).catch(o(this))}}getStyle(){let a={};if(this.variant==="preview"&&(a.fontSize="var(--calcite-font-size-sm)",a.padding="var(--calcite-spacing-xs)"),this.itemClassification&&this.portalClassificationSchema){let i=this.itemClassification.classification,t=this.portalClassificationSchema.classificationMetadata.classificationValueProperties.find(({value:m})=>m===i);t?.backgroundColor&&(a.backgroundColor=t.backgroundColor),t?.textColor&&(a.color=t.textColor)}return a}render(){return this._classificationDataTask.render({pending:void 0,error:void 0,complete:()=>this.portalClassificationSchema&&this.portalItem?.portal.authMode!=="anonymous"?this.validationErrors&&this.variant==="full"?s`<div class="invalid-container"><calcite-icon class="invalid-icon" scale=s icon=exclamation-mark-triangle .textLabel=${this.messages.invalidclassificationerror}></calcite-icon><span class="invalid-message">${this.messages.invalidclassificationerror}</span></div>`:s`<div class="banner" style=${c(this.getStyle())}>${this.itemClassification?.banner??this.messages.notyetclassified??"Not yet classified"}</div>`:""})}};l("arcgis-portal-classification-banner",r);return r},a,b)
|
package/dist/cdn/BBVYKMTF.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.128 */
|
|
4
|
-
export default $arcgis.t(([i])=>{var p=e=>e&&!e.endsWith("/")?`${e}/`:e;function a(e){return p(e.restUrl)}function f(e,t){return u(e,t)||m(e,t)}function u(e,t){return e.owner===t.username}function m(e,t){let n=e.owner,r=e.itemControl==="admin",s=["esri_livingatlas","esri_demographics","esri_boundaries"];return e.portal?.isPortal&&!u(e,t)&&r&&n?.includes("esri_")&&!s.includes(n)?!1:r}function w(e){return e.typeKeywords?.includes("Spatiotemporal")}function h(e){return e.typeKeywords?.includes("View Service")}function v(e){return e.typeKeywords?.includes("Hosted Service")}function g(e){return e.typeKeywords?.includes("Multi Services View")}function j(e){return e?.hasViews&&!e.sourceSchemaChangesAllowed}async function P(e){let t=e?.portalItem;if(!t)return await Promise.resolve(null);let n=t.portal;if(n?.user){let r=`${a(n)}community/users/${n.user.username}`;return await i(r,{query:{f:"json",token:t.portal.credential?.token},responseType:"json"}).then(async s=>{let o=s.data?.groups??[];return await Promise.resolve(o)},async()=>await Promise.reject(new Error("Failed to fetch user groups")))}return await Promise.resolve(null)}async function $(e){let t=e?.portalItem;if(!t)return await Promise.resolve(null);let n=t.portal,r=`${a(n)}content/items/${t.id}/groups`;return await i(r,{query:{f:"json",token:t.portal.credential?.token},responseType:"json"}).then(async s=>{let o=s.data?.admin??[],c=s.data?.member??[],l=s.data?.other??[],d=[...o,...c,...l];return await Promise.resolve(d)},async()=>await Promise.reject(new Error("Failed to fetch item groups")))}async function S(e,t,{relationshipType:n,direction:r}){let s=`${a(t)}content/items/${e}/relatedItems`;return await i(s,{query:{f:"json",relationshipType:n,direction:r},responseType:"json"})}function T(e,t){return e?.some(n=>t?.some(r=>n.id===r.id&&n.capabilities.includes("updateitemcontrol")))}return{a:a,b:f,c:w,d:h,e:v,f:g,g:j,h:P,i:$,j:S,k:T}},"request")
|
package/dist/cdn/HDBWKON4.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.127 */
|
|
4
|
-
import b from"./652FN34L.js";import a from"./JWB6OMHQ.js";import{a as o}from"./YVA74N2A.js";import{a as h}from"./ZXDJCERM.js";import"./5N7A6QPT.js";import{I as n,O as r,h as c,j as e}from"./MEPRQCQD.js";export default $arcgis.t(([{c:f,d:d},{f:v}])=>{var C=c`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: "var(--calcite-color-foreground-2)"}.save-new-favorite-button{display:flex;justify-content:flex-end;margin-top:.25rem;margin-bottom:1rem}.classification-favorite-item{display:flex;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--calcite-color-border-1)}.classification-favorite-list,.classification-favorite-input-section{margin:1.75rem 1rem}`,l=class extends n{constructor(){super(...arguments),this.messages=h(),this.selectFavoriteClassification=i=>{let a=i.target.value;if(a){this.hasUpdateError=!1;let t=this.favoriteClassifications.find(({name:s})=>s===a);t&&this.updateClassificationData(t)}},this.uploadFavoriteClassificationValueHandle=async i=>{let a=await d(this.portalItem,this.favoriteClassifications);if(this.renderFavoriteClassificationError({alertIndicatorType:"success",alertIndicatorIcon:"check",alertIndicatorInfo:i}),a){let{result:t,error:s}=a;if(s){console.error(s),this.renderFavoriteClassificationError({alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:this.messages.uploadClassificationFavoriteError??"Failed to upload classification favorites"});return}t&&this.renderFavoriteClassificationError({alertIndicatorType:"success",alertIndicatorIcon:"check",alertIndicatorInfo:i})}},this.retrieveFavoriteClassificationHandle=async()=>{let i=await f(this.portalItem);if(i){let{result:a,error:t}=i;if(t){console.error(t),this.renderFavoriteClassificationError({alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:this.messages.retrieveClassificationFavoriteError??"Failed to retrieve classification favorites"});return}a&&this.resetFavoriteClassification(a.favorites)}},this.changeFavoriteClassificationName=i=>{let a=i.target.value;this.newFavoriteClassificationName=a,this.hasDuplicatedClassificationError=this.favoriteClassifications.some(t=>t.name===a)},this.saveNewFavoriteClassification=async()=>{let i=this.newFavoriteClassificationName;if(this.favoriteClassifications.some(s=>s.name===i)){this.hasDuplicatedClassificationError=!0;return}if(!i)return;let a=this.deleteNonEnabledAttributes(),t={name:i,classification:a};this.favoriteClassifications=[...this.favoriteClassifications,t],await this.uploadFavoriteClassificationValueHandle(this.messages.addClassificationFavoriteSuccessMessage??"Classification Favorite added successfully"),await this.retrieveFavoriteClassificationHandle(),this.showSaveClassificationDialog=!1},this.updateFavoriteClassification=async()=>{if(!this.selectedFavoriteClassificationName){this.hasUpdateError=!0;return}await this.addFavoriteClassification(this.selectedFavoriteClassificationName),await this.retrieveFavoriteClassificationHandle()},this.deleteNonEnabledAttributes=()=>{let i=structuredClone(this.portalItem?.classification??{}),a=Object.fromEntries(Object.entries(i).filter(([t])=>this.attributeExpressionResults?.get(t)?.enabled!==!1));return{...a,...v(this.portalItem,a)}},this.addFavoriteClassification=async i=>{let a=this.deleteNonEnabledAttributes(),t={name:i,classification:a},s=this.favoriteClassifications.findIndex(m=>m.name===i);s>=0?this.favoriteClassifications[s].classification=a:this.favoriteClassifications=[...this.favoriteClassifications,t],await this.uploadFavoriteClassificationValueHandle(this.messages.updateClassificationFavoriteSuccessMessage??"Classification Favorite updated successfully")},this.removeFavoriteClassification=async i=>{this.favoriteClassifications=this.favoriteClassifications.filter(a=>a.name!==i),this.favoriteClassifications.length===0&&(this.showManageClassificationDialog=!1),await this.uploadFavoriteClassificationValueHandle(this.messages.removeClassificationFavoriteSuccessMessage??"Classification Favorite removed successfully"),await this.retrieveFavoriteClassificationHandle()},this.newFavoriteClassificationName="",this.showManageClassificationDialog=!1,this.showSaveClassificationDialog=!1,this.hasDuplicatedClassificationError=!1,this.hasUpdateError=!1,this.alertIndicator={alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:""},this.isNotificationModalActive=!1,this.favoriteClassifications=[],this.selectedFavoriteClassificationName="",this.resetFavoriteClassification=()=>{},this.updateClassificationData=()=>{},this.renderFavoriteClassificationError=i=>{let{alertIndicatorType:a,alertIndicatorIcon:t,alertIndicatorInfo:s}=i;return e`<calcite-alert .icon=${t} .label=${this.messages.classificationNotificationHandler??"Classification notification handler"} auto-close-duration=medium open .kind=${a} @calciteAlertClose=${()=>this.alertIndicator===null}><div slot=message>${s}</div></calcite-alert>`}}static{this.properties={newFavoriteClassificationName:16,showManageClassificationDialog:16,showSaveClassificationDialog:16,hasDuplicatedClassificationError:16,hasUpdateError:16,alertIndicator:16,isNotificationModalActive:16,portalItem:0,classificationValue:0,favoriteClassifications:0,selectedFavoriteClassificationName:1,attributeExpressionResults:0,resetFavoriteClassification:0,updateClassificationData:0}}static{this.styles=C}load(){this.newFavoriteClassificationName=this.classificationValue?.banner??""}onOpenFavoriteClassificationModal(){this.newFavoriteClassificationName=this.classificationValue?.banner??"",this.showSaveClassificationDialog=!0}getValidationMessage(){return this.newFavoriteClassificationName?this.hasDuplicatedClassificationError?this.messages.duplicatedClassificationError:"":this.messages.emptyFavoriteError}render(){return e`<div>${this.favoriteClassifications.length>0?e`<div><calcite-label><div class="select-favorite-label">${this.messages.applyClassificationFavoriteLabel}<calcite-link @click=${()=>this.showManageClassificationDialog=!0}>${this.messages.manageClassificationFavoriteBtn}</calcite-link></div><calcite-combobox label=select-calcite-combobox selection-mode=single .placeholder=${this.messages.selectFavoritePlaceholder} placeholder-icon=folder-star @calciteComboboxChange=${this.selectFavoriteClassification} .status=${this.hasUpdateError?"invalid":"idle"} .validationIcon=${this.hasUpdateError?"exclamation-mark-triangle":void 0} .validationMessage=${this.hasUpdateError?this.messages.updateWarning:""}>${o(this.favoriteClassifications,({name:i})=>i,({name:i})=>e`<calcite-combobox-item .selected=${this.selectedFavoriteClassificationName===i} icon=folder-star .value=${i} .heading=${i}></calcite-combobox-item>`)}</calcite-combobox></calcite-label><div class="favorite-actions"><calcite-link icon-start=refresh @click=${this.updateFavoriteClassification}>${this.messages.updateClassificationFavoriteBtn}</calcite-link><calcite-link icon-start=star @click=${this.onOpenFavoriteClassificationModal}>${this.messages.saveNewClassificationBtn}</calcite-link></div></div>`:e`<div class="save-new-favorite-button"><calcite-link icon-start=folder-star @click=${this.onOpenFavoriteClassificationModal}>${this.messages.saveNewClassificationFavoriteBtn}</calcite-link></div>`}<calcite-dialog class="classification-favorite-dialog" overlay-positioning=fixed .heading=${this.messages.manageClassificationFavoriteLabel} .open=${this.showManageClassificationDialog} modal placement=center scale=m outside-close-disabled @calciteDialogClose=${()=>this.showManageClassificationDialog=!1}><calcite-list class="classification-favorite-list" .label=${this.messages.classificationFavoriteListLabel??"Classification Favorite list label"} selection-appearance=border selection-mode=single-persist>${o(this.favoriteClassifications,({name:i})=>i,({name:i})=>e`<calcite-list-item .label=${i} .value=${i} class="classification-favorite-item"><div slot=content-end><calcite-icon icon=trash scale=s @click=${async()=>await this.removeFavoriteClassification(i)}></calcite-icon></div></calcite-list-item>`)}</calcite-list><calcite-button slot=footer-end scale=l @click=${()=>this.showManageClassificationDialog=!1}><div>${this.messages.favoriteClassificationBtnDone}</div></calcite-button></calcite-dialog><calcite-dialog class="classification-favorite-dialog" overlay-positioning=fixed .heading=${this.messages.addFavoriteDialogHeading} .open=${this.showSaveClassificationDialog} modal placement=center scale=m outside-close-disabled @calciteDialogClose=${()=>this.showSaveClassificationDialog=!1}><calcite-label class="classification-favorite-input-section">${this.messages.addClassificationFavorite}<calcite-input id=classification-favorite-name name=classification-favorite-name scale=m .value=${this.newFavoriteClassificationName} @calciteInputInput=${this.changeFavoriteClassificationName} .status=${!this.newFavoriteClassificationName||this.hasDuplicatedClassificationError?"invalid":"idle"} validation-icon=exclamation-mark-triangle .validationMessage=${this.getValidationMessage()}></calcite-input></calcite-label><calcite-button scale=l slot=footer-end @click=${this.saveNewFavoriteClassification}>${this.messages.favoriteClassificationBtnDone}</calcite-button></calcite-dialog></div>`}};r("arcgis-portal-classification-favorite",l);return l},a,b)
|