@arcgis/portal-components 5.2.0-next.76 → 5.2.0-next.78

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.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./2WI5FBDF.js";import b from"./D4VYYWA6.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import"./2GBRZSEC.js";import{a as f}from"./W3UBNVKL.js";import"./QZD2UBOW.js";import"./JVGCIDQW.js";import{M as d,N as h,P as p,S as g,T as y,h as m,j as a}from"./6BUBZ7WC.js";import"./UZLQALHY.js";export default $arcgis.t(([,{b:x}])=>{var $=m`:host{display:inline-flex;align-items:center}:host([scale="s"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size--2);--arcgis-portal-item-type-spacing: 1rem}:host([scale="m"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size--1);--arcgis-portal-item-type-spacing: 1rem}:host([scale="l"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size-0);--arcgis-portal-item-type-spacing: 1rem}.icon{display:block;flex-grow:0;flex-shrink:0;width:var(--arcgis-portal-item-type-spacing);height:var(--arcgis-portal-item-type-spacing)}.text{color:var(--calcite-text-color-2);font-size:var(--arcgis-portal-item-type-font-size);line-height:1.25rem}.text--ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.text--spaced{margin-inline-start:calc(var(--arcgis-portal-item-type-spacing) / 2);word-wrap:break-word;word-break:break-word}`,n=class extends d{constructor(){super(...arguments),this.messages=f({blocking:!0}),this.icon=null,this.displayName="",this.displayNameHosted="",this.scale="s"}static{this.properties={icon:16,displayName:16,displayNameHosted:16,item:0,serviceInfo:0,portal:0,user:0,scale:3,hideText:5,hideIcon:5,ellipsis:5,showHosted:5}}static{this.styles=$}async load(){this.item&&await this.getItemDisplayInformation()}async getItemDisplayInformation(){let{messages:o,user:r,serviceInfo:l,portal:e,item:t}=this,{displayName:i,displayNameHosted:c,icon:s}=await x({item:t,messages:o,serviceInfo:l,user:r,portal:e||t.portal});this.displayName=i,this.displayNameHosted=c,this.icon=s}render(){let{showHosted:o,displayNameHosted:r,scale:l,icon:e,hideText:t,hideIcon:i,ellipsis:c}=this;if(!e)return null;let s=o?r:this.displayName,v=s?.includes("(")?"":"&#x202D;",w=y(`./assets/portal-item-type/icons/${e}16.svg`),u=this.hideText?s:void 0;return a`${!i&&a`<span class="icon"><img src=${w??p} alt=${(u||"")??p} class=${`icon icon--${l}`}></span>`||""}${!t&&a`<span class=${h({text:!0,"text--spaced":!i,"text--ellipsis":c})} .innerHTML=${`${v}${s}`}></span>`||""}`}};g("arcgis-portal-item-type",n);return n},b,c)
2
+ import c from"./X7RTUKI5.js";import b from"./D4VYYWA6.js";import"./VMQIDO4Z.js";import"./QS3GXAIH.js";import"./2GBRZSEC.js";import{a as f}from"./W3UBNVKL.js";import"./QZD2UBOW.js";import"./JVGCIDQW.js";import{M as d,N as h,P as p,S as g,T as y,h as m,j as a}from"./6BUBZ7WC.js";import"./UZLQALHY.js";export default $arcgis.t(([,{b:x}])=>{var $=m`:host{display:inline-flex;align-items:center}:host([scale="s"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size--2);--arcgis-portal-item-type-spacing: 1rem}:host([scale="m"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size--1);--arcgis-portal-item-type-spacing: 1rem}:host([scale="l"]){--arcgis-portal-item-type-font-size: var(--calcite-font-size-0);--arcgis-portal-item-type-spacing: 1rem}.icon{display:block;flex-grow:0;flex-shrink:0;width:var(--arcgis-portal-item-type-spacing);height:var(--arcgis-portal-item-type-spacing)}.text{color:var(--calcite-text-color-2);font-size:var(--arcgis-portal-item-type-font-size);line-height:1.25rem}.text--ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.text--spaced{margin-inline-start:calc(var(--arcgis-portal-item-type-spacing) / 2);word-wrap:break-word;word-break:break-word}`,n=class extends d{constructor(){super(...arguments),this.messages=f({blocking:!0}),this.icon=null,this.displayName="",this.displayNameHosted="",this.scale="s"}static{this.properties={icon:16,displayName:16,displayNameHosted:16,item:0,serviceInfo:0,portal:0,user:0,scale:3,hideText:5,hideIcon:5,ellipsis:5,showHosted:5}}static{this.styles=$}async load(){this.item&&await this.getItemDisplayInformation()}async getItemDisplayInformation(){let{messages:o,user:r,serviceInfo:l,portal:e,item:t}=this,{displayName:i,displayNameHosted:c,icon:s}=await x({item:t,messages:o,serviceInfo:l,user:r,portal:e||t.portal});this.displayName=i,this.displayNameHosted=c,this.icon=s}render(){let{showHosted:o,displayNameHosted:r,scale:l,icon:e,hideText:t,hideIcon:i,ellipsis:c}=this;if(!e)return null;let s=o?r:this.displayName,v=s?.includes("(")?"":"&#x202D;",w=y(`./assets/portal-item-type/icons/${e}16.svg`),u=this.hideText?s:void 0;return a`${!i&&a`<span class="icon"><img src=${w??p} alt=${(u||"")??p} class=${`icon icon--${l}`}></span>`||""}${!t&&a`<span class=${h({text:!0,"text--spaced":!i,"text--ellipsis":c})} .innerHTML=${`${v}${s}`}></span>`||""}`}};g("arcgis-portal-item-type",n);return n},b,c)
@@ -167,7 +167,7 @@ Fields: This typically requires zero or one field of type number.`,schema:Ow});f
167
167
  Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
168
168
  Keywords: categorical, category, type, unique, discrete, point of interest, region, group
169
169
  Example: Color each feature based on the region it belongs to
170
- Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,schema:lb}),cb=M.Root({...Ot(),vectorSearchLayerIds:M(),vectorSearchFieldResults:M(),layerFieldInfo:M(),selectedLayerId:M()}),db=M.Root({...Ot(),vectorSearchLayerIds:M(),vectorSearchFieldResults:M(),layerFieldInfo:M(),queryResponse:M(),dataExplorationMessages:M({reducer:on,default:()=>[]})}),wp=[lp,up,cp,dp];var JH=new ot(wp,{handleToolErrors:!1});var pb=M.Root({...Ot(),helpInternalState:M({reducer:$n,default:()=>({toolCallMessage:void 0})})}),mb=M.Root({...Ot(),intent:M({reducer:(t,e)=>e}),arcgisKnowledgeMessages:M({reducer:on,default:()=>[]}),arcgisKnowledgeToolResult:M({reducer:(t,e)=>e,default:()=>null})});function bp(t){let e=t.map?.allLayers.filter(r=>r.type==="knowledge-graph");if(!e||e?.length!==1)throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.")}function Ho(t){return!!t?.map&&!("activeLinkChartLayer"in t.map)}async function na(t){!t||Ho(t)||!t.map?.diagramNodesExtent||await t.goTo(t.map.diagramNodesExtent)}function Ln(t){let e=t?.configurable?.context;if(!e||typeof e!="object")throw new Error("ArcgisKnowledgeAgent context missing");if(!("view"in e))throw new Error("View context missing");let r=e.view;return r.map&&!("activeLinkChartLayer"in r.map)&&bp(r),{view:r}}async function Jo(t){let e=t?.configurable?.context;if(fb(t)==="knowledgeGraph")return e;{let r=e.view.map;if(r&&"activeLinkChartLayer"in r){let o=r.knowledgeGraph?.url;if(!o)throw new Error("Knowledge graph url missing from link chart.");return{knowledgeGraph:await hp(o)}}else{bp(e.view);let o=(e.view.map?.allLayers.find(n=>n.type==="knowledge-graph")).url;if(!o)throw new Error("Knowledge graph url missing from map.");return{knowledgeGraph:await hp(o)}}}}function fb(t){let e=t?.configurable?.context;if(!e||typeof e!="object")throw new Error("ArcgisKnowledgeAgent context missing");if("knowledgeGraph"in e&&"view"in e)throw new Error("Knowledge Graph context should only have a view or knowledgeGraph, but never both.");if("knowledgeGraph"in e)return"knowledgeGraph";if("view"in e)return"view";throw new Error("ArcgisKnowledgeAgent context must have either a view or knowledgeGraph property.")}var Bi=class{constructor(e){this.dataModel=e,this.kind="GraphQueryGenerationRequest",this.explainQuery=!0,this.schemaInformation=oa.fromDataModel(e)}},oa=class t{constructor(){this.schemaType="ArcgisGraphSchema",this.entityTypes=[],this.relationshipTypes=[],this.identifierInfo={mappingInfo:{identifierMapsTo:"UniformPropertyIdentifier",identifierPropertyName:"globalid"}}}static fromDataModel(e){let r=new t;for(let o of e.entityTypes)r.entityTypes.push(zn.fromEntityType(o));for(let o of e.relationshipTypes)r.relationshipTypes.push(Ki.fromRelationshipType(o));return r.identifierInfo={mappingInfo:{identifierMapsTo:hb(e.identifierInfo.identifierMappingInfo.identifierInfoType),identifierPropertyName:e.identifierInfo.identifierMappingInfo.uniformPropertyIdentifier.identifierPropertyName}},r.spatialReference=JSON.parse(JSON.stringify(e.spatialReference)),r}static getDataModelTypesSummary(e){let r=e.entityTypes.map(n=>n.name).join(", "),o=e.relationshipTypes.map(n=>n.name).join(", ");return`Entity Types: ${r}.
170
+ Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,schema:lb}),cb=M.Root({...Ot(),vectorSearchLayerIds:M(),vectorSearchFieldResults:M(),layerFieldInfo:M(),selectedLayerId:M()}),db=M.Root({...Ot(),vectorSearchLayerIds:M(),vectorSearchFieldResults:M(),layerFieldInfo:M(),queryResponse:M(),dataExplorationMessages:M({reducer:on,default:()=>[]})}),wp=[lp,up,cp,dp];var JH=new ot(wp,{handleToolErrors:!1});var pb=M.Root({...Ot(),helpInternalState:M({reducer:$n,default:()=>({toolCallMessage:void 0})})}),mb=M.Root({...Ot(),intent:M({reducer:(t,e)=>e}),arcgisKnowledgeMessages:M({reducer:on,default:()=>[]}),arcgisKnowledgeToolResult:M({reducer:(t,e)=>e,default:()=>null})});function bp(t){let e=t.map?.allLayers.filter(r=>r.type==="knowledge-graph");if(!e||e?.length!==1)throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.")}function Ho(t){return!!t?.map&&"activeLinkChartLayer"in t.map}async function na(t){!Ho(t)||!t.map.diagramNodesExtent||await t.goTo(t.map.diagramNodesExtent)}function Ln(t){let e=t?.configurable?.context;if(!e||typeof e!="object")throw new Error("ArcgisKnowledgeAgent context missing");if(!("view"in e))throw new Error("View context missing");let r=e.view;return r.map&&!("activeLinkChartLayer"in r.map)&&bp(r),{view:r}}async function Jo(t){let e=t?.configurable?.context;if(fb(t)==="knowledgeGraph")return e;{let r=e.view.map;if(r&&"activeLinkChartLayer"in r){let o=r.knowledgeGraph?.url;if(!o)throw new Error("Knowledge graph url missing from link chart.");return{knowledgeGraph:await hp(o)}}else{bp(e.view);let o=(e.view.map?.allLayers.find(n=>n.type==="knowledge-graph")).url;if(!o)throw new Error("Knowledge graph url missing from map.");return{knowledgeGraph:await hp(o)}}}}function fb(t){let e=t?.configurable?.context;if(!e||typeof e!="object")throw new Error("ArcgisKnowledgeAgent context missing");if("knowledgeGraph"in e&&"view"in e)throw new Error("Knowledge Graph context should only have a view or knowledgeGraph, but never both.");if("knowledgeGraph"in e)return"knowledgeGraph";if("view"in e)return"view";throw new Error("ArcgisKnowledgeAgent context must have either a view or knowledgeGraph property.")}var Bi=class{constructor(e){this.dataModel=e,this.kind="GraphQueryGenerationRequest",this.explainQuery=!0,this.schemaInformation=oa.fromDataModel(e)}},oa=class t{constructor(){this.schemaType="ArcgisGraphSchema",this.entityTypes=[],this.relationshipTypes=[],this.identifierInfo={mappingInfo:{identifierMapsTo:"UniformPropertyIdentifier",identifierPropertyName:"globalid"}}}static fromDataModel(e){let r=new t;for(let o of e.entityTypes)r.entityTypes.push(zn.fromEntityType(o));for(let o of e.relationshipTypes)r.relationshipTypes.push(Ki.fromRelationshipType(o));return r.identifierInfo={mappingInfo:{identifierMapsTo:hb(e.identifierInfo.identifierMappingInfo.identifierInfoType),identifierPropertyName:e.identifierInfo.identifierMappingInfo.uniformPropertyIdentifier.identifierPropertyName}},r.spatialReference=JSON.parse(JSON.stringify(e.spatialReference)),r}static getDataModelTypesSummary(e){let r=e.entityTypes.map(n=>n.name).join(", "),o=e.relationshipTypes.map(n=>n.name).join(", ");return`Entity Types: ${r}.
171
171
  Relationship Types: ${o}.`}},zn=class t{constructor(){this.name="",this.properties=[]}static fromEntityType(e){let r=new t;r.name=e.name,r.alias=e.alias?e.alias:void 0,r.role=gb(e.role);for(let o of e.properties){let n={name:o.name,alias:o.alias?o.alias:void 0,fieldType:o.fieldType,role:yb(o.role),geometryDef:o.fieldType==="esriFieldTypeGeometry"?{geometryType:o.geometryType??"esriGeometryAny",hasM:o.hasM?o.hasM:void 0,hasZ:o.hasZ?o.hasZ:void 0}:void 0};r.properties.push(n)}return r}},Ki=class extends zn{constructor(){super(...arguments),this.observedEndPoints=[]}static fromRelationshipType(e){let r=zn.fromEntityType(e);r.observedEndPoints=[];for(let o of e.endPoints)r.observedEndPoints.push({originEntityType:o.originEntityType,destinationEntityType:o.destinationEntityType});return r}},hb=t=>{switch(t){case"esriIdentifierInfoTypeUNSPECIFIED":return"UNSPECIFIED";case"esriIdentifierInfoTypeDatabaseNative":return"DatabaseNative";case"esriIdentifierInfoTypeUniformProperty":return"UniformPropertyIdentifier";default:return t}},gb=t=>{switch(t){case"Regular":return"esriGraphNamedObjectRegular";case"Provenance":return"esriGraphNamedObjectProvenance";case"Document":return"esriGraphNamedObjectDocument";default:return t}};function yb(t){switch(t){case"esriGraphPropertyRegular":return"Regular";case"esriGraphPropertyDocumentName":return"Document_Name";case"esriGraphPropertyDocumentTitle":return"Document_Title";case"esriGraphPropertyDocumentUrl":return"Document_Url";case"esriGraphPropertyDocumentText":return"Document_Text";case"esriGraphPropertyDocumentKeywords":return"Document_Keywords";case"esriGraphPropertyDocumentContentType":return"Document_ContentType";case"esriGraphPropertyDocumentMetadata":return"Document_Metadata";case"esriGraphPropertyDocumentFileExtension":return"Document_FileExtension";case"esriGraphPropertyProvenanceInstanceId":return"Provenance_InstanceId";case"esriGraphPropertyProvenanceSourceType":return"Provenance_SourceType";case"esriGraphPropertyProvenanceSourceName":return"Provenance_SourceName";case"esriGraphPropertyProvenanceSource":return"Provenance_Source";case"esriGraphPropertyProvenanceComment":return"Provenance_Comment";case"esriGraphPropertyProvenanceTypeName":return"Provenance_TypeName";case"esriGraphPropertyProvenancePropertyName":return"Provenance_PropertyName";default:return"Regular"}}function sa(t){return t?.signal}async function _b(t,e){let r=await nt("arcgis_knowledge_cypher_query_prompt");return e?`${t} ${r}
172
172
 
173
173
  Your previous attempt to generate a cypher query failed. See the details below and generate a new cypher query that avoids this error.
@@ -175,13 +175,13 @@ Your previous attempt to generate a cypher query failed. See the details below a
175
175
  Attempt Number: ${e.attemptCount}
176
176
  Execution Error: ${e.executionError}
177
177
  Failed Query:
178
- ${e.failedGraphQuery}`:`${t} ${r}`}async function wb(t,e,r,o){let{graphQuery:n,explanation:s}=await Qi(t,e,r,o);return{graphQuery:n,explanation:s}}async function Qi(t,e,r,o,n){let s={message:await _b(t,n),context:new Bi(e)},a=sa(o);await J({text:"Attempting to generate a cypher query from your prompt..."},o);let i=await mp(`${r}/chat`,{method:"post",body:JSON.stringify(s),headers:{"Content-Type":"application/json",token:pp.findCredential(Wo.getDefault().url)?.token??""},signal:a});if(i.httpStatus!==200)throw new Error(`Graph query service returned an error: ${i.httpStatus}`,{cause:i.data});let u=!1,l=Date.now(),d=i.data.sequenceNumber,p="",f="",x=1;for(;!u;){await new Promise(b=>setTimeout(b,1e3)),await J({text:`Periodically requesting status of job from ArcGIS AI Services${"...".substring(0,x)}`},o),x=x%3+1;let w=await mp(`${r}/chat`,{method:"post",body:JSON.stringify({conversationId:i.data.conversationId,inquiryId:i.data.inquiryId,ackSequenceNumber:d}),headers:{"Content-Type":"application/json",token:pp.findCredential(Wo.getDefault().url)?.token??""},signal:a});if(w.httpStatus!==200)throw new Error(`Graph query service polling returned an error: ${w.httpStatus}`,{cause:w.data});if(w.data.context?.kind){if(w.data.context.kind!=="GraphQueryGenerationResponse")throw new Error(`Unexpected response from graph query service polling. Message: ${w.data.message}`,{cause:w.data});p=w.data.context.graphQuery,f=w.data.message||"",u=!0}else if(!w.data.hasMore)u=!0;else if(Date.now()-l>6e4)throw new Error("Graph query service polling timed out after 1 minute.");d=w.data.sequenceNumber}return{graphQuery:p,explanation:f}}function bb(t,e){Go(t,r=>{e.set(`${r.typeName}__${r.id}`,{id:r.id,typeName:r.typeName})})}function Go(t,e){if(!(!t||typeof t!="object")){if(xb(t))for(let r of t.path)Go(r,e);else if(Ab(t))e(t);else if(Array.isArray(t))for(let r of t)Go(r,e);else if(Ib(t))for(let r of Object.values(t.properties??{}))Go(r,e)}}function Ab(t){return!t||typeof t!="object"||Array.isArray(t)?!1:"id"in t&&"typeName"in t}function xb(t){return!t||typeof t!="object"||Array.isArray(t)?!1:t&&"path"in t&&Array.isArray(t.path)}function Ib(t){return!t||typeof t!="object"||Array.isArray(t)||"id"in t?!1:"properties"in t&&typeof t.properties=="object"}function vb(t,e){let r=[],o=[],n=[[e.dataModel.entityTypes,r],[e.dataModel.relationshipTypes,o]];for(let[s,a]of n)for(let i of s){let u=t.getMemberIdsByType(i.name);a.push(...u)}return{entityIds:r,relationshipIds:o}}function Tb(t,e){let r={entityIds:new Array,relationshipIds:new Array},o=[],n=t?.allLayers.find(i=>i.type==="knowledge-graph")?.inclusionModeDefinition;if(!n)return{allNamedTypesFullyDynamic:!0,bindParameters:r,nonDynamicTypes:o};let s=[[e.dataModel.entityTypes,r.entityIds],[e.dataModel.relationshipTypes,r.relationshipIds]],a=!0;for(let[i,u]of s)for(let l of i){let d=n.namedTypeDefinitions.get(l.name);if(!d){a=!1,o.push(l.name);continue}if(!d.useAllData){a=!1,o.push(l.name);for(let[p]of d.members||[])u.push(p)}}return{allNamedTypesFullyDynamic:a,bindParameters:r,nonDynamicTypes:o}}var Vo=3;function Ap(t,e=100){let r={};for(let o of Object.entries(t.properties??{})){let[n,s]=o;typeof s=="string"&&s.length>e?r[n]=`${s.slice(0,e)}... (truncated, original length: ${s.length})`:r[n]=s}return t.properties=r,t}function Zo(t){return typeof t!="object"||t===null?String(t):"details"in t&&typeof t.details=="object"&&t.details!==null&&"errorMessage"in t.details&&typeof t.details.errorMessage=="string"?t.details.errorMessage:"message"in t&&typeof t.message=="string"?t.message:String(t)}var Sb=async({kg:t,queryParams:e,targetStructure:r,targetStructureReducer:o,requestOptions:n,queryRowLimit:s,queryTimeoutMs:a})=>{let i=null,u=r,l=new AbortController,d=n?.signal,p=()=>{l.abort(d?.reason)};d&&(d.aborted?l.abort(d.reason):d.addEventListener("abort",p,{once:!0}));try{let f=await V_(t,e,n);i=f.resultHeader;let x=f.resultRowsStream.getReader(),w=0,b=Date.now(),y=!1;for(;;){let{done:S,value:h}=await x.read();if(S)break;if(!y&&a&&Date.now()-b>a)return l.abort(),{type:"timeout"};for(let I of h){if(w++,s&&w>s)return l.abort(),{type:"success",rowLimitReached:!0,resultHeader:i,processedResult:u};u=o(u,I)}}}catch(f){return l.signal.aborted?{type:"aborted"}:{type:"error",errorMessage:Zo(f),error:f}}finally{d?.removeEventListener("abort",p)}return{type:"success",rowLimitReached:!1,resultHeader:i,processedResult:u}};async function xp({prompt:t,bindParameters:e,kg:r,graphQueryServiceUrl:o,targetStructure:n,targetStructureReducer:s,requestOptions:a,queryRowLimit:i,queryTimeoutMs:u,config:l}){let d;for(let p=1;p<=Vo;p++){let f;try{f=await Qi(t,r.dataModel,o,l,d)}catch(y){return{type:"generation-error",errorMessage:Zo(y),error:y}}await J({text:`Attempting to execute query: ${f.graphQuery.substring(0,500)}${f.graphQuery.length>500?"...":""}`},l);let x=await Cb(f.graphQuery,e),w=await Sb({kg:r,queryParams:new _p({openCypherQuery:f.graphQuery,bindParameters:x}),targetStructure:n,targetStructureReducer:s,requestOptions:a,queryRowLimit:i,queryTimeoutMs:u}),b=w.type==="aborted"?"Query execution was aborted.":w.type==="timeout"?"Query execution timed out.":w.type==="error"?`Query failed with error: ${w.errorMessage}`:"";if(w.type==="success")return{type:"success",graphQuery:f.graphQuery,explanation:f.explanation,rowLimitReached:w.rowLimitReached,resultHeader:w.resultHeader,processedResult:w.processedResult};if(w.type==="aborted")return{type:"aborted",errorMessage:b,graphQuery:f.graphQuery,explanation:f.explanation};if(p>=Vo)return w.type==="timeout"?{type:"timeout",errorMessage:b,graphQuery:f.graphQuery,explanation:f.explanation}:{type:"execution-error",errorMessage:b,error:w.error,graphQuery:f.graphQuery,explanation:f.explanation};d={failedGraphQuery:f.graphQuery,executionError:b,attemptCount:p},await J({text:`Attempt ${p} failed with error: ${b}. Retrying...`},l)}throw new Error(`Failed to execute generated cypher due to an unexpected error after ${Vo} attempts.`)}var Cb=async(t,e)=>{if(!e)return{};let{bindParameters:r,parseErrors:o}=await J_(t);if(o)return e;let n={};for(let s of r)s in e&&(n[s]=e[s]);return n},kb=async({kg:t,searchQuery:e,typeCategoryFilter:r,namedTypesFilter:o,searchResultLimit:n,requestOptions:s})=>{let a=[],i=[r];r==="both"&&!t.serviceDefinition.serviceCapabilities.searchCapabilities.searchTypeFilterCapabilities.includes("esriTypeBoth")&&(i=["entity","relationship"]);let u=n??1/0;try{for(let l of i){let d=u-a.length;if(d<=0)break;let p=(await W_(t,new H_({searchQuery:e,typeCategoryFilter:l,namedTypesFilter:o??void 0,num:d}),s)).resultRowsStream.getReader(),f=!1;for(;!f;){let{done:x,value:w}=await p.read();if(x){f=!0;break}for(let b of w)for(let y of b)a.push(y)}}}catch(l){let d=Zo(l);return s?.signal?.aborted?{type:"aborted",errorMessage:d,error:l}:{type:"error",errorMessage:d,error:l}}return{type:"success",results:a}},Ip="IMPORTANT: The generated cypher query must return entire entities and relationships ONLY.";async function vp({prompt:t,view:e,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:o=!1}){let n=[t];if(o&&n.push(Ip),!Ho(e)&&e.map){let d=await nt("arcgis_knowledge_current_lc_context"),p=vb(e.map,r);return n.push(d),{enhancedPrompt:n.join(`
178
+ ${e.failedGraphQuery}`:`${t} ${r}`}async function wb(t,e,r,o){let{graphQuery:n,explanation:s}=await Qi(t,e,r,o);return{graphQuery:n,explanation:s}}async function Qi(t,e,r,o,n){let s={message:await _b(t,n),context:new Bi(e)},a=sa(o);await J({text:"Attempting to generate a cypher query from your prompt..."},o);let i=await mp(`${r}/chat`,{method:"post",body:JSON.stringify(s),headers:{"Content-Type":"application/json",token:pp.findCredential(Wo.getDefault().url)?.token??""},signal:a});if(i.httpStatus!==200)throw new Error(`Graph query service returned an error: ${i.httpStatus}`,{cause:i.data});let u=!1,l=Date.now(),d=i.data.sequenceNumber,p="",f="",x=1;for(;!u;){await new Promise(b=>setTimeout(b,1e3)),await J({text:`Periodically requesting status of job from ArcGIS AI Services${"...".substring(0,x)}`},o),x=x%3+1;let w=await mp(`${r}/chat`,{method:"post",body:JSON.stringify({conversationId:i.data.conversationId,inquiryId:i.data.inquiryId,ackSequenceNumber:d}),headers:{"Content-Type":"application/json",token:pp.findCredential(Wo.getDefault().url)?.token??""},signal:a});if(w.httpStatus!==200)throw new Error(`Graph query service polling returned an error: ${w.httpStatus}`,{cause:w.data});if(w.data.context?.kind){if(w.data.context.kind!=="GraphQueryGenerationResponse")throw new Error(`Unexpected response from graph query service polling. Message: ${w.data.message}`,{cause:w.data});p=w.data.context.graphQuery,f=w.data.message||"",u=!0}else if(!w.data.hasMore)u=!0;else if(Date.now()-l>6e4)throw new Error("Graph query service polling timed out after 1 minute.");d=w.data.sequenceNumber}return{graphQuery:p,explanation:f}}function bb(t,e){Go(t,r=>{e.set(`${r.typeName}__${r.id}`,{id:r.id,typeName:r.typeName})})}function Go(t,e){if(!(!t||typeof t!="object")){if(xb(t))for(let r of t.path)Go(r,e);else if(Ab(t))e(t);else if(Array.isArray(t))for(let r of t)Go(r,e);else if(Ib(t))for(let r of Object.values(t.properties??{}))Go(r,e)}}function Ab(t){return!t||typeof t!="object"||Array.isArray(t)?!1:"id"in t&&"typeName"in t}function xb(t){return!t||typeof t!="object"||Array.isArray(t)?!1:t&&"path"in t&&Array.isArray(t.path)}function Ib(t){return!t||typeof t!="object"||Array.isArray(t)||"id"in t?!1:"properties"in t&&typeof t.properties=="object"}function vb(t,e){let r=[],o=[],n=[[e.dataModel.entityTypes,r],[e.dataModel.relationshipTypes,o]];for(let[s,a]of n)for(let i of s){let u=t.getMemberIdsByType(i.name);a.push(...u)}return{entityIds:r,relationshipIds:o}}function Tb(t,e){let r={entityIds:new Array,relationshipIds:new Array},o=[],n=t?.allLayers.find(i=>i.type==="knowledge-graph")?.inclusionModeDefinition;if(!n)return{allNamedTypesFullyDynamic:!0,bindParameters:r,nonDynamicTypes:o};let s=[[e.dataModel.entityTypes,r.entityIds],[e.dataModel.relationshipTypes,r.relationshipIds]],a=!0;for(let[i,u]of s)for(let l of i){let d=n.namedTypeDefinitions.get(l.name);if(!d){a=!1,o.push(l.name);continue}if(!d.useAllData){a=!1,o.push(l.name);for(let[p]of d.members||[])u.push(p)}}return{allNamedTypesFullyDynamic:a,bindParameters:r,nonDynamicTypes:o}}var Vo=3;function Ap(t,e=100){let r={};for(let o of Object.entries(t.properties??{})){let[n,s]=o;typeof s=="string"&&s.length>e?r[n]=`${s.slice(0,e)}... (truncated, original length: ${s.length})`:r[n]=s}return t.properties=r,t}function Zo(t){return typeof t!="object"||t===null?String(t):"details"in t&&typeof t.details=="object"&&t.details!==null&&"errorMessage"in t.details&&typeof t.details.errorMessage=="string"?t.details.errorMessage:"message"in t&&typeof t.message=="string"?t.message:String(t)}var Sb=async({kg:t,queryParams:e,targetStructure:r,targetStructureReducer:o,requestOptions:n,queryRowLimit:s,queryTimeoutMs:a})=>{let i=null,u=r,l=new AbortController,d=n?.signal,p=()=>{l.abort(d?.reason)};d&&(d.aborted?l.abort(d.reason):d.addEventListener("abort",p,{once:!0}));try{let f=await V_(t,e,n);i=f.resultHeader;let x=f.resultRowsStream.getReader(),w=0,b=Date.now(),y=!1;for(;;){let{done:S,value:h}=await x.read();if(S)break;if(!y&&a&&Date.now()-b>a)return l.abort(),{type:"timeout"};for(let I of h){if(w++,s&&w>s)return l.abort(),{type:"success",rowLimitReached:!0,resultHeader:i,processedResult:u};u=o(u,I)}}}catch(f){return l.signal.aborted?{type:"aborted"}:{type:"error",errorMessage:Zo(f),error:f}}finally{d?.removeEventListener("abort",p)}return{type:"success",rowLimitReached:!1,resultHeader:i,processedResult:u}};async function xp({prompt:t,bindParameters:e,kg:r,graphQueryServiceUrl:o,targetStructure:n,targetStructureReducer:s,requestOptions:a,queryRowLimit:i,queryTimeoutMs:u,config:l}){let d;for(let p=1;p<=Vo;p++){let f;try{f=await Qi(t,r.dataModel,o,l,d)}catch(y){return{type:"generation-error",errorMessage:Zo(y),error:y}}await J({text:`Attempting to execute query: ${f.graphQuery.substring(0,500)}${f.graphQuery.length>500?"...":""}`},l);let x=await Cb(f.graphQuery,e),w=await Sb({kg:r,queryParams:new _p({openCypherQuery:f.graphQuery,bindParameters:x}),targetStructure:n,targetStructureReducer:s,requestOptions:a,queryRowLimit:i,queryTimeoutMs:u}),b=w.type==="aborted"?"Query execution was aborted.":w.type==="timeout"?"Query execution timed out.":w.type==="error"?`Query failed with error: ${w.errorMessage}`:"";if(w.type==="success")return{type:"success",graphQuery:f.graphQuery,explanation:f.explanation,rowLimitReached:w.rowLimitReached,resultHeader:w.resultHeader,processedResult:w.processedResult};if(w.type==="aborted")return{type:"aborted",errorMessage:b,graphQuery:f.graphQuery,explanation:f.explanation};if(p>=Vo)return w.type==="timeout"?{type:"timeout",errorMessage:b,graphQuery:f.graphQuery,explanation:f.explanation}:{type:"execution-error",errorMessage:b,error:w.error,graphQuery:f.graphQuery,explanation:f.explanation};d={failedGraphQuery:f.graphQuery,executionError:b,attemptCount:p},await J({text:`Attempt ${p} failed with error: ${b}. Retrying...`},l)}throw new Error(`Failed to execute generated cypher due to an unexpected error after ${Vo} attempts.`)}var Cb=async(t,e)=>{if(!e)return{};let{bindParameters:r,parseErrors:o}=await J_(t);if(o)return e;let n={};for(let s of r)s in e&&(n[s]=e[s]);return n},kb=async({kg:t,searchQuery:e,typeCategoryFilter:r,namedTypesFilter:o,searchResultLimit:n,requestOptions:s})=>{let a=[],i=[r];r==="both"&&!t.serviceDefinition.serviceCapabilities.searchCapabilities.searchTypeFilterCapabilities.includes("esriTypeBoth")&&(i=["entity","relationship"]);let u=n??1/0;try{for(let l of i){let d=u-a.length;if(d<=0)break;let p=(await W_(t,new H_({searchQuery:e,typeCategoryFilter:l,namedTypesFilter:o??void 0,num:d}),s)).resultRowsStream.getReader(),f=!1;for(;!f;){let{done:x,value:w}=await p.read();if(x){f=!0;break}for(let b of w)for(let y of b)a.push(y)}}}catch(l){let d=Zo(l);return s?.signal?.aborted?{type:"aborted",errorMessage:d,error:l}:{type:"error",errorMessage:d,error:l}}return{type:"success",results:a}},Ip="IMPORTANT: The generated cypher query must return entire entities and relationships ONLY.";async function vp({prompt:t,view:e,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:o=!1}){let n=[t];if(o&&n.push(Ip),Ho(e)){let d=await nt("arcgis_knowledge_current_lc_context"),p=vb(e.map,r);return n.push(d),{enhancedPrompt:n.join(`
179
179
 
180
180
  `),bindParameters:p,allNamedTypesFullyDynamic:!1}}let s=e.map,{allNamedTypesFullyDynamic:a,bindParameters:i,nonDynamicTypes:u}=Tb(s,r);if(a)return{enhancedPrompt:n.join(`
181
181
 
182
182
  `),bindParameters:i,allNamedTypesFullyDynamic:!0};let l=(await nt("arcgis_knowledge_current_map_context")).replaceAll("{nonDynamicTypes}",JSON.stringify(u));return n.push(l),{enhancedPrompt:n.join(`
183
183
 
184
- `),bindParameters:i,allNamedTypesFullyDynamic:a}}async function Eb(t,e,r,o,n,s){let{view:a}=n,i=await xp({prompt:t,bindParameters:e,kg:r,graphQueryServiceUrl:o,targetStructure:new Map,targetStructureReducer:(f,x)=>{for(let w of x)bb(w,f);return f},requestOptions:{signal:sa(s),timeout:s?.timeout},config:s});if(i.type!=="success"){let f=i.type==="generation-error"?i.errorMessage:`${i.errorMessage} Cypher query: ${i.graphQuery}`;throw new Error(`Failed to add records to the link chart. ${f}`)}let{graphQuery:u,explanation:l,processedResult:d}=i,p=Array.from(d.values());return await J({text:`Query Results parsed into ${p.length} unique relationships and entities. Atempting to add to link chart...`},s),!Ho(a)&&a?.map?(await a.map.addRecords(p),await na(a),{generatedQuery:u,explanation:l,addedIdTypePairs:p}):(await a?.map?.allLayers.find(f=>f.type==="knowledge-graph")?.addRecords(p),{generatedQuery:u,explanation:l,addedIdTypePairs:p})}var ta="addRecords",Mb=c.object({prompt:c.string().describe("The user's inquiry and context required in order to generate a cypher query that will be used to add records to the link chart.")}),Pb=async({prompt:t},e)=>{let{knowledgeGraph:r}=await Jo(e),o=Ln(e),{view:n}=o,s=Wo.getDefault().helperServices,{enhancedPrompt:a,bindParameters:i,allNamedTypesFullyDynamic:u}=await vp({prompt:t,view:n,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:!0});if(u)return{toolName:ta,status:"success",summary:"No records have been added to the map because all data in the knowledge graph is contained in the map.",details:{generatedQuery:"N/A",explanation:"All named types in the knowledge graph are fully dynamic and therefore all data is already contained in the map. No records have been added.",addedIdTypePairs:[]}};try{let{generatedQuery:l,explanation:d,addedIdTypePairs:p}=await Eb(a,i,r,`${s.aiAssistantServices.url}${s.aiAssistantServices.graphQueryAssistant}`,o,e);return{toolName:ta,status:"success",summary:`Records added successfully. Cypher Query used: ${l}
184
+ `),bindParameters:i,allNamedTypesFullyDynamic:a}}async function Eb(t,e,r,o,n,s){let{view:a}=n,i=await xp({prompt:t,bindParameters:e,kg:r,graphQueryServiceUrl:o,targetStructure:new Map,targetStructureReducer:(f,x)=>{for(let w of x)bb(w,f);return f},requestOptions:{signal:sa(s),timeout:s?.timeout},config:s});if(i.type!=="success"){let f=i.type==="generation-error"?i.errorMessage:`${i.errorMessage} Cypher query: ${i.graphQuery}`;throw new Error(`Failed to add records to the link chart. ${f}`)}let{graphQuery:u,explanation:l,processedResult:d}=i,p=Array.from(d.values());return await J({text:`Query Results parsed into ${p.length} unique relationships and entities. Atempting to add to link chart...`},s),Ho(a)?(await a.map.addRecords(p),await na(a),{generatedQuery:u,explanation:l,addedIdTypePairs:p}):(await a?.map?.allLayers.find(f=>f.type==="knowledge-graph")?.addRecords(p),{generatedQuery:u,explanation:l,addedIdTypePairs:p})}var ta="addRecords",Mb=c.object({prompt:c.string().describe("The user's inquiry and context required in order to generate a cypher query that will be used to add records to the link chart.")}),Pb=async({prompt:t},e)=>{let{knowledgeGraph:r}=await Jo(e),o=Ln(e),{view:n}=o,s=Wo.getDefault().helperServices,{enhancedPrompt:a,bindParameters:i,allNamedTypesFullyDynamic:u}=await vp({prompt:t,view:n,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:!0});if(u)return{toolName:ta,status:"success",summary:"No records have been added to the map because all data in the knowledge graph is contained in the map.",details:{generatedQuery:"N/A",explanation:"All named types in the knowledge graph are fully dynamic and therefore all data is already contained in the map. No records have been added.",addedIdTypePairs:[]}};try{let{generatedQuery:l,explanation:d,addedIdTypePairs:p}=await Eb(a,i,r,`${s.aiAssistantServices.url}${s.aiAssistantServices.graphQueryAssistant}`,o,e);return{toolName:ta,status:"success",summary:`Records added successfully. Cypher Query used: ${l}
185
185
 
186
186
  Number of records added: ${p.length}`,details:{generatedQuery:l,explanation:d,addedIdTypePairs:p}}}catch(l){let d=Zo(l);return{toolName:ta,status:"error",errorMessage:`Failed to add records to the link chart. ${d}`,error:l}}},Ob=E(Pb,{name:ta,description:`Adds records (entities or relationships) to the current link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the records to be added to the link chart. The user should have explicitly requested to add records to the current link chart from their prompt. "add to new link chart" is not a valid prompt for this tool.
187
187
 
@@ -193,15 +193,15 @@ Number of records added: ${p.length}`,details:{generatedQuery:l,explanation:d,ad
193
193
  - "expand company x through all the buildings it owns"
194
194
  - "connect company x and company y"
195
195
  - "connect all buildings on the link chart"
196
- `,schema:Mb});async function Rb(t,e){return await e.map?.applyLayout(t),await na(e),{appliedLayout:t}}var Gi="applyLayout",Nb=c.object({layout:c.enum(["organic-standard","organic-community","basic-grid","hierarchical-bottom-to-top","radial-root-centric","tree-left-to-right","geographic-organic-standard","chronological-mono-timeline","chronological-multi-timeline"]).describe("The layout mode to apply to the link chart. The value must be one of the following: organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline, chronological-multi-timeline")}),$b=async({layout:t},e)=>{let{view:r}=Ln(e);if(Ho(r))return{toolName:Gi,status:"error",errorMessage:"The applyLayout tool can only be used with a LinkChartView.",error:new Error};{let{appliedLayout:o}=await Rb(t,r);return{toolName:Gi,status:"success",summary:`Successfully applied layout: ${o}.`,details:{appliedLayout:o}}}},zb=E($b,{name:Gi,description:"Apply a diagram layout to the link chart",schema:Nb});async function Lb(t,e){return e.map?.changeNonspatialDataDisplay(t),await na(e),{appliedNonspatialDataDisplayMode:t}}var Vi="changeNonspatialVisibility",jb=c.object({setting:c.enum(["hidden","visible"]).describe("The setting of nonspatial visibility")}),Db=async({setting:t},e)=>{let{view:r}=Ln(e);if(Ho(r))return{toolName:Vi,status:"error",errorMessage:"The changeNonspatialVisibility tool can only be used with a LinkChartView.",error:new Error};{let{appliedNonspatialDataDisplayMode:o}=await Lb(t,r);return{toolName:Vi,status:"success",summary:`Successfully applied nonspatial visibility setting: ${o}.`,details:{appliedNonspatialDataDisplayMode:o}}}},Fb=E(Db,{name:Vi,description:"Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",schema:jb});async function Ub(t,e,r,o,n){let s,a="";for(let i=1;i<=Vo;i++){let{graphQuery:u,explanation:l}=await Qi(t,e.dataModel,r,n,s);try{await J({text:`Attempting to create link chart from derived query: ${u}`},n);let d=await G_.fromCypherQuery(e,new _p({openCypherQuery:u}));await J({text:"Link chart created successfully, loading..."},n),await d.load();let p=o.map;return o.map=d,await o.when(),await yp.whenOnce(()=>!o.updating),d.entityCount===0&&d.relationshipCount===0?(o.map===d&&(o.map=p),d.destroy(),{type:"error",errorMessage:`Query returned no results. Cypher Query used to create the link chart:
196
+ `,schema:Mb});async function Rb(t,e){return await e.map?.applyLayout(t),await na(e),{appliedLayout:t}}var Gi="applyLayout",Nb=c.object({layout:c.enum(["organic-standard","organic-community","basic-grid","hierarchical-bottom-to-top","radial-root-centric","tree-left-to-right","geographic-organic-standard","chronological-mono-timeline","chronological-multi-timeline"]).describe("The layout mode to apply to the link chart. The value must be one of the following: organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline, chronological-multi-timeline")}),$b=async({layout:t},e)=>{let{view:r}=Ln(e);if(Ho(r)){let{appliedLayout:o}=await Rb(t,r);return{toolName:Gi,status:"success",summary:`Successfully applied layout: ${o}.`,details:{appliedLayout:o}}}else return{toolName:Gi,status:"error",errorMessage:"The applyLayout tool can only be used with a LinkChartView.",error:new Error}},zb=E($b,{name:Gi,description:"Apply a diagram layout to the link chart",schema:Nb});async function Lb(t,e){return e.map?.changeNonspatialDataDisplay(t),await na(e),{appliedNonspatialDataDisplayMode:t}}var Vi="changeNonspatialVisibility",jb=c.object({setting:c.enum(["hidden","visible"]).describe("The setting of nonspatial visibility")}),Db=async({setting:t},e)=>{let{view:r}=Ln(e);if(Ho(r)){let{appliedNonspatialDataDisplayMode:o}=await Lb(t,r);return{toolName:Vi,status:"success",summary:`Successfully applied nonspatial visibility setting: ${o}.`,details:{appliedNonspatialDataDisplayMode:o}}}else return{toolName:Vi,status:"error",errorMessage:"The changeNonspatialVisibility tool can only be used with a LinkChartView.",error:new Error}},Fb=E(Db,{name:Vi,description:"Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",schema:jb});async function Ub(t,e,r,o,n){let s,a="";for(let i=1;i<=Vo;i++){let{graphQuery:u,explanation:l}=await Qi(t,e.dataModel,r,n,s);try{await J({text:`Attempting to create link chart from derived query: ${u}`},n);let d=await G_.fromCypherQuery(e,new _p({openCypherQuery:u}));await J({text:"Link chart created successfully, loading..."},n),await d.load();let p=o.map;return o.map=d,await o.when(),await yp.whenOnce(()=>!o.updating),d.entityCount===0&&d.relationshipCount===0?(o.map===d&&(o.map=p),d.destroy(),{type:"error",errorMessage:`Query returned no results. Cypher Query used to create the link chart:
197
197
  ${u}
198
198
 
199
- Explanation: ${l}`}):(await na(o),{type:"success",graphQuery:u,explanation:l})}catch(d){let p=Zo(d);if(i>=Vo){a=p;break}s={failedGraphQuery:u,executionError:p,attemptCount:i},await J({text:`Attempt ${i} to create link chart failed with error: ${p}. Retrying ...`},n)}}return{type:"error",errorMessage:`Failed to create link chart after ${Vo} attempts. Last error: ${a}`}}var ra="createLinkChart",qb=c.object({prompt:c.string().describe("The user's inquiry and context required in order to generate a cypher query that will be used to create a link chart visualization. Only include information relevant to generating a cypher query. Do not suggest entity types, relationship types or properties. Do not include limits or formatting instructions for the query results unless specifically requested by the user. The prompt should be focused on the data the user wants to see in the link chart, not how to generate it.")}),Bb=async({prompt:t},e)=>{let{knowledgeGraph:r}=await Jo(e),{view:o}=Ln(e);if(Ho(o))return{toolName:ra,status:"error",errorMessage:"The createLinkChart tool can only be used with a LinkChartView.",error:new Error};{let n=Wo.getDefault().helperServices,s=await Ub(`${t}
199
+ Explanation: ${l}`}):(await na(o),{type:"success",graphQuery:u,explanation:l})}catch(d){let p=Zo(d);if(i>=Vo){a=p;break}s={failedGraphQuery:u,executionError:p,attemptCount:i},await J({text:`Attempt ${i} to create link chart failed with error: ${p}. Retrying ...`},n)}}return{type:"error",errorMessage:`Failed to create link chart after ${Vo} attempts. Last error: ${a}`}}var ra="createLinkChart",qb=c.object({prompt:c.string().describe("The user's inquiry and context required in order to generate a cypher query that will be used to create a link chart visualization. Only include information relevant to generating a cypher query. Do not suggest entity types, relationship types or properties. Do not include limits or formatting instructions for the query results unless specifically requested by the user. The prompt should be focused on the data the user wants to see in the link chart, not how to generate it.")}),Bb=async({prompt:t},e)=>{let{knowledgeGraph:r}=await Jo(e),{view:o}=Ln(e);if(Ho(o)){let n=Wo.getDefault().helperServices,s=await Ub(`${t}
200
200
 
201
201
  ${Ip}`,r,`${n.aiAssistantServices.url}${n.aiAssistantServices.graphQueryAssistant}`,o,e);if(s.type==="error")return{toolName:ra,status:"error",errorMessage:s.errorMessage,error:new Error};let{graphQuery:a,explanation:i}=s;return{toolName:ra,status:"success",summary:`Link chart created successfully. Cypher Query used to create the link chart:
202
202
  ${a}
203
203
 
204
- Explanation: ${i}`,details:{generatedQuery:a,explanation:i}}}},Kb=E(Bb,{name:ra,description:"Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt using language like 'create new link chart' or 'add to new link chart'.",schema:qb}),Wi="queryGraphData",Gb=c.object({prompt:c.string().describe("The user's inquiry into the knowledge graph, from which a cypher query will be generated and executed to answer the inquiry. Only include entity types, relationship types or properties if they are provided in the user prompt or prior steps. Do not suggest entity types, relationship types or properties. Do not include limits, information on what to return, instructions on how to write the query, or formatting instructions for the query results unless specifically requested by the user.")}),Vb=async({prompt:t},e)=>{let{knowledgeGraph:r}=await Jo(e),o=Wo.getDefault().helperServices,n=t,s=null,a=null;try{({view:a}=Ln(e))}catch{}a&&({enhancedPrompt:n,bindParameters:s}=await vp({prompt:t,view:a,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:!1}));let i=await xp({prompt:n,bindParameters:s,kg:r,graphQueryServiceUrl:`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,targetStructure:new Array,targetStructureReducer:(b,y)=>(b.push(y),b),requestOptions:{signal:sa(e),timeout:e?.timeout},config:e});if(i.type!=="success"){let b=i.type==="generation-error"?i.errorMessage:`${i.errorMessage} Cypher query: ${i.graphQuery}`;return{toolName:Wi,status:"error",errorMessage:`Failed to query the knowledge graph. ${b}`,error:"error"in i?i.error:null}}let{graphQuery:u,explanation:l,processedResult:d,resultHeader:p}=i,f=p.headerKeys;for(let b of d)for(let y of b)Go(y,S=>Ap(S));let x=50,w=d.slice(0,x).map(b=>JSON.stringify(b));return{toolName:Wi,status:"success",summary:`To answer the inquiry, the following cypher query was executed against the knowledge graph:
204
+ Explanation: ${i}`,details:{generatedQuery:a,explanation:i}}}else return{toolName:ra,status:"error",errorMessage:"The createLinkChart tool can only be used with a LinkChartView.",error:new Error}},Kb=E(Bb,{name:ra,description:"Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt using language like 'create new link chart' or 'add to new link chart'.",schema:qb}),Wi="queryGraphData",Gb=c.object({prompt:c.string().describe("The user's inquiry into the knowledge graph, from which a cypher query will be generated and executed to answer the inquiry. Only include entity types, relationship types or properties if they are provided in the user prompt or prior steps. Do not suggest entity types, relationship types or properties. Do not include limits, information on what to return, instructions on how to write the query, or formatting instructions for the query results unless specifically requested by the user.")}),Vb=async({prompt:t},e)=>{let{knowledgeGraph:r}=await Jo(e),o=Wo.getDefault().helperServices,n=t,s=null,a=null;try{({view:a}=Ln(e))}catch{}a&&({enhancedPrompt:n,bindParameters:s}=await vp({prompt:t,view:a,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:!1}));let i=await xp({prompt:n,bindParameters:s,kg:r,graphQueryServiceUrl:`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,targetStructure:new Array,targetStructureReducer:(b,y)=>(b.push(y),b),requestOptions:{signal:sa(e),timeout:e?.timeout},config:e});if(i.type!=="success"){let b=i.type==="generation-error"?i.errorMessage:`${i.errorMessage} Cypher query: ${i.graphQuery}`;return{toolName:Wi,status:"error",errorMessage:`Failed to query the knowledge graph. ${b}`,error:"error"in i?i.error:null}}let{graphQuery:u,explanation:l,processedResult:d,resultHeader:p}=i,f=p.headerKeys;for(let b of d)for(let y of b)Go(y,S=>Ap(S));let x=50,w=d.slice(0,x).map(b=>JSON.stringify(b));return{toolName:Wi,status:"success",summary:`To answer the inquiry, the following cypher query was executed against the knowledge graph:
205
205
 
206
206
  \`\`\`cypher
207
207
  ${u}
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import g from"./X7RTUKI5.js";import{b as De}from"./4QA4AYHJ.js";import f from"./EBYEZR4N.js";import{a as ce}from"./XEK22IDA.js";import{b as j,c as se,d as Oe}from"./CFBSBZSS.js";import e from"./D4VYYWA6.js";import{a as Y}from"./TQLHU3PC.js";import{d as Ee,e as Le}from"./OBBYT2AV.js";import d from"./A4AA5T6M.js";import"./DFTUMKSN.js";import{a as Me}from"./YVKSTDL6.js";import b from"./TGTT2CVD.js";import a from"./F3ODJVJC.js";import{a as Q,b as B,c as X,d as Se,j as Ie}from"./VMQIDO4Z.js";import{b as K,c as re}from"./QS3GXAIH.js";import{b as ke}from"./2GBRZSEC.js";import{a as D}from"./XLLMHJCE.js";import{a as Ne}from"./W3UBNVKL.js";import"./QZD2UBOW.js";import"./JVGCIDQW.js";import{K as G,L as R,M as Ae,N as q,O as ne,S as xe,T as J,h as ye,j as c,k as $e,m as N,w as H}from"./6BUBZ7WC.js";import"./UZLQALHY.js";export default $arcgis.t(([{formatDate:Wt,substitute:ee,getLocale:Ft},,Ht,{e:L},{c:Te,f:Pe,g:je,h:Ce},{c:oe},,{a:ze,b:Ge,c:Re,d:We,e:Fe},{a:le,c:He}])=>{function Be({portal:e,productInfo:t}){let{name:i,glyph:a}=t||{};return c`<img alt class="logo__glyph" src=${a??N}><span class="logo__text"><span class="logo__title">${i}</span>${e?.name&&c`<span class="logo__subtitle">${e.name}</span>`||""}</span>`}function Bt({navigate:e,portal:t,product:i,productInfo:a,productHref:n,messages:r,searchActive:o,showNav:s,projectTitleEditing:l}){let u=o&&i==="Online"&&!s||i!=="Online"&&l&&window.innerWidth<960;return!i||!t||!r||u?null:n?c`<a href=${n??N} @click=${m=>{e({event:m,href:n})}} class="logo fade-in logo--link">${Be({portal:t,productInfo:a})}</a>`:c`<div class="logo fade-in">${Be({portal:t,productInfo:a})}</div>`}var pe={},C={Month:2628e3,Week:604800,Day:86400,Hour:3600,Minute:60,Second:1};function Ye(e){if(!e)return null;let t=Math.floor(e/1e3),i=Math.abs(t),a=C.Day*365;switch(!0){case i<C.Minute:return[Math.floor(t/C.Second),"second"];case i<C.Hour:return[Math.floor(t/C.Minute),"minute"];case i<C.Day:return[Math.floor(t/C.Hour),"hour"];case i<C.Week:return[Math.floor(t/C.Day),"day"];case i<C.Month:return[Math.floor(t/C.Week),"week"];case i<a:return[Math.floor(t/C.Month),"month"];default:return[Math.floor(t/a),"year"]}}function Ze(e){return(typeof e=="number"?e:e.getTime?.())-new Date().getTime()}function et({locale:e,time:t,t9n:i}){if(!e||!t)return"";let a=Ze(t);pe[e]??=new Intl.RelativeTimeFormat(e,{style:"long"});let n=Ye(a);return n?n[1]==="second"?i?.lessThanOneMinute||`< ${pe[e].format(n[0]>0?1:-1,"minutes")}`:pe[e].format(n[0],n[1]):""}var Vt={month:"long",day:"numeric",year:"numeric"},Ut={month:"long",day:"numeric"};function qt({locale:e,time:t},i){if(!e||!t)return"";let a=new Date(t);return Wt(a,i?Vt:Ut)}async function Jt({portal:e}){if(!e?.user)return{result:[]};let t=`${e.restUrl}/community/users/${e.user.id}/notifications`,{result:i,error:a}=await L(t);return a?{error:a}:{result:i?.notifications}}async function Kt(e,t){if(!e?.user)return{success:!0};let i=t.map(a=>({portal:e,id:a})).map(tt);return{success:!((await Promise.allSettled(i))?.filter(a=>a.status==="rejected"||!a.value?.success)).length}}async function tt({portal:e,id:t}){let i=`${e.restUrl}/community/users/${e.user?.id}/notifications/${t}/delete`,{result:a}=await L(i,{method:"post"});return a?.success?{success:!0,id:t}:{success:!1,id:t}}var it="notifications-menu";function Qt(e){try{let t=decodeURIComponent(e);return t!==e?t:e}catch{return e}}function Xt(e){switch(e){case"group_join_admin":return"users";case"group_application_accepted":return"register";case"group_join":return"file-user";case"group_application_declined":return"user-risk";case"user_invitation_declined":return"group-x";case"user_invitation_accepted":return"user-plus";case"user_invite":return"envelope";case"user_added_to_group":return"user-plus";case"collaboration_workspace_added":case"collaboration_deleted":case"collaboration_leaving":case"collaboration_join":case"collaboration_participant_workspace_join":case"collaboration_participant_workspace_unjoin":case"collaboration_participant_removed":case"collaboration_peer_participant_removed":case"collaboration_participant_access_changed":return"collaboration";case"collaboration_participant_join":return"collaboration-user";case"collaboration_content_store_disk_limit_reached":return"gauge";case"user_email_bounced":return"speech-bubble-exclamation";case"feature_layer_copy_over_failed":case"feature_layer_one_way_shared_not_two_way":case"feature_view_copy_over_failed":case"webapp_not_copied":case"webapp_not_copied_portal":case"insights_item_not_copied":return"collaboration";case"scheduled_task_disabled":return"date-time";case"portal_certificate_about_to_expire":case"portal_certificate_expired":return"hourglass-expired";case"notebook_runtime_deprecated":return"notebook-server";case"ingress_certificate_about_to_expire":case"ingress_certificate_expired":return"certificate";default:return"bell"}}function Yt({notification:e,portal:t,locale:i,t9n:a}){if(e?.received&&e.id){let n={date:et({locale:i,time:e.received,t9n:a}),id:e.id,text:"",icon:Xt(e.type)};if(e.type==="webapp_not_copied"&&t.isPortal&&(e.type="webapp_not_copied_portal"),e.data?.taskTitle&&(e.data.taskTitle=Qt(e.data.taskTitle)),e.type==="message_received")n.text=e.data.message||"";else if(a.types[e.type]){let r=K({portal:t,usePortalHostname:!!t.user});e.data.baseUrl=`${r}/home/`,n.text=ee(a.types[e.type],e.data)}if(n.text)return n}return null}async function Ve({portal:e,locale:t,t9n:i}){if(!i)return[];let{result:a,error:n}=await Jt({portal:e});return n&&console.error(n),a?.length?a.map(r=>Yt({notification:r,portal:e,t9n:i,locale:t})).filter(r=>r):[]}function Zt({notifications:e,messages:t,handleToggleNotifications:i,handleToggleSearch:a,notificationsActive:n}){return t?c`<calcite-action class="action" scale=l .text=${t.label} icon=bell .indicator=${!!e?.length} id=${it} @click=${()=>i(!n)} @focusin=${()=>a(!1,!0)}></calcite-action>`:null}function Z({icon:e,title:t,description:i}){return!t&&!i?null:c`<div class="empty">${e&&c`<svg xmlns=http://www.w3.org/2000/svg width=64 height=64 viewBox="0 0 64 64" fill=none>${$e`<path d=${Me[e]??N} fill=var(--calcite-color-border-input) />`}</svg>`||""}${t&&c`<h3 class="notifications__empty__header">${t}</h3>`||""}${i&&c`<p class="notifications__empty__text">${i}</p>`||""}</div>`}function ei({notifications:e,deleteNotifications:t,messages:i,navigate:a,portal:n,notificationsActive:r,handleToggleNotifications:o,notificationDeleteProgress:s}){return i?c`<calcite-popover .referenceElement=${it} @calcitePopoverClose=${()=>o(!1)} .label=${i.label} auto-close .open=${r} pointer-disabled flip-disabled trigger-disabled placement=bottom-end scale=l .heading=${i.label}>${e?.length>0?c`<div class="notifications notifications--full">${typeof s=="number"&&c`<calcite-scrim><calcite-loader type=determinate-value .label=${i.deleting} .value=${s}></calcite-loader></calcite-scrim>`||""}<calcite-list .label=${i.label} interaction-mode=static class="notifications__list" scale=l>${D(e,l=>l.id,l=>c`<calcite-list-item closable @calciteListItemClose=${async()=>await t([l.id])} .messageOverrides=${{close:i.dismissLabel}} .iconStart=${l.icon}><div slot=content class="notification"><div class="notification__message" .innerHTML=${l.text??""} @click=${u=>{let m=u.target,v=m.href;if(m.nodeName==="CALCITE-LINK"&&v){let h=`${K({portal:n,usePortalHostname:!!n.user})}/home/`;a({event:u,href:v,relativePath:v.replace(h,"")})}}}></div><div class="notification__date">${l.date}</div></div></calcite-list-item>`)}</calcite-list></div><calcite-button class="notifications__dismiss" scale=l appearance=transparent @click=${async l=>{let u=l.currentTarget?.parentElement;await t(e?.map(({id:m})=>m)),u.open=!1}}>${i.dismissAllLabel}</calcite-button>`:c`<div class="notifications">${Z({title:i.noNotifications,description:i.noNotificationsDescription,icon:"check"})}</div>`}</calcite-popover>`:null}function ti(e){return e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function ii(e,t,i,a){ci(e,JSON.stringify(t),i)}function ai(e){return oi(e,!0)}function ni(e){try{window.localStorage.removeItem(e)}catch{}}function ri(e){try{window.sessionStorage.removeItem(e)}catch{}}function oi(e,t){let i=si(e);return i&&t?JSON.parse(i):i}function si(e){let t=document.cookie,i=new RegExp(`(?:^|; )${ti(e)}=([^;]*)`,"u"),a=t.match(i);return a?decodeURIComponent(a[1]):""}function ci(e,t,i){i=i||{};let a=i?.expires;if(typeof a=="number"){let r=new Date,o=a*24*60*60*1e3;r.setTime(Date.now()+o),a=r,i.expires=r}typeof a!="string"&&a?.toUTCString&&(i.expires=a.toUTCString());let n=`${e}=${encodeURIComponent(t)}`;for(let r of Object.keys(i)){n+=`; ${r}`;let o=i[r];o!==!0&&(n+=`=${o}`)}document.cookie=n}async function li(e){let t=`owner:"${e.isPortal?"esri":"esri_config"}" AND title:"AppSwitcher Config" AND type:"Application Configuration"`,i=`${e.restUrl}/search`;return await L(i,{query:{num:1,start:0,sortField:"title",sortOrder:"asc",q:t}})}async function pi(e){let t={appSwitcher:{apps:[]}};if(!e?.id||!e.user)return t;let{result:i}=await li(e),a=i?.results?.[0];if(!a)return t;let n=a.id;return(await oe(e,n)).result}async function di(e,t,i){if(!t||!e?.length)return{result:null};let a=`${i.restUrl}/search`;return await L(a,{query:{num:100,q:`id:(${e.map(n=>`"${n.itemId}"`).join(" OR ")})`}})}async function ui(e){let t=`${e.restUrl}/search`,i={num:10,start:0,sortField:"title",sortOrder:"asc",q:'owner:"esri" AND title:"BlockedApps Config" AND type: "Application Configuration"'},{result:a}=await L(t,{query:i}),n=a?.results?.[0]?.id;return n?(await oe(e,n))?.result?.blockedApps||[]:[]}function hi(e,t){let i=e?.toLowerCase()||"",a=`${t.title||""} ${t.label||""}`;return!i||a.toLowerCase().includes(i)}function mi(){if(ai("APSW-query")?.expires>new Date().setHours(new Date().getHours()))return!0;let e={expires:new Date().setHours(new Date().getHours()+5)};return ii("APSW-query",e,{path:"/",domain:window.location.hostname,sameSite:"Strict"}),!1}function gi(e,t){let{landingPage:i}=t||{};return{image:"arcgis-online.png",label:"ArcGIS Online",title:"ArcGIS Online",url:`${re({portal:e})}/${i?.url?i.url:le(e.user)?"organization.html":"index.html"}`}}function Ue(e){let t=["api-for-python","appstudio","arcade","arcgis-earth","arcgis-enterprise","arcgis-experience-builder","arcgis-geoanalytics","arcgis-hub","arcgis-online","arcgis-pro","arcgis-urban","blank","business-analyst","city-engine","collector","community-analyst","configurable-apps","dashboards-beta","dashboards-classic","data-pipelines","deeplearningstudio","demographics","drone2map","esri-events","essential-apps","excalibur","explorer","field-apps","fieldmaps-beta","fieldmaps-ea","fieldmaps","generic-app","geobim","geoplanner","grid-view-9","indoor","indoors","insights","instant-apps","ips","knowledge-studio","living-atlas","location-platform","map-maker","map-viewer-beta","map-viewer-classic","map-viewer","maps-adobe-cloud","maps-for-office","maps-for-power-bi","maps-for-sharepoint","marketplace","mission","monitor","navigator","notebook","office-apps","open-data","operations-dashboard","ortho-maker","pro-extension","quick-capture","redistricting","runtime","scene-viewer","sites","solutions","story-maps","streetmap-premium","survey123","track-viewer","user-type-extension-online","user-type-extension","vector-tile-style-editor","velocity","web-app-builder","web-editor","web-mapping","workflow-manager-beta","workflow-manager","workforce"].find(i=>e?.includes(i)&&V(`${i}.png`)===e);return t?V(`${t}.avif`):e}function fi(e,t){let i=e?.blockedApps||[],a=[];return!i.length&&!e.blockBetaApps||!t?.length?[]:(e.blockBetaApps&&t.forEach(n=>{n.isBeta&&!i.includes(n.clientid)&&i.push(n.clientid)}),i.forEach(n=>{let r=t.find(o=>o.clientid===n);r&&a.push(r)}),a)}function k(e,t){return t&&t[e.toLowerCase()]?.valid||!1}function vi(e,t){return e?.portalProperties&&!e.portalProperties?.openData?.enabled?!1:k("HubforArcGIS",t)}function bi(e,t){if(!e)return!1;let i=["portal:publisher:publishFeeds","portal:publisher:publishRealTimeAnalytics","portal:publisher:publishBigDataAnalytics"],a=(e?.privileges||[]).some(r=>i.includes(r)),n=k("velocity",t);return a&&n}function _i(e){return k("HubforArcGIS",e)}function wi(e,t){return!(e.isPortal&&e.portalProperties?.newMapViewerEnabled===!1)&&k("arcgisWebApps",t)}function yi(e){return!!e.helperServices?.rasterAnalytics&&!!e.helperServices.orthoMapping}function $i(e,t,i){let a=i&&(!e.isPortal||!!e.sourceJSON?.supportsHostedNotebooks),n=!!t?.privileges?.length&&t.privileges.some(r=>r==="premium:publisher:createNotebooks");return a&&n}function Ai(e,t){return!!e.helperServices?.locationTracking&&t}function xi(e,t,i,a){let n=e?.user;return{"Open Data":{hasAccess:()=>vi(e,a)},AppStudio:{hasAccess:()=>k("arcgisWebApps",a)},"ArcGIS Velocity":{hasAccess:()=>e.isPortal||bi(n,a)},"ArcGIS Hub":{hasAccess:()=>k("HubforArcGIS",a)},"ArcGIS Enterprise Sites":{hasAccess:()=>_i(a)},"ArcGIS QuickCapture Web Designer":{hasAccess:()=>k("arcgisWebApps",a)},"ArcGIS Dashboards":{hasAccess:()=>k("dashboards",a)},"Map Viewer":{hasAccess:()=>wi(e,a)},"Map Viewer Classic":{hasAccess:()=>k("arcgisWebApps",a)},"Operations Dashboard for ArcGIS":{hasAccess:()=>k("opsdashboard",a)},"ArcGIS Dashboards Classic":{hasAccess:()=>k("opsdashboard",a)},"Ortho Maker":{hasAccess:()=>yi(e)},Notebook:{hasAccess:()=>$i(e,n,t)},"Scene Viewer":{hasAccess:()=>k("arcgisWebApps",a)},"Story Maps":{hasAccess:()=>k("arcgisWebApps",a)},Survey123:{hasAccess:()=>k("survey123",a)},"Track Viewer":{hasAccess:()=>Ai(e,i)},"Instant Apps":{hasAccess:()=>k("arcgisWebApps",a)},"ArcGIS Maps for Adobe Creative Cloud":{hasAccess:()=>k("arcgisWebApps",a)&&!e.isPortal}}}function ki(e){let t={opsdashboard:1,arcgisWebApps:1,Workforce:1,geoplanner:1,webappbuilder:1,HubforArcGIS:1,appstudio:1,survey123:1,storymaps:1,mapsForOffice:1,mapsForO365:1,mapsForSharePoint:1,mapsForCreativeCloud:1,indoorsweb:1,indoorskiosk:1,indoorsspaceplanner:1,locationplatformWebApps:1,communityanalyst_2:1};return e.isPortal&&(t={...t,arcgisonline:1,arcgisUrban:1,arcgisinstantapps:1}),t}function ue(e){return e.sourceJSON?.subscriptionInfo?.options?.includes("Developer")}function V(e){return J(`assets/portal-navigation/apps/${e||""}`)}function at(e,t,i){return e.icon?`${t.restUrl}/portals/self/resources/${e.icon}?token=${i}`:`${t.restUrl}/content/items/${e.itemId}/resources/${e.image||e.properties?.appSwitcher?.image}?token=${i}`}function W(e,t,i){if(e.image?e.image=V(e.image):e.placeHolderIcon=`${V()}svg-app-icon.svg`,e.url?.startsWith("../")){let a=i.urlKey?`${i.urlKey}.${i.customBaseUrl}`:i.portalHostname;e.url=`${window.location.protocol}//${a}${e.url.substring(2,e.url.length)}`}return delete e.isLicensed,delete e.privileges,e.itemId=t,e}function nt(){return`${V()}svg-app-circle.svg`}function Si(e,t,i){let a=e.properties?.appSwitcher?.image||e.icon;return{abbr:e.properties?.appSwitcher?.abbr||e.abbreviation,itemId:e.itemId,canAccess:!0,webMappingApp:!0,image:a?at(e,t,i):void 0,label:e.title||e.label,url:e.url,placeHolderIcon:e.placeHolderIcon||nt()}}function Ii(e,t,i){return e.appSwitcher?.image||e.icon?e.image=at(e,t,i):e.placeHolderIcon=nt(),e.abbr=e.appSwitcher?.abbr||e.abbreviation,delete e.abbreviation,delete e.appSwitcher,delete e.approvedApp,delete e.webMappingApp,e}function qe(e,t){e.forEach(i=>{i.uid==="Map Viewer Beta"&&(i.uid="Map Viewer"),t.isPortal&&(i.uid==="Operations Dashboard for ArcGIS"?i.uid="ArcGIS Dashboards Classic":i.uid==="Workforce for ArcGIS"&&(i.uid="ArcGIS Workforce"))})}async function Ti({userApps:e,servers:t,portal:i,licenses:a,blockedApps:n,provisionedListings:r,orgCapabilities:o,trackViewerEnabled:s,notebookServerEnabled:l,willQueryForItems:u,approvedApps:m}){let v={},h={},A=xi(i,l,s,a),y=ki(i),w=[],S=e.length;for(let d=0;d<S;d++){let p=e[d],g=p.itemId||p.title,x=!0,T=!p.serverFunction||t?.some(_=>(_.serverFunction?.split(",")||[]).includes(p.serverFunction)),$=n?.some(_=>p.itemId&&p.itemId===_.itemid||p.title&&p.title===_.title);if(v[g]=1,h[g]=p,$||ue(i)&&!p.showInLocationPlatform||i.sourceJSON?.portalDeploymentType==="ArcGISEnterpriseOnKubernetes"&&p.supportsKubernetes===!1)continue;let b=p.title;if(A[b]&&!A[b]?.hasAccess())continue;let f=i.sourceJSON?.subscriptionInfo;if(p.subscriptionType){f?.type===p.subscriptionType&&(h[g].canAccess=!0,w.push(W(p,g,i)));continue}if(p.orgCapabilities){o?.length&&o.some(_=>p.orgCapabilities?.includes(_.id))&&(h[g].canAccess=!0,w.push(W(p,g,i)));continue}if(!p.privileges?.length&&!p.isLicensed&&T&&(p.label!=="ArcGIS Location Platform"||ue(i))){h[g].canAccess=!0,w.push(W(p,g,i));continue}if(i.user?.sourceJSON?.userLicenseTypeId?.toLowerCase()==="storytellerut"&&p.label?.toLowerCase()==="storymaps"){h[g].canAccess=!0,w.push(W(p,g,i));continue}if(p.privileges?.length&&i.user?.privileges){for(let _=0;_<p.privileges.length;_++)if(!i.user.privileges.includes(p.privileges[_])){x=!1;break}if(!p.isLicensed&&x&&T){h[g].canAccess=!0,w.push(W(p,g,i));continue}}if(p.isLicensed&&x&&T){for(let _=0;_<r.length;_++)if(g===r[_].itemId||g===r[_].title){h[g].canAccess=!0,w.push(W(p,g,i));break}}}let I=await Te(i);return r.forEach(d=>{if(d.type==="Web Mapping Application"&&!y[d.clientId]&&!v[d.itemId]&&d.url&&d.title&&!v[d.title]&&!d.typeKeywords.includes("hideFromAppSwitcher")){let p=Si(d,i,I);h[d.itemId]=p,w.push(p)}}),{apps:[...m.map(d=>{let p={...d.appProperties,itemId:d.itemId,webMappingApp:!0,approvedApp:!0,canAccess:!u};return h[d.itemId]=p,Ii(p,i,I)}),...w],appDictionary:h}}function de(e,t){return e.filter(i=>!t?.some(a=>i.itemId&&i.itemId===a.itemid||i.title&&i.title===a.title))}function Je({apps:e,app:t,appDictionary:i,newAppDictionary:a,portal:n}){let r=Object.keys(i).map(o=>i[o]).filter(o=>o.itemId===t.uid||o.title===t.uid).shift();return r&&!i[t.uid]&&(t.uid=r.itemId||r.title||""),r?.hasBeenPopulated||(r?((t.hasChanged||r.hasChanged||!r.canAccess&&!r.ignoreNoAccess)&&le(n.user)&&(i[t.uid].hasChanged=!0,i[t.uid].ignoreNoAccess=t.ignoreNoAccess),t.isNew&&(i[t.uid].isNew=!0),delete a[t.uid]):(r=t,r.canAccess=!1,r.itemId=t.uid,i[t.uid]=r),i[t.uid].hasBeenPopulated=!0,e.push(r)),e}async function Pi({portal:e,trackViewerEnabled:t,notebookServerEnabled:i}){if(!e?.id||!e.user)return{apps:[],hiddenApps:{}};let a=mi(),[n,r,o,s,l,u,m]=await Promise.all([pi(e),Ce(e),Pe(e),ze(e),Ge(e),Fe(e),ui(e)]),v=e.isPortal?await We(e):null,h=o?.result?.properties,A=n?.appSwitcher?.apps||[];e.isPortal||(A=A.filter($=>$.title!=="Map Viewer Classic"||e.sourceJSON.created<new Date("February 26 2025")),A.unshift(gi(e,h)));let y=s?.result?.approvedApps?.filter($=>!$.hideForNonPrivilegedMember)||[],w={};r?.forEach($=>{let b=$.clientId?.toLowerCase();b&&(w[b]={valid:!0,itemId:$.itemId,clientId:$.clientId})}),l?.forEach($=>{let b=$.id?.toLowerCase();b&&(w[b]={valid:!0,clientId:$.id})});let S=fi(u,m),{apps:I,appDictionary:d}=await Ti({userApps:A,servers:v,portal:e,blockedApps:S,provisionedListings:r,orgCapabilities:l,licenses:w,trackViewerEnabled:t,notebookServerEnabled:i,willQueryForItems:a,approvedApps:y});h?.appLauncher&&(h?.appLauncher.primary&&qe(h?.appLauncher.primary,e),h?.appLauncher.secondary&&qe(h?.appLauncher.secondary,e));let p=[],g=[];if(!h?.appLauncher?.primary||!h?.appLauncher.secondary)p=I.slice().sort(($,b)=>($.label||"")<(b.label||"")?-1:1),p=de(p,S),g=[];else{let{result:$}=await di(y,a,e);$?.results?.length&&$.results.forEach(f=>{let _=d[f.id];_.canAccess=!0,_.hasChanged=_.url!==f.url?!!f.url:!1});let b={...d};h?.appLauncher?.primary?.forEach(f=>{f.label==="Map Viewer"&&(f.uid="Map Viewer")}),p=h?.appLauncher.primary.reduce((f,_)=>Je({apps:f,app:_,appDictionary:d,newAppDictionary:b,portal:e}),[])||[],g=h?.appLauncher.secondary.reduce((f,_)=>Je({apps:f,app:_,appDictionary:d,newAppDictionary:b,portal:e}),[])||[],p=de(p,S),g=de(g,S),ue(e)&&(p=p.filter(f=>f.canAccess),g=g.filter(f=>f.canAccess));for(let f of Object.keys(b))b[f].canAccess&&(b[f].isNew=!0,d[f]=b[f],p.push(b[f]))}let x=[...p,...g],T=g.reduce(($,b)=>(b.itemId&&($[b.itemId]=!0),$),{});return{apps:x,hiddenApps:T,signInSettings:u,licenses:w,userProperties:h}}function ji(e,t){return!e?.itemId||!t?!1:t[e.itemId]}async function Ci({apps:e,hiddenApps:t,userProperties:i,portal:a}){let n=e.reduce((o,s)=>{let l=t[s.itemId];return o[l?"secondary":"primary"].push({label:s.label,uid:s.itemId||s.title}),o},{primary:[],secondary:[]}),r={...i||{},appLauncher:n};return await je(r,a)}function rt({app:e}){if(!e)return null;if(!e.canAccess)return c`<span class="list-item__logo list-item__logo-empty"></span>`;let t=!e.image&&e.abbr;return c`${t&&c`<span class="list-item__logo">${e.placeHolderIcon&&c`<img src=${Ue(e.placeHolderIcon)??N} class="list-item__logo-bg" alt>`||""}<span style=${ne({fontSize:e.fontSize||"20px"})} class="list-item__abbr">${e.abbr}</span></span>`||""}${e.image&&c`<img src=${Ue(e.image)??N} class="list-item__logo" alt>`||""}`}function Ni({app:e,hiddenApps:t,messages:i,toggleAppVisibility:a,handleAppDelete:n}){if(!e||!i)return null;let r=ji(e,t),{title:o,itemId:s,label:l}=e;return c`<calcite-list-item .label=${o||l} class=${q(r?"app--hidden":"")}><span slot=content-start>${rt({app:e})}</span>${e.canAccess?c`<calcite-action .text=${r?i.show:i.hide} .icon=${r?"view-hide":"view-visible"} slot=actions-end @click=${()=>s&&a(s,!r)}></calcite-action>`:c`<calcite-action .text=${i.delete} icon=x slot=actions-end @click=${()=>s&&n(s)}></calcite-action>`}</calcite-list-item>`}function Mi({app:e,messages:t}){if(!e||!t)return null;let{title:i,itemId:a,label:n,url:r,isNew:o}=e,s=t?.descriptions?.[i]||t?.descriptions?.[n];return c`<li class="list-item"><a class="list-item__link" href=${r??N} target=_blank id=${a??N} aria-describedby=${`${a}--tooltip`}>${c`<span class="list-item__container">${rt({app:e})}<span class="list-item__title">${i||n}</span>${o&&c`<calcite-chip scale=s class="list-item__chip" .label=${t.new}>${t.new}</calcite-chip>`||""}</span>`}</a>${s&&c`<calcite-tooltip .referenceElement=${a} placement=trailing .id=${`${a}--tooltip`} role=tooltip>${s}</calcite-tooltip>`||""}</li>`}function Ei({apps:e,appsLoading:t,appsSearchTerm:i,hiddenApps:a,messages:n,handleAppsSearch:r,handleAppReorder:o,handleAppSave:s,handleAppHide:l,handleAppDelete:u,handleAppCancel:m,handleAppEdit:v,editingApplications:h,portal:A}){if(!e||!n)return null;let y=i?.length>0,w=(e||[]).filter(d=>d.itemId&&(!a?.[d.itemId]||y)&&hi(i,d)),S=y?n.noAppResults.replace("{term}",i):n.noAppsAvailable,I=y?j(A)?n.noAppsDescriptionPublic:n.noAppResultsDescriptionOrg:n.noAppsAvailable;return h?c`<div class="list__header"><calcite-button appearance=outline width=half @click=${()=>{m()}}>${n.cancel}</calcite-button><calcite-button width=half @click=${()=>{s()}}>${n.applyChanges}</calcite-button></div><calcite-list .label=${n.allMyApplications} drag-enabled @calciteListDragEnd=${d=>{let{newIndex:p,oldIndex:g}=d.detail;o({newIndex:p,oldIndex:g})}} .loading=${t}>${D(e,d=>d.itemId,d=>Ni({app:d,hiddenApps:a,messages:n,toggleAppVisibility:(p,g)=>{l({app:p,hidden:g})},handleAppDelete:u}))}</calcite-list>`:c`<div class="list__header"><calcite-input type=search icon .placeholder=${n.searchMyApps} .value=${i} scale=m class="list__search" @calciteInputInput=${d=>{r(d.currentTarget.value)}}></calcite-input><calcite-button appearance=transparent kind=neutral icon-start=reorder-cards .label=${n.reorder} @click=${()=>v()} id=customize-apps></calcite-button><calcite-tooltip reference-element=customize-apps><span>${n.customizeApps}</span></calcite-tooltip></div>${w?.length>0?c`<ul class="list">${D(w,d=>d.itemId,d=>Mi({app:d,messages:n}))}</ul>`:Z({title:S,description:I,icon:i?"search":"apps"})}`}var Ke="portalAppClientId",fe={GeoanalyticsEngine:"geoanalyticsengine",GeoanalyticsFabric:"geoanalyticsfabric",IndoorsOnline:"indoorsonline"};function ve(e){return fe.GeoanalyticsEngine===e}function be(e){return fe.GeoanalyticsFabric===e}function ot(e){return fe.IndoorsOnline===e}function _e(e){return["Location Platform","GeoAnalytics Fabric","GeoAnalytics Engine","Online","Enterprise"].includes(e)}function Li({portal:e,messages:t,licenses:i,clientId:a,signInSettings:n}){if(!t||!e)return[];let r=e.sourceJSON?.subscriptionInfo,o=Gi({messages:t,portal:e});if(!e.user)return o;if(!e||!o||e?.user&&!i&&!j(e))return[];let s=Wi({portal:e,licenses:i,subscriptionInfo:r});return Ri({messages:t,portal:e,clientId:a,signInSettings:n,navLinkDictionary:s})}function Di(e){let{id:t,access:i,isPortal:a}=e;return!t&&!i&&!a}function Oi(e,t){let i=new URL(e),a=t||window.location.pathname;return i.pathname===a}function st({portal:e,clientId:t,signInSettings:i}){let a=e.user,n=ot(t),r=!!i?.blockedApps?.includes("arcgisnotebooks"),{gallery:o="all",groups:s="all",map:l="all",notebook:u="notebookCreators",scene:m="all"}=e.portalProperties?.topNav||{},v=["home"];if(!a){if(!e.portalProperties?.topNav){let A=["gallery","map","scene","groups"],y=e.isPortal?["help"]:[];return[...v,...A,...y]}return[...v,...o==="all"?["gallery"]:[],...l==="all"?["map"]:[],...m==="all"?["scene"]:[],...s==="all"?["groups"]:[],...e.isPortal?["help"]:[]]}let h=a.orgId===e.id;return!e.portalProperties?.topNav&&j(e)?v=["ArcGIS","overview","pricing","map","scene","groups","myContent"]:v=[...v,...(o==="all"||o==="members"&&h)&&!n?["gallery"]:[],...(l==="all"||l==="members"&&h||l==="mapCreators"&&se(a))&&!n?["map"]:[],...(m==="all"||m==="members"&&h||m==="sceneCreators"&&se(a))&&!n?["scene"]:[],...!r&&(!e.isPortal||e.sourceJSON.supportsHostedNotebooks)&&(u==="members"&&h||u==="notebookCreators"&&Oe(a))&&!n?["notebook"]:[],...(s==="all"||s==="members"&&h)&&!n?["groups"]:[],...h&&!n?["myContent","organization"]:[]],v}function M(e){return`${re({portal:e})}/`}function zi({keys:e,navLinkDictionary:t,messages:i}){let a=[];return e.forEach(n=>{let r=t[n];if(r&&(!("show"in r)||r.show)){let{href:o,newTab:s,icon:l,relativePath:u}=r;a.push({label:i[n],href:o,newTab:s,relativePath:u,icon:l})}}),a}function Gi({messages:e,portal:t}){if(!e||!t)return[];let i=M(t),a={overview:{label:e.overview,href:`${i}../features/features.html`,icon:"information"},pricing:{label:e.pricing,href:`${i}../features/plans/pricing.html`,icon:"credit-card"},map:{label:e.map,href:`${i}apps/mapviewer/index.html`,icon:"map"},scene:{label:e.scene,href:`${i}webscene/viewer.html`,icon:"globe"},help:{label:e.help,href:X(t),newTab:!0,icon:"headset"},home:{label:e.home,href:`${i}index.html`,relativePath:"index.html",icon:"home"},gallery:{label:e.gallery,href:`${i}gallery.html`,relativePath:"gallery.html",icon:"gallery"},groups:{label:e.groups,href:`${i}groups.html`,relativePath:"groups.html",icon:"group"}};return(Di(t)?["overview","pricing","map","scene","help"]:st({portal:t})).map(n=>a[n])}function Ri({messages:e,portal:t,clientId:i,signInSettings:a,navLinkDictionary:n}){let r=ve(i),o=st({portal:t,clientId:i,signInSettings:a}),s=`${M(t)}geoanalytics${r?"engine":"fabric"}.html`;return r||be(i)?[{href:`${s}#subscription`,label:e.subscription},...r?[{href:`${s}#downloads`,label:e.downloads}]:[],{href:`${s}#credentials`,label:e.developerCredentials},{href:`${s}#account`,label:e.account}]:zi({keys:o,messages:e,navLinkDictionary:n})}function Wi({portal:e,licenses:t,subscriptionInfo:i}){let a=e.user,n=M(e),r=i?.options?.includes("Developer"),o=k("arcgiswebapps",t)||r&&k("locationplatformwebapps",t)||j(e);return{pricing:{href:`${n}../features/plans/pricing.html`},overview:{href:`${n}../features/features.html`},ArcGIS:{href:`${n}${j(e)?"index.html":"../features/features.html"}`,show:j(e)||!a},groups:{href:`${n}groups.html`,relativePath:"groups.html",icon:"group"},myContent:{href:`${n}content.html`,relativePath:"content.html",icon:"files"},map:{show:o,href:`${n}apps/mapviewer/index.html`,icon:"map"},help:{href:X(e),newTab:!0},gallery:{show:!!e.id&&!r,href:`${n}gallery.html`,relativePath:"gallery.html",icon:"gallery"},home:{show:!j(e)&&!r,href:`${n}index.html`,relativePath:"index.html",icon:"home"},scene:{show:o,href:`${n}webscene/viewer.html`,icon:"globe"},notebook:{show:Ie(e),href:`${n}notebook/notebookhome.html`,relativePath:"notebook/notebookhome.html",icon:"notebook"},organization:{show:!j(e),href:`${n}organization.html`,relativePath:"organization.html",icon:"organization"},features:{show:j(e)&&!e.isPortal,href:`${n}../features/features.html`,icon:"information"}}}function Fi({portal:e,item:t,messages:i,navigate:a,locale:n}){if(!t||!i||!t.modified)return null;let r=t.modified,o={lessThanOneMinute:i.lessThanOneMinute},s=Ye(Ze(r)),l=s?.[1]==="year"||s?.[1]==="month"?qt({locale:n,time:r},s?.[1]==="year"):et({locale:n,time:r,t9n:o}),u=`item.html?id=${t.id}`,m=`${M(e)}${u}}`;return Y(t.id,c`<li class="list-item"><a class="list-item__link" href=${m??N} @click=${v=>{a({event:v,href:m,relativePath:u})}}>${c`<span class="list-item__container"><span class="list-item__logo list-item__logo--item-type"><arcgis-portal-item-type .item=${t} .user=${e.user} hide-text></arcgis-portal-item-type></span><span class="list-item__content"><span class="list-item__title list-item__title--regular">${t.title}</span><span class="list-item__subtitle">${ee(i.lastUpdated,{date:l})}</span></span></span>`}</a></li>`)}function Hi({locale:e,navigate:t,portal:i,open:a,apps:n,appsLoading:r,hiddenApps:o,appsSearchTerm:s,handlePlatformClose:l,handleAppsSearch:u,handleAppReorder:m,handleAppSave:v,handleAppDelete:h,handleAppHide:A,handleAppCancel:y,handleAppEdit:w,handleItemSearch:S,editingApplications:I,recentContent:d,recentContentLoading:p,recentContentSearchTerm:g,product:x,productInfo:T,links:$,messages:b}){if(!x||!i||!b)return null;let{name:f,icon:_}=T||{};return c`<calcite-sheet class="platform" .label=${b.label} position=inline-start display-mode=overlay id=example-sheet .open=${a} @calciteSheetClose=${l}><calcite-panel class="platform__panel"><div slot=header-content class="platform__header"><img src=${_??N} class="platform__header-image"><div class="platform__header-text"><h2 class="platform__title">${f}</h2><p class="platform__subtitle">${i.name}</p></div><calcite-action icon=x text="Close menu" scale=l @click=${l}></calcite-action></div><div class="platform__container"><div class="platform__tiles">${$.filter(({icon:P})=>P).map(({label:P,href:z,icon:te,relativePath:U})=>c`<calcite-tile .icon=${te} .description=${P} .href=${z} alignment=center scale=s @keydown=${E=>{(E.key==="Enter"||E.key===" ")&&t({event:E,href:z,relativePath:U})}} @click=${E=>{t({event:E,href:z,relativePath:U})}}></calcite-tile>`)}</div>${i?.user&&c`<calcite-tabs layout=center class="platform__tabs"><calcite-tab-nav slot=title-group>${!j(i)&&c`<calcite-tab-title selected>${b.myApps}</calcite-tab-title>`||""}<calcite-tab-title>${b.recentContent}</calcite-tab-title></calcite-tab-nav>${!j(i)&&c`<calcite-tab selected class="platform__tab">${r&&c`<calcite-scrim loading></calcite-scrim>`||""}${Ei({apps:n,appsLoading:r,appsSearchTerm:s,hiddenApps:o,messages:b,handleAppsSearch:u,handleAppReorder:m,handleAppSave:v,handleAppDelete:h,handleAppHide:A,handleAppCancel:y,handleAppEdit:w,editingApplications:I,portal:i})}</calcite-tab>`||""}<calcite-tab class="platform__tab"><div class="list__header"><calcite-input type=search icon .placeholder=${b.searchRecentContent} scale=m class="list__search" @calciteInputInput=${P=>S(P.target.value)}></calcite-input></div>${p&&!r&&c`<calcite-scrim loading></calcite-scrim>`||""}<div class="list__container">${d?.length>0||p?c`<ul class="list">${D(d,P=>P.id,P=>Fi({portal:i,messages:b,navigate:t,item:P,locale:e}))}</ul>`:g?.length?Z({title:ee(b.noAppResults,{term:g}),description:b.recentContentNoResultsDescription,icon:"search"}):Z({title:b.noContent,description:b.noContentDescription,icon:"clock"})}</div></calcite-tab></calcite-tabs>`||""}</div></calcite-panel></calcite-sheet>`}var he=["new","open","rename","save","saveCopy","share","copyLink","embed","details"];async function Bi(e){return await Promise.resolve({status:"success"})}function me(e){return he.includes(e.id)}function Vi(e){return(e||[])?.toSorted((t,i)=>{let a=me(t),n=me(i);return a&&!n?-1:n&&!a?1:n&&a?he.indexOf(t.id)-he.indexOf(i.id):-1})}function Ui(e,t){let i={new:[],save:[],share:[],details:[],custom:[]};if(!t||!e?.length)return i;let a={new:{text:t.new,group:"new"},open:{text:t.open,group:"new"},rename:{text:t.rename,group:"save"},save:{text:t.save,group:"save"},saveCopy:{text:t.saveAsCopy,group:"save"},share:{text:t.manageSharing,group:"share"},copyLink:{text:t.copyLink,group:"share"},embed:{text:t.embed,group:"share"},details:{text:t.itemDetails,group:"details",external:!0}},n=Vi(e),r=[];return n.forEach(o=>{if(!me(o)){r.push(o);return}let{text:s,external:l,group:u}=a[o.id];i[u].push({text:s,external:l,...o})}),r.forEach(o=>{let s=o.group||"custom";i[s].push(o)}),i}function qi({navigate:e,portal:t,menuItem:i,messages:a,portalItem:n,openProjectTitleEdit:r,projectMenuClick:o}){if(!t||!a||!i||i.id==="details"&&!n)return null;let{external:s,id:l,text:u}=i,m=`${M(t)}item.html?id=${n?.id}`;return Y(`${l}${u}`,c`<calcite-dropdown-item .iconEnd=${s?"launch":void 0} .href=${l==="details"?m:i.href} .target=${s?"_blank":void 0} @calciteDropdownItemSelect=${v=>{if(l==="rename"){r?.();return}l==="details"&&e({event:v,href:m}),o?.({type:l})}}>${u}${l==="save"&&c`<calcite-icon icon=bullet-point-large class="project__indicator" scale=s></calcite-icon>`||""}</calcite-dropdown-item>`)}function Ji({navigate:e,portal:t,projectTitle:i,editedProjectTitle:a,handleProjectTitleSave:n,handleProjectTitleEdit:r,handleProjectTitleCancel:o,openProjectTitleEdit:s,portalItem:l,projectTitleEditing:u,projectTitleSaving:m,projectTitleErrorMessage:v,projectMenuIcon:h,projectMenuSaveIndicator:A,projectMenuClick:y,projectMenuOptions:w,projectTitleInputRef:S,projectButtonRef:I,messages:d}){if(!t||!d||!w?.length&&!i)return null;if(!w?.length)return c`<div class="project__title">${h&&c`<calcite-icon .icon=${h} scale=s class="project__menu-icon"></calcite-icon>`||""}<h1 class="project__title__header">${i}</h1>${A&&c`<calcite-icon scale=s icon=bullet-point-large class="project__indicator"></calcite-icon>`||""}</div>`;let p=Ui(w,d),g=!!v;return u?c`<form class="rename" @submit=${async x=>{x.preventDefault(),await n?.(a)}} @keydown=${x=>{x.key==="Escape"&&o?.()}}><calcite-input id=project-title-input type=text scale=l class="rename__input" .label=${d.title} .value=${a} .status=${g?"invalid":"idle"} @calciteInputInput=${x=>r?.(x.target.value)} ${R(S)}></calcite-input>${g&&c`<calcite-popover open .label=${d.error} .referenceElement=${S?.value||"project-title-input"} pointer-disabled placement=bottom-start><calcite-notice kind=danger open><div slot=message>${v}</div></calcite-notice></calcite-popover>`||""}<calcite-action .disabled=${m} icon=check scale=l .text=${d?.saveRename} active class="rename__action" type=submit .loading=${m}></calcite-action><calcite-action .disabled=${m} icon=x scale=l .text=${d?.cancelRename} class="rename__action" @click=${()=>o?.()}></calcite-action></form>`:c`<calcite-dropdown width=m class="fade-in project__dropdown"><button slot=trigger class="project" ${R(I)}>${h&&c`<calcite-icon scale=s .icon=${h} class="project__menu-icon"></calcite-icon>`||""}<span class="project__text">${i}</span>${A&&c`<calcite-icon scale=s icon=bullet-point-large class="project__indicator"></calcite-icon>`||""}<calcite-icon scale=s icon=chevron-down></calcite-icon></button>${D(Object.entries(p).filter(([x,T])=>T.length),([x,T])=>x,([x,T])=>c`<calcite-dropdown-group selection-mode=none>${T.map($=>qi({menuItem:$,navigate:e,portal:t,messages:d,portalItem:l,openProjectTitleEdit:s,projectMenuClick:y}))}</calcite-dropdown-group>`)}</calcite-dropdown>`}function Ki(e){return["Location Platform","Online","Enterprise"].includes(e)}function ct({portal:e,searchType:t,searchTerm:i}){let a=e?.sourceJSON?.vectorSearchEnabled?`&mode=${t}`:"";return`search.html?q=${i}${a}`}function Qi({portal:e,item:t,messages:i,navigate:a}){if(!t||!i)return null;let n=ee(i.by,{itemType:He(t),owner:t.owner}),r=`item.html?id=${t.id}`,o=`${M(e)}${r}`;return Y(t.id,c`<li class="list-item"><a class="list-item__link" href=${o??N} @click=${s=>a({event:s,href:o,relativePath:r})}>${c`<span class="list-item__container"><span class="list-item__logo list-item__logo--item-type"><arcgis-portal-item-type .item=${t} .user=${e.user} hide-text></arcgis-portal-item-type></span><span class="list-item__content"><span class="list-item__title list-item__title--regular list-item__title--large">${t.title}</span><span class="list-item__subtitle list-item__subtitle--large">${n}</span></span></span>`}</a></li>`)}function Xi({portal:e,suggestions:t,messages:i,navigate:a,searchType:n,searchTerm:r}){if(!i||!e||!r)return null;if(!t)return c`<div><calcite-loader scale=l .label=${i.loadingResults}></calcite-loader></div>`;let o=ct({portal:e,searchType:n,searchTerm:r}),s=`/${o}`,l=`${M(e)}${o}`;return c`<ul class="list">${t.map(u=>Qi({messages:i,portal:e,item:u,navigate:a}))}</ul><div class="suggestions__footer"><calcite-button icon-end=arrow-right scale=l appearance=outline class="suggestions__footer__button" kind=neutral round .href=${l} @click=${u=>{a({href:l,event:u,relativePath:s})}}>${i.viewAll}</calcite-button></div>`}function Yi({portal:e,messages:t,searchType:i,handleSearchTypeChange:a}){if(!t||!e?.sourceJSON?.vectorSearchEnabled)return null;let n=i==="keyword",r=t.searchType;return c`<calcite-chip .label=${r.label} .icon=${n?"text":"effects"} id=search-type-toggle appearance=solid kind=neutral><span>${n?r.keywordTitle:r.semanticTitle}</span><calcite-icon icon=chevron-down scale=s class="suggestions__search-type__icon" aria-hidden=true></calcite-icon></calcite-chip><calcite-popover pointer-disabled .label=${t.searchType.label} reference-element=search-type-toggle placement=bottom-end class="suggestions__search-type"><div class="esri-header-search-type-popover-contents"><calcite-list .label=${t.searchType.label} interaction-mode=interactive display-mode=flat scale=m selection-mode=none><calcite-list-item @calciteListItemSelect=${()=>a("keyword")} icon-start=text value=keyword .label=${r.keywordTitle} .description=${r.keywordDescription}></calcite-list-item><calcite-list-item @calciteListItemSelect=${()=>a("vector")} icon-start=effects value=semantic .label=${r.semanticTitle} .description=${r.semanticDescription}></calcite-list-item></calcite-list></div></calcite-popover>`}function Zi({currentPathname:e,navigate:t,product:i,portal:a,messages:n,searchActive:r,searchType:o,searchTerm:s,suggestions:l,searchInputRef:u,searchActionRef:m,searchPopoverRef:v,handleSearch:h,handleToggleSearch:A,handleSearchTypeChange:y}){if(!Ki(i)||!n||!a||e?.includes("search.html"))return null;let w=ct({portal:a,searchType:o,searchTerm:s}),S=`/${w}`,I=`${M(a)}${w}`;return r?c`<div class="search" id=search-reference-element><calcite-input type=search scale=l icon=search class="search__input" .ariaLabel=${n.label} .placeholder=${o==="vector"?n.searchType.semanticPlaceholder:n.searchType.keywordPlaceholder} @calciteInputInput=${d=>h(d.target.value)} @keydown=${d=>{d.key==="Enter"&&(t({href:I,event:d,relativePath:S}),d.defaultPrevented||(window.location.href=I)),d.key==="Escape"&&A(!1)}} ${R(u)}></calcite-input><calcite-action icon=x scale=l .text=${n?.close} active class="search__action" @click=${()=>A(!1)}></calcite-action><calcite-popover .label=${n.suggestions} reference-element=search-reference-element .open=${r&&!!s} pointer-disabled placement=bottom-start trigger-disabled .focusTrapOptions=${{initialFocus:!1}} ${R(v)}><div class="suggestions__header"><h3 class="suggestions__title">${n.topResults}</h3>${Yi({portal:a,messages:n,searchType:o,handleSearchTypeChange:y})}</div><div class="suggestions__results">${Xi({portal:a,suggestions:l,navigate:t,messages:n,searchType:o,searchTerm:s})}</div></calcite-popover></div>`:c`<calcite-action icon=search scale=l text=search class="search__action fade-in" @click=${()=>A(!0)} ${R(m)}></calcite-action>`}function ea({signIn:e,messages:t}){return c`<calcite-menu slot=user .label=${t?.account||""} class="border-start fade-in"><calcite-menu-item .label=${t?.signIn||""} text-enabled .text=${t?.signIn||""} @calciteMenuItemSelect=${()=>e()}></calcite-menu-item></calcite-menu>`}function ta({navigate:e,portal:t,product:i,links:a,messages:n,currentPathname:r,searchActive:o}){return!i||!t||!n||!_e(i)||!a||o?null:c`<calcite-menu slot=content-start .label=${n.label} class="site-nav fade-in">${D(a,({href:s})=>s,({label:s,href:l,relativePath:u})=>c`<calcite-menu-item .text=${s} text-enabled .label=${s} .href=${l} .active=${Oi(l,r)} @click=${m=>e({event:m,href:l,relativePath:u})}></calcite-menu-item>`)}</calcite-menu>`}function ia({userLinks:e,messages:t,navigate:i,openAccountSwitcher:a,portal:n,signOut:r,textDisabled:o}){let s=n?.user;return!s||!e||!t||e?.account?.options.length<1&&e?.resources?.options.length<1?null:c`<div class="user fade-in"><calcite-dropdown .width=${o?"l":"m"} class="user__dropdown"><calcite-button class="user__button" slot=trigger appearance=transparent kind=neutral><span class="user__button__contents"><arcgis-portal-user-avatar .user=${s} .portal=${n} scale=l class="user__button__avatar"></arcgis-portal-user-avatar>${!o&&c`<span class="user__button__text"><h2 class="user__button__full user__full">${s.fullName}</h2><p class="user__button__username user__username">${s.username}</p></span>`||""}</span></calcite-button>${o&&c`<div class="user__top"><arcgis-portal-user-avatar .user=${s} .portal=${n} scale=l class="user__avatar"></arcgis-portal-user-avatar><div class="user__top__text"><h2 class="user__top__full user__full">${s.fullName}</h2><p class="user__top__username user__username">${s.username}</p></div></div>`||""}${Object.values(e).filter(l=>l.options.length).map(({title:l,options:u})=>c`<calcite-dropdown-group selection-mode=none .groupTitle=${l}>${u.map(({icon:m,label:v,href:h,relativePath:A})=>c`<calcite-dropdown-item .iconStart=${m} .href=${h} @keydown=${y=>{(y.key==="Enter"||y.key===" ")&&i({event:y,href:h,relativePath:A})}} @click=${y=>{i({event:y,href:h,relativePath:A})}}>${v}</calcite-dropdown-item>`)}</calcite-dropdown-group>`)}<calcite-dropdown-group selection-mode=none>${a&&c`<calcite-dropdown-item icon-start=users @calciteDropdownItemSelect=${l=>{let u=Ee(l.target,"calcite-dropdown");u&&(u.open=!1),a()}}>${t.switchAccounts}</calcite-dropdown-item>`||""}<calcite-dropdown-item icon-start=sign-out @calciteDropdownItemSelect=${()=>r()}>${t.signOut}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown></div>`}var lt={community:"https://community.esri.com/plugins/common/feature/oauth2sso_v2/sso_login_redirect?referer=https%3A%2F%2Fcommunity.esri.com%2F",myEsri:"https://my.esri.com"};function aa({messages:e,userLinks:t}){let i={account:{title:e.account,options:[]},resources:{title:e.resources,options:[]}};return t.forEach(a=>{i[a.group].options.push(a)}),i}function na({portal:e,messages:t,clientId:i}){if(!e?.user||!t)return{account:{title:t?.account,options:[]},resources:{title:t?.account,options:[]}};let a=sa(e),n=ra({navLinkDictionary:a,messages:t,clientId:i});return aa({userLinks:n,messages:t})}function ra({navLinkDictionary:e,messages:t,clientId:i}){let a=["myProfile","mySettings","myEsri","training","trialDownload","communityForums","arcgisBlog","help"];return(ve(i)||be(i))&&(a=["mySettings","arcgisBlog","help"]),ot(i)&&(a=[]),oa(a,t,e)}function oa(e,t,i){let a=[];return e.forEach(n=>{let r=i[n];if(r&&(!("show"in r)||r.show)){let{href:o,newTab:s,icon:l,group:u,relativePath:m}=r;a.push({label:t[n],group:u,href:o,newTab:s,relativePath:m,icon:l})}}),a}function sa(e){let t=M(e),i=ca(e),a=`user.html${window.location.pathname.includes("home/user.html")?"?nav=1":""}`;return{myProfile:{href:`${t}${a}`,relativePath:a,group:"account",icon:"user"},mySettings:{href:`${t}${a}#settings`,relativePath:`${a}#settings`,group:"account",icon:"gear"},help:{group:"resources",icon:"question",href:X(e),newTab:!0},communityForums:{show:i,group:"resources",icon:"speech-bubbles",href:lt.community,newTab:!0},myEsri:{show:i,group:"account",icon:"globe",href:pa(e),newTab:!0},arcgisBlog:{show:i,group:"resources",icon:"article",href:"https://www.esri.com/arcgis-blog/products/arcgis-online",newTab:!0},training:{show:i,group:"resources",icon:"education",href:la(e),newTab:!0},trialDownload:{group:"resources",icon:"download-to",show:ua(e),href:`${t}/home/user.html${window.location.pathname.includes("home/user.html")?"?nav=1&tab=licenses":"?tab=licenses"}#settings`}}}function ca(e){return!e.isPortal&&e?.user?.sourceJSON?.userType==="both"}function la(e){return pt(e,`${window.location.protocol}//www.esri.com/training/arcgis-online-training`)}function pa(e){return pt(e,lt.myEsri)}function pt(e,t){let i=Q(e),a=da(e),n=`https://accounts${a?a==="dev"?"-dev":"-stg":""}.esri.com/`,r=`&authBaseUrl=${B(i.replace("/sharing/rest/",""),e)}`,o=`${n}LoginHandler/switchuser?`,s=`username=${e?.user?.username??""}&redirect_uri=${t}${r}`;return`${o}${s}`}function da(e){let t=e.portalHostname;return t?.includes("dev")?"dev":t?.includes("qa")?"qa":""}function ua(e){return!e?.isPortal&&["Trial","Trial Press"].includes(e?.sourceJSON.subscriptionInfo?.type)}function ha(e){switch(e){case"360 VR":return{name:"360 VR",fileName:"arcgis-360-vr",icon:"arcgis-360-vr"};case"Business Analyst":return{name:"ArcGIS Business Analyst",fileName:"arcgis-business-analyst",icon:"business-analyst"};case"Dashboards":return{name:"ArcGIS Dashboards",fileName:"arcgis-dashboards",icon:"operations-dashboard"};case"Data Pipelines":return{name:"ArcGIS Data Pipelines",fileName:"arcgis-data-pipelines",icon:"data-pipelines"};case"Deep Learning Studio":return{name:"Deep Learning Studio",fileName:"arcgis-deep-learning-studio",icon:"deeplearningstudio"};case"Enterprise":return{name:"ArcGIS Enterprise",fileName:"arcgis-enterprise",icon:"arcgis-enterprise"};case"Excalibur":return{name:"ArcGIS Excalibur",fileName:"arcgis-excalibur",icon:"excalibur"};case"Experience Builder":return{name:"ArcGIS Experience Builder",fileName:"arcgis-experience-builder",icon:"arcgis-experience-builder"};case"Field Maps":return{name:"Field Maps Designer",fileName:"arcgis-field-maps",icon:"fieldmaps"};case"Field Maps Designer EA":return{name:"Field Maps Designer (EA)",fileName:"arcgis-field-maps-designer-ea",icon:"fieldmaps"};case"GeoAnalytics Engine":case"GeoAnalytics Fabric":return{name:e,fileName:"arcgis-geoanalytics-engine",icon:"arcgis-geoanalytics"};case"GeoBIM":return{name:"ArcGIS GeoBIM",fileName:"arcgis-geobim",icon:"geobim"};case"Hub":return{name:"ArcGIS Hub",fileName:"arcgis-hub",icon:"arcgis-hub"};case"Instant Apps":return{name:"Instant Apps",fileName:"arcgis-instant-apps",icon:"instant-apps"};case"Knowledge":return{name:"ArcGIS Knowledge Studio",fileName:"arcgis-knowledge",icon:"knowledge-studio"};case"Location Platform":return{name:"Location Platform",fileName:"arcgis-location-platform",icon:"location-platform"};case"Map Viewer":return{name:"Map Viewer",fileName:"map-viewer",icon:"map-viewer"};case"Mission":return{name:"ArcGIS Mission Manager",fileName:"arcgis-mission",icon:"mission"};case"Monitor":return{name:"ArcGIS Monitor",fileName:"arcgis-monitor",icon:"monitor"};case"Notebooks":return{name:"ArcGIS Notebooks",fileName:"arcgis-notebooks",icon:"notebook"};case"Online":return{name:"ArcGIS Online",fileName:"arcgis-online",icon:"arcgis-online"};case"Ortho Maker":return{name:"Ortho Maker",fileName:"arcgis-ortho-maker",icon:"ortho-maker"};case"QuickCapture":return{name:"ArcGIS QuickCapture",fileName:"arcgis-quickcapture",icon:"quick-capture"};case"Reality Studio":return{name:"ArcGIS Reality Studio",fileName:"arcgis-reality-studio",icon:"arcgis-reality-studio"};case"Scene Viewer":return{name:"Scene Viewer",fileName:"sceneviewer",icon:"scene-viewer"};case"Solutions":return{name:"ArcGIS Solutions",fileName:"arcgis-solutions",icon:"solutions"};case"StoryMaps":return{name:"ArcGIS StoryMaps",fileName:"arcgis-storymaps",icon:"story-maps"};case"Survey123":return{name:"ArcGIS Survey123",fileName:"arcgis-survey123",icon:"survey123"};case"Tracker":return{name:"Track Viewer",fileName:"arcgis-tracker",icon:"track-viewer"};case"Urban":return{name:"ArcGIS Urban",fileName:"arcgis-urban",icon:"arcgis-urban"};case"Vector Tile Style Editor":return{name:"Vector Tile Style Editor",fileName:"vector-tile-style-editor",icon:"vector-tile-style-editor"};case"Velocity":return{name:"ArcGIS Velocity",fileName:"arcgis-velocity",icon:"velocity"};case"Web Editor":return{name:"Web Editor",fileName:"arcgis-web-editor",icon:"web-editor"};case"Workflow Manager":return{name:"ArcGIS Workflow Manager",fileName:"arcgis-workflow-manager",icon:"workflow-manager"};case"Workforce":return{name:"ArcGIS Workforce",fileName:"arcgis-workforce",icon:"workforce"};default:return{name:"ArcGIS Online",fileName:"arcgis-online",icon:"arcgis-online"}}}function ma({product:e,portal:t,clientId:i}){return e!=="Online"?e:t?.sourceJSON?.subscriptionInfo?.options?.includes("Developer")?"Location Platform":be(i)?"GeoAnalytics Fabric":ve(i)?"GeoAnalytics Engine":t?.isPortal?"Enterprise":"Online"}function Qe(e){let t=ma(e),{name:i,fileName:a,icon:n}=ha(t);return{name:i,glyph:J(`assets/portal-navigation/product-logos/${a}-glyph-32.svg`),icon:J(`assets/portal-navigation/apps/${n}.avif`)}}function ga(){let e=Ft();["item.html","group.html"].some(t=>window.location.href.includes(t))?window.location.href=`./signin.html?locale=${e}&useLandingPage=false&returnUrl=${encodeURIComponent(window.location.href)}`:window.location.href=`./signin.html?locale=${e}&useLandingPage=true`}function fa({portal:e,clientId:t}){let i=K({portal:e});if(e?.isPortal){let a=e.access==="private"?B("signin.html",e):e.allSSL||window.location.protocol==="https:"?B("./index.html",e):`${i}/index.html`;ba(e,a)}else window.location.href=`${i}/pages/Account/manage_accounts.html#client_id=${t}&signout=true`}function va(){ni(Ke),ri(Ke)}function ba(e,t=window.location.href){let i=window.location.href.startsWith("http://"),a=Se(e);Ht.destroyCredentials(),va();let n=new URL(B(`${Q(e)}oauth2/signout`,e)),{searchParams:r}=n;r.append("client_id","arcgisonline"),r.append("redirect_uri",t),a&&i&&(e.isPortal||e.user?.sourceJSON.provider==="enterprise")&&r.append("token",a),window.location.href=n.href}function O(e,t){if(!e)return 0;let i=Le({text:e,font:`${t==="s"?".875rem":"1rem"} 'Avenir Next'`});return Math.ceil(i)}function _a({portal:e,product:t,projectTitle:i,links:a,messages:n,productInfo:r}){if(!t||!e)return;let o=e.user,s=_e(t)&&a?.length?24+a.reduce((m,v)=>m+16+O(v.label)+16,0):0,l=40+O(i)+32+16+16+12,u=o?Math.max(O(o?.username,"s"),O(o?.fullName)):O(n?.signIn);return{actions:192,project:i?Math.min(l,400):0,product:64+Math.max(O(r?.name),O(e.name,"s"))+16,nav:s,user:64+u+16}}function wa({measurements:e,screenWidth:t}){let{actions:i,nav:a,product:n,project:r,user:o}=e,s=64,l=t-i-s>a,u=t-i-(l?a:0)-r-s>Math.min(n,400),m=t-a-r-i-n<Math.min(o,320);return{nav:l,product:u,user:m?"avatar":"full"}}var dt=' -type:"Code Attachment" -type:"Featured Items" -type:"Symbol Set" -type:"Color Set" -type:"Windows Viewer Add In" -type:"Windows Viewer Configuration" -type:"Map Area" -typekeywords:"MapAreaPackage" -type:"Indoors Map Configuration" -typekeywords:"SMX"';async function Xe({portal:e,searchTerm:t}){if(!e?.user)return[];try{return(await e.queryItems({...t?{query:t}:{},filter:`owner:${e.user.username}${dt}`,num:20,sortField:"modified",sortOrder:"desc"})).results}catch{return[]}}async function ya({portal:e,searchTerm:t}){if(!e)return[];let i=De((t||"").substring(0,409)),a=`${e?.id?`accountid:"${e.id}"`:""}${dt}`,n=`${Q(e)}search/suggest`;return(await L(n,{query:{suggest:i,filters:a,searchFields:"title",f:"json"}}))?.result?.results||[]}var $a=ye`:host{display:block;--arcgis-portal-navigation-logo-max-width: 260px;--arcgis-portal-navigation-logo-text-display: flex;--arcgis-portal-navigation-user-max-width: 260px;--arcgis-portal-navigation-user-text-display: block;--arcgis-portal-navigation-project-max-width: auto}.scrim{z-index:100;pointer-events:none;opacity:0;transition:opacity .2s ease-in-out;--calcite-scrim-background: rgba(0, 0, 0, .85)}.scrim--active{opacity:1}.wrapper{background:var(--calcite-color-foreground-1);border-bottom:1px solid var(--calcite-color-border-3);position:relative;z-index:200}.navigation{width:100%;min-width:0;min-height:4rem;display:flex;align-items:stretch;max-width:var(--arcgis-portal-navigation-max-width);margin-inline:auto;overflow:hidden}.navigation--loading .fade-in{opacity:0}.fade-in{opacity:1;transition:opacity ease-in-out .15s}.content-end{margin-inline-start:auto;display:flex;align-items:center}.content-end[hidden]{display:none}.action{height:100%;--calcite-internal-action-spacing: 1.25rem}.border-start{border-inline-start:1px solid var(--calcite-color-border-3)}.platform{--calcite-sheet-width: 24rem}.platform__container{display:flex;flex-direction:column;max-height:100%}.platform__header{display:flex;align-items:center}.platform__header-image{width:48px;height:48px;margin-inline-end:1rem}.platform__header-text{flex:1 1 auto;line-height:1.375}.platform__title{margin:0;padding:0;color:var(--calcite-color-text-1);font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium)}.platform__subtitle{margin:0;padding:0;font-size:var(--calcite-font-size--2);color:var(--calcite-color-text-2)}.platform__panel{border-inline-end:1px solid var(--calcite-color-border-3);--calcite-panel-background-color: var(--calcite-color-foreground-1)}.platform__tiles{margin:.75rem .75rem 1.5rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));grid-gap:.5rem}.platform__tabs{min-height:0;flex:1 1 auto;--calcite-tab-content-space-y: 0}.platform__tab{position:relative}.list{list-style:none;margin:0;padding:0}.list__container{position:relative}.list__header{display:flex;align-items:center;padding:.5rem .75rem;border-bottom:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1);position:sticky;top:0;z-index:701}.list__search{flex:1 1 auto;--calcite-color-border-input: var(--calcite-color-foreground-1)}.list-item__link{display:block;box-sizing:border-box;width:100%;padding-inline-start:.75rem;background-color:var(--calcite-color-foreground-1);outline-color:transparent;text-decoration:none;outline-offset:0;transition:color var(--calcite-animation-timing) ease-in-out,background-color var(--calcite-animation-timing) ease-in-out,outline-color var(--calcite-internal-animation-timing-fast) ease-in-out,outline-offset var(--calcite-internal-animation-timing-fast) ease-in-out}.list-item__link:hover{background-color:var(--calcite-color-transparent-hover)}.list-item__link:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus);outline-offset:-2px}.list-item:focus-within .list-item__container{border-bottom-color:transparent}.list-item__container{box-sizing:border-box;width:100%;padding-block:.5rem;padding-inline-start:0;padding-inline-end:.5rem;border-bottom:1px solid var(--calcite-color-border-3);display:flex;align-items:center;position:relative;pointer-events:none}.list-item__content{display:flex;flex-direction:column;justify-content:center;min-width:0}.list-item__logo{width:48px;height:48px;flex:0 0 auto;box-sizing:border-box;margin-inline-end:.5rem;justify-content:center;align-items:center;position:relative;display:flex}.list-item__logo-bg{position:absolute}.list-item__indicator{position:absolute;width:.5rem;height:.5rem;border-radius:50%;background-color:var(--calcite-color-status-success);border:2px solid var(--calcite-color-foreground-1);z-index:50;top:.25rem;inset-inline-start:-.25rem}.list-item__abbr{color:#fff;font-weight:700;position:relative}.list-item__logo-empty{border:2px dashed var(--calcite-color-border-3);border-radius:8px}.list-item__logo--item-type{background-color:var(--calcite-color-background);display:flex;justify-content:center;align-items:center}.list-item__title{display:block;font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1);font-weight:500;word-wrap:break-word}.list-item__title--regular{font-weight:400;padding-top:.25rem}.list-item__title--large{font-size:var(--calcite-font-size-0);line-height:1}.list-item__subtitle{display:block;font-size:var(--calcite-font-size--2);color:var(--calcite-color-text-3);font-weight:500;padding-top:.25rem;padding-bottom:.25rem}.list-item__subtitle--large{font-size:var(--calcite-font-size--1);font-weight:400;padding:0}.list-item__chip{margin-inline-start:auto;--calcite-chip-background-color: var(--calcite-color-foreground-current)}.app--hidden{--calcite-list-background-color: var(--calcite-color-background)}.app--hidden .list-item__logo{opacity:.4}.logo{border-inline-end:1px solid var(--calcite-color-border-3);max-width:var(--arcgis-portal-navigation-logo-max-width);display:flex;align-items:center}.logo--link{text-decoration:none}.logo--link:hover{background-color:var(--calcite-color-transparent-hover)}.logo--link:focus{outline:2px solid var(--calcite-color-brand);outline-offset:-2px}.logo__glyph{width:32px;height:32px;padding-inline:1rem}.logo__text{display:var(--arcgis-portal-navigation-logo-text-display);flex-direction:column;overflow:hidden;white-space:nowrap;text-align:start;padding-inline:var(--calcite-internal-navigation-logo-padding-inline);padding-inline-end:1rem}.logo__title{margin:0;padding:0;color:var(--calcite-color-text-1);font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);line-height:1.25rem;text-overflow:ellipsis;overflow:hidden}.logo__subtitle{margin:0;padding:0;font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-2);font-size:.875rem;line-height:1rem;text-overflow:ellipsis;overflow:hidden}.site-nav{margin-inline-start:1.5rem}.project{min-width:0;outline:none;border:none;border-inline-end:1px solid var(--calcite-color-border-3);cursor:pointer;background-color:var(--calcite-color-foreground-1);box-sizing:border-box;display:flex;user-select:none;appearance:none;align-items:center;justify-content:center;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;outline-color:transparent;box-shadow:var(--calcite-button-shadow, var(--calcite-shadow-none));color:var(--calcite-color-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s,outline 0s,outline-offset 0s;inset-inline-end:.25rem;background:transparent;white-space:nowrap;padding:0 1.375rem;flex-grow:2}.project:hover{background-color:var(--calcite-color-transparent-hover)}.project:focus{outline:2px solid var(--calcite-color-brand);outline-offset:-2px}.project__title{display:flex;justify-self:stretch;min-width:0;align-items:center;justify-content:center;padding:0 1.5rem;margin-inline-end:1.5rem;color:var(--calcite-color-text-1);border-inline-end:1px solid var(--calcite-color-border-3);max-width:var(--arcgis-portal-navigation-project-max-width, 60%)}.project__title__header{padding:0;margin:0;font-size:1rem;font-weight:400;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project__dropdown{max-width:var(--arcgis-portal-navigation-project-max-width, 60%);min-width:0;margin-inline-end:1.5rem}.project__indicator{margin-inline-end:.5rem;--calcite-ui-icon-color: var(--calcite-color-status-danger)}.project__menu-icon{margin-inline-end:.75rem}.project__text{font-size:1rem;min-width:0;overflow:hidden;text-overflow:ellipsis;margin-inline-end:.75rem}.rename{width:100%;min-width:0;display:flex;flex:1 1 0;align-items:center;margin-inline-start:.5rem}.rename__action{margin-inline-end:.5rem;display:flex;align-items:center}.rename__input{margin-inline-end:.5rem;display:block;width:100%}.search{width:100%;min-width:0;display:flex;flex:1 1 0;align-items:center;margin-inline-start:.5rem}.search__action{margin-inline-end:.5rem;display:flex;align-items:center}.search__input{margin-inline-end:.5rem;display:block;width:100%}.suggestions__header{display:flex;align-items:center;width:var(--calcite-popover-max-size-x);box-sizing:border-box;padding:.75rem 1rem;border-bottom:1px solid var(--calcite-color-border-3)}.suggestions__title{padding:0;margin:0;font-weight:500;color:var(--calcite-color-text-1);font-size:var(--calcite-font-size-1);flex:1 1 0}.suggestions__search-type{--calcite-popover-max-size-x: 320px}.suggestions__search-type__icon{vertical-align:-.2rem}.suggestions__footer{display:flex;align-items:center;justify-content:center;padding:1rem}.notifications{width:min(24rem,80vw)}.notifications--full:after{content:"";display:block;border-top:1px solid var(--calcite-color-border-3);margin-left:1rem}.notifications__list{max-height:min(18rem,80vh);overflow:auto;box-sizing:border-box;width:100%}.notifications--empty{padding:2rem}.empty{padding:1rem;text-align:center;color:var(--calcite-color-text-3);--calcite-icon-color: var(--calcite-color-status-success-hover)}.empty__header{margin:0;padding:.75rem 0 0;color:var(--calcite-color-text-1);font-weight:500;font-size:var(--calcite-font-size-1)}.empty__text{margin:0;padding:0;color:var(--calcite-color-text-3);font-weight:400;font-size:var(--calcite-font-size-0)}.notification{display:flex;flex-direction:column;padding:.5rem}.notification__message{color:var(--calcite-color-text-1);font-size:var(--calcite-font-size-0);--calcite-color-brand-underline: transparent}.notification__date{color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-0)}.notifications__dismiss{margin-inline-start:auto;margin-inline-end:1rem;margin-block:.5rem}.user{display:flex;max-width:var(--arcgis-portal-navigation-user-max-width);--calcite-dropdown-item-text-color: var(--calcite-color-text-3);--calcite-dropdown-group-title-text-color: var(--calcite-color-text-2)}.user__dropdown{max-width:100%}.user__button{max-width:100%;--calcite-spacing-base: -2px}.user__button__contents{display:flex;text-align:start}.user__button__text{display:var(--arcgis-portal-navigation-user-text-display);flex:1 1 0;min-width:0;padding-inline-start:1rem;line-height:1.375;overflow:hidden}.user__button__avatar{flex:0 0 auto}.user__button__full,.user__button__username{max-width:100%;overflow:hidden;text-overflow:ellipsis}.user__top{display:flex;padding:.75rem;border-bottom:1px solid var(--calcite-color-border-3)}.user__top__avatar{flex:0 0 auto}.user__top__text{box-sizing:border-box;word-wrap:break-word;flex:1 1 0;min-width:0;padding-inline-start:1rem;line-height:1.375}.user__full{font-size:1rem;font-weight:medium;color:var(--calcite-colot-text-1);line-height:1.25;padding:0;margin:0}.user__username{font-size:.875rem;line-height:1.25;color:var(--calcite-colot-text-2);padding:0;margin:0}`;function Aa({messages:e,portal:t,showNav:i,openPlatformMenu:a,handleToggleSearch:n}){return!e||i&&!t?.user?null:c`<calcite-action .label=${e.applicationMenu} text="app switcher" icon=app-launcher scale=l class="action" @click=${a} @focusin=${()=>n(!1,!0)}></calcite-action>`}var ge=class extends Ae{constructor(){super(...arguments),this.messages=Ne({blocking:!0}),this.refreshNotifications=async()=>{let{portal:t,messages:i}=this;this.notifications=await Ve({portal:t,locale:i._t9nLocale,t9n:i.notifications})},this.deleteNotifications=async t=>{let{portal:i}=this;if(t?.length<20)await Kt(i,t);else{let a=0;for await(let n of t)await tt({id:n,portal:i}),this.notificationDeleteProgress=Math.ceil(a++/t.length*100)}this.notificationDeleteProgress=void 0,this.refreshNotifications()},this.navigate=t=>{this.arcgisNavigate.emit(t),this.platformMenuOpen=!1,this.notificationsActive=!1,this.searchActive=!1},this.openPlatformMenu=()=>{this.platformMenuOpen=!0,this.searchActive=!1},this.projectMenuClick=t=>{this.arcgisNavigationProjectMenuClick.emit(t)},this.openProjectTitleEdit=()=>{this.projectTitleEditing=!0,this.editedProjectTitle=this.projectTitle,requestAnimationFrame(()=>{this.projectTitleInputRef?.value?.setFocus()})},this.closeProjectTitleEdit=()=>{this.projectTitleEditing=!1,this.projectTitleErrorMessage=void 0,requestAnimationFrame(()=>{this.projectButtonRef?.value?.focus()})},this.handleProjectTitleSave=async t=>{this.projectTitleSaving=!0;let i=await(this.projectTitleSave||Bi)(t);if(this.projectTitleSaving=!1,i.status==="success"){this.closeProjectTitleEdit();return}i.message&&(this.projectTitleErrorMessage=i.message)},this.handleProjectTitleEdit=t=>{this.editedProjectTitle=t},this.handleProjectTitleCancel=()=>{this.editedProjectTitle=this.projectTitle,this.closeProjectTitleEdit()},this.signOut=()=>{let{portal:t,clientId:i}=this;fa({portal:t,clientId:i}),this.arcgisNavigationSignOut.emit()},this.signIn=()=>{this.arcgisNavigationSignIn.emit(),ga()},this.openAccountSwitcher=()=>{this.accountSwitcherOpen=!0},this.handlePlatformClose=()=>{this.platformMenuOpen=!1,this.handleAppCancel(),this.appsSearchTerm=""},this.handleAppSave=async()=>{let{hiddenApps:t,sortedApps:i,userProperties:a,portal:n}=this;this.apps=[...i],this.editingApplications=!1,this.appsLoading=!0;let{result:r}=await Ci({apps:i,hiddenApps:t,userProperties:a,portal:n});r?.success&&(this.previousAppState={apps:i,hiddenApps:t}),await ke(1e3),this.appsLoading=!1},this.handleAppDelete=async t=>{t&&(this.apps=this.sortedApps.filter(i=>i.itemId!==t),this.sortedApps=this.sortedApps.filter(i=>i.itemId!==t))},this.handleAppCancel=()=>{this.previousAppState&&(this.apps=this.previousAppState.apps,this.hiddenApps=this.previousAppState.hiddenApps),this.editingApplications=!1},this.handleAppHide=({app:t,hidden:i})=>{!this.hiddenApps||!t||(this.hiddenApps={...this.hiddenApps||{},[t]:i})},this.handleAppReorder=({oldIndex:t,newIndex:i})=>{let a=[...this.sortedApps],n=a[t];a.splice(t,1),a.splice(i,0,n),this.sortedApps=a},this.handleItemSearch=t=>{this.recentContentLoading=!0,this.recentContentSearchTerm=t,this.debouncedItemSearch(t)},this.debouncedItemSearch=ce(async t=>{this.recentContent=await Xe({portal:this.portal,searchTerm:t}),this.recentContentLoading=!1},1e3),this.debouncedSuggest=ce(async t=>{this.suggestions=await ya({portal:this.portal,searchTerm:t})},1e3),this.handleSearch=t=>{this.searchTerm=t,this.suggestions=void 0,this.debouncedSuggest(t)},this.sizeSearchPopover=()=>{let t=this.searchInput?.value,i=this.searchPopover?.value;if(!t||!i)return;let a=t.offsetWidth>480?`${t.offsetWidth}px`:"80vw";i.style?.setProperty?.("--calcite-popover-max-size-x",a)},this.handleToggleNotifications=t=>{this.notificationsActive=t},this.handleToggleSearch=(t,i)=>{this.searchActive=t,this.searchTerm="",this.suggestions=void 0,document.documentElement.style.overflow=t?"hidden":this.initialDocumentOverflowStyle,!i&&requestAnimationFrame(()=>{if(t){this.searchInput?.value?.setFocus(),this.sizeSearchPopover();return}this.searchAction?.value?.setFocus()})},this.handleSearchTypeChange=t=>{this.searchType=t},this.searchInput=G(),this.searchAction=G(),this.searchPopover=G(),this.projectTitleInputRef=G(),this.projectButtonRef=G(),this.initialDocumentOverflowStyle=document.documentElement.style.overflow,this.links=[],this.notifications=[],this.notificationsActive=!1,this.apps=[],this.hiddenApps={},this.sortedApps=[],this.appsSearchTerm="",this.appsLoading=!0,this.editingApplications=!1,this.recentContent=[],this.recentContentSearchTerm="",this.recentContentLoading=!0,this.platformMenuOpen=!1,this.accountSwitcherOpen=!1,this.projectTitleEditing=!1,this.projectTitleSaving=!1,this.screenWidth=window.innerWidth,this.searchActive=!1,this.searchTerm="",this.searchType="keyword",this.projectMenuOptions=[],this.currentPathname=window.location.pathname,this.arcgisNavigate=H(),this.arcgisNavigationProjectMenuClick=H(),this.arcgisNavigationSignIn=H(),this.arcgisNavigationSignOut=H()}static{this.properties={infoBanner:16,links:16,userLinks:16,notifications:16,notificationsActive:16,apps:16,hiddenApps:16,sortedApps:16,previousAppState:16,appsSearchTerm:16,appsLoading:16,editingApplications:16,recentContent:16,recentContentSearchTerm:16,recentContentLoading:16,platformMenuOpen:16,accountSwitcherOpen:16,editedProjectTitle:16,projectTitleEditing:16,projectTitleSaving:16,projectTitleErrorMessage:16,productInfo:16,notificationDeleteProgress:16,measurements:16,screenWidth:16,showProduct:16,showNav:16,showUser:16,searchActive:16,searchTerm:16,suggestions:16,searchType:16,portal:0,portalItem:0,product:1,productHref:1,projectTitle:1,projectTitleSave:0,projectMenuIcon:1,projectMenuSaveIndicator:5,projectMenuOptions:0,disableTrackViewer:5,disableNotebookServer:5,clientId:1,currentPathname:1,maxWidth:9}}static{this.styles=$a}#e;async loaded(){let{portal:t,messages:i,clientId:a,product:n}=this;this.calculateMeasurements(),this.productInfo=Qe({product:n,clientId:a,portal:t}),this.userLinks=na({portal:t,messages:i.user,clientId:a}),this.notifications=await Ve({portal:t,locale:i._t9nLocale,t9n:i.notifications}),this.recentContent=await Xe({portal:t}),this.recentContentLoading=!1;let{apps:r,hiddenApps:o,signInSettings:s,licenses:l,userProperties:u}=await Pi({portal:t,trackViewerEnabled:!this.disableTrackViewer,notebookServerEnabled:!this.disableNotebookServer}),m=await Re(t);this.infoBanner=m?.informationalBanner,this.userProperties=u,this.apps=r,this.hiddenApps=o,this.sortedApps=r,this.previousAppState={apps:r,hiddenApps:o},this.appsLoading=!1,this.links=Li({portal:t,messages:i.links,licenses:l,clientId:a,signInSettings:s}),this.calculateMeasurements()}connectedCallback(){super.connectedCallback(),this.initialDocumentOverflowStyle=document.documentElement.style.overflow,!(typeof ResizeObserver>"u")&&(this.#e=new ResizeObserver(()=>{requestAnimationFrame(()=>{this.screenWidth=window.innerWidth,this.updateBreakpoints(),this.sizeSearchPopover()})}))}firstUpdated(){this.el&&this.#e&&(this.#e.observe(this.el),this.screenWidth=window.innerWidth)}willUpdate(t){(t.has("product")||t.has("clientId"))&&this.hasUpdated&&(this.productInfo=Qe({product:this.product,clientId:this.clientId,portal:this.portal}))}disconnectedCallback(){this.#e?.disconnect(),this.#e=void 0,document.documentElement.style.overflow=this.initialDocumentOverflowStyle,super.disconnectedCallback()}calculateMeasurements(){let{links:t,messages:i,portal:a,product:n,productInfo:r,projectTitle:o}=this;if(a){let s=_a({portal:a,product:n,productInfo:r,links:t,messages:i.user,projectTitle:o});this.measurements=s,this.updateBreakpoints()}}updateBreakpoints(){let{measurements:t,maxWidth:i}=this;if(t){let a=i?Math.min(this.screenWidth,i):this.screenWidth,n=wa({measurements:t,screenWidth:a});this.showProduct=n.product,this.showNav=n.nav,this.showUser=n.user}}render(){let{accountSwitcherOpen:t,apps:i,appsLoading:a,appsSearchTerm:n,currentPathname:r,handleAppCancel:o,handleAppDelete:s,handleAppHide:l,handleAppReorder:u,handleAppSave:m,handleItemSearch:v,handlePlatformClose:h,handleSearch:A,handleToggleSearch:y,handleSearchTypeChange:w,hiddenApps:S,infoBanner:I,links:d,messages:p,navigate:g,notifications:x,notificationsActive:T,notificationDeleteProgress:$,openAccountSwitcher:b,portal:f,portalItem:_,product:P,productInfo:z,productHref:te,projectTitle:U,editedProjectTitle:E,handleProjectTitleSave:ut,handleProjectTitleEdit:ht,handleProjectTitleCancel:mt,handleToggleNotifications:we,openProjectTitleEdit:gt,openPlatformMenu:ft,platformMenuOpen:vt,projectTitleEditing:ie,projectTitleSaving:bt,projectTitleErrorMessage:_t,projectMenuIcon:wt,projectMenuSaveIndicator:yt,projectMenuClick:$t,projectMenuOptions:At,projectTitleInputRef:xt,projectButtonRef:kt,recentContent:St,recentContentSearchTerm:It,recentContentLoading:Tt,userLinks:Pt,searchActive:F,searchTerm:jt,searchType:Ct,searchInput:Nt,searchAction:Mt,searchPopover:Et,showNav:ae,showProduct:Lt,showUser:Dt,suggestions:Ot}=this,zt=f?.user,Gt=_e(P)&&!d?.length||!this.measurements;return c`<calcite-scrim class=${q({scrim:!0,"scrim--active":F})}></calcite-scrim><div class="wrapper" style=${ne({"--arcgis-portal-navigation-max-width":this.maxWidth?`${this.maxWidth}px`:"100%"})}><arcgis-portal-info-banner .config=${I}></arcgis-portal-info-banner>${f?.isPortal&&_?.loaded&&c`<arcgis-portal-classification-banner .portalItem=${_}></arcgis-portal-classification-banner>`||""}<header class=${q({navigation:!0,"navigation--loading":Gt})}>${Aa({messages:p?.platform,portal:f,showNav:ae,openPlatformMenu:ft,handleToggleSearch:y})}${Lt&&Bt({navigate:g,portal:f,product:P,productInfo:z,productHref:te,messages:p?.logo,showNav:ae,searchActive:F,projectTitleEditing:ie})||""}${Ji({navigate:g,portal:f,portalItem:_,messages:p?.project,projectTitle:U,editedProjectTitle:E,handleProjectTitleSave:ut,handleProjectTitleEdit:ht,openProjectTitleEdit:gt,projectTitleErrorMessage:_t,handleProjectTitleCancel:mt,projectTitleEditing:ie,projectTitleSaving:bt,projectMenuIcon:wt,projectMenuSaveIndicator:yt,projectMenuClick:$t,projectMenuOptions:At,projectTitleInputRef:xt,projectButtonRef:kt})}${ae&&ta({searchActive:F,navigate:g,portal:f,product:P,messages:p?.links,links:d,currentPathname:r})||""}<div slot=content-end class="content-end fade-in" .hidden=${ie||F}><slot name=content-end></slot></div>${Zi({currentPathname:r,navigate:g,portal:f,product:P,messages:p?.search,searchActive:F,searchType:Ct,searchTerm:jt,suggestions:Ot,handleSearch:A,handleToggleSearch:y,handleSearchTypeChange:w,searchInputRef:Nt,searchActionRef:Mt,searchPopoverRef:Et})}${zt?c`<div class="border-start fade-in">${Zt({notifications:x,notificationsActive:T,messages:p?.notifications,handleToggleNotifications:we,handleToggleSearch:y})}${ei({notificationsActive:T,notifications:x,navigate:g,portal:f,deleteNotifications:this.deleteNotifications,handleToggleNotifications:we,messages:p?.notifications,notificationDeleteProgress:$})}</div>${ia({portal:f,userLinks:Pt,openAccountSwitcher:f?.isPortal?void 0:b,signOut:this.signOut,messages:p?.user,textDisabled:Dt==="avatar",navigate:g})}`:ea({messages:p.user,signIn:this.signIn})}</header>${Hi({locale:p._t9nLocale,navigate:g,portal:f,product:P,productInfo:z,messages:p?.platform,apps:i,appsLoading:a,hiddenApps:S,appsSearchTerm:n,editingApplications:this.editingApplications,open:vt,links:d,recentContent:St,recentContentSearchTerm:It,recentContentLoading:Tt,handlePlatformClose:h,handleAppReorder:u,handleAppEdit:()=>this.editingApplications=!0,handleAppDelete:s,handleAppsSearch:Rt=>this.appsSearchTerm=Rt,handleAppSave:m,handleAppCancel:o,handleAppHide:l,handleItemSearch:v})}${t&&c`<arcgis-portal-account-switcher .portal=${f} @arcgisClose=${()=>{this.accountSwitcherOpen=!1}}></arcgis-portal-account-switcher>`||""}</div>`}};xe("arcgis-portal-navigation",ge);return ge},"intl","portal/Portal","identity/IdentityManager",a,b,d,e,f,g)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as ce}from"./AAHGOYVY.js";import{a as oe}from"./DFTUMKSN.js";import{a as le}from"./2GBRZSEC.js";import{a as ae}from"./W3UBNVKL.js";import"./QZD2UBOW.js";import"./JVGCIDQW.js";import{M as se,S as ie,h as ne,j as R,w as j}from"./6BUBZ7WC.js";import"./UZLQALHY.js";function X(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var z=X();function xe(r){z=r}var T={exec:()=>null};function A(r){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),n=e[s];return n||(n=r(s),e[s]=n),n}}function u(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(f.caret,"$1"),t=t.replace(n,a),s},getRegex:()=>new RegExp(t,e)};return s}var Pe=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),f={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:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:A(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:A(r=>new RegExp(`^ {0,${r}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:A(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:A(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:A(r=>new RegExp(`^ {0,${r}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:A(r=>new RegExp(`^ {0,${r}}>`))},Le=/^(?:[ \t]*(?:\n|$))+/,Ie=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ve=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ce=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,U=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,be=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,me=u(be).replace(/bull/g,U).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ee=u(be).replace(/bull/g,U).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),W=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Be=/^[^\n]+/,F=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qe=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",F).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),De=u(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,U).getRegex(),Q="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",J=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ze=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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",J).replace("tag",Q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),we=r=>u(W).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",r).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex(),Me=we(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Qe=we(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),He=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qe).getRegex(),K={blockquote:He,code:Ie,def:qe,fences:ve,heading:Ce,hr:E,html:Ze,lheading:me,list:De,newline:Le,paragraph:Me,table:T,text:Be},pe=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex(),je={...K,lheading:Ee,table:pe,paragraph:u(W).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex()},Oe={...K,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",J).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:T,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(W).replace("hr",E).replace("heading",` *#{1,6} *[^
2
+ import{a as ce}from"./AAHGOYVY.js";import{a as oe}from"./DFTUMKSN.js";import{a as le}from"./2GBRZSEC.js";import{a as ae}from"./W3UBNVKL.js";import"./QZD2UBOW.js";import"./JVGCIDQW.js";import{M as se,S as ie,h as ne,j as R,w as j}from"./6BUBZ7WC.js";import"./UZLQALHY.js";function X(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var z=X();function xe(r){z=r}var T={exec:()=>null};function A(r){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),n=e[s];return n||(n=r(s),e[s]=n),n}}function u(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(f.caret,"$1"),t=t.replace(n,a),s},getRegex:()=>new RegExp(t,e)};return s}var Pe=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),f={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:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:A(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:A(r=>new RegExp(`^ {0,${r}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:A(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:A(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:A(r=>new RegExp(`^ {0,${r}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:A(r=>new RegExp(`^ {0,${r}}>`))},Le=/^(?:[ \t]*(?:\n|$))+/,Ie=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ve=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ce=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,U=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,be=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,me=u(be).replace(/bull/g,U).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ee=u(be).replace(/bull/g,U).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),W=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Be=/^[^\n]+/,F=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qe=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",F).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),De=u(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,U).getRegex(),Q="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",J=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ze=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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",J).replace("tag",Q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),we=r=>u(W).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",r).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex(),Me=we(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Qe=we(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),He=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qe).getRegex(),K={blockquote:He,code:Ie,def:qe,fences:ve,heading:Ce,hr:E,html:Ze,lheading:me,list:De,newline:Le,paragraph:Me,table:T,text:Be},pe=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex(),je={...K,lheading:Ee,table:pe,paragraph:u(W).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Q).getRegex()},Oe={...K,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",J).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:T,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(W).replace("hr",E).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("lheading",me).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ne=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ge=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$e=/^( {2,}|\\)\n(?!\s*$)/,Xe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,y=/[\p{P}\p{S}]/u,P=/[\s\p{P}\p{S}]/u,B=/[^\s\p{P}\p{S}]/u,Ue=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,P).getRegex(),We=/[\p{Pi}\p{Ps}"']/u,ye=/(?!~)[\p{P}\p{S}]/u,Fe=/(?!~)[\s\p{P}\p{S}]/u,Je=/(?:[^\s\p{P}\p{S}]|~)/u,Ke=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Se=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ve=u(Se,"u").replace(/punct/g,y).getRegex(),Ye=u(Se,"u").replace(/punct/g,ye).getRegex(),et=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,tt=u(et,"u").replace(/openQuote/g,We).replace(/punct/g,y).getRegex(),Re="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",rt=u(Re,"gu").replace(/notPunctSpace/g,B).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),nt=u(Re,"gu").replace(/notPunctSpace/g,Je).replace(/punctSpace/g,Fe).replace(/punct/g,ye).getRegex(),st="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",it=u(st,"gu").replace(/notPunctSpace/g,B).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),lt=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,B).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),at="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",ot=u(at,"gu").replace(/notPunctSpace/g,B).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),ct=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,y).getRegex(),pt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ht=u(pt,"gu").replace(/notPunctSpace/g,B).replace(/punctSpace/g,P).replace(/punct/g,y).getRegex(),ut=u(/\\(punct)/,"gu").replace(/punct/g,y).getRegex(),gt=u(/^<(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(),kt=u(J).replace("(?:-->|$)","-->").getRegex(),dt=u("^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",kt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),D=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ft=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",D).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Te=u(/^!?\[(label)\]\[(ref)\]/).replace("label",D).replace("ref",F).getRegex(),_e=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",F).getRegex(),xt=u("reflink|nolink(?!\\()","g").replace("reflink",Te).replace("nolink",_e).getRegex(),he=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,V={_backpedal:T,anyPunctuation:ut,autolink:gt,blockSkip:Ke,br:$e,code:Ge,del:T,delLDelim:T,delRDelim:T,emStrongLDelim:Ve,emStrongRDelimAst:rt,emStrongRDelimUnd:lt,escape:Ne,link:ft,nolink:_e,punctuation:Ue,reflink:Te,reflinkSearch:xt,tag:dt,text:Xe,url:T},bt={...V,emStrongLDelim:tt,emStrongRDelimAst:it,emStrongRDelimUnd:ot,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",D).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",D).getRegex()},O={...V,emStrongRDelimAst:nt,emStrongLDelim:Ye,delLDelim:ct,delRDelim:ht,url:u(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",he).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:u(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",he).getRegex()},mt={...O,br:u($e).replace("{2,}","*").getRegex(),text:u(O.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},q={normal:K,gfm:je,pedantic:Oe},v={normal:V,gfm:O,breaks:mt,pedantic:bt},wt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ue=r=>wt[r];function $(r,e){if(e){if(f.escapeTest.test(r))return r.replace(f.escapeReplace,ue)}else if(f.escapeTestNoEncode.test(r))return r.replace(f.escapeReplaceNoEncode,ue);return r}function ge(r){try{r=encodeURI(r).replace(f.percentDecode,"%")}catch{return null}return r}function ke(r,e){let t=r.replace(f.findPipe,(i,a,l)=>{let o=!1,c=a;for(;--c>=0&&l[c]==="\\";)o=!o;return o?"|":" |"}),s=t.split(f.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(f.slashPipe,"|");return s}function S(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s;){let i=r.charAt(s-n-1);if(i===e&&!t)n++;else if(i!==e&&t)n++;else break}return r.slice(0,s-n)}function de(r){let e=r.split(`
4
4
  `),t=e.length-1;for(;t>=0&&f.blankLine.test(e[t]);)t--;return e.length-t<=2?r:e.slice(0,t+1).join(`
5
5
  `)}function $t(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function yt(r,e=0){let t=e,s="";for(let n of r)if(n===" "){let i=4-t%4;s+=" ".repeat(i),t+=i}else s+=n,t++;return s}function fe(r,e,t,s,n){let i=e.href,a=e.title||null,l=r[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}function St(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
@@ -12,25 +12,25 @@ import{a as ce}from"./AAHGOYVY.js";import{a as oe}from"./DFTUMKSN.js";import{a a
12
12
  `),h=c.replace(this.rules.other.blockquoteSetextReplace,`
13
13
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
14
14
  ${c}`:c,n=n?`${n}
15
- ${h}`:h;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,i,!0),this.lexer.state.top=p,t.length===0)break;let g=i.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let x=g,d=t.join(`
15
+ ${h}`:h;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,i,!0),this.lexer.state.top=p,t.length===0)break;let k=i.at(-1);if(k?.type==="code")break;if(k?.type==="blockquote"){let x=k,d=t.join(`
16
16
  `),w=x.raw+`
17
17
  `+d.replace(this.rules.other.blockquoteSetextReplace2,""),L=this.blockquote(w);i[i.length-1]=L,s=`${s}
18
- ${d}`,n=n.substring(0,n.length-x.text.length)+L.text;break}else if(g?.type==="list"){let x=g,d=x.raw+`
18
+ ${d}`,n=n.substring(0,n.length-x.text.length)+L.text;break}else if(k?.type==="list"){let x=k,d=x.raw+`
19
19
  `+t.join(`
20
- `),w=this.list(d);i[i.length-1]=w,s=s.substring(0,s.length-g.raw.length)+w.raw,n=n.substring(0,n.length-x.raw.length)+w.raw,t=d.substring(i.at(-1).raw.length).split(`
20
+ `),w=this.list(d);i[i.length-1]=w,s=s.substring(0,s.length-k.raw.length)+w.raw,n=n.substring(0,n.length-x.raw.length)+w.raw,t=d.substring(i.at(-1).raw.length).split(`
21
21
  `);continue}}return{type:"blockquote",raw:s,tokens:i,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,n={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let i=this.rules.other.listItemRegex(t),a=!1;for(;r;){let o=!1,c="",h="";if(!(e=i.exec(r))||this.rules.block.hr.test(r))break;c=e[0],r=r.substring(c.length);let p=yt(e[2].split(`
22
- `,1)[0],e[1].length),g=r.split(`
23
- `,1)[0],x=!p.trim(),d=0;if(this.options.pedantic?(d=2,h=p.trimStart()):x?d=e[1].length+1:(d=p.search(this.rules.other.nonSpaceChar),d=d>4?1:d,h=p.slice(d),d+=e[1].length),x&&this.rules.other.blankLine.test(g)&&(c+=g+`
24
- `,r=r.substring(g.length+1),o=!0),!o){let w=this.rules.other.nextBulletRegex(d),L=this.rules.other.hrRegex(d),te=this.rules.other.fencesBeginRegex(d),re=this.rules.other.headingBeginRegex(d),ze=this.rules.other.htmlBeginRegex(d),Ae=this.rules.other.blockquoteBeginRegex(d);for(;r;){let H=r.split(`
25
- `,1)[0],I;if(g=H,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),I=g):I=g.replace(this.rules.other.tabCharGlobal," "),te.test(g)||re.test(g)||ze.test(g)||Ae.test(g)||w.test(g)||L.test(g))break;if(I.search(this.rules.other.nonSpaceChar)>=d||!g.trim())h+=`
22
+ `,1)[0],e[1].length),k=r.split(`
23
+ `,1)[0],x=!p.trim(),d=0;if(this.options.pedantic?(d=2,h=p.trimStart()):x?d=e[1].length+1:(d=p.search(this.rules.other.nonSpaceChar),d=d>4?1:d,h=p.slice(d),d+=e[1].length),x&&this.rules.other.blankLine.test(k)&&(c+=k+`
24
+ `,r=r.substring(k.length+1),o=!0),!o){let w=this.rules.other.nextBulletRegex(d),L=this.rules.other.hrRegex(d),te=this.rules.other.fencesBeginRegex(d),re=this.rules.other.headingBeginRegex(d),ze=this.rules.other.htmlBeginRegex(d),Ae=this.rules.other.blockquoteBeginRegex(d);for(;r;){let H=r.split(`
25
+ `,1)[0],I;if(k=H,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),I=k):I=k.replace(this.rules.other.tabCharGlobal," "),te.test(k)||re.test(k)||ze.test(k)||Ae.test(k)||w.test(k)||L.test(k))break;if(I.search(this.rules.other.nonSpaceChar)>=d||!k.trim())h+=`
26
26
  `+I.slice(d);else{if(x||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||te.test(p)||re.test(p)||L.test(p))break;h+=`
27
- `+g}x=!g.trim(),c+=H+`
28
- `,r=r.substring(H.length+1),p=I.slice(d)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0)),n.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),n.raw+=c}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let o of n.items){this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]);let c=o.tokens[0];if(o.task&&(c?.type==="text"||c?.type==="paragraph")){o.text=o.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(o.raw);if(h){let p={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};o.checked=p.checked,n.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=p.raw+o.tokens[0].raw,o.tokens[0].text=p.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(p)):o.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):o.tokens.unshift(p)}}else o.task&&(o.task=!1);if(!n.loose){let h=o.tokens.filter(g=>g.type==="space"),p=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));n.loose=p}}if(n.loose)for(let o of n.items){o.loose=!0;for(let c of o.tokens)c.type==="text"&&(c.type="paragraph")}return n}}html(r){let e=this.rules.block.html.exec(r);if(e){let t=de(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:S(e[0],`
27
+ `+k}x=!k.trim(),c+=H+`
28
+ `,r=r.substring(H.length+1),p=I.slice(d)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0)),n.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),n.raw+=c}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let o of n.items)if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),!n.loose){let c=o.tokens.filter(p=>p.type==="space"),h=c.length>0&&c.some(p=>this.rules.other.anyLine.test(p.raw));n.loose=h}for(let o of n.items){let c=o.tokens[0];if(o.task&&(c?.type==="text"||c?.type==="paragraph")){o.text=o.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(o.raw);if(h){let p={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};o.checked=p.checked,n.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=p.raw+o.tokens[0].raw,o.tokens[0].text=p.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(p)):o.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):o.tokens.unshift(p)}}else o.task&&(o.task=!1)}if(n.loose)for(let o of n.items){o.loose=!0;for(let c of o.tokens)c.type==="text"&&(c.type="paragraph")}return n}}html(r){let e=this.rules.block.html.exec(r);if(e){let t=de(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:S(e[0],`
29
29
  `),href:s,title:n}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ke(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
30
  `):[],i={type:"table",raw:S(e[0],`
31
31
  `),header:[],align:[],rows:[]};if(t.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of n)i.rows.push(ke(a,i.header.length).map((l,o)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[o]})));return i}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e){let t=e[1].trim();return{type:"heading",raw:S(e[0],`
32
32
  `),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
33
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=S(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=$t(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],n=i[3])}else n=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),fe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return fe(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,i,a,l=n,o=0,c=s[0][0],h=t===c,p=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*r.length+n);(s=p.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(a=[...i].length,s[3]||s[4]){l+=a;continue}else if(s[5]||s[6]){if(n%3&&!((n+a)%3)){o+=a;continue}if(h)break}if(l-=a,l>0)continue;a=Math.min(a,a+l+o);let g=[...s[0]][0].length,x=r.slice(0,n+s.index+g+a);if(Math.min(n,a)%2){let w=x.slice(1,-1);return{type:"em",raw:x,text:w,tokens:this.lexer.inlineTokens(w)}}let d=x.slice(2,-2);return{type:"strong",raw:x,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,t=""){let s=this.rules.inline.delLDelim.exec(r);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,i,a,l=n,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*r.length+n);(s=o.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(a=[...i].length,a!==n))continue;if(s[3]||s[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let c=[...s[0]][0].length,h=r.slice(0,n+s.index+c+a),p=h.slice(n,-n);return{type:"del",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},b=class N{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||z,this.options.tokenizer=this.options.tokenizer||new Z,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 t={other:f,block:q.normal,inline:v.normal};this.options.pedantic?(t.block=q.pedantic,t.inline=v.pedantic):this.options.gfm&&(t.block=q.gfm,this.options.breaks?t.inline=v.breaks:t.inline=v.gfm),this.tokenizer.rules=t}static get rules(){return{block:q,inline:v}}static lex(e,t){return new N(t).lex(e)}static lexInline(e,t){return new N(t).inlineTokens(e)}lex(e){e=e.replace(f.carriageReturn,`
33
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=S(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=$t(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],n=i[3])}else n=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),fe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return fe(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,i,a,l=n,o=0,c=s[0][0],h=t===c,p=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*r.length+n);(s=p.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(a=[...i].length,s[3]||s[4]){l+=a;continue}else if(s[5]||s[6]){if(n%3&&!((n+a)%3)){o+=a;continue}if(h)break}if(l-=a,l>0)continue;a=Math.min(a,a+l+o);let k=[...s[0]][0].length,x=r.slice(0,n+s.index+k+a);if(Math.min(n,a)%2){let w=x.slice(1,-1);return{type:"em",raw:x,text:w,tokens:this.lexer.inlineTokens(w)}}let d=x.slice(2,-2);return{type:"strong",raw:x,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,t=""){let s=this.rules.inline.delLDelim.exec(r);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,i,a,l=n,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*r.length+n);(s=o.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(a=[...i].length,a!==n))continue;if(s[3]||s[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let c=[...s[0]][0].length,h=r.slice(0,n+s.index+c+a),p=h.slice(n,-n);return{type:"del",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},b=class N{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||z,this.options.tokenizer=this.options.tokenizer||new Z,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 t={other:f,block:q.normal,inline:v.normal};this.options.pedantic?(t.block=q.pedantic,t.inline=v.pedantic):this.options.gfm&&(t.block=q.gfm,this.options.breaks?t.inline=v.breaks:t.inline=v.gfm),this.tokenizer.rules=t}static get rules(){return{block:q,inline:v}}static lex(e,t){return new N(t).lex(e)}static lexInline(e,t){return new N(t).inlineTokens(e)}lex(e){e=e.replace(f.carriageReturn,`
34
34
  `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(f.tabCharGlobal," ").replace(f.spaceLine,""));let n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(l=>(i=l.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let l=t.at(-1);i.raw.length===1&&l!==void 0?l.raw+=`
35
35
  `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
36
36
  `)?"":`
@@ -44,7 +44,7 @@ ${d}`,n=n.substring(0,n.length-x.text.length)+L.text;break}else if(g?.type==="li
44
44
  `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(i),s=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let l=t.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
45
45
  `)?"":`
46
46
  `)+i.raw,l.text+=`
47
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e;if(this.tokens.links){let l=Object.keys(this.tokens.links);l.length>0&&(s=s.replace(this.tokenizer.rules.inline.reflinkSearch,o=>l.includes(o.slice(o.lastIndexOf("[")+1,-1))?"["+"a".repeat(o.length-2)+"]":o))}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),s=s.replace(this.tokenizer.rules.inline.blockSkip,(l,o,c)=>{let h=c?c.length:0;return l.slice(0,h)+"["+"a".repeat(l.length-h-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let n=!1,i="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(i=""),n=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=t.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,s,i)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,s,i)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let o=e;if(this.options.extensions?.startInline){let c=1/0,h=e.slice(1),p;this.options.extensions.startInline.forEach(g=>{p=g.call({lexer:this},h),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(o=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(o)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(i=l.raw.slice(-1)),n=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},M=class{options;parser;constructor(r){this.options=r||z}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(f.notSpaceStart)?.[0],n=r.replace(f.endingNewline,"")+`
47
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e;if(this.tokens.links){let l=Object.keys(this.tokens.links);l.length>0&&(s=s.replace(this.tokenizer.rules.inline.reflinkSearch,o=>l.includes(o.slice(o.lastIndexOf("[")+1,-1))?"["+"a".repeat(o.length-2)+"]":o))}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,l=>"+".repeat(l.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(l,o,c)=>{let h=c?c.length:0;return l.slice(0,h)+"["+"a".repeat(l.length-h-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let n=!1,i="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(i=""),n=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=t.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,s,i)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,s,i)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let o=e;if(this.options.extensions?.startInline){let c=1/0,h=e.slice(1),p;this.options.extensions.startInline.forEach(k=>{p=k.call({lexer:this},h),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(o=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(o)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(i=l.raw.slice(-1)),n=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},M=class{options;parser;constructor(r){this.options=r||z}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(f.notSpaceStart)?.[0],n=r.replace(f.endingNewline,"")+`
48
48
  `;return s?'<pre><code class="language-'+$(s)+'">'+(t?n:$(n,!0))+`</code></pre>
49
49
  `:"<pre><code>"+(t?n:$(n,!0))+`</code></pre>
50
50
  `}blockquote({tokens:r}){return`<blockquote>
@@ -63,4 +63,4 @@ ${this.parser.parse(r)}</blockquote>
63
63
  ${r}</tr>
64
64
  `}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
65
65
  `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${$(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),n=ge(r);if(n===null)return s;r=n;let i='<a href="'+r+'"';return e&&(i+=' title="'+$(e)+'"'),i+=">"+s+"</a>",i}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=ge(r);if(n===null)return $(t);r=n;let i=`<img src="${r}" alt="${$(t)}"`;return e&&(i+=` title="${$(e)}"`),i+=">",i}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:$(r.text)}},Y=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},m=class G{options;renderer;textRenderer;constructor(e){this.options=e||z,this.options.renderer=this.options.renderer||new M,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Y}static parse(e,t){return new G(t).parse(e)}static parseInline(e,t){return new G(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=n,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){t+=l||"";continue}}let i=n;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}let a=i;switch(a.type){case"escape":{s+=t.text(a);break}case"html":{s+=t.html(a);break}case"link":{s+=t.link(a);break}case"image":{s+=t.image(a);break}case"checkbox":{s+=t.checkbox(a);break}case"strong":{s+=t.strong(a);break}case"em":{s+=t.em(a);break}case"codespan":{s+=t.codespan(a);break}case"br":{s+=t.br(a);break}case"del":{s+=t.del(a);break}case"text":{s+=t.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},C=class{options;block;constructor(r){this.options=r||z}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?b.lex:b.lexInline}provideParser(r=this.block){return r?m.parse:m.parseInline}},Rt=class{defaults=X();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=m;Renderer=M;TextRenderer=Y;Lexer=b;Tokenizer=Z;Hooks=C;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let n=s;for(let i of n.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of n.rows)for(let a of i)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let n=s;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(i=>{let a=n[i].flat(1/0);t=t.concat(this.walkTokens(a,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let i=e.renderers[n.name];i?e.renderers[n.name]=function(...a){let l=n.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[n.level];i?i.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new M(this.defaults);for(let i in t.renderer){if(!(i in n))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=t.renderer[a],o=n[a];n[a]=(...c)=>{let h=l.apply(n,c);return h===!1&&(h=o.apply(n,c)),h||""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new Z(this.defaults);for(let i in t.tokenizer){if(!(i in n))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=t.tokenizer[a],o=n[a];n[a]=(...c)=>{let h=l.apply(n,c);return h===!1&&(h=o.apply(n,c)),h}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new C;for(let i in t.hooks){if(!(i in n))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=t.hooks[a],o=n[a];C.passThroughHooks.has(i)?n[a]=c=>{if(this.defaults.async&&C.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await l.call(n,c);return o.call(n,p)})();let h=l.call(n,c);return o.call(n,h)}:n[a]=(...c)=>{if(this.defaults.async)return(async()=>{let p=await l.apply(n,c);return p===!1&&(p=await o.apply(n,c)),p})();let h=l.apply(n,c);return h===!1&&(h=o.apply(n,c)),h}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),n&&(l=l.concat(n.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return b.lex(r,e??this.defaults)}parser(r,e){return m.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},i=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return i(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 e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=r),n.async)return(async()=>{let a=n.hooks?await n.hooks.preprocess(e):e,l=await(n.hooks?await n.hooks.provideLexer(r):r?b.lex:b.lexInline)(a,n),o=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(o,n.walkTokens));let c=await(n.hooks?await n.hooks.provideParser(r):r?m.parse:m.parseInline)(o,n);return n.hooks?await n.hooks.postprocess(c):c})().catch(i);try{n.hooks&&(e=n.hooks.preprocess(e));let a=(n.hooks?n.hooks.provideLexer(r):r?b.lex:b.lexInline)(e,n);n.hooks&&(a=n.hooks.processAllTokens(a)),n.walkTokens&&this.walkTokens(a,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(r):r?m.parse:m.parseInline)(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(r,e){return t=>{if(t.message+=`
66
- Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+$(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},_=new Rt;function k(r,e){return _.parse(r,e)}k.options=k.setOptions=function(r){return _.setOptions(r),k.defaults=_.defaults,xe(k.defaults),k};k.getDefaults=X;k.defaults=z;function Tt(...r){return _.use(...r),k.defaults=_.defaults,xe(k.defaults),k}k.use=Tt;k.walkTokens=function(r,e){return _.walkTokens(r,e)};k.parseInline=_.parseInline;k.Parser=m;k.parser=m.parse;k.Renderer=M;k.TextRenderer=Y;k.Lexer=b;k.lexer=b.lex;k.Tokenizer=Z;k.Hooks=C;k.parse=k;var At=k.options,Pt=k.setOptions,Lt=k.walkTokens,It=k.parseInline;var vt=m.parse,Ct=b.lex;var _t=ne`.interrupt-container{display:flex;flex-direction:column;gap:.75rem}.interrupt-actions{display:flex;justify-content:flex-end;gap:.5rem}.interrupt-message{white-space:normal}.interrupt-message :where(p){margin:0}.interrupt-message :where(ul,ol){margin:0;padding-inline-start:1.25rem}`;k.use({gfm:!0,breaks:!0,async:!1});var zt=new oe,ee=class extends se{constructor(){super(...arguments),this.#e=[],this._messages=ae({blocking:!0}),this.arcgisCancel=j(),this.arcgisSubmit=j()}static{this.properties={type:1,message:1,options:0}}static{this.styles=_t}#e;_renderMessageContent(){let e=this.message??"",t=k.parse(e,{async:!1});return zt.sanitize(t)}_renderInterruptInput(){let{_messages:e,type:t,options:s}=this;switch(t){case"single-select":return R`<calcite-list class="interrupt-list" .label=${e.singleSelectLabel} selection-mode=single-persist @calciteListChange=${n=>this.#e=n.target.selectedItems[0]?.value}>${s?.map(n=>R`<calcite-list-item .label=${n} .value=${n}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return R`<calcite-list class="interrupt-list" .label=${e.multiSelectLabel} selection-mode=multiple @calciteListChange=${n=>this.#e=n.target.selectedItems.map(i=>i.value)}>${s?.map(n=>R`<calcite-list-item .label=${n} .value=${n}></calcite-list-item>`)}</calcite-list>`;case"text-input":return R`<calcite-input class="interrupt-input" .label=${e.textInputLabel} @calciteInputInput=${n=>this.#e=n.target.value}></calcite-input>`;case"boolean-choice":return null;default:return le(t)}}render(){let{_messages:e,type:t}=this,s=t==="boolean-choice";return R`<div class="interrupt-container"><calcite-notice open kind=neutral width=full><div slot=title>${s?e.titleConfirm:e.titleInput}</div><div slot=message class="interrupt-message">${ce(this._renderMessageContent())}</div></calcite-notice>${this._renderInterruptInput()}<div class="interrupt-actions"><calcite-button appearance=outline @click=${()=>this.arcgisCancel.emit()}>${s?e.cancelButton:e.skipButton}</calcite-button><calcite-button appearance=solid @click=${()=>this.arcgisSubmit.emit(t==="boolean-choice"?!0:this.#e)}>${s?e.confirmButton:e.submitButton}</calcite-button></div></div>`}};ie("arcgis-portal-ai-assistant-interrupt",ee);export{ee as ArcgisPortalAiAssistantInterrupt};
66
+ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+$(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},_=new Rt;function g(r,e){return _.parse(r,e)}g.options=g.setOptions=function(r){return _.setOptions(r),g.defaults=_.defaults,xe(g.defaults),g};g.getDefaults=X;g.defaults=z;function Tt(...r){return _.use(...r),g.defaults=_.defaults,xe(g.defaults),g}g.use=Tt;g.walkTokens=function(r,e){return _.walkTokens(r,e)};g.parseInline=_.parseInline;g.Parser=m;g.parser=m.parse;g.Renderer=M;g.TextRenderer=Y;g.Lexer=b;g.lexer=b.lex;g.Tokenizer=Z;g.Hooks=C;g.parse=g;var At=g.options,Pt=g.setOptions,Lt=g.walkTokens,It=g.parseInline;var vt=m.parse,Ct=b.lex;var _t=ne`.interrupt-container{display:flex;flex-direction:column;gap:.75rem}.interrupt-actions{display:flex;justify-content:flex-end;gap:.5rem}.interrupt-message{white-space:normal}.interrupt-message :where(p){margin:0}.interrupt-message :where(ul,ol){margin:0;padding-inline-start:1.25rem}`;g.use({gfm:!0,breaks:!0,async:!1});var zt=new oe,ee=class extends se{constructor(){super(...arguments),this.#e=[],this._messages=ae({blocking:!0}),this.arcgisCancel=j(),this.arcgisSubmit=j()}static{this.properties={type:1,message:1,options:0}}static{this.styles=_t}#e;_renderMessageContent(){let e=this.message??"",t=g.parse(e,{async:!1});return zt.sanitize(t)}_renderInterruptInput(){let{_messages:e,type:t,options:s}=this;switch(t){case"single-select":return R`<calcite-list class="interrupt-list" .label=${e.singleSelectLabel} selection-mode=single-persist @calciteListChange=${n=>this.#e=n.target.selectedItems[0]?.value}>${s?.map(n=>R`<calcite-list-item .label=${n} .value=${n}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return R`<calcite-list class="interrupt-list" .label=${e.multiSelectLabel} selection-mode=multiple @calciteListChange=${n=>this.#e=n.target.selectedItems.map(i=>i.value)}>${s?.map(n=>R`<calcite-list-item .label=${n} .value=${n}></calcite-list-item>`)}</calcite-list>`;case"text-input":return R`<calcite-input class="interrupt-input" .label=${e.textInputLabel} @calciteInputInput=${n=>this.#e=n.target.value}></calcite-input>`;case"boolean-choice":return null;default:return le(t)}}render(){let{_messages:e,type:t}=this,s=t==="boolean-choice";return R`<div class="interrupt-container"><calcite-notice open kind=neutral width=full><div slot=title>${s?e.titleConfirm:e.titleInput}</div><div slot=message class="interrupt-message">${ce(this._renderMessageContent())}</div></calcite-notice>${this._renderInterruptInput()}<div class="interrupt-actions"><calcite-button appearance=outline @click=${()=>this.arcgisCancel.emit()}>${s?e.cancelButton:e.skipButton}</calcite-button><calcite-button appearance=solid @click=${()=>this.arcgisSubmit.emit(t==="boolean-choice"?!0:this.#e)}>${s?e.confirmButton:e.submitButton}</calcite-button></div></div>`}};ie("arcgis-portal-ai-assistant-interrupt",ee);export{ee as ArcgisPortalAiAssistantInterrupt};