@arcgis/portal-components 5.1.0-next.108 → 5.1.0-next.109
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/4ISLOZQ3.js +2 -0
- package/dist/cdn/4PLEDCHL.js +2 -0
- package/dist/cdn/{KXRYESNS.js → CDDNZIPE.js} +1 -1
- package/dist/cdn/LKV32QEU.js +2 -0
- package/dist/cdn/{XQQKUZKF.js → NG5R67AA.js} +1 -1
- package/dist/cdn/NUKQXUVP.js +66 -0
- package/dist/cdn/{TQLNWCB2.js → QWGLUXW5.js} +1 -1
- package/dist/cdn/{DVLJMLOY.js → TQUCMPPA.js} +45 -40
- package/dist/cdn/{S2J35TA2.js → ZOKEGSM2.js} +1 -1
- package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/functionalities.js +10 -0
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +314 -262
- package/dist/components/arcgis-portal-ai-assistant/index.js +1 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.d.ts +42 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +51 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/index.d.ts +1 -0
- package/dist/components/arcgis-portal-ai-assistant-interrupt/index.js +6 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/loader.js +1 -0
- package/dist/types/lumina.d.ts +7 -0
- package/dist/types/preact.d.ts +8 -0
- package/dist/types/react.d.ts +9 -0
- package/dist/types/stencil.d.ts +7 -0
- package/package.json +10 -8
- package/dist/cdn/YDNJNULR.js +0 -2
- /package/dist/cdn/{O3GDFHCX.js → 2I6FOF3Y.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{A as o,B as a,k as r,l as s,z as n}from"./ADZOZHQC.js";var i=class extends a{constructor(t){if(super(t),this.it=s,t.type!==n.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===s||t==null)return this._t=void 0,this.it=t;if(t===r)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};i.directiveName="unsafeHTML",i.resultType=1;var f=o(i);export{f as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"./GPSI4ROI.js";import c from"./HATVE2OT.js";import a from"./PBZ25RYU.js";import{a as S,b as P}from"./4TR5BU4V.js";import{a as I}from"./XMHAVYOA.js";import{b as v,f as E}from"./RPYRSBGP.js";import{H as d,I as m,J as b,M as C,P as y,h as g,j as n}from"./ADZOZHQC.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{createArcadeExecutor:F},{watch:q},{c:w},{a:x,b:$},{a:f,b:c,c:p,d:R,e:_,f:O}])=>{async function k({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await T(e,r,t);return{[e]:{enabled:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function T(r,t,i){let a=t?.attributes?.[r];if(!a)return!1;let{isAttributeEnabled:e}=a;return e?await h(e,JSON.stringify(t),i):!0}async function j({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await M(e,r,t);return{[e]:{valueExpressionResult:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function M(r,t,i){let a=t.attributes[r];if(!a)throw Error(`Attribute ${r} not found in schema`);let e=a.valueExpression,s=a.validValues,o=a.validValuesMap;return s?.length?s:o&&Object.keys(o)?.length?o:e?await h(e,t,i,r):null}async function N({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await H(e,r,t);return{[e]:{attributeValidationResult:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function H(r,t,i){let a=t?.attributes?.[r];if(!a)return null;let e=a?.attributeValidation;return e?await h(e,JSON.stringify(t),i,r):null}var D=async(r,t)=>{let i=r?.bannerExpression;return i?.length?await h(i,r,t):W(r,t)},W=(r,t)=>{let i=Object.entries(r.attributes).sort(([,s],[,o])=>(s?.bannerOrder??0)-(o?.bannerOrder??0)),a=[],e=[];return i.forEach(([s,o])=>{let l=t?.[s];l&&o.bannerOrder&&(a.push(U({elementType:o.uiElement??"",selectionDisplayLabel:o.bannerLabel??"",labelDelimiter:o.labelDelimiter??"",classificationProp:l,valueDelimiter:o.valueDelimiter??""})),e.push(o.attributeDelimiter??""))}),a.length>0?a.reduce((s,o,l)=>l===0?o:`${s}${e[l-1]}${o}`,""):""},U=({elementType:r,selectionDisplayLabel:t,labelDelimiter:i,classificationProp:a,valueDelimiter:e})=>{let s=r.includes("multi")&&a?a.split("").join(e):a;return`${t}${i}${s}`};async function h(r,t,i,a=""){let e={schemaJsonString:typeof t=="string"?t:JSON.stringify(t),valueJsonString:JSON.stringify(i),attributeId:a};return(await J(r)).execute(e)}async function J(r){return await F(r,{variables:[{name:"schemaJsonString",type:"text"},{name:"valueJsonString",type:"text"},{name:"attributeId",type:"text"}]})}var L=g`:host{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.header-section{padding:var(--calcite-spacing-sm)}.header-section__title-container{display:flex;align-items:center;justify-content:space-between}.header-section__title-text{margin:unset;font-weight:unset;font-size:var(--calcite-font-size)}.header-section__title-popover{padding:var(--calcite-spacing-md)}.form-section{display:flex;border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);padding:var(--calcite-spacing-sm);height:100%;overflow:hidden}.form-section__sidebar{flex:1;padding:var(--calcite-spacing-sm)}.form-section__main-content{flex:3;padding:var(--calcite-spacing-sm);overflow:auto}.danger{color:var(--calcite-color-status-danger)}.spacing-y{margin:var(--calcite-spacing-md) 0}`,u=class extends b{constructor(){super(),this.classificationModel=x(this),this.messages=I(),this.formMainContentRef=d(),this.bannerRef=d(),this._classificationDataTask=$(this),this._formCreationTask=new P(this,{task:async()=>{if(await this._classificationDataTask.taskComplete,!this.portalClassificationSchema||!this.portalItem)throw new Error("Portal item and classification schema are required to render the form");let t=this.portalItem.clone();if(await t.load(),!this.primaryAttribute)throw new Error("primaryAttribute is required but was undefined.");this.existingClassification=!!t.classification,t.classification=f(t.classification,this.primaryAttribute,this.portalClassificationSchema),t.classification&&(t.classification.banner=await D(this.portalClassificationSchema,t.classification)),this.pendingPortalItem=t,this.cleanupItemClassificationWatchHandle(),this._itemClassificationWatchHandle=q(()=>this.portalItem.classification,i=>{if(this.pendingPortalItem){let a=this.pendingPortalItem.clone();a.load().then(()=>{a.classification=i,this.pendingPortalItem=a}).catch(e=>{console.error(e)})}}),this._itemClassificationWatchPortalItem=this.portalItem,this._itemClassificationWatchPortalItem.addHandles(this._itemClassificationWatchHandle,"arcgis-classification-config"),await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults),this.existingClassification&&this.validateForm()},args:()=>[this.portalItem,this.portalClassificationSchema]}),this.getFormDisplayOrder=t=>this.portalClassificationSchema?.layouts.default.layoutElements[t].formDisplayOrder??0,this.addEditInfoAttributes=()=>{if(!this.pendingPortalItem?.classification)return{};let t=structuredClone(this.pendingPortalItem.classification),i=O(this.pendingPortalItem,t);return{...t,...i}},this.updateFavoriteClassification=t=>{this.favoriteClassifications=t},this.updateClassificationData=async t=>{let i=t.classification;if(this.selectedFavoriteClassificationName=t.name,this.pendingPortalItem){let a=this.pendingPortalItem.clone();if(await a.load(),a.classification=p(this.portalClassificationSchema,i),!this.portalClassificationSchema)return;await this.evaluateAttributeExpressions(this.portalClassificationSchema,a),a.classification=c(a.classification,this.attributeExpressionResults),this.pendingPortalItem=a}},this.existingClassification=!1,this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.primaryAttribute=this.classificationModel.primaryAttribute,this.attributeExpressionResults=new Map,this.formValidationErrors=[],this.remoteValidationErrors="",this.canUserConfigureClassification=!0,this.favoriteClassifications=[],this.isRequiredErrors=new Set,this.status=this.classificationModel.status,this.values={},this.valid=!1,this.autoDestroyDisabled=!1,this.arcgisPropertyChange=E()("status","values","valid")}static{this.properties={existingClassification:16,portalClassificationSchema:16,primaryAttribute:16,attributeExpressionResults:16,formValidationErrors:16,itemClassification:16,pendingPortalItem:16,selectedCategory:16,remoteValidationErrors:16,canUserConfigureClassification:16,favoriteClassifications:16,selectedFavoriteClassificationName:16,isRequiredErrors:16,portalItem:0,status:35,values:[1,{type:Object}],valid:7,autoDestroyDisabled:5}}static{this.styles=L}async destroy(){this.cleanupItemClassificationWatchHandle(),await this.destroyManagedChildren(),await this.manager.destroy()}async resetForm(){if(this.existingClassification)this.pendingPortalItem=this.portalItem?.clone(),this.portalClassificationSchema&&this.pendingPortalItem&&(await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults),this.validateForm());else if(this.portalItem&&this.primaryAttribute&&this.portalClassificationSchema){let t=this.portalItem.clone();await t.load(),this.pendingPortalItem=this.portalItem?.clone(),this.pendingPortalItem.classification=f(t.classification,this.primaryAttribute,this.portalClassificationSchema),this.portalClassificationSchema&&this.pendingPortalItem&&(await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults))}}async validateForm(){this.updateFormValidationErrors(),await this.updateRemoteValidationErrors()}async load(){try{await _(this.portalItem)||(this.canUserConfigureClassification=!1);let t=await w(this.portalItem);if(t){let{result:i,error:a}=t;if(a&&a.details.raw.messageCode!=="COM_1177"){console.error(a);return}i&&(this.favoriteClassifications=i.favorites)}}catch(t){console.error("Error occured while loading arcgis-classification-config:",t)}}willUpdate(t){if(t.has("pendingPortalItem")){let i=this.addEditInfoAttributes();this.values=i}(t.has("formValidationErrors")||t.has("remoteValidationErrors"))&&(this.valid=!this.formValidationErrors.length&&!this.remoteValidationErrors)}loaded(){let t=v(this.el,"form");t&&(this.listenOn(t,"formdata",this.updateFormData),this.listenOn(t,"submit",this.handleFormSubmit)),this.listen("submit",this.handleFormSubmit)}async updateClassificationProperty(t){if(!this.pendingPortalItem||!this.portalClassificationSchema)return;let i=this.pendingPortalItem.clone();await i.load(),Object.entries(t??{}).forEach(([a,e])=>{if(a===this.primaryAttribute){let s=R(e,i.classification,this.primaryAttribute);s=p(this.portalClassificationSchema,s),i.classification=s}else{let s=new Map(Object.entries(i.classification??{}));if(e===void 0||e===""||Array.isArray(e)&&e.length===0)s.delete(a);else if(s.set(a,e),a==="fgi"&&!s.has("fgiOptions")){let o=this.portalClassificationSchema?.attributes?.fgiOptions?.defaultValue??[];s.set("fgiOptions",Array.isArray(o)?o:[o])}i.classification=Object.fromEntries(s)}}),i.classification&&!i.classification.fgi&&delete i.classification.fgiOptions,await this.evaluateAttributeExpressions(this.portalClassificationSchema,i),i.classification=c(i.classification,this.attributeExpressionResults),i.classification&&(i.classification.banner=await D(this.portalClassificationSchema,i.classification)),this.pendingPortalItem=i,this.existingClassification&&this.validateForm(),t&&"classification"in t&&this.updateIsRequiredErrors()}handleCategorySelectChange(t){this.selectedCategory=t.target.selectedItems[0].value}async evaluateAttributeExpressions(t,i){let a=await k({portalClassificationSchema:t,itemClassification:i.classification}),e=await j({portalClassificationSchema:t,itemClassification:i.classification}),s=await N({portalClassificationSchema:t,itemClassification:i.classification});Object.keys(t.attributes).forEach(o=>{let l=a[o]?.enabled??!0,V=e[o]?.valueExpressionResult,A=s[o]?.attributeValidationResult;this.attributeExpressionResults.set(o,{enabled:l,valueExpressionResult:V,attributeValidationResult:A})})}updateIsRequiredErrors(){let t=new Set;Object.entries(this.portalClassificationSchema?.attributes??{})?.forEach(([i,a])=>{a.isRequired&&!this.pendingPortalItem?.classification?.[i]&&this.pendingPortalItem?.classification?.[i]!==0&&t.add(i)}),this.isRequiredErrors=t}updateFormValidationErrors(t=!1){let i=[];Object.entries(this.portalClassificationSchema?.attributes??{})?.forEach(([a,e])=>{e.isRequired&&!this.pendingPortalItem?.classification?.[a]&&this.pendingPortalItem?.classification?.[a]!==0&&(!t||this.isRequiredErrors.has(a))&&i.push({attribute:e.label,reason:this.messages.isrequired??"is required",category:e.attributeCategory}),this.attributeExpressionResults.get(a)?.attributeValidationResult&&i.push({attribute:e.label,reason:this.attributeExpressionResults.get(a)?.attributeValidationResult??"",category:e.attributeCategory})}),this.formValidationErrors=i}async updateRemoteValidationErrors(){if(!this.pendingPortalItem?.classification)return;let t=await this.classificationModel.validateClassification(void 0,this.pendingPortalItem?.classification,this.pendingPortalItem.portal.restUrl);this.remoteValidationErrors=t}cleanupItemClassificationWatchHandle(){this._itemClassificationWatchHandle?.remove(),this._itemClassificationWatchHandle=void 0,this._itemClassificationWatchPortalItem?.removeHandles("arcgis-classification-config"),this._itemClassificationWatchPortalItem=void 0}async destroyManagedChildren(){let t=this.bannerRef.value;!t?.autoDestroyDisabled||t.manager?.destroyed||await t.destroy()}async handleFormSubmit(t){this.validateForm(),this.updateIsRequiredErrors(),this.formMainContentRef.value?.scrollIntoView()}updateFormData(t){let i=t.formData,a=this.addEditInfoAttributes();a=c(a,this.attributeExpressionResults),Object.entries(a??{}).forEach(([e,s])=>{i.set(e,s)})}renderCategoryTabs(){return this._classificationDataTask.render({complete:()=>{if(this.portalClassificationSchema?.attributeCategories?.length)return this.selectedCategory||(this.selectedCategory=this.portalClassificationSchema?.attributeCategories[0]),n`<calcite-list .label=${this.messages.selectcategory??"select category"} selection-appearance=border selection-mode=single-persist @calciteListChange=${this.handleCategorySelectChange}>${this.portalClassificationSchema.attributeCategories.map(t=>{let i=this.formValidationErrors.filter(a=>a.category===t).length;return n`<calcite-list-item .label=${t} .value=${t} .selected=${this.selectedCategory===t} .description=${i?`${i} ${i>1?this.messages.errors:this.messages.error}`:void 0}>${i&&n`<div slot=content-end class="danger"><calcite-icon icon=exclamation-mark-triangle scale=s></calcite-icon></div>`||""}</calcite-list-item>`})}</calcite-list>`}})}renderValidationErrors(){return this.formValidationErrors.length&&(!this.selectedCategory||this.formValidationErrors.some(t=>this.selectedCategory===t.category))?n`<calcite-notice open icon=exclamation-mark-triangle class="spacing-y" kind=danger><div slot=message>${this.messages.bannererror??"Some fields are incomplete or contain errors. Check the highlighted fields for details."}</div></calcite-notice>`:null}renderFavoriteClassification(){let t=this.portalClassificationSchema?.attributeCategories?.[0]??"Default";return this.selectedCategory=this.portalClassificationSchema?.attributeCategories?.length?this.selectedCategory:"Default",this.selectedCategory===t?n`<arcgis-portal-classification-favorite .portalItem=${this.pendingPortalItem??this.portalItem} .classificationValue=${this.pendingPortalItem?.classification} .favoriteClassifications=${this.favoriteClassifications} .selectedFavoriteClassificationName=${this.selectedFavoriteClassificationName} .attributeExpressionResults=${this.attributeExpressionResults} .resetFavoriteClassification=${i=>this.updateFavoriteClassification(i)} .updateClassificationData=${async i=>{await this.updateClassificationData(i),this.updateFormValidationErrors(),this.updateIsRequiredErrors()}}></arcgis-portal-classification-favorite>`:null}renderForm(){return this._formCreationTask.render({pending:()=>n`<calcite-loader .label=${this.messages.loading??"loading"}></calcite-loader>`,complete:()=>{if(!this.pendingPortalItem||!this.portalClassificationSchema)return;let t=Object.entries(this.portalClassificationSchema.attributes).sort(([i],[a])=>this.getFormDisplayOrder(i)-this.getFormDisplayOrder(a));return n`${this.renderValidationErrors()}${this.renderFavoriteClassification()}${t.filter(([,{attributeCategory:i}])=>this.selectedCategory===i||!i).map(([i,a])=>{if(this.attributeExpressionResults.get(i)?.enabled===!1)return null;let e=this.pendingPortalItem?.classification?.[i];return n`<arcgis-portal-classification-form-element .attributeKey=${i} .attribute=${a} .value=${e} @arcgisAttributeValueChange=${async s=>{await this.updateClassificationProperty(s.detail),a.isRequired&&!s.detail[i]?this.isRequiredErrors.add(i):this.isRequiredErrors=new Set(Array.from(this.isRequiredErrors).filter(o=>o!==i)),this.updateFormValidationErrors(!0)}} .renderingInfo=${this.attributeExpressionResults.get(i)} .isRequiredErrors=${this.isRequiredErrors}></arcgis-portal-classification-form-element>`})}`}})}renderNotice(t,i="warning"){return n`<calcite-notice icon=exclamation-mark-triangle open class="spacing-y" .kind=${i}><div slot=message>${t}</div></calcite-notice>`}renderHelpTooltip(){return this.portalClassificationSchema?.helpTooltip?n`<calcite-action id=portal-classification-config-tooltip-button .text=${this.portalClassificationSchema?.helpTooltip} icon=information></calcite-action><calcite-popover .label=${this.portalClassificationSchema?.helpTooltip} reference-element=portal-classification-config-tooltip-button placement=bottom-end overlay-positioning=fixed auto-close><div class="header-section__title-popover"><calcite-link .href=${this.portalClassificationSchema?.helpUrl} target=_blank id=portal-classification-config-tooltip-button>${this.portalClassificationSchema?.helpTooltip}</calcite-link></div></calcite-popover>`:null}render(){return this.portalItem?this._classificationDataTask.render({pending:()=>n`<calcite-loader .label=${this.messages.loading??"loading"}></calcite-loader>`,error:()=>this.renderNotice(this.messages.anerroroccurred??"An error has occurred.","danger"),complete:()=>this.portalItem?this.canUserConfigureClassification?this.portalItem.portal.hasClassificationSchema?n`<div class="header-section" role=region aria-label=${this.messages.documentbannerpreview??"documentbannerpreview"??C}><div class="header-section__title-container"><h2 class="header-section__title-text">${this.messages.documentbannerpreview??"documentbannerpreview"}</h2>${this.renderHelpTooltip()}</div>${this._formCreationTask.status===S.COMPLETE&&n`<arcgis-portal-classification-banner .portalItem=${this.pendingPortalItem??this.portalItem} variant=preview .missingExistingClassification=${!this.existingClassification} .autoDestroyDisabled=${this.autoDestroyDisabled} ${m(this.bannerRef)}></arcgis-portal-classification-banner>`||""}</div><div class="form-section">${this.portalClassificationSchema?.attributeCategories?.length&&n`<div class="form-section__sidebar">${this.renderCategoryTabs()}</div>`||""}<div class="form-section__main-content" ${m(this.formMainContentRef)}>${this.renderForm()}</div></div>`:this.renderNotice(this.messages.missingclassificationschema??"Portal is missing classification schema."):this.renderNotice(this.messages.userconfigurepermissionrequired??"User configuration permission is required."):this.renderNotice(this.messages.portalitemrequired??"Portal item is required.")}):this.renderNotice(this.messages.portalitemrequired??"Portal item is required.")}};y("arcgis-portal-classification-config",u);return u},"arcade","core/reactiveUtils",a,c,e)
|
|
2
|
+
import e from"./HATVE2OT.js";import c from"./GPSI4ROI.js";import a from"./PBZ25RYU.js";import{a as S,b as P}from"./4TR5BU4V.js";import{a as I}from"./XMHAVYOA.js";import{b as v,f as E}from"./RPYRSBGP.js";import{H as d,I as m,J as b,M as C,P as y,h as g,j as n}from"./ADZOZHQC.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{createArcadeExecutor:F},{watch:q},{c:w},{a:f,b:c,c:p,d:R,e:_,f:O},{a:x,b:$}])=>{async function k({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await T(e,r,t);return{[e]:{enabled:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function T(r,t,i){let a=t?.attributes?.[r];if(!a)return!1;let{isAttributeEnabled:e}=a;return e?await h(e,JSON.stringify(t),i):!0}async function j({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await M(e,r,t);return{[e]:{valueExpressionResult:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function M(r,t,i){let a=t.attributes[r];if(!a)throw Error(`Attribute ${r} not found in schema`);let e=a.valueExpression,s=a.validValues,o=a.validValuesMap;return s?.length?s:o&&Object.keys(o)?.length?o:e?await h(e,t,i,r):null}async function N({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await H(e,r,t);return{[e]:{attributeValidationResult:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function H(r,t,i){let a=t?.attributes?.[r];if(!a)return null;let e=a?.attributeValidation;return e?await h(e,JSON.stringify(t),i,r):null}var D=async(r,t)=>{let i=r?.bannerExpression;return i?.length?await h(i,r,t):W(r,t)},W=(r,t)=>{let i=Object.entries(r.attributes).sort(([,s],[,o])=>(s?.bannerOrder??0)-(o?.bannerOrder??0)),a=[],e=[];return i.forEach(([s,o])=>{let l=t?.[s];l&&o.bannerOrder&&(a.push(U({elementType:o.uiElement??"",selectionDisplayLabel:o.bannerLabel??"",labelDelimiter:o.labelDelimiter??"",classificationProp:l,valueDelimiter:o.valueDelimiter??""})),e.push(o.attributeDelimiter??""))}),a.length>0?a.reduce((s,o,l)=>l===0?o:`${s}${e[l-1]}${o}`,""):""},U=({elementType:r,selectionDisplayLabel:t,labelDelimiter:i,classificationProp:a,valueDelimiter:e})=>{let s=r.includes("multi")&&a?a.split("").join(e):a;return`${t}${i}${s}`};async function h(r,t,i,a=""){let e={schemaJsonString:typeof t=="string"?t:JSON.stringify(t),valueJsonString:JSON.stringify(i),attributeId:a};return(await J(r)).execute(e)}async function J(r){return await F(r,{variables:[{name:"schemaJsonString",type:"text"},{name:"valueJsonString",type:"text"},{name:"attributeId",type:"text"}]})}var L=g`:host{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.header-section{padding:var(--calcite-spacing-sm)}.header-section__title-container{display:flex;align-items:center;justify-content:space-between}.header-section__title-text{margin:unset;font-weight:unset;font-size:var(--calcite-font-size)}.header-section__title-popover{padding:var(--calcite-spacing-md)}.form-section{display:flex;border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);padding:var(--calcite-spacing-sm);height:100%;overflow:hidden}.form-section__sidebar{flex:1;padding:var(--calcite-spacing-sm)}.form-section__main-content{flex:3;padding:var(--calcite-spacing-sm);overflow:auto}.danger{color:var(--calcite-color-status-danger)}.spacing-y{margin:var(--calcite-spacing-md) 0}`,u=class extends b{constructor(){super(),this.classificationModel=x(this),this.messages=I(),this.formMainContentRef=d(),this.bannerRef=d(),this._classificationDataTask=$(this),this._formCreationTask=new P(this,{task:async()=>{if(await this._classificationDataTask.taskComplete,!this.portalClassificationSchema||!this.portalItem)throw new Error("Portal item and classification schema are required to render the form");let t=this.portalItem.clone();if(await t.load(),!this.primaryAttribute)throw new Error("primaryAttribute is required but was undefined.");this.existingClassification=!!t.classification,t.classification=f(t.classification,this.primaryAttribute,this.portalClassificationSchema),t.classification&&(t.classification.banner=await D(this.portalClassificationSchema,t.classification)),this.pendingPortalItem=t,this.cleanupItemClassificationWatchHandle(),this._itemClassificationWatchHandle=q(()=>this.portalItem.classification,i=>{if(this.pendingPortalItem){let a=this.pendingPortalItem.clone();a.load().then(()=>{a.classification=i,this.pendingPortalItem=a}).catch(e=>{console.error(e)})}}),this._itemClassificationWatchPortalItem=this.portalItem,this._itemClassificationWatchPortalItem.addHandles(this._itemClassificationWatchHandle,"arcgis-classification-config"),await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults),this.existingClassification&&this.validateForm()},args:()=>[this.portalItem,this.portalClassificationSchema]}),this.getFormDisplayOrder=t=>this.portalClassificationSchema?.layouts.default.layoutElements[t].formDisplayOrder??0,this.addEditInfoAttributes=()=>{if(!this.pendingPortalItem?.classification)return{};let t=structuredClone(this.pendingPortalItem.classification),i=O(this.pendingPortalItem,t);return{...t,...i}},this.updateFavoriteClassification=t=>{this.favoriteClassifications=t},this.updateClassificationData=async t=>{let i=t.classification;if(this.selectedFavoriteClassificationName=t.name,this.pendingPortalItem){let a=this.pendingPortalItem.clone();if(await a.load(),a.classification=p(this.portalClassificationSchema,i),!this.portalClassificationSchema)return;await this.evaluateAttributeExpressions(this.portalClassificationSchema,a),a.classification=c(a.classification,this.attributeExpressionResults),this.pendingPortalItem=a}},this.existingClassification=!1,this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.primaryAttribute=this.classificationModel.primaryAttribute,this.attributeExpressionResults=new Map,this.formValidationErrors=[],this.remoteValidationErrors="",this.canUserConfigureClassification=!0,this.favoriteClassifications=[],this.isRequiredErrors=new Set,this.status=this.classificationModel.status,this.values={},this.valid=!1,this.autoDestroyDisabled=!1,this.arcgisPropertyChange=E()("status","values","valid")}static{this.properties={existingClassification:16,portalClassificationSchema:16,primaryAttribute:16,attributeExpressionResults:16,formValidationErrors:16,itemClassification:16,pendingPortalItem:16,selectedCategory:16,remoteValidationErrors:16,canUserConfigureClassification:16,favoriteClassifications:16,selectedFavoriteClassificationName:16,isRequiredErrors:16,portalItem:0,status:35,values:[1,{type:Object}],valid:7,autoDestroyDisabled:5}}static{this.styles=L}async destroy(){this.cleanupItemClassificationWatchHandle(),await this.destroyManagedChildren(),await this.manager.destroy()}async resetForm(){if(this.existingClassification)this.pendingPortalItem=this.portalItem?.clone(),this.portalClassificationSchema&&this.pendingPortalItem&&(await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults),this.validateForm());else if(this.portalItem&&this.primaryAttribute&&this.portalClassificationSchema){let t=this.portalItem.clone();await t.load(),this.pendingPortalItem=this.portalItem?.clone(),this.pendingPortalItem.classification=f(t.classification,this.primaryAttribute,this.portalClassificationSchema),this.portalClassificationSchema&&this.pendingPortalItem&&(await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults))}}async validateForm(){this.updateFormValidationErrors(),await this.updateRemoteValidationErrors()}async load(){try{await _(this.portalItem)||(this.canUserConfigureClassification=!1);let t=await w(this.portalItem);if(t){let{result:i,error:a}=t;if(a&&a.details.raw.messageCode!=="COM_1177"){console.error(a);return}i&&(this.favoriteClassifications=i.favorites)}}catch(t){console.error("Error occured while loading arcgis-classification-config:",t)}}willUpdate(t){if(t.has("pendingPortalItem")){let i=this.addEditInfoAttributes();this.values=i}(t.has("formValidationErrors")||t.has("remoteValidationErrors"))&&(this.valid=!this.formValidationErrors.length&&!this.remoteValidationErrors)}loaded(){let t=v(this.el,"form");t&&(this.listenOn(t,"formdata",this.updateFormData),this.listenOn(t,"submit",this.handleFormSubmit)),this.listen("submit",this.handleFormSubmit)}async updateClassificationProperty(t){if(!this.pendingPortalItem||!this.portalClassificationSchema)return;let i=this.pendingPortalItem.clone();await i.load(),Object.entries(t??{}).forEach(([a,e])=>{if(a===this.primaryAttribute){let s=R(e,i.classification,this.primaryAttribute);s=p(this.portalClassificationSchema,s),i.classification=s}else{let s=new Map(Object.entries(i.classification??{}));if(e===void 0||e===""||Array.isArray(e)&&e.length===0)s.delete(a);else if(s.set(a,e),a==="fgi"&&!s.has("fgiOptions")){let o=this.portalClassificationSchema?.attributes?.fgiOptions?.defaultValue??[];s.set("fgiOptions",Array.isArray(o)?o:[o])}i.classification=Object.fromEntries(s)}}),i.classification&&!i.classification.fgi&&delete i.classification.fgiOptions,await this.evaluateAttributeExpressions(this.portalClassificationSchema,i),i.classification=c(i.classification,this.attributeExpressionResults),i.classification&&(i.classification.banner=await D(this.portalClassificationSchema,i.classification)),this.pendingPortalItem=i,this.existingClassification&&this.validateForm(),t&&"classification"in t&&this.updateIsRequiredErrors()}handleCategorySelectChange(t){this.selectedCategory=t.target.selectedItems[0].value}async evaluateAttributeExpressions(t,i){let a=await k({portalClassificationSchema:t,itemClassification:i.classification}),e=await j({portalClassificationSchema:t,itemClassification:i.classification}),s=await N({portalClassificationSchema:t,itemClassification:i.classification});Object.keys(t.attributes).forEach(o=>{let l=a[o]?.enabled??!0,V=e[o]?.valueExpressionResult,A=s[o]?.attributeValidationResult;this.attributeExpressionResults.set(o,{enabled:l,valueExpressionResult:V,attributeValidationResult:A})})}updateIsRequiredErrors(){let t=new Set;Object.entries(this.portalClassificationSchema?.attributes??{})?.forEach(([i,a])=>{a.isRequired&&!this.pendingPortalItem?.classification?.[i]&&this.pendingPortalItem?.classification?.[i]!==0&&t.add(i)}),this.isRequiredErrors=t}updateFormValidationErrors(t=!1){let i=[];Object.entries(this.portalClassificationSchema?.attributes??{})?.forEach(([a,e])=>{e.isRequired&&!this.pendingPortalItem?.classification?.[a]&&this.pendingPortalItem?.classification?.[a]!==0&&(!t||this.isRequiredErrors.has(a))&&i.push({attribute:e.label,reason:this.messages.isrequired??"is required",category:e.attributeCategory}),this.attributeExpressionResults.get(a)?.attributeValidationResult&&i.push({attribute:e.label,reason:this.attributeExpressionResults.get(a)?.attributeValidationResult??"",category:e.attributeCategory})}),this.formValidationErrors=i}async updateRemoteValidationErrors(){if(!this.pendingPortalItem?.classification)return;let t=await this.classificationModel.validateClassification(void 0,this.pendingPortalItem?.classification,this.pendingPortalItem.portal.restUrl);this.remoteValidationErrors=t}cleanupItemClassificationWatchHandle(){this._itemClassificationWatchHandle?.remove(),this._itemClassificationWatchHandle=void 0,this._itemClassificationWatchPortalItem?.removeHandles("arcgis-classification-config"),this._itemClassificationWatchPortalItem=void 0}async destroyManagedChildren(){let t=this.bannerRef.value;!t?.autoDestroyDisabled||t.manager?.destroyed||await t.destroy()}async handleFormSubmit(t){this.validateForm(),this.updateIsRequiredErrors(),this.formMainContentRef.value?.scrollIntoView()}updateFormData(t){let i=t.formData,a=this.addEditInfoAttributes();a=c(a,this.attributeExpressionResults),Object.entries(a??{}).forEach(([e,s])=>{i.set(e,s)})}renderCategoryTabs(){return this._classificationDataTask.render({complete:()=>{if(this.portalClassificationSchema?.attributeCategories?.length)return this.selectedCategory||(this.selectedCategory=this.portalClassificationSchema?.attributeCategories[0]),n`<calcite-list .label=${this.messages.selectcategory??"select category"} selection-appearance=border selection-mode=single-persist @calciteListChange=${this.handleCategorySelectChange}>${this.portalClassificationSchema.attributeCategories.map(t=>{let i=this.formValidationErrors.filter(a=>a.category===t).length;return n`<calcite-list-item .label=${t} .value=${t} .selected=${this.selectedCategory===t} .description=${i?`${i} ${i>1?this.messages.errors:this.messages.error}`:void 0}>${i&&n`<div slot=content-end class="danger"><calcite-icon icon=exclamation-mark-triangle scale=s></calcite-icon></div>`||""}</calcite-list-item>`})}</calcite-list>`}})}renderValidationErrors(){return this.formValidationErrors.length&&(!this.selectedCategory||this.formValidationErrors.some(t=>this.selectedCategory===t.category))?n`<calcite-notice open icon=exclamation-mark-triangle class="spacing-y" kind=danger><div slot=message>${this.messages.bannererror??"Some fields are incomplete or contain errors. Check the highlighted fields for details."}</div></calcite-notice>`:null}renderFavoriteClassification(){let t=this.portalClassificationSchema?.attributeCategories?.[0]??"Default";return this.selectedCategory=this.portalClassificationSchema?.attributeCategories?.length?this.selectedCategory:"Default",this.selectedCategory===t?n`<arcgis-portal-classification-favorite .portalItem=${this.pendingPortalItem??this.portalItem} .classificationValue=${this.pendingPortalItem?.classification} .favoriteClassifications=${this.favoriteClassifications} .selectedFavoriteClassificationName=${this.selectedFavoriteClassificationName} .attributeExpressionResults=${this.attributeExpressionResults} .resetFavoriteClassification=${i=>this.updateFavoriteClassification(i)} .updateClassificationData=${async i=>{await this.updateClassificationData(i),this.updateFormValidationErrors(),this.updateIsRequiredErrors()}}></arcgis-portal-classification-favorite>`:null}renderForm(){return this._formCreationTask.render({pending:()=>n`<calcite-loader .label=${this.messages.loading??"loading"}></calcite-loader>`,complete:()=>{if(!this.pendingPortalItem||!this.portalClassificationSchema)return;let t=Object.entries(this.portalClassificationSchema.attributes).sort(([i],[a])=>this.getFormDisplayOrder(i)-this.getFormDisplayOrder(a));return n`${this.renderValidationErrors()}${this.renderFavoriteClassification()}${t.filter(([,{attributeCategory:i}])=>this.selectedCategory===i||!i).map(([i,a])=>{if(this.attributeExpressionResults.get(i)?.enabled===!1)return null;let e=this.pendingPortalItem?.classification?.[i];return n`<arcgis-portal-classification-form-element .attributeKey=${i} .attribute=${a} .value=${e} @arcgisAttributeValueChange=${async s=>{await this.updateClassificationProperty(s.detail),a.isRequired&&!s.detail[i]?this.isRequiredErrors.add(i):this.isRequiredErrors=new Set(Array.from(this.isRequiredErrors).filter(o=>o!==i)),this.updateFormValidationErrors(!0)}} .renderingInfo=${this.attributeExpressionResults.get(i)} .isRequiredErrors=${this.isRequiredErrors}></arcgis-portal-classification-form-element>`})}`}})}renderNotice(t,i="warning"){return n`<calcite-notice icon=exclamation-mark-triangle open class="spacing-y" .kind=${i}><div slot=message>${t}</div></calcite-notice>`}renderHelpTooltip(){return this.portalClassificationSchema?.helpTooltip?n`<calcite-action id=portal-classification-config-tooltip-button .text=${this.portalClassificationSchema?.helpTooltip} icon=information></calcite-action><calcite-popover .label=${this.portalClassificationSchema?.helpTooltip} reference-element=portal-classification-config-tooltip-button placement=bottom-end overlay-positioning=fixed auto-close><div class="header-section__title-popover"><calcite-link .href=${this.portalClassificationSchema?.helpUrl} target=_blank id=portal-classification-config-tooltip-button>${this.portalClassificationSchema?.helpTooltip}</calcite-link></div></calcite-popover>`:null}render(){return this.portalItem?this._classificationDataTask.render({pending:()=>n`<calcite-loader .label=${this.messages.loading??"loading"}></calcite-loader>`,error:()=>this.renderNotice(this.messages.anerroroccurred??"An error has occurred.","danger"),complete:()=>this.portalItem?this.canUserConfigureClassification?this.portalItem.portal.hasClassificationSchema?n`<div class="header-section" role=region aria-label=${this.messages.documentbannerpreview??"documentbannerpreview"??C}><div class="header-section__title-container"><h2 class="header-section__title-text">${this.messages.documentbannerpreview??"documentbannerpreview"}</h2>${this.renderHelpTooltip()}</div>${this._formCreationTask.status===S.COMPLETE&&n`<arcgis-portal-classification-banner .portalItem=${this.pendingPortalItem??this.portalItem} variant=preview .missingExistingClassification=${!this.existingClassification} .autoDestroyDisabled=${this.autoDestroyDisabled} ${m(this.bannerRef)}></arcgis-portal-classification-banner>`||""}</div><div class="form-section">${this.portalClassificationSchema?.attributeCategories?.length&&n`<div class="form-section__sidebar">${this.renderCategoryTabs()}</div>`||""}<div class="form-section__main-content" ${m(this.formMainContentRef)}>${this.renderForm()}</div></div>`:this.renderNotice(this.messages.missingclassificationschema??"Portal is missing classification schema."):this.renderNotice(this.messages.userconfigurepermissionrequired??"User configuration permission is required."):this.renderNotice(this.messages.portalitemrequired??"Portal item is required.")}):this.renderNotice(this.messages.portalitemrequired??"Portal item is required.")}};y("arcgis-portal-classification-config",u);return u},"arcade","core/reactiveUtils",a,c,e)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import a from"./SKW3IFMK.js";import"./S2PHM4WZ.js";import{a as I}from"./4PLEDCHL.js";import{a as y}from"./XMHAVYOA.js";import"./RPYRSBGP.js";import{H as u,I as h,J as f,M as g,P as v,Q as b,h as m,j as l,v as d}from"./ADZOZHQC.js";import"./CFDTXKJ6.js";export default $arcgis.t(([k,{p:w}])=>{var C=m`.thumbnail-container{width:100%}.replacement-container{margin:.5rem}.replacement-message{margin-bottom:.5rem}.replacement-card__title{margin-bottom:.25rem}`,M=["3DInsetMap","3DScene","3DViz","AttachmentViewer","CapacityAnalysis","Cascade","Compare","Compare/Configure","Compare/Multiviewer","Compare/Search","Compare/SideBySideViewer_Configure","Compare/storytelling_compare","Compare/storytelling_sidepanel","Compare/storytelling_tabbed","Compare3d","CompareAnalysis","CompareMaps","CrowdsourceManager","CrowdsourcePolling","CrowdsourceReporter","Directions","Edit","Editor","Elevations","ElevationsProfile","Embed","Filter","FilterGallery","GeoForm","GeoList","GeoTour","HeaderFooter","Identify","ImageInterpretation","ImageMask","ImageVisit","ImageryViewer","ImpactSummary","InformationLookup","InteractiveFilter","InteractiveLegend","LayerShowcase","Legend","LiveMaps","LocalPerspective","MapAndAppGallery","MapCarousel","MapJournal","MapSeries","Shortlist","MapTools","MapTour","Media","MinimalGallery","Minimalist","MobileViewer","Nearby","OnePane","Panels","PanelsLegend","Profile","PublicGallery","PublicInformation","ServiceLookup","SimpleMapViewer","SimpleViewer","SocialMedia","Solutions/s2.html?app=apps2/FindEditFilter","Solutions/s2.html?app=apps2/Finder","Solutions/s2.html","StoryMapBasic","StorytellingSwipe","StorytellingTextLegend","Styler","SummaryViewer","Time","TimeAware","TwoPane","View","Viewer","ZoneLookup"],S=i=>{if(!i)return!1;let e=M.some(t=>{let a=t.includes(".html"),r=`/apps/${t}${a?"":"/"}`;return decodeURIComponent(i.url)?.includes(r)});return i.type==="Web Mapping Application"&&!!i.url&&e};function T(i){let e=["Cascade","MapTour","MapJournal","MapSeries","Shortlist","StoryMapCrowdsource","SwipeSpyglass","Story Map"];return i.type==="Web Mapping Application"&&(P(e,i)||A(i))}function A(i){return["Cascade","MapTour","MapJournal","MapSeries","Shortlist","StoryMapCrowdsource","StorytellingSwipe"].some(e=>{let t=`/apps/${e}/index.html`;return decodeURIComponent(i.url)?.includes(t)})}function P(i,e){return i?.some(t=>e?.typeKeywords?.includes(t))}function $(i){let e=U(i);return b(`assets/portal-item-thumbnail/${e}`)}function U(i){let e=i.type?.toLowerCase(),t=i.typeKeywords||[];switch(e){case"web mapping application":return"webapp.avif";case"mobile application":return"mobileapp.avif";case"notebook code snippets":case"notebook code snippet library":return"notebookcodesnippets.avif";case"notebook":return"notebook.avif";case"style":return t.includes("Dictionary")?"dictionarystyle.avif":"style.avif";case"feature service":return t.includes("Location Tracking View")?"locationtrackingservice.avif":t.includes("IndoorPositioningDataService")?"indoor-positioning-data-service.avif":"default.avif";case"pro presentation":return"pro-presentation.avif";case"reality mapping project":return"realitymappingproject.avif";case"raster function template":return"rasterfunctiontemplate.avif";case"workforce project":return"workforceproject.avif";case"hub initiative":return"hubinitiative.avif";case"hub page":return"hubpage.avif";case"hub site application":case"site application":return"hubsite.avif";case"hub event":return"hubevent.avif";case"hub project":return"hubproject.avif";case"dashboard":return t.includes("ArcGIS Dashboards")?"dashboards.avif":"opsdashboard.avif";case"geoprocessing service":return t.includes("Notebook Web Tool")?"notebookwebtool.avif":"webtool.avif";case"web scene":case"scene service":return"scene.avif";case"ortho mapping project":return"orthomappingproject.avif";case"ortho mapping template":return"orthomappingtemplate.avif";case"insights theme":return"insightstheme.avif";case"insights workbook package":return"insightsworkbookpackage.avif";case"solution":return"solution.avif";case"mobile scene package":return"mobilescenepackage.avif";case"deep learning package":return"deeplearningpackage.avif";case"big data analytic":return"bigdataanalytic.avif";case"real time analytic":return"realtimeanalytic.avif";case"feed":return"feed.avif";case"excalibur imagery project":return"excaliburimageryproject.avif";case"storymap":return t?.includes("storymapcollection")?"storymapcollection.avif":"storymap.avif";case"survey123 add in":return"survey123addin.avif";case"mission":return"mission.avif";case"mission template":return"missiontemplate.avif";case"quickcapture project":return"quickcaptureproject.avif";case"pro report":return"proreport.avif";case"pro package":return"propackage.avif";case"pro report template":return"proreporttemplate.avif";case"urban model":return"urbanmodel.avif";case"urban project":return"urbanproject.avif";case"web experience":return"webexperience.avif";case"web experience template":return"webexperiencetemplate.avif";case"experience builder widget":return"experiencebuilderwidget.avif";case"experience builder widget package":return"experiencebuilderwidgetpackage.avif";case"workflow":return"workflow.avif";case"insights script":return"insightsscript.avif";case"kernel gateway connection":return"kernelgatewayconnection.avif";case"hub initiative template":return"hubinitiativetemplate.avif";case"image service":return t?.includes("Tile Imagery")?"tiledimagerylayer.avif":"imagerylayer.avif";case"mission report":return"missionreport.avif";case"administrative report":return"administrativereport.avif";case"storymap theme":return"storymaptheme.avif";case"knowledge graph":return"knowledgegraph.avif";case"knowledge graph layer":return"knowledgegraphlayer.avif";case"knowledge studio project":return"knowledgestudio.avif";case"earth configuration":return"earthconfiguration.avif";case"link chart":return"linkchart.avif";case"investigation":return"investigation.avif";case"apache parquet":return"apacheparquet.avif";case"curated collection":return"curatedcollection.avif";case"video service":return"mediaservice.avif";case"geodata service":return"geodataservice.avif";case"suitability model":return"suitabilitymodel.avif";case"esri classifier definition":return"classifierdefinition.avif";case"esri spectral library":return"spectrallibrary.avif";case"deep learning studio project":return"deeplearningstudioproject.avif";case"esri classification schema":return"classificationschema.avif";case"insights data engineering workbook":return"dataengineeringworkbook.avif";case"insights data engineering model":return"dataengineeringmodel.avif";case"discussion":return"discussion.avif";case"api key":return"apikey.avif";case"data pipeline":return"datapipeline.avif";case"analysis model":return"analysismodel.avif";case"service connection":return"serviceconnection.avif";case"xr experience":return"xrexperience.avif";case"3dtiles service":return t?.includes("GaussianSplat")?"gaussiansplatlayer.avif":"default.avif";default:return"default.avif"}}function x(i,e,t){let{restUrl:a}=i,r=j(i),n=r?`token=${r}`:"",c=`${a}/content/items/${e.id}`;if(e.thumbnail){let o=e.thumbnailUrl;if(o){let s=new URL(o);return s.searchParams.append("w","400"),s.href}return`${c}/info/${e.thumbnail}?w=400${r?"&":""}${n}`}else if(e.type==="Image")return`${c}/data?${n}`;return $(e)}function j(i){return i?.credential?.token||i?.token||i?.user?.credential?.token||i?.portalUser?.token||""}function L({portal:i,usePortalHostname:e}){let{customBaseUrl:t,portalHostname:a,urlKey:r}=i,{protocol:n}=window.location,c=!e&&r?`${r}.${t}`:a;return`${n}//${c}`}var R=5e3,p=class extends f{constructor(){super(...arguments),this.replacementId=null,this.replacementItemInRecycleBin=!1,this.hasInaccessibleReplacementItem=!1,this.thumbnailUrl=null,this.timer=void 0,this.t9n=y({blocking:!0}),this.primaryActionRef=u(),this.getItemDetailsUrl=({portal:e,itemId:t,redirect:a})=>{let r=L({portal:e,usePortalHostname:!this.user});return r?`${`${r}/home`}/item.html?id=${t}${a?"&performRedirectAction=true":""}`:""},this.performRedirectAction=()=>{window.open(this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId,redirect:!0}),"_self")},this.viewItemDetailsPage=()=>{window.open(this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId??this.itemId}),this.canRedirect?"_self":"_blank")},this.item=null,this.replacementItem=null,this.redirectAction=null,this.canRedirect=!1,this.redirectCancelled=!1,this.open=!1,this.redirectTimeRemaining=R/1e3,this.arcgisPortalReplacementItemFetch=d()}static{this.properties={item:16,replacementItem:16,redirectAction:16,canRedirect:16,redirectCancelled:16,open:16,redirectTimeRemaining:16,itemId:1,portal:0,user:0}}static{this.styles=C}async setFocus(){this.primaryActionRef.value?.setFocus()}willUpdate(e){(e.has("itemId")||e.has("portal")||e.has("user"))&&(this.user??=this.portal?.user??null,this.initItem())}setupTimer({onComplete:e}){typeof this.timer=="number"&&clearInterval(this.timer),this.redirectTimeRemaining=R/1e3,this.timer=setInterval(()=>{if(this.redirectTimeRemaining<=0){clearInterval(this.timer),this.timer=void 0,e();return}this.redirectTimeRemaining-=1},1e3)}cancelTimer({onCancel:e}={}){e?.(),clearInterval(this.timer)}handleClose(){this.cancelTimer(),this.itemId="",this.item=null,this.open=!1}cancelRedirect(){this.cancelTimer(),this.redirectCancelled=!0}isItemRetired(e){return S(e)||T(e)}async initItem(){if(!this.itemId)return;let{itemId:e,portal:t,performRedirectAction:a}=this,r=new k({id:e,portal:t});this.item=await r?.load();let n=await w(e,t,{relationshipType:"ReplacementItem2Item",direction:"reverse"},!0),c=n.data?.relatedItems?.[0];this.replacementItemInRecycleBin=c?.inRecycleBin;let o=c?.id,s=!this.replacementItemInRecycleBin&&o?new k({id:o,portal:t}):null;await s?.load(),this.replacementItem=s,this.hasInaccessibleReplacementItem=this.replacementItemInRecycleBin||!s&&n.data?.aggregations?.total?.count>0&&n.data?.relatedItems?.length===0,this.arcgisPortalReplacementItemFetch.emit({replacementItem:this.hasInaccessibleReplacementItem?{}:s||null}),this.replacementItem=s,this.thumbnailUrl=x(t,s??this.item),this.canRedirect=!!s&&this.isItemRetired(r),this.replacementId=s?.id||null,this.canRedirect&&this.setupTimer({onComplete:()=>a()}),this.open=!0}getReplacementHeading(){let{t9n:e,hasInaccessibleReplacementItem:t,canRedirect:a}=this;return t?e.replacementUnavailable:a?e.redirectToReplacement:this.isItemRetired(this.item)&&!this.replacementItem?e.replacementUnavailable:e.replacementAvailable}getReplacementMessage(){let{t9n:e,hasInaccessibleReplacementItem:t,canRedirect:a}=this;return t?e.retiredReplacementUnavailable:a?e.deprecatedHasReplacement:this.isItemRetired(this.item)&&!this.replacementItem?e.retired:e.deprecatedHasReplacement}getRedirectActionMessage(){let{t9n:e,canRedirect:t,redirectTimeRemaining:a,redirectCancelled:r}=this;return r?e.redirectToReplacement:t?e.redirect.replace("${seconds}",`${a}`):e.moreDetails}renderCard(e){let{canRedirect:t,t9n:a}=this;return l`<calcite-card thumbnail-position=inline-start><img slot=thumbnail class="thumbnail" src=${(this.thumbnailUrl||void 0)??g} @error=${async()=>this.thumbnailUrl=$(e)}><span slot=heading class="replacement-card__title">${e.title}</span><span slot=description>${a.ownedBy?.replace("${owner}",e.owner||"")||""}</span>${t&&l`<calcite-link slot=footer-start icon-end=launch .href=${this.getItemDetailsUrl({portal:this.portal,itemId:this.replacementId})} target=_blank>${a.moreDetails}</calcite-link>`||""}</calcite-card>`}render(){let{open:e,t9n:t,item:a,replacementItem:r,canRedirect:n,redirectCancelled:c}=this;if(!(!a||!this.isItemRetired(a)))return l`<calcite-dialog modal .open=${e} width=s kind=info outside-close-disabled escape-disabled close-disabled .heading=${this.getReplacementHeading()} @calciteDialogClose=${()=>this.handleClose()}><div class="replacement-container"><div class="replacement-message">${I(this.getReplacementMessage()?.replace("${itemTitle}",this.item?.title||""))}</div>${this.renderCard(n?r:a)}</div>${n&&!c&&l`<calcite-button slot=footer-end appearance=outline-fill kind=neutral @click=${()=>{this.cancelRedirect()}}>${t.cancelRedirection}</calcite-button>`||""}<calcite-button slot=footer-end @click=${()=>{this.cancelTimer(),n?this.performRedirectAction():this.viewItemDetailsPage()}} .iconEnd=${n?void 0:"launch"} icon-flip-rtl=end ${h(this.primaryActionRef)}>${this.getRedirectActionMessage()}</calcite-button></calcite-dialog>`}};v("arcgis-portal-replacement-item-redirect",p);return p},"portal/PortalItem",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{$a as N,A,Ab as ka,B,Bb as la,Qa as C,Ra as D,Sa as E,Ta as F,Ua as G,Va as H,Wa as I,Xa as J,Ya as K,Za as L,_a as M,a,ab as O,b,bb as P,c,cb as Q,d,db as R,e,eb as S,f,fb as T,g,gb as U,h,hb as V,i,ib as W,j,jb as X,k,kb as Y,l,lb as Z,m,mb as _,n,nb as $,o,ob as aa,p,q,r,rb as ba,s,sb as ca,t,tb as da,u,ub as ea,v,vb as fa,w,wb as ga,x,xb as ha,y,yb as ia,z,zb as ja}from"./
|
|
2
|
+
import{$a as N,A,Ab as ka,B,Bb as la,Qa as C,Ra as D,Sa as E,Ta as F,Ua as G,Va as H,Wa as I,Xa as J,Ya as K,Za as L,_a as M,a,ab as O,b,bb as P,c,cb as Q,d,db as R,e,eb as S,f,fb as T,g,gb as U,h,hb as V,i,ib as W,j,jb as X,k,kb as Y,l,lb as Z,m,mb as _,n,nb as $,o,ob as aa,p,q,r,rb as ba,s,sb as ca,t,tb as da,u,ub as ea,v,vb as fa,w,wb as ga,x,xb as ha,y,yb as ia,z,zb as ja}from"./2I6FOF3Y.js";import"./CFDTXKJ6.js";export{L as Annotation,H as AsyncBatchedStore,J as BaseChannel,E as BaseCheckpointSaver,k as BaseLangGraphError,G as BaseStore,K as BinaryOperatorAggregate,d as COMMAND_SYMBOL,i as Command,e as CommandInstance,ca as CompiledStateGraph,b as END,v as EmptyChannelError,u as EmptyInputError,R as Graph,l as GraphBubbleUp,o as GraphInterrupt,m as GraphRecursionError,n as GraphValueError,c as INTERRUPT,I as InMemoryStore,w as InvalidUpdateError,F as MemorySaver,da as MessageGraph,ia as MessagesAnnotation,aa as MessagesValue,ja as MessagesZodMeta,ka as MessagesZodState,x as MultipleSubgraphsError,p as NodeInterrupt,g as Overwrite,q as ParentCommand,_ as REMOVE_ALL_MESSAGES,X as ReducedValue,z as RemoteException,a as START,f as Send,ba as StateGraph,A as StateGraphInputError,Z as StateSchema,y as UnreachableNodeError,Y as UntrackedValue,W as UntrackedValueChannel,$ as addMessages,D as copyCheckpoint,C as emptyCheckpoint,ga as entrypoint,O as getConfig,P as getCurrentTaskInput,U as getJsonSchemaFromSchema,ha as getPreviousState,V as getSchemaDefaultGetter,M as getStore,B as getSubgraphsSeenSet,N as getWriter,Q as interrupt,j as isCommand,s as isGraphBubbleUp,t as isGraphInterrupt,h as isInterrupted,r as isParentCommand,T as isSerializableSchema,S as isStandardSchema,$ as messagesStateReducer,ea as pushMessage,fa as task,la as writer};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as ze}from"./4PLEDCHL.js";import{a as _e}from"./4ISLOZQ3.js";import{a as Le}from"./XMHAVYOA.js";import"./RPYRSBGP.js";import{J as $e,P as Re,h as Te,j as z,v as le}from"./ADZOZHQC.js";import"./CFDTXKJ6.js";var J=function(){return J=Object.assign||function(t){for(var r,s=1,i=arguments.length;s<i;s++){r=arguments[s];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},J.apply(this,arguments)},oe={exports:{}},b={},ce={exports:{}},E={};function Oe(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function ht(e,t,r){}function gt(e,t,r){}var dt=/javascript\s*\:/img;function kt(e,t){return dt.test(t)?"":t}E.whiteList=Oe();E.getDefaultWhiteList=Oe;E.onAttr=ht;E.onIgnoreAttr=gt;E.safeAttrValue=kt;var bt={indexOf:function(e,t){var r,s;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,s=e.length;r<s;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var s,i;if(Array.prototype.forEach)return e.forEach(t,r);for(s=0,i=e.length;s<i;s++)t.call(r,e[s],s,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},N=bt;function mt(e,t){e=N.trimRight(e),e[e.length-1]!==";"&&(e+=";");var r=e.length,s=!1,i=0,n=0,l="";function a(){if(!s){var p=N.trim(e.slice(i,n)),u=p.indexOf(":");if(u!==-1){var f=N.trim(p.slice(0,u)),g=N.trim(p.slice(u+1));if(f){var h=t(i,l.length,f,g,p);h&&(l+=h+"; ")}}}i=n+1}for(;n<r;n++){var c=e[n];if(c==="/"&&e[n+1]==="*"){var o=e.indexOf("*/",n+2);if(o===-1)break;n=o+1,i=n+1,s=!1}else c==="("?s=!0:c===")"?s=!1:c===";"?s||a():c===`
|
|
3
|
+
`&&a()}return N.trim(l)}var xt=mt,H=E,wt=xt;function Ee(e){return e==null}function yt(e){var t={};for(var r in e)t[r]=e[r];return t}function Be(e){e=yt(e||{}),e.whiteList=e.whiteList||H.whiteList,e.onAttr=e.onAttr||H.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||H.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||H.safeAttrValue,this.options=e}Be.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,s=r.whiteList,i=r.onAttr,n=r.onIgnoreAttr,l=r.safeAttrValue,a=wt(e,function(c,o,p,u,f){var g=s[p],h=!1;if(g===!0?h=g:typeof g=="function"?h=g(u):g instanceof RegExp&&(h=g.test(u)),h!==!0&&(h=!1),u=l(p,u),!!u){var m={position:o,sourcePosition:c,source:f,isWhite:h};if(h){var x=i(p,u,m);return Ee(x)?p+":"+u:x}else{var x=n(p,u,m);if(!Ee(x))return x}}});return a};var vt=Be;(function(e,t){var r=E,s=vt;function i(l,a){var c=new s(a);return c.process(l)}t=e.exports=i,t.FilterCSS=s;for(var n in r)t[n]=r[n]})(ce,ce.exports);var ue=ce.exports,pe={indexOf:function(e,t){var r,s;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,s=e.length;r<s;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var s,i;if(Array.prototype.forEach)return e.forEach(t,r);for(s=0,i=e.length;s<i;s++)t.call(r,e[s],s,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,r=t.exec(e);return r?r.index:-1}},At=ue.FilterCSS,St=ue.getDefaultWhiteList,K=pe;function qe(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var De=new At;function Tt(e,t,r){}function $t(e,t,r){}function Rt(e,t,r){}function Lt(e,t,r){}function Fe(e){return e.replace(zt,"<").replace(Et,">")}function _t(e,t,r,s){if(r=Me(r),t==="href"||t==="src"){if(r=K.trim(r),r==="#")return"#";if(!(r.substr(0,7)==="http://"||r.substr(0,8)==="https://"||r.substr(0,7)==="mailto:"||r.substr(0,4)==="tel:"||r.substr(0,11)==="data:image/"||r.substr(0,6)==="ftp://"||r.substr(0,2)==="./"||r.substr(0,3)==="../"||r[0]==="#"||r[0]==="/"))return""}else if(t==="background"){if(X.lastIndex=0,X.test(r))return""}else if(t==="style"){if(Ie.lastIndex=0,Ie.test(r)||(Ce.lastIndex=0,Ce.test(r)&&(X.lastIndex=0,X.test(r))))return"";s!==!1&&(s=s||De,r=s.process(r))}return r=Ze(r),r}var zt=/</g,Et=/>/g,It=/"/g,Ct=/"/g,Pt=/&#([a-zA-Z0-9]*);?/gim,Ot=/:?/gim,Bt=/&newline;?/gim,X=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Ie=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Ce=/u\s*r\s*l\s*\(.*/gi;function Ve(e){return e.replace(It,""")}function Ne(e){return e.replace(Ct,'"')}function We(e){return e.replace(Pt,function(r,s){return s[0]==="x"||s[0]==="X"?String.fromCharCode(parseInt(s.substr(1),16)):String.fromCharCode(parseInt(s,10))})}function je(e){return e.replace(Ot,":").replace(Bt," ")}function Ge(e){for(var t="",r=0,s=e.length;r<s;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return K.trim(t)}function Me(e){return e=Ne(e),e=We(e),e=je(e),e=Ge(e),e}function Ze(e){return e=Ve(e),e=Fe(e),e}function qt(){return""}function Dt(e,t){typeof t!="function"&&(t=function(){});var r=!Array.isArray(e);function s(l){return r?!0:K.indexOf(e,l)!==-1}var i=[],n=!1;return{onIgnoreTag:function(l,a,c){if(s(l))if(c.isClosing){var o="[/removed]",p=c.position+o.length;return i.push([n!==!1?n:c.position,p]),n=!1,o}else return n||(n=c.position),"[removed]";else return t(l,a,c)},remove:function(l){var a="",c=0;return K.forEach(i,function(o){a+=l.slice(c,o[0]),c=o[1]}),a+=l.slice(c),a}}}function Ft(e){for(var t="",r=0;r<e.length;){var s=e.indexOf("<!--",r);if(s===-1){t+=e.slice(r);break}t+=e.slice(r,s);var i=e.indexOf("-->",s);if(i===-1)break;r=i+3}return t}function Vt(e){var t=e.split("");return t=t.filter(function(r){var s=r.charCodeAt(0);return s===127?!1:s<=31?s===10||s===13:!0}),t.join("")}b.whiteList=qe();b.getDefaultWhiteList=qe;b.onTag=Tt;b.onIgnoreTag=$t;b.onTagAttr=Rt;b.onIgnoreTagAttr=Lt;b.safeAttrValue=_t;b.escapeHtml=Fe;b.escapeQuote=Ve;b.unescapeQuote=Ne;b.escapeHtmlEntities=We;b.escapeDangerHtml5Entities=je;b.clearNonPrintableCharacter=Ge;b.friendlyAttrValue=Me;b.escapeAttrValue=Ze;b.onIgnoreTagStripAll=qt;b.StripTagBody=Dt;b.stripCommentTag=Ft;b.stripBlankChar=Vt;b.cssFilter=De;b.getDefaultCSSWhiteList=St;var Y={},$=pe;function Nt(e){var t=$.spaceIndex(e),r;return t===-1?r=e.slice(1,-1):r=e.slice(1,t+1),r=$.trim(r).toLowerCase(),r.slice(0,1)==="/"&&(r=r.slice(1)),r.slice(-1)==="/"&&(r=r.slice(0,-1)),r}function Wt(e){return e.slice(0,2)==="</"}function jt(e,t,r){var s="",i=0,n=!1,l=!1,a=0,c=e.length,o="",p="";e:for(a=0;a<c;a++){var u=e.charAt(a);if(n===!1){if(u==="<"){n=a;continue}}else if(l===!1){if(u==="<"){s+=r(e.slice(i,a)),n=a,i=a;continue}if(u===">"){s+=r(e.slice(i,n)),p=e.slice(n,a+1),o=Nt(p),s+=t(n,s.length,o,p,Wt(p)),i=a+1,n=!1;continue}if(u==='"'||u==="'")for(var f=1,g=e.charAt(a-f);g.trim()===""||g==="=";){if(g==="="){l=u;continue e}g=e.charAt(a-++f)}}else if(u===l){l=!1;continue}}return i<e.length&&(s+=r(e.substr(i))),s}var Gt=/[^a-zA-Z0-9\\_:.-]/gim;function Mt(e,t){var r=0,s=0,i=[],n=!1,l=e.length;function a(f,g){if(f=$.trim(f),f=f.replace(Gt,"").toLowerCase(),!(f.length<1)){var h=t(f,g||"");h&&i.push(h)}}for(var c=0;c<l;c++){var o=e.charAt(c),p,u;if(n===!1&&o==="="){n=e.slice(r,c),r=c+1,s=e.charAt(r)==='"'||e.charAt(r)==="'"?r:Ht(e,c+1);continue}if(n!==!1&&c===s){if(u=e.indexOf(o,c+1),u===-1)break;p=$.trim(e.slice(s+1,u)),a(n,p),n=!1,c=u,r=c+1;continue}if(/\s|\n|\t/.test(o))if(e=e.replace(/\s|\n|\t/g," "),n===!1)if(u=Zt(e,c),u===-1){p=$.trim(e.slice(r,c)),a(p),n=!1,r=c+1;continue}else{c=u-1;continue}else if(u=Xt(e,c-1),u===-1){p=$.trim(e.slice(r,c)),p=Pe(p),a(n,p),n=!1,r=c+1;continue}else continue}return r<e.length&&(n===!1?a(e.slice(r)):a(n,Pe($.trim(e.slice(r))))),$.trim(i.join(" "))}function Zt(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="="?t:-1}}function Ht(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="'"||r==='"'?t:-1}}function Xt(e,t){for(;t>0;t--){var r=e[t];if(r!==" ")return r==="="?t:-1}}function Qt(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function Pe(e){return Qt(e)?e.substr(1,e.length-2):e}Y.parseTag=jt;Y.parseAttr=Mt;var Ut=ue.FilterCSS,y=b,He=Y,Jt=He.parseTag,Kt=He.parseAttr,U=pe;function Q(e){return e==null}function Yt(e){var t=U.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=U.trim(e.slice(t+1,-1));var r=e[e.length-1]==="/";return r&&(e=U.trim(e.slice(0,-1))),{html:e,closing:r}}function er(e){var t={};for(var r in e)t[r]=e[r];return t}function tr(e){var t={};for(var r in e)Array.isArray(e[r])?t[r.toLowerCase()]=e[r].map(function(s){return s.toLowerCase()}):t[r.toLowerCase()]=e[r];return t}function Xe(e){e=er(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=y.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=tr(e.whiteList||e.allowList):e.whiteList=y.whiteList,e.onTag=e.onTag||y.onTag,e.onTagAttr=e.onTagAttr||y.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||y.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||y.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||y.safeAttrValue,e.escapeHtml=e.escapeHtml||y.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Ut(e.css))}Xe.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,s=r.whiteList,i=r.onTag,n=r.onIgnoreTag,l=r.onTagAttr,a=r.onIgnoreTagAttr,c=r.safeAttrValue,o=r.escapeHtml,p=t.cssFilter;r.stripBlankChar&&(e=y.stripBlankChar(e)),r.allowCommentTag||(e=y.stripCommentTag(e));var u=!1;r.stripIgnoreTagBody&&(u=y.StripTagBody(r.stripIgnoreTagBody,n),n=u.onIgnoreTag);var f=Jt(e,function(g,h,m,x,M){var L={sourcePosition:g,position:h,isClosing:M,isWhite:Object.prototype.hasOwnProperty.call(s,m)},_=i(m,x,L);if(!Q(_))return _;if(L.isWhite){if(L.isClosing)return"</"+m+">";var Z=Yt(x),F=s[m],T=Kt(Z.html,function(O,B){var ae=U.indexOf(F,O)!==-1,V=l(m,O,B,ae);return Q(V)?ae?(B=c(m,O,B,p),B?O+'="'+B+'"':O):(V=a(m,O,B,ae),Q(V)?void 0:V):V});return x="<"+m,T&&(x+=" "+T),Z.closing&&(x+=" /"),x+=">",x}else return _=n(m,x,L),Q(_)?o(x):_},o);return u&&(f=u.remove(f)),f};var rr=Xe;(function(e,t){var r=b,s=Y,i=rr;function n(a,c){var o=new i(c);return o.process(a)}t=e.exports=n,t.filterXSS=n,t.FilterXSS=i,(function(){for(var a in r)t[a]=r[a];for(var c in s)t[c]=s[c]})();function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(oe,oe.exports);var q=oe.exports,sr=function(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},Qe=(function(){function e(t,r){var s=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],article:["style"],aside:["style"],audio:["autoplay","controls","loop","muted","preload"],b:[],blockquote:["style"],br:[],code:["style"],dd:["style"],del:["style"],details:["open","style"],div:["align","aria-hidden","aria-label","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],footer:["style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],header:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],main:["style"],mark:["style"],nav:["style"],ol:[],p:["style"],pre:["style"],section:["style"],source:["media","src","type"],span:["aria-hidden","aria-label","style"],strong:[],sub:["style"],summary:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],time:["style"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.arcgisCSSWhiteList=J(J({},q.getDefaultCSSWhiteList()),{"align-items":!0,"align-self":!0,flex:!0,"flex-basis":!0,"flex-direction":!0,"flex-flow":!0,"flex-grow":!0,"flex-shrink":!0,"flex-wrap":!0,float:!0,gap:!0,grid:!0,"grid-area":!0,"grid-auto-columns":!0,"grid-auto-flow":!0,"grid-auto-rows":!0,"grid-column":!0,"grid-column-end":!0,"grid-column-start":!0,"grid-row":!0,"grid-row-end":!0,"grid-row-start":!0,"grid-template":!0,"grid-template-areas":!0,"grid-template-columns":!0,"grid-template-rows":!0,"justify-content":!0,"justify-items":!0,"justify-self":!0,"line-height":!0,overflow:!0}),this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(n,l,a,c){return n==="a"&&l==="href"||(n==="img"||n==="source")&&l==="src"?s.sanitizeUrl(a):q.safeAttrValue(n,l,a,c)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var i;t&&!r?i=t:t&&r?(i=Object.create(this.arcgisFilterOptions),i.css={whiteList:this.arcgisCSSWhiteList},Object.keys(t).forEach(function(n){if(n==="whiteList")i.whiteList=s._extendObjectOfArrays([s.arcgisWhiteList,t.whiteList||{}]);else if(n==="css"){var l=t.css.whiteList;l!=null&&t.css instanceof Object&&Object.keys(l).forEach(function(a){return i.css.whiteList[a]=l[a]})}else i[n]=t[n]})):(i=Object.create(this.arcgisFilterOptions),i.whiteList=this.arcgisWhiteList,i.css={whiteList:this.arcgisCSSWhiteList}),this.xssFilterOptions=i,this._xssFilter=new q.FilterXSS(i)}return e.prototype.sanitize=function(t,r){switch(r===void 0&&(r={}),typeof t){case"number":return isNaN(t)||!isFinite(t)?null:t;case"boolean":return t;case"string":return this._xssFilter.process(t);case"object":return this._iterateOverObject(t,r);default:return r.allowUndefined&&typeof t>"u"?void 0:null}},e.prototype.sanitizeUrl=function(t,r){var s=(r??{}).isProtocolRequired,i=s===void 0?!0:s,n=this._trim(t.substring(0,t.indexOf(":"))),l=t==="/",a=/^#/.test(t),c=n&&this.allowedProtocols.indexOf(n.toLowerCase())>-1;return l||a||c?q.escapeAttrValue(t):!n&&!i?q.escapeAttrValue("https://".concat(t)):""},e.prototype.sanitizeHTMLAttribute=function(t,r,s,i){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(t,r,s,i):q.safeAttrValue(t,r,s,i)},e.prototype.validate=function(t,r){r===void 0&&(r={});var s=this.sanitize(t,r);return{isValid:t===s,sanitized:s}},e.prototype.encodeHTML=function(t){var r=this;return String(t).replace(/[&<>"'\/]/g,function(s){return r._entityMap[s]})},e.prototype.encodeAttrValue=function(t){var r=/^[a-zA-Z0-9]$/;return String(t).replace(/[\x00-\xFF]/g,function(s,i){return r.test(s)?s:"&#x".concat(Number(t.charCodeAt(i)).toString(16),";")})},e.prototype._extendObjectOfArrays=function(t){var r={};return t.forEach(function(s){Object.keys(s).forEach(function(i){Array.isArray(s[i])&&Array.isArray(r[i])?r[i]=r[i].concat(s[i]):r[i]=s[i]})}),r},e.prototype._iterateOverObject=function(t,r){var s=this;r===void 0&&(r={});try{var i=!1,n=void 0;if(Array.isArray(t))n=t.reduce(function(a,c){var o=s.validate(c,r);return o.isValid?a.concat([c]):(i=!0,a.concat([o.sanitized]))},[]);else if(sr(t)){var l=Object.keys(t);n=l.reduce(function(a,c){var o=t[c],p=s.validate(o,r);return p.isValid?a[c]=o:(i=!0,a[c]=p.sanitized),a},{})}else return r.allowUndefined&&typeof t>"u"?void 0:null;return i?n:t}catch{return null}},e.prototype._trim=function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},e})();function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var P=de();function st(e){P=e}var I={exec:()=>null};function d(e,t=""){let r=typeof e=="string"?e:e.source,s={replace:(i,n)=>{let l=typeof n=="string"?n:n.source;return l=l.replace(w.caret,"$1"),r=r.replace(i,l),s},getRegex:()=>new RegExp(r,t)};return s}var ir=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},nr=/^(?:[ \t]*(?:\n|$))+/,ar=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,lr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,G=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,or=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ke=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,it=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nt=d(it).replace(/bull/g,ke).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),cr=d(it).replace(/bull/g,ke).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),be=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ur=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,pr=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fr=d(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ke).getRegex(),ie="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",xe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,hr=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",xe).replace("tag",ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),at=d(be).replace("hr",G).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),gr=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",at).getRegex(),we={blockquote:gr,code:ar,def:pr,fences:lr,heading:or,hr:G,html:hr,lheading:nt,list:fr,newline:nr,paragraph:at,table:I,text:ur},Ue=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",G).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),dr={...we,lheading:cr,table:Ue,paragraph:d(be).replace("hr",G).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ue).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex()},kr={...we,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:I,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(be).replace("hr",G).replace("heading",` *#{1,6} *[^
|
|
4
|
+
]`).replace("lheading",nt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},br=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,mr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lt=/^( {2,}|\\)\n(?!\s*$)/,xr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,D=/[\p{P}\p{S}]/u,ne=/[\s\p{P}\p{S}]/u,ye=/[^\s\p{P}\p{S}]/u,wr=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ne).getRegex(),ot=/(?!~)[\p{P}\p{S}]/u,yr=/(?!~)[\s\p{P}\p{S}]/u,vr=/(?:[^\s\p{P}\p{S}]|~)/u,Ar=d(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ir?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ct=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Sr=d(ct,"u").replace(/punct/g,D).getRegex(),Tr=d(ct,"u").replace(/punct/g,ot).getRegex(),ut="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$r=d(ut,"gu").replace(/notPunctSpace/g,ye).replace(/punctSpace/g,ne).replace(/punct/g,D).getRegex(),Rr=d(ut,"gu").replace(/notPunctSpace/g,vr).replace(/punctSpace/g,yr).replace(/punct/g,ot).getRegex(),Lr=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ye).replace(/punctSpace/g,ne).replace(/punct/g,D).getRegex(),_r=d(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,D).getRegex(),zr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Er=d(zr,"gu").replace(/notPunctSpace/g,ye).replace(/punctSpace/g,ne).replace(/punct/g,D).getRegex(),Ir=d(/\\(punct)/,"gu").replace(/punct/g,D).getRegex(),Cr=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Pr=d(xe).replace("(?:-->|$)","-->").getRegex(),Or=d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Pr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Br=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pt=d(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",me).getRegex(),ft=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),qr=d("reflink|nolink(?!\\()","g").replace("reflink",pt).replace("nolink",ft).getRegex(),Je=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ve={_backpedal:I,anyPunctuation:Ir,autolink:Cr,blockSkip:Ar,br:lt,code:mr,del:I,delLDelim:I,delRDelim:I,emStrongLDelim:Sr,emStrongRDelimAst:$r,emStrongRDelimUnd:Lr,escape:br,link:Br,nolink:ft,punctuation:wr,reflink:pt,reflinkSearch:qr,tag:Or,text:xr,url:I},Dr={...ve,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},fe={...ve,emStrongRDelimAst:Rr,emStrongLDelim:Tr,delLDelim:_r,delRDelim:Er,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Je).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Je).getRegex()},Fr={...fe,br:d(lt).replace("{2,}","*").getRegex(),text:d(fe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ee={normal:we,gfm:dr,pedantic:kr},W={normal:ve,gfm:fe,breaks:Fr,pedantic:Dr},Vr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ke=e=>Vr[e];function S(e,t){if(t){if(w.escapeTest.test(e))return e.replace(w.escapeReplace,Ke)}else if(w.escapeTestNoEncode.test(e))return e.replace(w.escapeReplaceNoEncode,Ke);return e}function Ye(e){try{e=encodeURI(e).replace(w.percentDecode,"%")}catch{return null}return e}function et(e,t){let r=e.replace(w.findPipe,(n,l,a)=>{let c=!1,o=l;for(;--o>=0&&a[o]==="\\";)c=!c;return c?"|":" |"}),s=r.split(w.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(w.slashPipe,"|");return s}function R(e,t,r){let s=e.length;if(s===0)return"";let i=0;for(;i<s;){let n=e.charAt(s-i-1);if(n===t&&!r)i++;else if(n!==t&&r)i++;else break}return e.slice(0,s-i)}function tt(e){let t=e.split(`
|
|
5
|
+
`),r=t.length-1;for(;r>=0&&w.blankLine.test(t[r]);)r--;return t.length-r<=2?e:t.slice(0,r+1).join(`
|
|
6
|
+
`)}function Nr(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])r++;else if(e[s]===t[1]&&(r--,r<0))return s;return r>0?-2:-1}function Wr(e,t=0){let r=t,s="";for(let i of e)if(i===" "){let n=4-r%4;s+=" ".repeat(n),r+=n}else s+=i,r++;return s}function rt(e,t,r,s,i){let n=t.href,l=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");s.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:n,title:l,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,c}function jr(e,t,r){let s=e.match(r.other.indentCodeCompensation);if(s===null)return t;let i=s[1];return t.split(`
|
|
7
|
+
`).map(n=>{let l=n.match(r.other.beginningSpace);if(l===null)return n;let[a]=l;return a.length>=i.length?n.slice(i.length):n}).join(`
|
|
8
|
+
`)}var re=class{options;rules;lexer;constructor(e){this.options=e||P}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=this.options.pedantic?t[0]:tt(t[0]),s=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:s}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],s=jr(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let s=R(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:R(t[0],`
|
|
9
|
+
`),depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:R(t[0],`
|
|
10
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=R(t[0],`
|
|
11
|
+
`).split(`
|
|
12
|
+
`),s="",i="",n=[];for(;r.length>0;){let l=!1,a=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))a.push(r[c]),l=!0;else if(!l)a.push(r[c]);else break;r=r.slice(c);let o=a.join(`
|
|
13
|
+
`),p=o.replace(this.rules.other.blockquoteSetextReplace,`
|
|
14
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
15
|
+
${o}`:o,i=i?`${i}
|
|
16
|
+
${p}`:p;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,n,!0),this.lexer.state.top=u,r.length===0)break;let f=n.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let g=f,h=g.raw+`
|
|
17
|
+
`+r.join(`
|
|
18
|
+
`),m=this.blockquote(h);n[n.length-1]=m,s=s.substring(0,s.length-g.raw.length)+m.raw,i=i.substring(0,i.length-g.text.length)+m.text;break}else if(f?.type==="list"){let g=f,h=g.raw+`
|
|
19
|
+
`+r.join(`
|
|
20
|
+
`),m=this.list(h);n[n.length-1]=m,s=s.substring(0,s.length-f.raw.length)+m.raw,i=i.substring(0,i.length-g.raw.length)+m.raw,r=h.substring(n.at(-1).raw.length).split(`
|
|
21
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:n,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),s=r.length>1,i={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let n=this.rules.other.listItemRegex(r),l=!1;for(;e;){let c=!1,o="",p="";if(!(t=n.exec(e))||this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let u=Wr(t[2].split(`
|
|
22
|
+
`,1)[0],t[1].length),f=e.split(`
|
|
23
|
+
`,1)[0],g=!u.trim(),h=0;if(this.options.pedantic?(h=2,p=u.trimStart()):g?h=t[1].length+1:(h=u.search(this.rules.other.nonSpaceChar),h=h>4?1:h,p=u.slice(h),h+=t[1].length),g&&this.rules.other.blankLine.test(f)&&(o+=f+`
|
|
24
|
+
`,e=e.substring(f.length+1),c=!0),!c){let m=this.rules.other.nextBulletRegex(h),x=this.rules.other.hrRegex(h),M=this.rules.other.fencesBeginRegex(h),L=this.rules.other.headingBeginRegex(h),_=this.rules.other.htmlBeginRegex(h),Z=this.rules.other.blockquoteBeginRegex(h);for(;e;){let F=e.split(`
|
|
25
|
+
`,1)[0],T;if(f=F,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),T=f):T=f.replace(this.rules.other.tabCharGlobal," "),M.test(f)||L.test(f)||_.test(f)||Z.test(f)||m.test(f)||x.test(f))break;if(T.search(this.rules.other.nonSpaceChar)>=h||!f.trim())p+=`
|
|
26
|
+
`+T.slice(h);else{if(g||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(u)||L.test(u)||x.test(u))break;p+=`
|
|
27
|
+
`+f}g=!f.trim(),o+=F+`
|
|
28
|
+
`,e=e.substring(F.length+1),u=T.slice(h)}}i.loose||(l?i.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(l=!0)),i.items.push({type:"list_item",raw:o,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=o}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c of i.items){this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]);let o=c.tokens[0];if(c.task&&(o?.type==="text"||o?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),o.raw=o.raw.replace(this.rules.other.listReplaceTask,""),o.text=o.text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(c.raw);if(p){let u={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};c.checked=u.checked,i.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=u.raw+c.tokens[0].raw,c.tokens[0].text=u.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(u)):c.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):c.tokens.unshift(u)}}else c.task&&(c.task=!1);if(!i.loose){let p=c.tokens.filter(f=>f.type==="space"),u=p.length>0&&p.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=u}}if(i.loose)for(let c of i.items){c.loose=!0;for(let o of c.tokens)o.type==="text"&&(o.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let r=tt(t[0]);return{type:"html",block:!0,raw:r,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:r}}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:R(t[0],`
|
|
29
|
+
`),href:s,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=et(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
30
|
+
`):[],n={type:"table",raw:R(t[0],`
|
|
31
|
+
`),header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?n.align.push("right"):this.rules.other.tableAlignCenter.test(l)?n.align.push("center"):this.rules.other.tableAlignLeft.test(l)?n.align.push("left"):n.align.push(null);for(let l=0;l<r.length;l++)n.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:n.align[l]});for(let l of i)n.rows.push(et(l,n.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:n.align[c]})));return n}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let r=t[1].trim();return{type:"heading",raw:R(t[0],`
|
|
32
|
+
`),depth:t[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
|
|
33
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let n=R(r.slice(0,-1),"\\");if((r.length-n.length)%2===0)return}else{let n=Nr(t[2],"()");if(n===-2)return;if(n>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let s=t[2],i="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(s);n&&(s=n[1],i=n[3])}else i=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),rt(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[s.toLowerCase()];if(!i){let n=r[0].charAt(0);return{type:"text",raw:n,text:n}}return rt(r,i,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!r||this.rules.inline.punctuation.exec(r))){let i=[...s[0]].length-1,n,l,a=i,c=0,o=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+i);(s=o.exec(t))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n)continue;if(l=[...n].length,s[3]||s[4]){a+=l;continue}else if((s[5]||s[6])&&i%3&&!((i+l)%3)){c+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+c);let p=[...s[0]][0].length,u=e.slice(0,i+s.index+p+l);if(Math.min(i,l)%2){let g=u.slice(1,-1);return{type:"em",raw:u,text:g,tokens:this.lexer.inlineTokens(g)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),i=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&i&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let s=this.rules.inline.delLDelim.exec(e);if(s&&(!s[1]||!r||this.rules.inline.punctuation.exec(r))){let i=[...s[0]].length-1,n,l,a=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+i);(s=c.exec(t))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n||(l=[...n].length,l!==i))continue;if(s[3]||s[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let o=[...s[0]][0].length,p=e.slice(0,i+s.index+o+l),u=p.slice(i,-i);return{type:"del",raw:p,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,s;return t[2]==="@"?(r=t[1],s="mailto:"+r):(r=t[1],s=r),{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},v=class he{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||P,this.options.tokenizer=this.options.tokenizer||new re,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:w,block:ee.normal,inline:W.normal};this.options.pedantic?(r.block=ee.pedantic,r.inline=W.pedantic):this.options.gfm&&(r.block=ee.gfm,this.options.breaks?r.inline=W.breaks:r.inline=W.gfm),this.tokenizer.rules=r}static get rules(){return{block:ee,inline:W}}static lex(t,r){return new he(r).lex(t)}static lexInline(t,r){return new he(r).inlineTokens(t)}lex(t){t=t.replace(w.carriageReturn,`
|
|
34
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(w.tabCharGlobal," ").replace(w.spaceLine,""));let i=1/0;for(;t;){if(t.length<i)i=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let n;if(this.options.extensions?.block?.some(a=>(n=a.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))continue;if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);let a=r.at(-1);n.raw.length===1&&a!==void 0?a.raw+=`
|
|
35
|
+
`:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
36
|
+
`)?"":`
|
|
37
|
+
`)+n.raw,a.text+=`
|
|
38
|
+
`+n.text,this.inlineQueue.at(-1).src=a.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
39
|
+
`)?"":`
|
|
40
|
+
`)+n.raw,a.text+=`
|
|
41
|
+
`+n.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},r.push(n));continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}let l=t;if(this.options.extensions?.startBlock){let a=1/0,c=t.slice(1),o;this.options.extensions.startBlock.forEach(p=>{o=p.call({lexer:this},c),typeof o=="number"&&o>=0&&(a=Math.min(a,o))}),a<1/0&&a>=0&&(l=t.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){let a=r.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
42
|
+
`)?"":`
|
|
43
|
+
`)+n.raw,a.text+=`
|
|
44
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(n),s=l.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
45
|
+
`)?"":`
|
|
46
|
+
`)+n.raw,a.text+=`
|
|
47
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(n);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){this.tokenizer.lexer=this;let s=t,i=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,i.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)n=i[2]?i[2].length:0,s=s.slice(0,i.index+n)+"["+"a".repeat(i[0].length-n-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let l=!1,a="",c=1/0;for(;t;){if(t.length<c)c=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}l||(a=""),l=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let u=r.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(t,s,a)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(t,s,a)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),r.push(o);continue}let p=t;if(this.options.extensions?.startInline){let u=1/0,f=t.slice(1),g;this.options.extensions.startInline.forEach(h=>{g=h.call({lexer:this},f),typeof g=="number"&&g>=0&&(u=Math.min(u,g))}),u<1/0&&u>=0&&(p=t.substring(0,u+1))}if(o=this.tokenizer.inlineText(p)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),l=!0;let u=r.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return r}infiniteLoopError(t){let r="Infinite loop on byte: "+t;if(this.options.silent)console.error(r);else throw new Error(r)}},se=class{options;parser;constructor(e){this.options=e||P}space(e){return""}code({text:e,lang:t,escaped:r}){let s=(t||"").match(w.notSpaceStart)?.[0],i=e.replace(w.endingNewline,"")+`
|
|
48
|
+
`;return s?'<pre><code class="language-'+S(s)+'">'+(r?i:S(i,!0))+`</code></pre>
|
|
49
|
+
`:"<pre><code>"+(r?i:S(i,!0))+`</code></pre>
|
|
50
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
51
|
+
${this.parser.parse(e)}</blockquote>
|
|
52
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
53
|
+
`}hr(e){return`<hr>
|
|
54
|
+
`}list(e){let t=e.ordered,r=e.start,s="";for(let l=0;l<e.items.length;l++){let a=e.items[l];s+=this.listitem(a)}let i=t?"ol":"ul",n=t&&r!==1?' start="'+r+'"':"";return"<"+i+n+`>
|
|
55
|
+
`+s+"</"+i+`>
|
|
56
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
57
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
58
|
+
`}table(e){let t="",r="";for(let i=0;i<e.header.length;i++)r+=this.tablecell(e.header[i]);t+=this.tablerow({text:r});let s="";for(let i=0;i<e.rows.length;i++){let n=e.rows[i];r="";for(let l=0;l<n.length;l++)r+=this.tablecell(n[l]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
59
|
+
<thead>
|
|
60
|
+
`+t+`</thead>
|
|
61
|
+
`+s+`</table>
|
|
62
|
+
`}tablerow({text:e}){return`<tr>
|
|
63
|
+
${e}</tr>
|
|
64
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
65
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${S(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let s=this.parser.parseInline(r),i=Ye(e);if(i===null)return s;e=i;let n='<a href="'+e+'"';return t&&(n+=' title="'+S(t)+'"'),n+=">"+s+"</a>",n}image({href:e,title:t,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let i=Ye(e);if(i===null)return S(r);e=i;let n=`<img src="${e}" alt="${S(r)}"`;return t&&(n+=` title="${S(t)}"`),n+=">",n}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:S(e.text)}},Ae=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},A=class ge{options;renderer;textRenderer;constructor(t){this.options=t||P,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ae}static parse(t,r){return new ge(r).parse(t)}static parseInline(t,r){return new ge(r).parseInline(t)}parse(t){this.renderer.parser=this;let r="";for(let s=0;s<t.length;s++){let i=t[s];if(this.options.extensions?.renderers?.[i.type]){let l=i,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=a||"";continue}}let n=i;switch(n.type){case"space":{r+=this.renderer.space(n);break}case"hr":{r+=this.renderer.hr(n);break}case"heading":{r+=this.renderer.heading(n);break}case"code":{r+=this.renderer.code(n);break}case"table":{r+=this.renderer.table(n);break}case"blockquote":{r+=this.renderer.blockquote(n);break}case"list":{r+=this.renderer.list(n);break}case"checkbox":{r+=this.renderer.checkbox(n);break}case"html":{r+=this.renderer.html(n);break}case"def":{r+=this.renderer.def(n);break}case"paragraph":{r+=this.renderer.paragraph(n);break}case"text":{r+=this.renderer.text(n);break}default:{let l='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,r=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<t.length;i++){let n=t[i];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){s+=a||"";continue}}let l=n;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"checkbox":{s+=r.checkbox(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},j=class{options;block;constructor(e){this.options=e||P}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?v.lex:v.lexInline}provideParser(e=this.block){return e?A.parse:A.parseInline}},Gr=class{defaults=de();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=A;Renderer=se;TextRenderer=Ae;Lexer=v;Tokenizer=re;Hooks=j;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":{let i=s;for(let n of i.header)r=r.concat(this.walkTokens(n.tokens,t));for(let n of i.rows)for(let l of n)r=r.concat(this.walkTokens(l.tokens,t));break}case"list":{let i=s;r=r.concat(this.walkTokens(i.items,t));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let l=i[n].flat(1/0);r=r.concat(this.walkTokens(l,t))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let n=t.renderers[i.name];n?t.renderers[i.name]=function(...l){let a=i.renderer.apply(this,l);return a===!1&&(a=n.apply(this,l)),a}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=t[i.level];n?n.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),s.extensions=t),r.renderer){let i=this.defaults.renderer||new se(this.defaults);for(let n in r.renderer){if(!(n in i))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let l=n,a=r.renderer[l],c=i[l];i[l]=(...o)=>{let p=a.apply(i,o);return p===!1&&(p=c.apply(i,o)),p||""}}s.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new re(this.defaults);for(let n in r.tokenizer){if(!(n in i))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let l=n,a=r.tokenizer[l],c=i[l];i[l]=(...o)=>{let p=a.apply(i,o);return p===!1&&(p=c.apply(i,o)),p}}s.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new j;for(let n in r.hooks){if(!(n in i))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let l=n,a=r.hooks[l],c=i[l];j.passThroughHooks.has(n)?i[l]=o=>{if(this.defaults.async&&j.passThroughHooksRespectAsync.has(n))return(async()=>{let u=await a.call(i,o);return c.call(i,u)})();let p=a.call(i,o);return c.call(i,p)}:i[l]=(...o)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(i,o);return u===!1&&(u=await c.apply(i,o)),u})();let p=a.apply(i,o);return p===!1&&(p=c.apply(i,o)),p}}s.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,n=r.walkTokens;s.walkTokens=function(l){let a=[];return a.push(n.call(this,l)),i&&(a=a.concat(i.call(this,l))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return v.lex(e,t??this.defaults)}parser(e,t){return A.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let s={...r},i={...this.defaults,...s},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let l=i.hooks?await i.hooks.preprocess(t):t,a=await(i.hooks?await i.hooks.provideLexer(e):e?v.lex:v.lexInline)(l,i),c=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?A.parse:A.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(n);try{i.hooks&&(t=i.hooks.preprocess(t));let l=(i.hooks?i.hooks.provideLexer(e):e?v.lex:v.lexInline)(t,i);i.hooks&&(l=i.hooks.processAllTokens(l)),i.walkTokens&&this.walkTokens(l,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(e):e?A.parse:A.parseInline)(l,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(l){return n(l)}}}onError(e,t){return r=>{if(r.message+=`
|
|
66
|
+
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+S(r.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}},C=new Gr;function k(e,t){return C.parse(e,t)}k.options=k.setOptions=function(e){return C.setOptions(e),k.defaults=C.defaults,st(k.defaults),k};k.getDefaults=de;k.defaults=P;k.use=function(...e){return C.use(...e),k.defaults=C.defaults,st(k.defaults),k};k.walkTokens=function(e,t){return C.walkTokens(e,t)};k.parseInline=C.parseInline;k.Parser=A;k.parser=A.parse;k.Renderer=se;k.TextRenderer=Ae;k.Lexer=v;k.lexer=v.lex;k.Tokenizer=re;k.Hooks=j;k.parse=k;var Xr=k.options,Qr=k.setOptions,Ur=k.use,Jr=k.walkTokens,Kr=k.parseInline;var Yr=A.parse,es=v.lex;var Mr=Te`.interrupt-container{display:flex;flex-direction:column;gap:.75rem}.interrupt-actions{display:flex;justify-content:flex-end;gap:.5rem}.interrupt-message{white-space:normal}// \`:where()\` to reset styles of common elements in the message content without increasing specificity .interrupt-message :where(p){margin:0}// \`:where()\` to reset styles of list elements and add consistent indentation for nested lists without increasing specificity .interrupt-message :where(ul,ol){margin:0;padding-inline-start:1.25rem}`;k.use({gfm:!0,breaks:!0,async:!1});var Zr=new Qe,Se=class extends $e{constructor(){super(...arguments),this.#e=[],this._messages=Le({blocking:!0}),this.arcgisCancel=le(),this.arcgisSubmit=le()}static{this.properties={type:1,message:1,options:0}}static{this.styles=Mr}#e;_renderMessageContent(){let t=this.message??"",r=k.parse(t,{async:!1});return Zr.sanitize(r)}_renderInterruptInput(){let{_messages:t,type:r,options:s}=this;switch(r){case"single-select":return z`<calcite-list class="interrupt-list" .label=${t.singleSelectLabel} selection-mode=single-persist @calciteListChange=${i=>this.#e=i.target.selectedItems[0]?.value}>${s?.map(i=>z`<calcite-list-item .label=${i} .value=${i}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return z`<calcite-list class="interrupt-list" .label=${t.multiSelectLabel} selection-mode=multiple @calciteListChange=${i=>this.#e=i.target.selectedItems.map(n=>n.value)}>${s?.map(i=>z`<calcite-list-item .label=${i} .value=${i}></calcite-list-item>`)}</calcite-list>`;case"text-input":return z`<calcite-input class="interrupt-input" .label=${t.textInputLabel} @calciteInputInput=${i=>this.#e=i.target.value}></calcite-input>`;case"boolean-choice":return null;default:return _e(r)}}render(){let{_messages:t,type:r}=this,s=r==="boolean-choice";return z`<div class="interrupt-container"><calcite-notice open kind=neutral width=full><div slot=title>${s?t.titleConfirm:t.titleInput}</div><div slot=message class="interrupt-message">${ze(this._renderMessageContent())}</div></calcite-notice>${this._renderInterruptInput()}<div class="interrupt-actions"><calcite-button appearance=outline @click=${()=>this.arcgisCancel.emit()}>${s?t.cancelButton:t.skipButton}</calcite-button><calcite-button appearance=solid @click=${()=>this.arcgisSubmit.emit(r==="boolean-choice"?!0:this.#e)}>${s?t.confirmButton:t.submitButton}</calcite-button></div></div>`}};Re("arcgis-portal-ai-assistant-interrupt",Se);export{Se as ArcgisPortalAiAssistantInterrupt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import a from"./SKW3IFMK.js";import{a as T}from"./S2PHM4WZ.js";import{b as W}from"./4TR5BU4V.js";import{a as q}from"./XMHAVYOA.js";import"./RPYRSBGP.js";import{H as C,I as P,J,N as A,P as B,h as R,j as y,o as N,q as S,r as j,v as E}from"./ADZOZHQC.js";import"./CFDTXKJ6.js";export default $arcgis.t(([le,Ie,ve,Fe,x,de,I,pe,fe,L,Z,$,ee,{g:G,i:z,j:V,k:U,l:_,m:H,n:K,o:Q,p:X,q:Y}])=>{var k=(i=>(i.expression="expression/",i))(k||{});function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(k.expression)){let r=t.get(s);return r?.title?r.title:s}else return ee.supportsFieldConfiguration(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 r=e.get(i);s=r.type?r.type.toLowerCase():""}else if(t.has(i)){let r=t.get(i);s=r.returnType?r.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 re(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,r=s?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=a.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(a=>{t(new Error(a))}):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 ae(i,e,t,s){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=s?.item??e.portalItem,o=e.sourceJSON;if(!r||!a||!a.portal.user||!U(a)||V(a)||_(a)||H(o)||a.portal.isPortal&&z(a)||["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 f=new Set;if(await I.collectFeatureReductionFields(f,e,e.featureReduction),Array.from(f).some(b=>d(b,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(f=>d(f,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let f=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(f&&((await I.getExpressionFields(e,f)).some(b=>d(b,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(f=>d(f,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(f=>f.keyField)?.some(f=>d(f,t.name)))return!1;let u=G(a,a.portal.user),v=s?.userItemInfo?.userGroups??await K(e)??[],g=s?.userItemInfo?.itemGroups??await Q(e)??[],w=Y(v,g);if(!u&&!w)return!1;let m=s?.userItemInfo?.relatedItems??await X(a.id,a.portal,{relationshipType:"Service2Service"});return!(m?.data?.relatedItems&&m.data.relatedItems.some(f=>["WMTS","Map Service","Vector Tile Service"].includes(f.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`;try{let r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await Z(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(o=>d(o,e))):!1}catch{return!1}}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let r=s.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,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 r=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],a=!1;for(let o=0;o<r.length;o++){let c=r[o].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let r=`${T(s.portal)}content/items/${s.id}/data`,a=(t?.userItemInfo?.itemData??await Z(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let o=a.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(u=>d(u,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,r=t?.featureReduction;if(!s&&!r)return!1;if(s){let a=L.fromJSON(s);if((await I.getRendererFields(a,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(r&&await ne(i,e,r))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(r=>r.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(r=>d(r,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"?pe.fromJSON(t):fe.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,i,s),!!Array.from(r).some(a=>d(a,e.name))}var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Ne=({fieldType:i})=>y`<calcite-icon scale=s .icon=${h.get(i)}></calcite-icon>`,Ee=R`.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}`,O=class extends J{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=q({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new W(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(a=>s.includes(a.name));let r=s.some(a=>!e.fields.find(o=>o.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async o=>await ae(t,e,o,this.options)));if(this.fieldsAreDeletable=a.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=re(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 r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?te(t,r,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return de.supportsFieldConfiguration(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`,r={fields:t.map(o=>({name:o}))},a={deleteFromDefinition:JSON.stringify(r)};await x(s,{query:{...a,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(u=>delete u.prototype.attributes[l]):n.types?.forEach(u=>{u.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(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,r=[];return(e??[]).forEach(a=>{let o=new Ie;o.description=a.description??"",o.name=a.name||s.newFeature,o.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let u=0;u<a.prototype.attributes.length;u++)if(a.prototype.attributes[u]===n.name){l=!0,c[n.name]=a.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,r.push(o)}),r}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,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(r)};await x(a,{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,u)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[u].fieldInfos=(t.popupTemplate?.content)[u].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 u=t.isTable,v=u?l.tables:l.layers,g=v?.find(w=>w.id===t.layerId);if(s.forEach(w=>{g?.attributeTableInfo?.attributeTableElements&&(g.attributeTableInfo.attributeTableElements=g.attributeTableInfo.attributeTableElements.map(m=>{if(m.type==="field")return m.fieldName===w?void 0:m;if(m.type==="group"&&Array.isArray(m.attributeTableElements)){let f=m.attributeTableElements.filter(b=>!(b.type==="field"&&b.fieldName===w));return f.length?{...m,attributeTableElements:f}:void 0}return m}).filter(Boolean),g.attributeTableInfo.orderByFields=g.attributeTableInfo.orderByFields.filter(m=>m.field!==w))}),g?.layerDefinition?.fieldConfigurations&&(g.layerDefinition.fieldConfigurations=g.layerDefinition.fieldConfigurations.filter(w=>!s.includes(w.name))),g?.popupInfo){s.forEach(b=>{g.popupInfo.fieldInfos=g.popupInfo.fieldInfos.filter(D=>D.fieldName!==b),g.popupInfo.popupElements?.forEach((D,M)=>{D.type==="fields"&&D.fieldInfos&&(g.popupInfo.popupElements[M].fieldInfos=g.popupInfo.popupElements[M].fieldInfos.filter(ce=>ce.fieldName!==b))})});let w=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,m={};u?(m.tables=v,l.layers&&(m.layers=l.layers)):(m.layers=v,l.tables&&(m.tables=l.tables));let f={f:"json",text:JSON.stringify(m)};await x(w,{query:{...f},method:"post",responseType:"json"}).then(b=>{b.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(y`<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(y`<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(y`<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&&y`<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:r}=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"))),y`<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?y`<div class=${`dialog-content-wrapper ${r?"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 y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return y`<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:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return y`<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,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<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 y`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:r}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.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>`}};B("arcgis-portal-field-delete",O);return O},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","applications/PortalApp/layerUtils","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql","applications/PortalApp/layerUtils",a)
|
|
2
|
+
import{b as W}from"./4TR5BU4V.js";import a from"./SKW3IFMK.js";import{a as T}from"./S2PHM4WZ.js";import{a as q}from"./XMHAVYOA.js";import"./RPYRSBGP.js";import{H as C,I as P,J,N as A,P as B,h as R,j as y,o as N,q as S,r as j,v as E}from"./ADZOZHQC.js";import"./CFDTXKJ6.js";export default $arcgis.t(([le,Ie,ve,Fe,x,de,I,pe,fe,L,Z,$,ee,{g:G,i:z,j:V,k:U,l:_,m:H,n:K,o:Q,p:X,q:Y}])=>{var k=(i=>(i.expression="expression/",i))(k||{});function F(i){return i!=null}function te(i,e,t){let s=e.fieldName;if(s.includes(k.expression)){let r=t.get(s);return r?.title?r.title:s}else return ee.supportsFieldConfiguration(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 r=e.get(i);s=r.type?r.type.toLowerCase():""}else if(t.has(i)){let r=t.get(i);s=r.returnType?r.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 re(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,r=s?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let o=new Map(s.fields.map(n=>[n.name,n])),c=a.thematicGroup.fieldNames,p=[];c.forEach(n=>{o.has(n)&&p.push(o.get(n))}),e(p)}else e(s.fields)}).catch(a=>{t(new Error(a))}):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 ae(i,e,t,s){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=s?.item??e.portalItem,o=e.sourceJSON;if(!r||!a||!a.portal.user||!U(a)||V(a)||_(a)||H(o)||a.portal.isPortal&&z(a)||["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 f=new Set;if(await I.collectFeatureReductionFields(f,e,e.featureReduction),Array.from(f).some(b=>d(b,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(f=>d(f,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let f=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(f&&((await I.getExpressionFields(e,f)).some(b=>d(b,t.name))||await oe(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(f=>d(f,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(f=>f.keyField)?.some(f=>d(f,t.name)))return!1;let u=G(a,a.portal.user),v=s?.userItemInfo?.userGroups??await K(e)??[],g=s?.userItemInfo?.itemGroups??await Q(e)??[],w=Y(v,g);if(!u&&!w)return!1;let m=s?.userItemInfo?.relatedItems??await X(a.id,a.portal,{relationshipType:"Service2Service"});return!(m?.data?.relatedItems&&m.data.relatedItems.some(f=>["WMTS","Map Service","Vector Tile Service"].includes(f.type)))}async function ue(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`;try{let r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await Z(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(o=>d(o,e))):!1}catch{return!1}}function he(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let r=s.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,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 r=[...await Promise.all(s.map(async o=>await $.parseWhereClause(o.where,i.fieldsIndex)))],a=!1;for(let o=0;o<r.length;o++){let c=r[o].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ge(i,e,t){let s=i.portalItem;if(!s)return!1;let r=`${T(s.portal)}content/items/${s.id}/data`,a=(t?.userItemInfo?.itemData??await Z(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let o=a.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(u=>d(u,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,r=t?.featureReduction;if(!s&&!r)return!1;if(s){let a=L.fromJSON(s);if((await I.getRendererFields(a,i.fieldsIndex)).some(o=>d(o,e.name)))return!0}return!!(r&&await ne(i,e,r))}async function be(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(r=>r.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(r=>d(r,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"?pe.fromJSON(t):fe.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,i,s),!!Array.from(r).some(a=>d(a,e.name))}var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Ne=({fieldType:i})=>y`<calcite-icon scale=s .icon=${h.get(i)}></calcite-icon>`,Ee=R`.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}`,O=class extends J{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=q({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new W(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(a=>s.includes(a.name));let r=s.some(a=>!e.fields.find(o=>o.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async o=>await ae(t,e,o,this.options)));if(this.fieldsAreDeletable=a.every(o=>o),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=re(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 r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?te(t,r,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return de.supportsFieldConfiguration(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`,r={fields:t.map(o=>({name:o}))},a={deleteFromDefinition:JSON.stringify(r)};await x(s,{query:{...a,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(u=>delete u.prototype.attributes[l]):n.types?.forEach(u=>{u.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(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,r=[];return(e??[]).forEach(a=>{let o=new Ie;o.description=a.description??"",o.name=a.name||s.newFeature,o.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(n=>{let l=!1;for(let u=0;u<a.prototype.attributes.length;u++)if(a.prototype.attributes[u]===n.name){l=!0,c[n.name]=a.prototype.attributes[n.name];break}!l&&n.editable&&(c[n.name]=n.defaultValue||null)});let p=new ve({attributes:c});o.prototype=p,r.push(o)}),r}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,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,o={f:"json",updateDefinition:JSON.stringify(r)};await x(a,{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,u)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[u].fieldInfos=(t.popupTemplate?.content)[u].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 u=t.isTable,v=u?l.tables:l.layers,g=v?.find(w=>w.id===t.layerId);if(s.forEach(w=>{g?.attributeTableInfo?.attributeTableElements&&(g.attributeTableInfo.attributeTableElements=g.attributeTableInfo.attributeTableElements.map(m=>{if(m.type==="field")return m.fieldName===w?void 0:m;if(m.type==="group"&&Array.isArray(m.attributeTableElements)){let f=m.attributeTableElements.filter(b=>!(b.type==="field"&&b.fieldName===w));return f.length?{...m,attributeTableElements:f}:void 0}return m}).filter(Boolean),g.attributeTableInfo.orderByFields=g.attributeTableInfo.orderByFields.filter(m=>m.field!==w))}),g?.layerDefinition?.fieldConfigurations&&(g.layerDefinition.fieldConfigurations=g.layerDefinition.fieldConfigurations.filter(w=>!s.includes(w.name))),g?.popupInfo){s.forEach(b=>{g.popupInfo.fieldInfos=g.popupInfo.fieldInfos.filter(D=>D.fieldName!==b),g.popupInfo.popupElements?.forEach((D,M)=>{D.type==="fields"&&D.fieldInfos&&(g.popupInfo.popupElements[M].fieldInfos=g.popupInfo.popupElements[M].fieldInfos.filter(ce=>ce.fieldName!==b))})});let w=`${T(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,m={};u?(m.tables=v,l.layers&&(m.layers=l.layers)):(m.layers=v,l.tables&&(m.tables=l.tables));let f={f:"json",text:JSON.stringify(m)};await x(w,{query:{...f},method:"post",responseType:"json"}).then(b=>{b.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(y`<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(y`<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(y`<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&&y`<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:r}=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"))),y`<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?y`<div class=${`dialog-content-wrapper ${r?"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 y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return y`<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:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(o=>{let c=t.find(p=>p.name===o);return y`<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,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<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 y`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:r}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.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>`}};B("arcgis-portal-field-delete",O);return O},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","applications/PortalApp/layerUtils","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql","applications/PortalApp/layerUtils",a)
|