@techdocs/cli 1.4.2-next.1 → 1.4.2

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,508 +0,0 @@
1
- (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(jt,De,r){"use strict";r.d(De,{n3:function(){return g},MS:function(){return me}});var t=r(87612),h=r(25271),H=r(23054),f=r(96279),W=r.n(f);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function u(ue){return!ue.cursor}function B(ue){return!u(ue)}class me{async getEntityAncestors(V,K){const{kind:I,namespace:w,name:se}=(0,h.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(se)}/ancestry`,K)}async getLocationById(V,K){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,K)}async getEntities(V,K){const{filter:I=[],fields:w=[],order:se,offset:_,limit:te,after:$}=V!=null?V:{},T=this.getParams(I);if(w.length&&T.push(`fields=${w.map(encodeURIComponent).join(",")}`),se)for(const oe of[se].flat())oe&&T.push(`order=${encodeURIComponent(oe.order)}:${encodeURIComponent(oe.field)}`);_!==void 0&&T.push(`offset=${_}`),te!==void 0&&T.push(`limit=${te}`),$!==void 0&&T.push(`after=${encodeURIComponent($)}`);const P=T.length?`?${T.join("&")}`:"",L=await this.requestRequired("GET",`/entities${P}`,K),k=(oe,ke)=>{var We,z;if(((We=oe.metadata)===null||We===void 0?void 0:We.name)===void 0||oe.kind===void 0||((z=ke.metadata)===null||z===void 0?void 0:z.name)===void 0||ke.kind===void 0)return 0;const xt=(0,h.eE)(oe),ot=(0,h.eE)(ke);return xt<ot?-1:xt>ot?1:0};return{items:L.sort(k)}}async getEntitiesByRefs(V,K){var I;const w={entityRefs:V.entityRefs};!((I=V.fields)===null||I===void 0)&&I.length&&(w.fields=V.fields);const _=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,te=await this.fetchApi.fetch(_,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify(w)});if(!te.ok)throw await H.VL.fromResponse(te);const{items:$}=await te.json();return{items:$.map(T=>T!=null?T:void 0)}}async queryEntities(V={},K){const I=[];if(u(V)){var w,se;const{fields:te=[],filter:$,limit:T,orderFields:P,fullTextFilter:L}=V;I.push(...this.getParams($)),T!==void 0&&I.push(`limit=${T}`),P!==void 0&&(Array.isArray(P)?P:[P]).forEach(({field:oe,order:ke})=>I.push(`orderField=${oe},${ke}`)),te.length&&I.push(`fields=${te.map(encodeURIComponent).join(",")}`);const k=L==null||(w=L.term)===null||w===void 0?void 0:w.trim();k&&I.push(`fullTextFilterTerm=${k}`),!(L==null||(se=L.fields)===null||se===void 0)&&se.length&&I.push(`fullTextFilterFields=${L.fields.join(",")}`)}else{const{fields:te=[],limit:$,cursor:T}=V;I.push(`cursor=${T}`),$!==void 0&&I.push(`limit=${$}`),te.length&&I.push(`fields=${te.map(encodeURIComponent).join(",")}`)}const _=I.length?`?${I.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${_}`,K)}async getEntityByRef(V,K){const{kind:I,namespace:w,name:se}=(0,h.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(se)}`,K)}async getEntityByName(V,K){const{kind:I,namespace:w="default",name:se}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(se)}`,K)}async refreshEntity(V,K){const I=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify({entityRef:V})});if(I.status!==200)throw new Error(await I.text())}async getEntityFacets(V,K){const{filter:I=[],facets:w}=V,se=this.getParams(I);for(const te of w)se.push(`facet=${encodeURIComponent(te)}`);const _=se.length?`?${se.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${_}`,K)}async addLocation(V,K){const{type:I="url",target:w,dryRun:se}=V,_=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${se?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify({type:I,target:w})});if(_.status!==201)throw new Error(await _.text());const{location:te,entities:$,exists:T}=await _.json();if(!te)throw new Error(`Location wasn't added: ${w}`);return{location:te,entities:$,exists:T}}async getLocationByRef(V,K){return(await this.requestRequired("GET","/locations",K)).map(w=>w.data).find(w=>V===(0,h.NZ)(w))}async removeLocationById(V,K){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,K)}async removeEntityByUid(V,K){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,K)}async validateEntity(V,K,I){const w=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(I==null?void 0:I.token)&&{Authorization:`Bearer ${I==null?void 0:I.token}`}},method:"POST",body:JSON.stringify({entity:V,location:K})});if(w.ok)return{valid:!0};if(w.status!==400)throw await H.VL.fromResponse(w);const{errors:se=[]}=await w.json();return{valid:!1,errors:se}}async requestIgnored(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,se=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},_=await this.fetchApi.fetch(w,{method:V,headers:se});if(!_.ok)throw await H.VL.fromResponse(_)}async requestRequired(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,se=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},_=await this.fetchApi.fetch(w,{method:V,headers:se});if(!_.ok)throw await H.VL.fromResponse(_);return _.json()}async requestOptional(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,se=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},_=await this.fetchApi.fetch(w,{method:V,headers:se});if(!_.ok){if(_.status===404)return;throw await H.VL.fromResponse(_)}return await _.json()}getParams(V=[]){const K=[];for(const I of[V].flat()){const w=[];for(const[se,_]of Object.entries(I))for(const te of[_].flat())te===g?w.push(encodeURIComponent(se)):typeof te=="string"&&w.push(`${encodeURIComponent(se)}=${encodeURIComponent(te)}`);w.length&&K.push(`filter=${w.join(",")}`)}return K}constructor(V){(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:W()}}}},25271:function(jt,De,r){"use strict";r.d(De,{Tf:function(){return H},P1:function(){return dn},q1:function(){return Tn},M6:function(){return we},l2:function(){return h},zG:function(){return t},w$:function(){return Ln},nP:function(){return mn},aS:function(){return Kn},S4:function(){return $t},cz:function(){return ft},iB:function(){return Ct},CV:function(){return _e},of:function(){return Tt},Ou:function(){return Be},eE:function(){return bt},NZ:function(){return ze}});const t="default",h="backstage.io/view-url",H="backstage.io/edit-url",f="kubernetes.io/api-server",W="kubernetes.io/api-server-certificate-authority",g="kubernetes.io/auth-provider";var u=r(76635),B=r.n(u);class me{async enforce(Z){return Z.metadata.namespace?Z:lodash.merge({metadata:{namespace:this.namespace}},Z)}constructor(Z=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=Z}}class ue{static isValidPrefixAndOrSuffix(Z,pe,Ze,Xe){if(typeof Z!="string")return!1;const lt=Z.split(pe);return lt.length===1?Xe(lt[0]):lt.length===2?Ze(lt[0])&&Xe(lt[1]):!1}static isJsonSafe(Z){try{return B().isEqual(Z,JSON.parse(JSON.stringify(Z)))}catch{return!1}}static isValidDnsSubdomain(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=253&&Z.split(".").every(ue.isValidDnsLabel)}static isValidDnsLabel(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(Z)}static isValidTag(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(Z)}static isValidUrl(Z){if(typeof Z!="string")return!1;try{return new URL(Z),!0}catch{return!1}}static isValidString(Z){var pe;return typeof Z=="string"&&((pe=Z==null?void 0:Z.trim())===null||pe===void 0?void 0:pe.length)>=1}static isNonEmptyString(Z){var pe;return typeof Z=="string"&&((pe=Z==null?void 0:Z.trim())===null||pe===void 0?void 0:pe.length)>=1}}var V=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),K=r(27991),I=r.n(K),w=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),se=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),_=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const te=new Map,$=[V,w,se,_];function T(ne){if(!(ne!=null&&ne.length))throw new TypeError("Unknown error");const Z=ne[0];throw new TypeError(`${Z.instancePath||"<root>"} ${Z.message}${Z.params?` - ${Object.entries(Z.params).map(([pe,Ze])=>`${pe}: ${Ze}`).join(", ")}`:""}`)}function P(ne,Z={}){var pe;const Ze=(pe=Z==null?void 0:Z.disableCache)!==null&&pe!==void 0?pe:!1,Xe=Ze?"":JSON.stringify(ne);if(!Ze){const X=te.get(Xe);if(X)return X}const lt=L(ne),kt=new(I())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});lt.length&&kt.addSchema(lt,void 0,void 0,!0);const Ut=kt.compile(ne);return Ze||te.set(Xe,Ut),Ut}function L(ne){if(typeof ne!="object")return[];const Z=new Set;ne.$id&&Z.add(ne.$id);const pe=new Array,Ze=[ne];for(;Ze.length;){const Xe=Ze.pop();for(const lt of k(Xe))if(!Z.has(lt)){Z.add(lt);const kt=$.find(Ut=>Ut.$id===lt);kt&&(pe.push(kt),Ze.push(kt))}}return pe}function*k(ne){const Z=[ne];for(;Z.length;){const pe=Z.pop();if(typeof pe=="object"&&pe)for(const[Ze,Xe]of Object.entries(pe))Ze==="$ref"&&typeof Xe=="string"?yield Xe.split("#")[0]:Z.push(Xe)}}function oe(ne){const Z=compileAjvSchema(ne||entityEnvelopeSchema);return pe=>{if(Z(pe)===!0)return pe;throw throwAjvError(Z.errors)}}function ke(ne){const Z=P(ne);return pe=>{var Ze;if(Z(pe)===!0)return pe;const lt=(Ze=Z.errors)===null||Ze===void 0?void 0:Ze.filter(kt=>["/kind","/apiVersion"].includes(kt.instancePath));if(lt!=null&&lt.length&&lt.every(kt=>kt.keyword==="enum"))return!1;throw T(Z.errors)}}function We(ne){const Z=compileAjvSchema(ne||entitySchema);return pe=>{if(Z(pe)===!0)return pe;throw throwAjvError(Z.errors)}}class z{static isValidApiVersion(Z){return ue.isValidPrefixAndOrSuffix(Z,"/",ue.isValidDnsSubdomain,pe=>pe.length>=1&&pe.length<=63&&/^[a-z0-9A-Z]+$/.test(pe))}static isValidKind(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(Z)}static isValidObjectName(Z){return typeof Z=="string"&&Z.length>=1&&Z.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(Z)}static isValidNamespace(Z){return ue.isValidDnsLabel(Z)}static isValidLabelKey(Z){return ue.isValidPrefixAndOrSuffix(Z,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidLabelValue(Z){return Z===""||z.isValidObjectName(Z)}static isValidAnnotationKey(Z){return ue.isValidPrefixAndOrSuffix(Z,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidAnnotationValue(Z){return typeof Z=="string"}}const xt={isValidApiVersion:z.isValidApiVersion,isValidKind:z.isValidKind,isValidEntityName:z.isValidObjectName,isValidNamespace:z.isValidNamespace,isValidLabelKey:z.isValidLabelKey,isValidLabelValue:z.isValidLabelValue,isValidAnnotationKey:z.isValidAnnotationKey,isValidAnnotationValue:z.isValidAnnotationValue,isValidTag:ne=>typeof ne=="string"&&ne.length>=1&&ne.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ne)};function ot(ne={}){return{...xt,...ne}}class Ye{async enforce(Z){function pe(Ce,y,U){if(y==null)throw new Error(`${Ce} must have a value`);let re;try{re=U(y)}catch(q){throw new Error(`${Ce} could not be validated, ${q}`)}if(!re){let q;switch(U.name){case"isValidLabelValue":case"isValidObjectName":q="a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total";break;case"isValidLabelKey":case"isValidApiVersion":case"isValidAnnotationKey":q="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":q="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":q="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":q="a string";break;case"isValidKind":q="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":q="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":q="a non empty string";break;default:q=void 0;break}const Ae=q?` expected ${q} but found "${y}".`:"";throw new Error(`"${Ce}" is not valid;${Ae} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function Ze(Ce,y,U){return y===void 0||pe(Ce,y,U)}pe("apiVersion",Z.apiVersion,this.validators.isValidApiVersion),pe("kind",Z.kind,this.validators.isValidKind),pe("metadata.name",Z.metadata.name,this.validators.isValidEntityName),Ze("metadata.namespace",Z.metadata.namespace,this.validators.isValidNamespace);var Xe;for(const[Ce,y]of Object.entries((Xe=Z.metadata.labels)!==null&&Xe!==void 0?Xe:[]))pe(`labels.${Ce}`,Ce,this.validators.isValidLabelKey),pe(`labels.${Ce}`,y,this.validators.isValidLabelValue);var lt;for(const[Ce,y]of Object.entries((lt=Z.metadata.annotations)!==null&&lt!==void 0?lt:[]))pe(`annotations.${Ce}`,Ce,this.validators.isValidAnnotationKey),pe(`annotations.${Ce}`,y,this.validators.isValidAnnotationValue);var kt;const Ut=(kt=Z.metadata.tags)!==null&&kt!==void 0?kt:[];for(let Ce=0;Ce<Ut.length;++Ce)pe(`tags.${Ce}`,Ut[Ce],this.validators.isValidTag);var X;const Y=(X=Z.metadata.links)!==null&&X!==void 0?X:[];for(let Ce=0;Ce<Y.length;++Ce){var le,ce,ye;pe(`links.${Ce}.url`,(le=Y[Ce])===null||le===void 0?void 0:le.url,CommonValidatorFunctions.isValidUrl),Ze(`links.${Ce}.title`,(ce=Y[Ce])===null||ce===void 0?void 0:ce.title,CommonValidatorFunctions.isNonEmptyString),Ze(`links.${Ce}.icon`,(ye=Y[Ce])===null||ye===void 0?void 0:ye.icon,KubernetesValidatorFunctions.isValidObjectName)}return Z}constructor(Z=makeValidator()){_define_property(this,"validators",void 0),this.validators=Z}}class st{async enforce(Z){if(!this.validate){const Xe=new Ajv({allowUnionTypes:!0});this.validate=Xe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(Z)===!0)return Z;const[Ze]=this.validate.errors||[];throw Ze?new Error(`Malformed envelope, ${Ze.instancePath||"<root>"} ${Ze.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Qe(ne){let Z=ne.indexOf(":");const pe=ne.indexOf("/");pe!==-1&&pe<Z&&(Z=-1);const Ze=Z===-1?void 0:ne.slice(0,Z),Xe=pe===-1?void 0:ne.slice(Z+1,pe),lt=ne.slice(Math.max(Z+1,pe+1));if(Ze===""||Xe===""||lt==="")throw new TypeError(`Entity reference "${ne}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ze,namespace:Xe,name:lt}}function Ct(ne){return{kind:ne.kind,namespace:ne.metadata.namespace||t,name:ne.metadata.name}}function Tt(ne,Z){if(!ne)throw new Error("Entity reference must not be empty");const pe=Z==null?void 0:Z.defaultKind,Ze=(Z==null?void 0:Z.defaultNamespace)||t;let Xe,lt,kt;if(typeof ne=="string"){const ce=Qe(ne);var Ut;Xe=(Ut=ce.kind)!==null&&Ut!==void 0?Ut:pe;var X;lt=(X=ce.namespace)!==null&&X!==void 0?X:Ze,kt=ce.name}else{var Y;Xe=(Y=ne.kind)!==null&&Y!==void 0?Y:pe;var le;lt=(le=ne.namespace)!==null&&le!==void 0?le:Ze,kt=ne.name}if(Xe)if(lt){if(!kt){const ce=JSON.stringify(ne);throw new Error(`Entity reference ${ce} had missing or empty name`)}}else{const ce=JSON.stringify(ne);throw new Error(`Entity reference ${ce} had missing or empty namespace`)}else{const ce=JSON.stringify(ne);throw new Error(`Entity reference ${ce} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Xe,namespace:lt,name:kt}}function bt(ne){let Z,pe,Ze;if("metadata"in ne){Z=ne.kind;var Xe;pe=(Xe=ne.metadata.namespace)!==null&&Xe!==void 0?Xe:t,Ze=ne.metadata.name}else{Z=ne.kind;var lt;pe=(lt=ne.namespace)!==null&&lt!==void 0?lt:t,Ze=ne.name}return`${Z.toLocaleLowerCase("en-US")}:${pe.toLocaleLowerCase("en-US")}/${Ze.toLocaleLowerCase("en-US")}`}var it=r(87612);class Pt{async enforce(Z){let pe=Z;for(const Ze of this.policies){const Xe=await Ze.enforce(pe);if(!Xe)throw new Error(`Policy ${Ze.constructor.name} did not return a result`);pe=Xe}return pe}constructor(Z){(0,it._)(this,"policies",void 0),this.policies=Z}}class Nt{async enforce(Z){for(const pe of this.policies){const Ze=await pe.enforce(Z);if(Ze)return Ze}throw new Error("The entity did not match any known policy")}constructor(Z){(0,it._)(this,"policies",void 0),this.policies=Z}}const Ge={allOf(ne){return new Pt(ne)},oneOf(ne){return new Nt(ne)}};var Qt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function ge(ne){let Z;return{async check(pe){return Z||(Z=ke(ne)),Z(pe)===pe}}}const Se=ge(Qt);var Ue=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const nt=ge(Ue);var yt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const gt=ge(yt);var pt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Bt=ge(pt);var Mt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const Kt=ge(Mt),$t="ownedBy",Xt="ownerOf",qt="consumesApi",gn="apiConsumedBy",Mn="providesApi",Pn="apiProvidedBy",mn="dependsOn",Ln="dependencyOf",kn="parentOf",_t="childOf",jn="memberOf",zn="hasMember",ft="partOf",Kn="hasPart";var Rt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ResourceV1alpha1","description":"A resource describes the infrastructure a system needs to operate, like BigTable databases, Pub/Sub topics, S3 buckets or CDNs. Modelling them together with components and systems allows to visualize resource footprint, and create tooling around them.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Resource","metadata":{"name":"artists-db","description":"Stores artist details"},"spec":{"type":"database","owner":"artist-relations-team","system":"artist-engagement-portal"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Resource"]},"spec":{"type":"object","required":["type","owner"],"properties":{"type":{"type":"string","description":"The type of resource.","examples":["database","s3-bucket","cluster"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the resource.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"dependsOn":{"type":"array","description":"An array of references to other entities that the resource depends on to function.","items":{"type":"string","minLength":1}},"system":{"type":"string","description":"An entity reference to the system that the resource belongs to.","minLength":1}}}}}]}');const at=ge(Rt);var xn=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const Gt=ge(xn);var an=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const En=ge(an),dn="backstage.io/managed-by-location",Tn="backstage.io/managed-by-origin-location",we="backstage.io/source-location",ae=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function Be(ne){if(typeof ne!="string")throw new TypeError(`Unable to parse location ref '${ne}', unexpected argument ${typeof ne}`);const Z=ne.indexOf(":");if(Z<0)throw new TypeError(`Unable to parse location ref '${ne}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const pe=ne.substring(0,Z).trim(),Ze=ne.substring(Z+1).trim();if(!pe||!Ze)throw new TypeError(`Unable to parse location ref '${ne}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(pe==="http"||pe==="https")throw new TypeError(`Invalid location ref '${ne}', please prefix it with 'url:', e.g. 'url:${ne}'`);if(ae.test(Ze))throw new TypeError(`Invalid location ref '${ne}', target is a javascript: URL`);return{type:pe,target:Ze}}function ze(ne){const{type:Z,target:pe}=ne;if(Z){if(!pe)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(ae.test(pe))throw new TypeError(`Invalid location ref '${Z}:${pe}', target is a javascript: URL`);return`${Z}:${pe}`}function _e(ne){var Z,pe,Ze,Xe,lt;const kt=(lt=(Z=ne.metadata)===null||Z===void 0||(pe=Z.annotations)===null||pe===void 0?void 0:pe[we])!==null&&lt!==void 0?lt:(Ze=ne.metadata)===null||Ze===void 0||(Xe=Ze.annotations)===null||Xe===void 0?void 0:Xe[dn];if(!kt)throw new Error(`Entity '${bt(ne)}' is missing location`);return Be(kt)}},15332:function(jt,De,r){"use strict";r.d(De,{r:function(){return L}});var t=r(52322),h=r(60871),H=r(86689),f=r(79692),W=r(90436),g=r(72779),u=r.n(g),B=r(76635),me=r(2784),ue=r(73557),V=r(71597);function K(){const[k]=(0,ue.is)((0,t.jsx)(ue.AW,{index:!0,element:(0,t.jsx)("div",{})}));return!k.index}const I=(0,f.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),w=k=>/^([a-z+.-]+):/.test(k),se=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,_=window.open;if(_&&!_.__backstage){const k=function(...ke){const We=String(ke[0]);if(se.test(We))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return _.apply(this,ke)};k.__backstage=!0,window.open=k}const te=()=>{try{return(0,h.h_)(h.Ds).getOptionalString("app.baseUrl")}catch{return}},$=()=>{const k="http://sample.dev";var oe;const ke=(oe=te())!==null&&oe!==void 0?oe:"/",{pathname:We}=new URL(ke,k);return(0,B.trimEnd)(We,"/")},T=k=>{let oe=String(k);const ke=$(),We=w(oe),z=oe.startsWith(ke);return!We&&!z&&(oe=ke.concat(oe)),oe},P=k=>{if(k instanceof Array)return k.map(P).join(" ").trim();if(typeof k=="object"&&k){var oe;return P(k==null||(oe=k.props)===null||oe===void 0?void 0:oe.children)}return["string","number"].includes(typeof k)?String(k):""},L=me.forwardRef(({onClick:k,noTrack:oe,...ke},We)=>{const z=I(),xt=(0,h.z$)(),ot=K()?T(ke.to):ke.to,Ye=P(ke.children)||ot,st=w(ot),Qe=st&&!!/^https?:/.exec(ot);if(se.test(ot))throw new Error("Link component rejected javascript: URL as a security precaution");const Ct=Tt=>{k==null||k(Tt),oe||xt.captureEvent("click",Ye,{attributes:{to:ot}})};return st?(0,t.jsxs)(H.Z,{...Qe?{target:"_blank",rel:"noopener"}:{},...ke,ref:We,href:ot,onClick:Ct,className:u()(z.externalLink,ke.className),children:[ke.children,(0,t.jsx)(W.Z,{component:"span",className:z.visuallyHidden,children:", Opens in a new window"})]}):(0,t.jsx)(H.Z,{...ke,ref:We,component:V.rU,to:ot,onClick:Ct})})},53974:function(jt,De,r){"use strict";r.d(De,{Oi:function(){return ke},VY:function(){return Ri},yW:function(){return Wa},XF:function(){return ot},mn:function(){return Ln},NX:function(){return Pt},ub:function(){return ae},mf:function(){return Ya},yu:function(){return St},h4:function(){return xa},M6:function(){return c},i9:function(){return sl},aR:function(){return s},rJ:function(){return Er},Oh:function(){return ul},hu:function(){return ll},rU:function(){return ue.r},Qj:function(){return K},nU:function(){return Sr},SA:function(){return or},sk:function(){return lt},Or:function(){return Zr},T3:function(){return ba},g9:function(){return fl},Ex:function(){return ro},Gk:function(){return nn},tn:function(){return p},Ph:function(){return R},YE:function(){return qi},v7:function(){return Si},R6:function(){return Us},tR:function(){return Xi},uw:function(){return be},qt:function(){return js},iA:function(){return ya},GB:function(){return dt},po:function(){return fr},mZ:function(){return Xr},Pf:function(){return Or}});var t=r(52322),h=r(60871),H=r(19928),f=r(2784);function W(e){const[o,l]=useState([]),d=useApi(alertApiRef),{anchorOrigin:m={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,E=v!=null?v:5e3;useEffect(()=>{const F=d.alert$().subscribe(fe=>l(he=>he.concat(fe)));return()=>{F.unsubscribe()}},[d]);const[N]=o;if(useEffect(()=>{if(N&&N.display==="transient"){const F=setTimeout(()=>{l(fe=>{const he=fe.filter(Le=>Le!==N);return he.length===fe.length?fe:he})},E);return()=>clearTimeout(F)}},[N,E]),o.length===0)return null;const G=()=>{l(F=>F.filter(fe=>fe!==N))};return _jsx(Snackbar,{open:!0,anchorOrigin:m,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:N.severity,children:_jsxs(Typography,{component:"span",children:[String(N.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var g=r(79692);const u=(0,g.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function B(e){const{displayName:o,picture:l,customStyles:d}=e,m=u();let v={...d};const E={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return l||(v={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:l,className:m.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:m.avatarText,style:E,children:extractInitials(o)})})}var me=r(77277),ue=r(15332);const V=f.forwardRef((e,o)=>(0,t.jsx)(ue.r,{ref:o,...e,color:"initial"})),K=f.forwardRef((e,o)=>(0,t.jsx)(me.Z,{ref:o,component:V,...e})),I=null;var w=r(95544),se=r(60364),_=r(83229),te=r(26639),$=r(39595),T=r(61837),P=r(80030),L=r(19353),k=r(95074);function oe(e){const{text:o,tooltipDelay:l=1e3,tooltipText:d="Text copied to clipboard","aria-label":m="Copy text"}=e,v=(0,h.h_)(h.VE),[E,N]=(0,f.useState)(!1),[{error:G},F]=(0,k.Z)();(0,f.useEffect)(()=>{G&&v.post(G)},[G,v]);const fe=he=>{he.stopPropagation(),N(!0),F(o)};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(P.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:l,onClose:()=>N(!1),open:E,children:(0,t.jsx)(T.Z,{onClick:fe,"aria-label":m,children:(0,t.jsx)(L.Z,{})})})})}function ke(e){const{text:o,language:l,showLineNumbers:d=!1,highlightedNumbers:m,customStyle:v,showCopyCodeButton:E=!1}=e,N=(0,se.Z)(),G=N.palette.type==="dark"?te.Z:$.Z,F=N.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,t.jsxs)(w.Z,{position:"relative",children:[(0,t.jsx)(_.Z,{customStyle:v,language:l,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:N.palette.textVerySubtle},lineProps:fe=>m!=null&&m.includes(fe)?{style:{backgroundColor:F}}:{},children:o}),E&&(0,t.jsx)(w.Z,{position:"absolute",top:0,right:0,children:(0,t.jsx)(oe,{text:o})})]})}var We=r(41156),z=r(71597),xt=r(88188);function ot(e){const{title:o,to:l}=e,d=(0,We.Z)(m=>m.breakpoints.down("xs"));return l?d?(0,t.jsx)(T.Z,{component:z.rU,color:"primary",title:o,size:"small",to:l,children:(0,t.jsx)(xt.Z,{})}):(0,t.jsx)(me.Z,{component:z.rU,variant:"contained",color:"primary",to:l,children:o}):null}var Ye=r(27397),st=r(11105),Qe=r(97963),Ct=r(46506),Tt=r.n(Ct),bt=r(54073),it=r.n(bt),Pt;(function(e){let o;(function(v){v.TOP_BOTTOM="TB",v.BOTTOM_TOP="BT",v.LEFT_RIGHT="LR",v.RIGHT_LEFT="RL"})(o=e.Direction||(e.Direction={}));let l;(function(v){v.UP_LEFT="UL",v.UP_RIGHT="UR",v.DOWN_LEFT="DL",v.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let d;(function(v){v.NETWORK_SIMPLEX="network-simplex",v.TIGHT_TREE="tight-tree",v.LONGEST_PATH="longest-path"})(d=e.Ranker||(e.Ranker={}));let m;(function(v){v.LEFT="l",v.RIGHT="r",v.CENTER="c"})(m=e.LabelPosition||(e.LabelPosition={}))})(Pt||(Pt={}));var Nt=r(10368);const Ge=(0,g.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Qt({node:{id:e}}){const o=Ge(),[l,d]=f.useState(0),[m,v]=f.useState(0),E=f.useRef(null);f.useLayoutEffect(()=>{if(E.current){let{height:fe,width:he}=E.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==l)&&(d(he),v(fe))}},[l,m]);const N=10,G=l+N*2,F=m+N*2;return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{className:o.node,width:G,height:F,rx:10}),(0,t.jsx)("text",{ref:E,className:o.text,y:F/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const ge="arrow-marker",Se="node",Ue="edge",nt="label",yt=(0,Nt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),gt=e=>(0,t.jsx)(Qt,{...e});function pt({render:e=gt,setNode:o,node:l}){const{width:d,height:m,x:v=0,y:E=0}=l,N=l,G=yt(),F=f.useRef(null);return f.useLayoutEffect(()=>{if(F.current){let{height:fe,width:he}=F.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==d)&&o(l.id,{...l,height:fe,width:he})}},[l,d,m,o]),(0,t.jsx)("g",{ref:F,"data-testid":Se,className:G.node,transform:`translate(${v-d/2},${E-m/2})`,children:e({node:N})})}var Bt=r(76985),Mt=r(39829),Kt=r(19574),$t=r.n(Kt);const Xt=(0,Nt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function qt({edge:{label:e}}){const o=Xt();return(0,t.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const gn=(0,Nt.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),Mn=e=>(0,t.jsx)(qt,{...e});function Pn({render:e=Mn,setEdge:o,id:l,edge:d,curve:m}){const{x:v=0,y:E=0,width:N,height:G,points:F}=d,fe=d,he=gn(),Le=f.useRef(null);f.useLayoutEffect(()=>{if(Le.current){let{height:qe,width:Vt}=Le.current.getBBox();qe=Math.round(qe),Vt=Math.round(Vt),(qe!==G||Vt!==N)&&o(l,{...d,height:qe,width:Vt})}},[d,G,N,o,l]);let Re="";const Me=f.useMemo(()=>Bt.Z().x(qe=>qe.x).y(qe=>qe.y).curve(Mt[m]),[m]);if(F){const qe=F.filter(Vt=>$t()(Vt.x)&&$t()(Vt.y));Re=Me(qe)||""}return(0,t.jsxs)(t.Fragment,{children:[Re&&(0,t.jsx)("path",{"data-testid":Ue,className:he.path,d:Re}),fe.label?(0,t.jsx)("g",{ref:Le,"data-testid":nt,className:he.label,transform:`translate(${v},${E})`,children:e({edge:fe})}):null]})}const mn="workspace";function Ln(e){var o,l;const{edges:d,nodes:m,renderNode:v,direction:E=Pt.Direction.TOP_BOTTOM,align:N,nodeMargin:G=50,edgeMargin:F=10,rankMargin:fe=50,paddingX:he=0,paddingY:Le=0,acyclicer:Re,ranker:Me=Pt.Ranker.NETWORK_SIMPLEX,labelPosition:qe=Pt.LabelPosition.RIGHT,labelOffset:Vt=10,edgeRanks:hn=1,edgeWeight:Nn=1,renderLabel:rr,defs:Zt,zoom:on="enabled",curve:sn="curveMonotoneX",fit:dr="grow",...mr}=e,vr=(0,Qe.Z)(),[yr,ns]=f.useState(100),[Wr,Zi]=f.useState(100),tn=f.useRef(new(Tt()).graphlib.Graph),[Ao,Ms]=f.useState(((o=tn.current.graph())===null||o===void 0?void 0:o.width)||0),[Vr,Ni]=f.useState(((l=tn.current.graph())===null||l===void 0?void 0:l.height)||0),[Fn,Tr]=f.useState([]),[qr,_r]=f.useState([]),pn=Math.max(Ao,yr),wn=Math.max(Vr,Wr),To=Math.min(Vr,Wr),eo=dr==="grow"?wn:To,rs=f.useMemo(()=>it()(yn=>{if(!yn)return;const Un=st.Z(yn),fn=st.Z(yn.getElementById(mn));function xr(){Un.call(Ye.sP().scaleExtent([1,10]).on("zoom",Br=>{Br.transform.x=Math.min(0,Math.max(Br.transform.x,pn-pn*Br.transform.k)),Br.transform.y=Math.min(0,Math.max(Br.transform.y,wn-wn*Br.transform.k)),fn.attr("transform",Br.transform)}))}on==="enabled"?xr():on==="enable-on-click"&&Un.on("click",()=>xr());const{width:br,height:zs}=yn.getBoundingClientRect();yr!==br&&ns(br),Wr!==zs&&Zi(zs)},100),[Wr,yr,pn,wn,on]),Ta=f.useCallback(()=>{const yn=tn.current.nodes(),Un=tn.current.edges();yn.forEach(fn=>{m.some(br=>br.id===fn)||tn.current.removeNode(fn)}),Un.forEach(fn=>{d.some(br=>br.from===fn.v&&br.to===fn.w)||tn.current.removeEdge(fn.v,fn.w)}),m.forEach(fn=>{const xr=tn.current.nodes().find(br=>fn.id===br);if(xr&&tn.current.node(xr)){const{width:br,height:zs,x:Br,y:Ol}=tn.current.node(xr);tn.current.setNode(xr,{...fn,width:br,height:zs,x:Br,y:Ol})}else tn.current.setNode(fn.id,{...fn,width:0,height:0})}),d.forEach(fn=>{tn.current.setEdge(fn.from,fn.to,{...fn,label:fn.label,width:0,height:0,labelpos:qe,labeloffset:Vt,weight:Nn,minlen:hn})})},[d,m,qe,Vt,Nn,hn]),os=f.useMemo(()=>it()(()=>{Tt().layout(tn.current);const{height:yn,width:Un}=tn.current.graph(),fn=Math.max(0,yn||0),xr=Math.max(0,Un||0);Ms(xr),Ni(fn),Tr(tn.current.nodes()),_r(tn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(tn.current.setGraph({rankdir:E,align:N,nodesep:G,edgesep:F,ranksep:fe,marginx:he,marginy:Le,acyclicer:Re,ranker:Me}),Ta(),os(),os.cancel),[Re,N,E,F,he,Le,G,fe,Me,Ta,os]);function Ll(yn,Un){return tn.current.setNode(yn,Un),os(),tn.current}function kl(yn,Un){return tn.current.setEdge(yn,Un),os(),tn.current}return(0,t.jsxs)("svg",{ref:rs,...mr,width:"100%",height:eo,viewBox:`0 0 ${pn} ${wn}`,children:[(0,t.jsxs)("defs",{children:[(0,t.jsx)("marker",{id:ge,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,t.jsx)("path",{fill:vr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Zt]}),(0,t.jsx)("g",{id:mn,children:(0,t.jsxs)("svg",{width:Ao,height:Vr,y:wn/2-Vr/2,x:pn/2-Ao/2,viewBox:`0 0 ${Ao} ${Vr}`,children:[qr.map(yn=>{const Un=tn.current.edge(yn);return Un?(0,t.jsx)(Pn,{id:yn,setEdge:kl,render:rr,edge:Un,curve:sn},`${yn.v}-${yn.w}`):null}),Fn.map(yn=>{const Un=tn.current.node(yn);return Un?(0,t.jsx)(pt,{setNode:Ll,render:v,node:Un},yn):null})]})})]})}var kn=r(72779),_t=r.n(kn),jn,zn;const ft=(0,g.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(jn=e.palette.banner.closeButtonColor)!==null&&jn!==void 0?jn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(zn=e.palette.banner.warning)!==null&&zn!==void 0?zn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Kn=e=>{const{variant:o,message:l,id:d,fixed:m=!1}=e,v=ft(),N=useApi(storageApiRef).forBucket("notifications");var G;const F=(G=N.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[fe,he]=useState(new Set(F)),Le=useObservable(N.observe$("dismissedBanners"));useEffect(()=>{if(Le!=null&&Le.value){var Me;const qe=(Me=Le==null?void 0:Le.value)!==null&&Me!==void 0?Me:[];he(new Set(qe))}},[Le==null?void 0:Le.value]);const Re=()=>{N.set("dismissedBanners",[...fe,d])};return _jsx(Snackbar,{anchorOrigin:m?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(d),classes:{root:classNames(v.root,!m&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:l,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:v.button,onClick:Re,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var Rt=r(60905),at=r(90436),xn=r.p+"static/missingAnnotation.67f79e98..svg",Gt=r.p+"static/noInformation.4b426325..svg",an=r.p+"static/createComponent.975d1e1e..svg",En=r.p+"static/noBuild.1715fa71..svg";const dn=(0,g.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Tn=({missing:e})=>{const o=dn();switch(e){case"field":return(0,t.jsx)("img",{src:xn,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,t.jsx)("img",{src:Gt,alt:"no Information",className:o.generalImg});case"content":return(0,t.jsx)("img",{src:an,alt:"create Component",className:o.generalImg});case"data":return(0,t.jsx)("img",{src:En,alt:"no Build",className:o.generalImg});default:return null}},we=(0,g.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function ae(e){const{title:o,description:l,missing:d,action:m}=e,v=we();return(0,t.jsxs)(Rt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,t.jsx)(Rt.Z,{item:!0,xs:12,md:6,children:(0,t.jsxs)(Rt.Z,{container:!0,direction:"column",children:[(0,t.jsx)(Rt.Z,{item:!0,xs:!0,children:(0,t.jsx)(at.Z,{variant:"h5",children:o})}),(0,t.jsx)(Rt.Z,{item:!0,xs:!0,children:(0,t.jsx)(at.Z,{variant:"body1",children:l})}),(0,t.jsx)(Rt.Z,{item:!0,xs:!0,className:v.action,children:m})]})}),(0,t.jsx)(Rt.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,t.jsx)(Tn,{missing:d}):d.customImage})]})}const Be=`apiVersion: backstage.io/v1alpha1
2
- kind: Component
3
- metadata:
4
- name: example
5
- description: example.com
6
- annotations:
7
- ANNOTATION: value
8
- spec:
9
- type: website
10
- lifecycle: production
11
- owner: user:guest`,ze=/^.*ANNOTATION.*$/m,_e=Be.match(ze)[0],ne=Be.split(`
12
- `).findIndex(e=>ze.test(e)),Z=(0,g.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function pe(e){return Array.from(Array(e+1).keys(),o=>o+ne)}function Ze(e){const o=e.map(l=>_e.replace("ANNOTATION",l)).join(`
13
- `);return Be.replace(_e,o)}function Xe(e){const o=e.length<=1;return(0,t.jsxs)(t.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,t.jsx)("code",{children:l})).reduce((l,d)=>(0,t.jsxs)(t.Fragment,{children:[l,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function lt(e){const{annotation:o,readMoreUrl:l}=e,d=Array.isArray(o)?o:[o],m=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=Z();return(0,t.jsx)(ae,{missing:"field",title:"Missing Annotation",description:Xe(d),action:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(at.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,t.jsx)(w.Z,{className:v.code,children:(0,t.jsx)(ke,{text:Ze(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:pe(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(me.Z,{color:"primary",component:ue.r,to:m,children:"Read more"})]})})}var kt=r(11776),Ut=r(38402),X=r(49378),Y=r(41128),le=r(27616),ce=r(8284),ye=r(70660),Ce=r(91750),y=r(38016);const U=(e,o)=>(o.palette.type==="light"?Y._j:Y.$n)(o.palette[e].light,.6),re=(e,o)=>(o.palette.type==="light"?Y.$n:Y._j)(o.palette[e].light,.9),q=(0,g.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>U(o,e)}})),Ae=({severity:e})=>{const o=q({severity:e});return(0,t.jsx)(Ce.Z,{classes:o})},Pe=({severity:e})=>{const o=q({severity:e});return(0,t.jsx)(y.Z,{classes:o})},et=(0,g.Z)(e=>({panel:{backgroundColor:({severity:o})=>re(o,e),color:({severity:o})=>U(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>U(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>U(o,e),backgroundColor:({severity:o})=>re(o,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),wt=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function dt(e){const{severity:o="warning",title:l,message:d,children:m,defaultExpanded:v}=e,E=et({severity:o}),N=wt(o)+(l?`: ${l}`:"");return(0,t.jsxs)(le.Z,{defaultExpanded:v!=null?v:!1,className:E.panel,role:"alert",children:[(0,t.jsxs)(ce.Z,{expandIcon:(0,t.jsx)(Pe,{severity:o}),className:E.summary,children:[(0,t.jsx)(Ae,{severity:o}),(0,t.jsx)(at.Z,{className:E.summaryText,variant:"subtitle1",children:N})]}),(d||m)&&(0,t.jsx)(ye.Z,{children:(0,t.jsxs)(Rt.Z,{container:!0,children:[d&&(0,t.jsx)(Rt.Z,{item:!0,xs:12,children:(0,t.jsx)(at.Z,{className:E.message,variant:"body1",children:d})}),m&&(0,t.jsx)(Rt.Z,{item:!0,xs:12,className:E.details,children:m})]})})]})}const Ve=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),ut=({error:e,message:o,stack:l,children:d})=>{const m=Ve();return(0,t.jsxs)(kt.Z,{dense:!0,children:[(0,t.jsxs)(Ut.Z,{alignItems:"flex-start",children:[(0,t.jsx)(X.Z,{classes:{secondary:m.text},primary:"Error",secondary:e}),(0,t.jsx)(oe,{text:e})]}),(0,t.jsxs)(Ut.Z,{alignItems:"flex-start",children:[(0,t.jsx)(X.Z,{classes:{secondary:m.text},primary:"Message",secondary:o}),(0,t.jsx)(oe,{text:o})]}),l&&(0,t.jsxs)(Ut.Z,{alignItems:"flex-start",children:[(0,t.jsx)(X.Z,{classes:{secondary:m.text},primary:"Stack Trace",secondary:l}),(0,t.jsx)(oe,{text:l})]}),d]})};function St(e){const{title:o,error:l,defaultExpanded:d,children:m}=e;return(0,t.jsx)(dt,{severity:"error",title:o!=null?o:l.message,defaultExpanded:d,children:(0,t.jsx)(ut,{error:l.name,message:l.message,stack:l.stack,children:m})})}var tt=r(85256);const Ft=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function nn(e){var o;const{title:l,error:d,defaultExpanded:m}=e,v=Ft();if(d.name!=="ResponseError")return(0,t.jsx)(St,{title:l!=null?l:d.message,defaultExpanded:m,error:d});const{body:E,cause:N}=d,{request:G,response:F}=E,fe=`${F.statusCode}: ${N.name}`,he=G&&`${G.method} ${G.url}`,Le=N.message.replace(/\\n/g,`
14
- `),Re=(o=N.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
15
- `),Me=JSON.stringify(E,void 0,2);return(0,t.jsxs)(St,{title:l!=null?l:d.message,defaultExpanded:m,error:{name:fe,message:Le,stack:Re},children:[he&&(0,t.jsxs)(Ut.Z,{alignItems:"flex-start",children:[(0,t.jsx)(X.Z,{classes:{secondary:v.text},primary:"Request",secondary:G?`${he}`:void 0}),(0,t.jsx)(oe,{text:he})]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tt.Z,{component:"li",className:v.divider}),(0,t.jsx)(Ut.Z,{alignItems:"flex-start",children:(0,t.jsx)(X.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,t.jsx)(ke,{language:"json",text:Me,showCopyCodeButton:!0})]})]})}var Yt=r(28316);function Ht(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function Dt(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function en(e){const o=useRef(null);useEffect(function(){const m=document.querySelector(`#${e}`),v=m||Ht(e);return m||Dt(v),v.appendChild(o.current),function(){o.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var Lt=null;const Ot="core.calloutSeen";function un(){const[e,o]=useState(()=>{const d=localStorage.getItem(Ot);return d?JSON.parse(d):{}}),l=useCallback((d,m)=>{const v=localStorage.getItem(Ot),N={...v?JSON.parse(v):{},[d]:m};o(N),localStorage.setItem(Ot,JSON.stringify(N))},[]);return{states:e,setState:l}}function bn(e){const{states:o,setState:l}=un(),d=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:d}}function Wn(e){const{seen:o,markSeen:l}=bn(e);return{show:o===!1,hide:l}}const Yn=(0,g.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function ur(e){const{featureId:o,title:l,description:d,children:m}=e,{show:v,hide:E}=useShowCallout(o),N=usePortal("core.callout"),G=useRef(null),[F,fe]=useState(),he=Yn(),Le=useCallback(()=>{if(G.current){const Re=G.current.getBoundingClientRect(),Me=Math.max(Re.width,Re.height),qe=800,Vt=Re.x-(Me-Re.width)/2-qe,hn=Re.y-(Me-Re.height)/2-qe,Nn=Me+2*qe,rr=450,Zt=Re.x+Re.width/2-rr,on=Re.y-(Me-Re.height)/2+Me+20;fe({dotLeft:Vt,dotTop:hn,dotSize:Nn,borderWidth:qe,textTop:on,textLeft:Zt,textWidth:rr})}},[]);return useEffect(()=>(window.addEventListener("resize",Le),window.addEventListener("scroll",Le),()=>{window.removeEventListener("resize",Le),window.removeEventListener("scroll",Le)}),[Le]),useLayoutEffect(Le,[G.current,Le]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:he.featureWrapper,ref:G,children:m}),createPortal(_jsx(Box,{className:he.backdrop,children:_jsx(ClickAwayListener,{onClickAway:E,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:he.dot,"data-testid":"dot",style:{left:F==null?void 0:F.dotLeft,top:F==null?void 0:F.dotTop,width:F==null?void 0:F.dotSize,height:F==null?void 0:F.dotSize,borderWidth:F==null?void 0:F.borderWidth},onClick:E,onKeyDown:E,role:"button",tabIndex:0,children:_jsx(Box,{className:he.pulseCircle})}),_jsxs(Box,{className:he.text,"data-testid":"text",style:{left:F==null?void 0:F.textLeft,top:F==null?void 0:F.textTop,width:F==null?void 0:F.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:d})]})]})})}),N)]}):_jsx(_Fragment,{children:m})}var An=r(35292);const On=(0,g.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function qn({color:e="primary",disabled:o=!1,href:l="#",icon:d=(0,t.jsx)(An.Z,{}),label:m,onClick:v,title:E}){const N=On();return o?(0,t.jsxs)(w.Z,{title:E,className:_t()(N.link,N.disabled),children:[d,(0,t.jsx)(at.Z,{variant:"caption",component:"span",className:N.label,children:m})]}):(0,t.jsxs)(ue.r,{title:E,className:_t()(N.link,N[e]),to:l,onClick:v,children:[d,(0,t.jsx)(at.Z,{variant:"caption",component:"span",className:N.label,children:m})]})}const S=(0,g.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function c(e){const{links:o}=e,l=S();return(0,t.jsx)("nav",{className:l.links,children:o.map((d,m)=>(0,t.jsx)(qn,{...d},m+1))})}const b=e=>{const o=e==="dark"?"16%":"97%";return`
16
- hsl(0, 0%, ${o}) 0%,
17
- hsla(0, 0%, ${o}, 0.987) 8.1%,
18
- hsla(0, 0%, ${o}, 0.951) 15.5%,
19
- hsla(0, 0%, ${o}, 0.896) 22.5%,
20
- hsla(0, 0%, ${o}, 0.825) 29%,
21
- hsla(0, 0%, ${o}, 0.741) 35.3%,
22
- hsla(0, 0%, ${o}, 0.648) 41.2%,
23
- hsla(0, 0%, ${o}, 0.55) 47.1%,
24
- hsla(0, 0%, ${o}, 0.45) 52.9%,
25
- hsla(0, 0%, ${o}, 0.352) 58.8%,
26
- hsla(0, 0%, ${o}, 0.259) 64.7%,
27
- hsla(0, 0%, ${o}, 0.175) 71%,
28
- hsla(0, 0%, ${o}, 0.104) 77.5%,
29
- hsla(0, 0%, ${o}, 0.049) 84.5%,
30
- hsla(0, 0%, ${o}, 0.013) 91.9%,
31
- hsla(0, 0%, ${o}, 0) 100%
32
- `},A=100,J=10,xe=(0,g.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:A,height:`calc(100% + ${J}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-J,background:`linear-gradient(90deg, ${b(e.palette.type)})`},fadeRight:{right:-J,background:`linear-gradient(270deg, ${b(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function je(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){d([0,0]);return}const v=()=>{const E=m.scrollLeft,N=m.scrollWidth-m.offsetWidth-m.scrollLeft;d([E,N])};return v(),m.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{m.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,l]}function Oe(e,o,l){const[d,m]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),E=requestAnimationFrame(N=>{if(!e.current)return;const G=N-v,F=Math.abs(d)*G/o,he=Math.max(l,F)*Math.sign(d);e.current.scrollBy({left:he});const Le=d-he;Math.sign(d)!==Math.sign(Le)?m(0):m(Le)});return()=>cancelAnimationFrame(E)},[e,d,o,l]),m}function ht(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:m,...v}=e,E=xe(e),N=React.useRef(),[G,F]=je(N),fe=Oe(N,l,d),he=Le=>{N.current&&fe(Le?o:-o)};return _jsxs(Box,{...v,className:E.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:E.container,ref:N,children:m}),_jsx(Box,{className:classNames(E.fade,E.fadeLeft,{[E.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(E.fade,E.fadeRight,{[E.fadeHidden]:F===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>he(!1),className:classNames(E.button,E.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>he(!0),className:classNames(E.button,E.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const mt=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function vn(e){const o=mt(e),{shorthand:l,alpha:d}=e;return l?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Bn=(0,f.lazy)(()=>Promise.all([r.e(1049),r.e(6051)]).then(r.bind(r,76051)).then(e=>({default:e.RealLogViewer})));function Sr(e){const{Progress:o}=(0,h.qD)().getComponents();return(0,t.jsx)(f.Suspense,{fallback:(0,t.jsx)(o,{}),children:(0,t.jsx)(Bn,{...e})})}var $r=r(28865),Dr=r(60251);const Ro=(0,g.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),to=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(to,e):e,Cr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(to,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},Rr={code:({inline:e,className:o,children:l,...d})=>{const m=String(l).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,t.jsx)(ke,{language:v[1],text:m}):(0,t.jsx)("code",{className:o,...d,children:l})},h1:Cr,h2:Cr,h3:Cr,h4:Cr,h5:Cr,h6:Cr};function or(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:m,transformImageUri:v,className:E}=e,N=Ro();return(0,t.jsx)($r.D,{remarkPlugins:l==="gfm"?[Dr.Z]:[],className:`${N.markdown} ${E}`,children:o,components:Rr,linkTarget:d,transformLinkUri:m,transformImageUri:v})}var Jn=r(23054);const Ir=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),wr=({request:e,busy:o,setBusy:l})=>{const d=Ir(),[m,v]=useState(),E=async()=>{l(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{l(!1)}},N=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(N,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:E,children:"Log in"})]})};var Io=null;const Po=(0,g.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function no(e){const o=Po(),[l,d]=useState(!1),m=useApi(oauthRequestApiRef),v=useApi(configApiRef);var E;const N=(E=v.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&E!==void 0?E:!1,G=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),F=()=>{G.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(G.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"}),N?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:G.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:d},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:F,children:"Reject All"})})]})}var Lo=r(15277),ko=r.n(Lo),Hr=r(29862);const _n=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Zr(e){const[o,l]=(0,f.useState)(!1),d=(0,Hr.t)(),m=_n(),v=N=>{d()&&l(N)};var E;return(0,t.jsx)(P.ZP,{title:(E=e.title)!==null&&E!==void 0?E:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,t.jsx)(ko(),{text:e.text,line:e.line,onToggled:v,containerClassName:m.container})})}var Nr=r(67358);function ro(e){const o=(0,se.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,t.jsx)(Nr.Z,{...e,"data-testid":"progress"}):(0,t.jsx)(w.Z,{display:"none"})}var Pr=r(94339),Gr=r(14503),Oo=r(24579),oo=r(32552),Sn=r(15459),so=r(27597);const io=(0,g.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function ao(e){const{link:o,title:l,onClick:d}=e,m=io();return(0,t.jsxs)(w.Z,{children:[(0,t.jsx)(tt.Z,{}),(0,t.jsx)(ue.r,{to:o,onClick:d,underline:"none",children:(0,t.jsxs)(w.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,t.jsx)(w.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,t.jsx)(at.Z,{children:(0,t.jsx)("strong",{children:l})})}),(0,t.jsx)(so.Z,{className:m.arrow})]})})]})}const jr=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,t.jsxs)(at.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,t.jsxs)(at.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,t.jsx)(K,{to:o.href,variant:"contained",children:o.name})},Bo=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,t.jsx)(St,{title:"Something Went Wrong",error:d,children:(0,t.jsx)(jr,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},lo=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),$o=(0,Sn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Gr.Z),co={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Er(e){const{title:o,subheader:l,divider:d=!0,deepLink:m,slackChannel:v,errorBoundaryProps:E,variant:N,children:G,headerStyle:F,headerProps:fe,icon:he,action:Le,actionsClassName:Re,actions:Me,cardClassName:qe,actionsTopRight:Vt,className:hn,noPadding:Nn,titleTypographyProps:rr}=e,Zt=lo();let on={},sn={};N&&N.split(/[\s]+/g).forEach(yr=>{on={...on,...co.card[yr]},sn={...sn,...co.cardContent[yr]}});const dr=()=>!l&&!he?null:(0,t.jsxs)("div",{className:Zt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,t.jsx)("div",{className:Zt.subheader,children:l}),he]}),mr=E||(v?{slackChannel:v}:{});return(0,t.jsx)(Pr.Z,{style:on,className:hn,children:(0,t.jsxs)(Bo,{...mr,children:[o&&(0,t.jsx)(oo.Z,{classes:{root:Zt.header,title:Zt.headerTitle,subheader:Zt.headerSubheader,avatar:Zt.headerAvatar,action:Zt.headerAction,content:Zt.headerContent},title:o,subheader:dr(),action:Le,style:{...F},titleTypographyProps:rr,...fe}),Vt&&(0,t.jsx)($o,{children:Vt}),d&&(0,t.jsx)(tt.Z,{}),(0,t.jsx)(Oo.Z,{className:_t()(qe,{[Zt.noPadding]:Nn}),style:sn,children:G}),Me&&(0,t.jsx)(Gr.Z,{className:Re,children:Me}),m&&(0,t.jsx)(ao,{...m})]})})}var ss=r(39307);const uo=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),hr={fractional:!0,inverse:!1,unit:"%",max:100},Lr=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const m=d||hr.max,v=l?m-o:o;return v<m/3?e.status.error:v<m*(2/3)?e.status.warning:e.status.ok};function Do(e){const[o,l]=useState(null),{getColor:d=Lr}=e,m=uo(e),{palette:v}=useTheme(),{value:E,fractional:N,inverse:G,unit:F,max:fe,description:he}={...hr,...e},Le=N?Math.round(E*fe):E,Re=fe!==100?Math.round(E):Le,[Me,qe]=useState(!1);return useEffect(()=>{const Vt=o,hn=()=>qe(!0),Nn=()=>qe(!1);return Vt&&he?(Vt.addEventListener("mouseenter",hn),Vt.addEventListener("mouseleave",Nn),()=>{Vt.removeEventListener("mouseenter",hn),Vt.removeEventListener("mouseleave",Nn)}):()=>{qe(!1)}},[he,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Le,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Re,inverse:G,max:fe}),className:m.circle}),he&&Me?_jsx(Box,{className:m.description,children:he}):_jsx(Box,{className:m.overlay,children:isNaN(E)?"N/A":`${Re}${F}`})]})}const Qn=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Ws(e){const o=Qn(e),{title:l,subheader:d,progress:m,inverse:v,deepLink:E,description:N,icon:G,variant:F,getColor:fe}=e,he={inverse:v,description:N,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:E,variant:F,icon:G,children:_jsx(Gauge,{...he})})})}function Zo(e){const{value:o,getColor:l=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let m=Math.round(o*100*100)/100;m>100&&(m=100);const v=l({palette:d,value:m,inverse:!1,max:100});return _jsx(Tooltip,{title:`${m}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:m,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var is=r(21324),as=r(7089),ls=r(1292),ho=r(42494),cs=r(74603),pr=r(56939),po=r(12231),No=r(73698),Vn=r(12420),fo=r(72379);const Fr=(0,g.Z)(e=>(0,Vn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Fo=()=>{const e=Fr();return(0,t.jsx)(fo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Uo=(0,g.Z)(e=>(0,Vn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var go=()=>{const e=Uo();return(0,t.jsx)(fo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const x=(0,Sn.Z)(e=>(0,Vn.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(cs.Z),C=(0,g.Z)(e=>(0,Vn.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function R(e){const{multiple:o,items:l,label:d,placeholder:m,selected:v,onChange:E,triggerReset:N,native:G=!1,disabled:F=!1,margin:fe}=e,he=C(),[Le,Re]=(0,f.useState)(v||(o?[]:"")),[Me,qe]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Re(o?[]:"")},[N,o]),(0,f.useEffect)(()=>{Re(v||(o?[]:""))},[v,o]);const Vt=Zt=>{Re(Zt.target.value),E(Zt.target.value)},hn=Zt=>{if(F){Zt.preventDefault();return}qe(on=>o&&!(Zt.target instanceof HTMLElement)?!0:!on)},Nn=()=>{qe(!1)},rr=Zt=>()=>{const on=Le.filter(sn=>sn!==Zt);Re(on),E(on)};return(0,t.jsx)(w.Z,{className:he.root,children:(0,t.jsx)(ls.Z,{onClickAway:Nn,children:(0,t.jsxs)(ho.Z,{className:he.formControl,children:[(0,t.jsx)(pr.Z,{className:he.formLabel,children:d}),(0,t.jsxs)(No.Z,{"aria-label":d,value:Le,native:G,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Vt,onClick:hn,open:Me,input:(0,t.jsx)(x,{}),label:d,tabIndex:0,renderValue:Zt=>{var on;return o&&Le.length!==0?(0,t.jsx)(w.Z,{className:he.chips,children:Zt.map(sn=>{var dr,mr;return(0,t.jsx)(as.Z,{label:(dr=l.find(vr=>vr.value===sn))===null||dr===void 0?void 0:dr.label,clickable:!0,onDelete:rr(sn),className:he.chip},(mr=l.find(vr=>vr.value===sn))===null||mr===void 0?void 0:mr.value)})}):(0,t.jsx)(at.Z,{children:Le.length===0?m||"":(on=l.find(sn=>sn.value===Zt))===null||on===void 0?void 0:on.label})},IconComponent:()=>Me?(0,t.jsx)(go,{}):(0,t.jsx)(Fo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,t.jsx)(po.Z,{value:[],children:m}),G?l&&l.map(Zt=>(0,t.jsx)("option",{value:Zt.value,children:Zt.label},Zt.value)):l&&l.map(Zt=>(0,t.jsxs)(po.Z,{value:Zt.value,children:[o&&(0,t.jsx)(is.Z,{color:"primary",checked:Le.includes(Zt.value)||!1,className:he.checkbox}),Zt.label]},Zt.value))]})]})})})}const D=()=>{},ee=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:D,stepHistory:[],setStepHistory:D,onStepChange:D});function de(e){const{children:o,elevated:l,onStepChange:d,activeStep:m=0}=e,[v,E]=useState(m),[N,G]=useState([0]);useEffect(()=>{E(m)},[m]);const F=[];let fe;return Children.forEach(o,he=>{isValidElement(he)&&(he.props.end?fe=he:F.push(he))}),_jsxs(_Fragment,{children:[_jsx(ee.Provider,{value:{stepIndex:v,setStepIndex:E,stepHistory:N,setStepHistory:G,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:l?2:0,children:F})}),v>=Children.count(o)-1&&fe]})}const Q=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ve=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Ee=({text:e,handleClick:o,disabled:l,last:d,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(d?"Finish":"Next")}),Ie=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),Ne=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),Fe=({actions:e={},children:o})=>{const l=Q(),{stepperLength:d,stepIndex:m,setStepIndex:v,stepHistory:E,setStepHistory:N,onStepChange:G}=useContext(VerticalStepperContext),F=(Re,Me)=>{Me&&Me(),G&&G(m,Re),v(Re)},fe=()=>{const Re=e.nextStep?e.nextStep(m,d-1):m+1;F(Re,e.onNext),N([...E,Re])},he=()=>{E.pop(),F(E[E.length-1],e.onBack),N([...E])},Le=()=>{F(0,e.onRestart),N([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(Ne,{text:e.backText,handleClick:he,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(Ie,{text:e.skipText,handleClick:fe,disabled:!!d&&m>=d||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(Ee,{text:e.nextText,handleClick:fe,disabled:!!d&&m>=d||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(ve,{text:e.restartText,handleClick:Le,stepIndex:m}),o]})},rt=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function ct(e){const{title:o,children:l,end:d,actions:m,...v}=e,E=rt();return d?_jsxs(Box,{className:E.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const He=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function $e(e){const o=He(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Je(e){const o=He(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Et(e){const o=He(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ln(e){const o=He(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Jt(e){const o=He(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function rn(e){const o=He(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var cn=r(74600),Cn=r(15584);const Rn=e=>(0,Vn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Ar={root:{border:"0",verticalAlign:"top"}},Ur=e=>(0,Vn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Kr=e=>(0,Vn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),In=(0,Sn.Z)(Rn,{name:"BackstageMetadataTableTitleCell"})(Cn.Z),$n=(0,Sn.Z)(Ar,{name:"BackstageMetadataTableCell"})(Cn.Z),kr=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Vs=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(In,{children:e}),_jsx($n,{colSpan:e?1:2,...l,children:o})]}),hs=(0,Sn.Z)(Ur,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(kt.Z,{disablePadding:!0,className:e.root,children:o})),Fi=(0,Sn.Z)(Kr,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,t.jsx)(Ut.Z,{className:e.root,children:o})),ps=(0,Vn.Z)({root:{margin:"0 0",listStyleType:"none"}}),Hs=e=>(0,Vn.Z)({root:{...ps.root,paddingLeft:e.spacing(1)}}),Mo=(0,Sn.Z)(ps,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(hs,{classes:e,children:o})),er=(0,Sn.Z)(Hs,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,t.jsx)(hs,{classes:e,children:o}));function sr(e,o){const l=e.map((d,m)=>_jsx(MetadataListItem,{children:Yr(d)},m));return o?_jsx(er,{children:l}):_jsx(Mo,{children:l})}function ir(e,o,l){const d=Object.keys(e).map(m=>{const v=Yr(e[m],!0),E=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${E}: `}),v]},m)});return o?_jsx(er,{children:d}):_jsx(Mo,{children:d})}function Yr(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?ir(e,o,l):Array.isArray(e)?sr(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Gs=({value:e,options:o})=>_jsx(Fragment,{children:Yr(e,o)}),Ks=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Gs,{value:o,options:l})});function Ys(e,o){return Object.keys(e).map(l=>_jsx(Ks,{title:l,value:e[l],options:o},l))}function Ui(e){const{metadata:o,dense:l=!0,options:d}=e,m=Ys(o,d||{});return _jsx(MetadataTable,{dense:l,children:m})}var fs=r(49429),gs=r(86136),ms=r(79784),Jr=r(76635),Js=r(19126),vs=r.n(Js);function ys(e){return qs.stringify(e,{strictNullHandling:!0})}function zo(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function xs(e,o){return zo(e)[o]}function Qs(e,o,l){const d={...zo(e),[o]:l};return ys(d)}function Wo(e,o=250){const[l,d]=useSearchParams(),m=l.toString(),[v,E]=useState(xs(m,e));return useEffect(()=>{const N=xs(m,e);E(G=>isEqual(N,G)?G:N)},[m,E,e]),useDebouncedEffect(()=>{const N=Qs(m,e,v);m!==N&&d(N,{replace:!0})},[d,v,m,e],o),[v,E]}const bs={url:"https://github.com/backstage/backstage/issues",items:[{title:"Support Not Configured",icon:"warning",links:[{title:"Add `app.support` config key",url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]};function Ss(){const o=(0,h.I_)().get(h.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return bs;var d;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((d=m.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var Xs=r(80079);function ar(e,o){const d=(0,h.qD)().getSystemIcon(e);return d?(0,t.jsx)(d,{...o}):(0,t.jsx)(Xs.Z,{...o})}function Qr(e){return ar("brokenImage",e)}function Mi(e){return ar("catalog",e)}function Hn(e){return ar("chat",e)}function Ra(e){return ar("dashboard",e)}function Ia(e){return ar("docs",e)}function Pa(e){return ar("email",e)}function zi(e){return ar("github",e)}function La(e){return ar("group",e)}function Vo(e){return ar("help",e)}function Cs(e){return ar("user",e)}function Wi(e){return ar("warning",e)}const mo=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),vo=({icon:e})=>{const o=(0,h.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:Vo;return(0,t.jsx)(d,{})};var Mr;const _s=({link:e})=>(0,t.jsx)(ue.r,{to:e.url,children:(Mr=e.title)!==null&&Mr!==void 0?Mr:e.url}),ws=({item:e})=>{var o;return(0,t.jsxs)(Ut.Z,{children:[(0,t.jsx)(gs.Z,{children:(0,t.jsx)(vo,{icon:e.icon})}),(0,t.jsx)(X.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,m)=>[...l,m>0&&(0,t.jsx)("br",{},m),(0,t.jsx)(_s,{link:d},d.url)],[])})]})};function js(e){const{title:o,items:l,children:d}=e,{items:m}=Ss(),[v,E]=(0,f.useState)(!1),[N,G]=(0,f.useState)(null),F=mo(),fe=(0,We.Z)(Re=>Re.breakpoints.down("sm")),he=Re=>{G(Re.currentTarget),E(!0)},Le=()=>{E(!1)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{display:"flex",ml:1,children:fe?(0,t.jsx)(T.Z,{color:"primary",size:"small",onClick:he,"data-testid":"support-button","aria-label":"Support",children:(0,t.jsx)(Vo,{})}):(0,t.jsx)(me.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:he,startIcon:(0,t.jsx)(Vo,{}),children:"Support"})}),(0,t.jsxs)(ms.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:N,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Le,children:[(0,t.jsxs)(kt.Z,{className:F.popoverList,children:[o&&(0,t.jsx)(Ut.Z,{alignItems:"flex-start",children:(0,t.jsx)(at.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Re,Me)=>(0,t.jsx)(Ut.Z,{alignItems:"flex-start",children:Re},`child-${Me}`)),(l!=null?l:m).map((Re,Me)=>(0,t.jsx)(ws,{item:Re},`item-${Me}`))]}),(0,t.jsx)(fs.Z,{children:(0,t.jsx)(me.Z,{color:"primary",onClick:Le,"aria-label":"Close",children:"Close"})})]})]})}var Ho=r(18671),lr=r(73557),Go=r(84800);const yo=72,Es=24,ei=18,fr={drawerWidthClosed:yo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:yo,iconSize:yo-Es*2,iconPadding:Es,selectedIndicatorWidth:3,userBadgePadding:ei,userBadgeDiameter:yo-ei*2,mobileSidebarHeight:56},ti=e=>({...fr,...e,iconContainerWidth:fr.drawerWidthClosed,iconSize:fr.drawerWidthClosed-fr.iconPadding*2,userBadgeDiameter:fr.drawerWidthClosed-fr.userBadgePadding*2}),xo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:fr.defaultOpenDelayMs+200},ni=e=>({...xo,...e}),Vi="@backstage/core/sidebar-intro-dismissed",tr=(0,f.createContext)({sidebarConfig:fr,submenuConfig:xo}),As=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var ri=r(50023),oi=r(4190),si=r(87685),Hi=r(44882),bo=r(51837);const Ts={isOpen:!1,setOpen:()=>{}},Rs=(0,f.createContext)(Ts),Is=(0,bo.CT)("sidebar-open-state-context");function Ko(e){const{children:o,value:l}=e;return(0,t.jsx)(Rs.Provider,{value:l,children:(0,t.jsx)(Is.Provider,{value:(0,bo.EI)({1:l}),children:o})})}const Xr=()=>{const e=(0,f.useContext)(Is),o=(0,f.useContext)(Rs);if(e===void 0)return o||Ts;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var ii=r(57998);const Ps={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ls=(0,f.createContext)(Ps),ks=(0,bo.CT)("sidebar-pin-state-context");function Gi(e){const{children:o,value:l}=e;return(0,t.jsx)(Ls.Provider,{value:l,children:(0,t.jsx)(ks.Provider,{value:(0,bo.EI)({1:l}),children:o})})}const Or=()=>{const e=(0,f.useContext)(ks),o=(0,f.useContext)(Ls);if(e===void 0)return o||Ps;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},Ki=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Yi=e=>{const{to:o,label:l,icon:d,value:m}=e,{sidebarConfig:v}=(0,f.useContext)(tr),E=Ki({sidebarConfig:v}),N=(0,lr.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:F}=(0,f.useContext)(Yo),fe=(Le,Re)=>{F(Re===G?-1:Re)},he=m===G&&G>=0||m!==G&&!(G>=0)&&o===N.pathname;return(0,t.jsx)(ii.Z,{"aria-label":l,label:l,icon:d,component:ue.r,to:o||N.pathname,onChange:fe,value:m,selected:he,classes:E})},Os=e=>{const{children:o,to:l,label:d,icon:m,value:v}=e,{isMobile:E}=Or();return E?(0,t.jsx)(Yi,{to:l,label:d,icon:m,value:v}):(0,t.jsx)(t.Fragment,{children:o})},Bs=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),$s=e=>(0,Jr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Ji=f.createElement(Os).type,Qi=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:m}=(0,f.useContext)(tr),v=Bs({sidebarConfig:m});return(0,t.jsxs)(oi.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,t.jsxs)(w.Z,{className:v.overlayHeader,children:[(0,t.jsx)(at.Z,{variant:"h3",children:o}),(0,t.jsx)(T.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,t.jsx)(si.Z,{})})]}),(0,t.jsx)(w.Z,{component:"nav",children:e})]})},Yo=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Ds=e=>{const{sidebarConfig:o}=(0,f.useContext)(tr),{children:l}=e,d=Bs({sidebarConfig:o}),m=(0,lr.TH)(),[v,E]=(0,f.useState)(-1);(0,f.useEffect)(()=>{E(-1)},[m.pathname]);let N=(0,h.vJ)(l,F=>F.getElements().filter(fe=>fe.type===Ji));if(l)N.length?N=$s(N):N.push((0,t.jsx)(Os,{icon:(0,t.jsx)(Hi.Z,{}),children:l},"default_menu"));else return null;const G=v>=0&&!N[v].props.to;return(0,t.jsx)(Ko,{value:{isOpen:!0,setOpen:()=>{}},children:(0,t.jsxs)(Yo.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:E},children:[(0,t.jsx)(Qi,{label:N[v]&&N[v].props.label,open:G,onClose:()=>E(-1),children:N[v]&&N[v].props.children}),(0,t.jsx)(ri.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:N})]})})};var So;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(So||(So={}));const Zs={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(So.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(So.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Co=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),ai=(0,f.createContext)({content:{contentRef:void 0}});function Xi(e){const[o,l]=(0,f.useState)(()=>Zs.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(tr),m=(0,f.useRef)(null),v=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Zs.setSidebarPinState(o)},[o]);const E=(0,We.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),N=()=>l(!o),G=Co({isPinned:o,sidebarConfig:d});return(0,t.jsx)(Gi,{value:{isPinned:o,toggleSidebarPinState:N,isMobile:E},children:(0,t.jsx)(ai.Provider,{value:v,children:(0,t.jsx)(w.Z,{className:G.root,children:e.children})})})}function li(){const{content:e}=(0,f.useContext)(ai);return{focusContent:(0,f.useCallback)(()=>{var l,d;e==null||(l=e.contentRef)===null||l===void 0||(d=l.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const ci=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Gn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Gn||(Gn={}));const Dn=e=>{const{sidebarConfig:o}=(0,f.useContext)(tr),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:m,children:v}=e,E=ci({sidebarConfig:o}),N=(0,We.Z)(hn=>hn.breakpoints.down("md"),{noSsr:!0}),[G,F]=(0,f.useState)(Gn.Closed),fe=(0,f.useRef)(),{isPinned:he,toggleSidebarPinState:Le}=Or(),Re=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G!==Gn.Open&&!N&&(fe.current=window.setTimeout(()=>{fe.current=void 0,F(Gn.Open)},l),F(Gn.Idle)))},Me=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G===Gn.Idle?F(Gn.Closed):G===Gn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,F(Gn.Closed)},d)))},qe=G===Gn.Open&&!N||he,Vt=hn=>{hn?(F(Gn.Open),Le()):(F(Gn.Closed),Le())};return(0,t.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,t.jsx)(di,{}),(0,t.jsx)(Ko,{value:{isOpen:qe,setOpen:Vt},children:(0,t.jsx)(w.Z,{className:E.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Re,onFocus:m?()=>{}:Re,onMouseLeave:m?()=>{}:Me,onBlur:m?()=>{}:Me,children:(0,t.jsx)(w.Z,{className:_t()(E.drawer,E.drawerWidth,{[E.drawerOpen]:qe}),children:v})})})]})},qi=e=>{var o;const l=ti((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const m=ni((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:E,openDelayMs:N,closeDelayMs:G}=e,{isMobile:F}=Or();return F?(0,t.jsx)(Ds,{children:v}):(0,t.jsx)(tr.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,t.jsx)(Dn,{openDelayMs:N,closeDelayMs:G,disableExpandOnHover:E,children:v})})};function di(){const{sidebarConfig:e}=(0,f.useContext)(tr),{focusContent:o,contentRef:l}=li(),d=ci({sidebarConfig:e});return l!=null&&l.current?(0,t.jsx)(me.Z,{onClick:o,variant:"contained",className:_t()(d.visuallyHidden),children:"Skip to content"}):null}function ui(e,o){const l=new URLSearchParams(o.search).toString(),d=vs().parse(l),m=new URLSearchParams(e.search).toString(),v=vs().parse(m);return(0,Jr.isEqual)(o.pathname,e.pathname)&&(0,Jr.isMatch)(v,d)}const _i=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),ka=e=>{const{title:o,subtitle:l,to:d,icon:m,dropdownItems:v}=e,E=_i(),{setIsHoveredOn:N}=useContext(SidebarItemWithSubmenuContext),G=()=>{N(!1)},F=useResolvedPath(d!=null?d:""),fe=useLocation();let he=isLocationMatch(fe,F);const[Le,Re]=useState(!1),Me=()=>{Re(!Le)};return v!==void 0?(v.some(qe=>{const Vt=resolvePath(qe.to);return he=isLocationMatch(fe,Vt),he}),_jsxs(Box,{className:E.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Me,onTouchStart:qe=>qe.stopPropagation(),className:classnames(E.item,he?E.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:l})]}),Le?_jsx(ArrowDropUpIcon,{className:E.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:E.dropdownArrow})]})}),v&&Le&&_jsx(Box,{className:E.dropdown,children:v.map((qe,Vt)=>_jsx(Tooltip,{title:qe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:qe.to,underline:"none",className:E.dropdownItem,onClick:G,onTouchStart:hn=>hn.stopPropagation(),children:_jsx(Typography,{className:E.textContent,children:qe.title})})},Vt))})]})):_jsx(Box,{className:E.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(E.item,he?E.selected:void 0),onClick:G,onTouchStart:qe=>qe.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:l})]})]})})})};var Ns;const ea=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Ns=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Ns!==void 0?Ns:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),ta=e=>{const{isOpen:o}=Xr(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(tr),m=o?l.drawerWidthOpen:l.drawerWidthClosed,v=ea({left:m,submenuConfig:d}),{isHoveredOn:E}=(0,f.useContext)(As),[N,G]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{G(E)},[E]),(0,t.jsxs)(w.Z,{className:_t()(v.drawer,{[v.drawerOpen]:N}),children:[(0,t.jsx)(at.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var na=r(26739),Jo=r(76600),ra=r(83543),oa=r(59797),hi=r(98989);const sa=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),pi=()=>{const e=sa();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var ia=null;const fi=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),aa=()=>{const e=fi();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var la=null,Qo,Xo;const gi=e=>(0,g.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Qo=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&Qo!==void 0?Qo:"#404040"}},highlighted:{background:(Xo=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Xo!==void 0?Xo:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function wo(e){return(0,f.useMemo)(()=>gi(e),[e])()}const mi=(e,o)=>(0,h.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:E})=>d=d||ui(o,(0,Go.i3)(E)));return}m&&(d=ui(o,(0,Go.i3)(m)))}}),d},[o.pathname]);function Fs(e){return e.to===void 0}const vi=f.createElement(ta).type,yi=f.forwardRef(function({to:o,end:l,style:d,className:m,activeStyle:v,caseSensitive:E,activeClassName:N="active","aria-current":G="page",...F},fe){let{pathname:he}=(0,lr.TH)(),{pathname:Le}=(0,lr.WU)(o);E||(he=he.toLocaleLowerCase("en-US"),Le=Le.toLocaleLowerCase("en-US"));let Re=he===Le;!Re&&!l&&(Re=he.startsWith(`${Le}/`));const Me=Re?G:void 0;return(0,t.jsx)(z.rU,{...F,to:o,ref:fe,"aria-current":Me,style:{...d,...Re?v:void 0},className:_t()([m,Re?N:void 0])})}),xi=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:m=!1,hasSubmenu:v=!1,disableHighlight:E=!1,onClick:N,noTrack:G,children:F,className:fe,...he}=e,{sidebarConfig:Le}=(0,f.useContext)(tr),Re=wo(Le),{isOpen:Me}=Xr(),qe=!Me&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Vt=(0,t.jsxs)(w.Z,{style:qe,children:[(0,t.jsx)(l,{fontSize:"small"}),!Me&&v?(0,t.jsx)(hi.Z,{fontSize:"small"}):(0,t.jsx)(t.Fragment,{})]}),hn=(0,t.jsx)(na.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:_t()({[Re.closedItemIcon]:!Me}),children:Vt}),Nn=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{"data-testid":"login-button",className:Re.iconContainer,children:hn}),d&&(0,t.jsx)(at.Z,{variant:"subtitle2",className:Re.label,children:d}),(0,t.jsx)("div",{className:Re.secondaryAction,children:F})]}),rr=Me?Nn:hn,Zt={onClick:N,className:_t()(fe,Re.root,Me?Re.open:Re.closed,Fs(e)&&Re.buttonItem,{[Re.highlightable]:!E})},on=(0,h.z$)(),{pathname:sn}=(0,lr.WU)(!Fs(e)&&e.to?e.to:""),dr=(0,f.useCallback)(mr=>{if(!G){const vr="click",yr=d!=null?d:"Sidebar Item",ns=sn?{attributes:{to:sn}}:void 0;on.captureEvent(vr,yr,ns)}N==null||N(mr)},[on,d,sn,G,N]);return Fs(e)?(0,t.jsx)(me.Z,{role:"button","aria-label":d,...Zt,ref:o,onClick:dr,children:rr}):(0,t.jsx)(yi,{...Zt,activeClassName:Re.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...he,onClick:dr,children:rr})}),bi=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(tr),d=wo(l),[m,v]=(0,f.useState)(!1),E=(0,lr.TH)(),N=mi(e,E),G=(0,We.Z)(Le=>Le.breakpoints.down("sm")),F=()=>{v(!0)},fe=()=>{v(!1)},he=()=>G?m?(0,t.jsx)(oa.Z,{fontSize:"small",className:d.submenuArrow}):(0,t.jsx)(ra.Z,{fontSize:"small",className:d.submenuArrow}):!m&&(0,t.jsx)(hi.Z,{fontSize:"small",className:d.submenuArrow});return(0,t.jsx)(As.Provider,{value:{isHoveredOn:m,setIsHoveredOn:v},children:(0,t.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:F,onMouseEnter:F,className:_t()(m&&d.highlighted),children:[(0,t.jsx)(xi,{hasSubmenu:!0,className:N?d.selected:"",...o,children:he()}),m&&e]})})},Us=(0,f.forwardRef)((e,o)=>{const[l]=(0,h.vJ)(e.children,d=>d.getElements().filter(m=>m.type===vi));return l?(0,t.jsx)(bi,{...e,children:l}):(0,t.jsx)(xi,{...e,ref:o})});function ca(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),m=wo(o),v=e.icon?e.icon:SearchIcon,E=()=>{e.onSearch(l),d("")},N=he=>{he.key==="Enter"&&(he.preventDefault(),E())},G=he=>{d(he.target.value)},F=he=>{he.preventDefault(),he.stopPropagation()},fe=he=>{E(),he.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Us,{icon:v,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:F,onChange:G,onKeyDown:N,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const da=(0,Jo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),ua=(0,Jo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Si=(0,Jo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Ci=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),gr=(0,Jo.Z)("div")(({theme:e})=>{const o=Ci(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),ha=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=wo(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(E=>E.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:v,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},wi=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function ji(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=wi({sidebarConfig:o}),{text:d,onClose:m}=e,v=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:v,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const qo=e=>{const{text:o,onDismiss:l}=e,[d,m]=useState(!1),v=()=>{m(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(ji,{text:o,onClose:v})})},Ei=null,Ai="And your recently viewed plugins will pop up here!";function pa(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:E}=d!=null?d:{},N=()=>{m(F=>({...l,...F,starredItemsDismissed:!0}))},G=()=>{m(F=>({...l,...F,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(qo,{text:Ei,onDismiss:N}),_jsx(SidebarDivider,{})]}),!E&&_jsx(qo,{text:Ai,onDismiss:G})]}):null}const Ti=(0,g.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ri(e){const{className:o,stretch:l,noPadding:d,children:m,...v}=e,{contentRef:E}=li(),N=Ti();return(0,t.jsx)("article",{ref:E,tabIndex:-1,...v,className:_t()(N.root,o,{[N.stretch]:l,[N.noPadding]:d}),children:m})}var Ii=r(6487),i=r(99152);const n=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function s(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[m,v]=(0,f.useState)(d!=null?d:0),E=n(),N=(0,f.useCallback)((G,F)=>{d===void 0&&v(F),l&&d!==F&&l(F)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,t.jsx)(w.Z,{className:E.tabsWrapper,children:(0,t.jsx)(i.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:N,value:m,children:o.map((G,F)=>(0,f.createElement)(Ii.Z,{...G.tabProps,"data-testid":`header-tab-${F}`,label:G.label,key:G.id,value:F,className:E.defaultTab,classes:{selected:E.selected,root:E.tabRoot}}))})})}function a(e){const o=(0,lr.UO)(),d=e.map(({path:Le,children:Re})=>({caseSensitive:!1,path:`${Le}/*`,element:Re})).sort((Le,Re)=>Re.path.replace(/\/\*$/,"").localeCompare(Le.path.replace(/\/\*$/,"")));var m;const v=(m=(0,lr.V$)(d))!==null&&m!==void 0?m:e[0].children;var E;let N=(E=o["*"])!==null&&E!==void 0?E:"";N.startsWith("/")||(N=`/${N}`);var G;const[F]=(G=(0,Go.fp)(d,N))!==null&&G!==void 0?G:[],fe=F?e.findIndex(Le=>`${Le.path}/*`===F.route.path):0;var he;return{index:fe===-1?0:fe,element:v,route:(he=e[fe])!==null&&he!==void 0?he:e[0]}}function p(e){const{routes:o}=e,l=(0,lr.s0)(),{index:d,route:m,element:v}=a(o),E=(0,f.useMemo)(()=>o.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[o]),N=G=>{let{path:F}=o[G];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),l(F)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s,{tabs:E,selectedIndex:d,onChange:N}),(0,t.jsxs)(Ri,{children:[(0,t.jsx)(Ho.q,{title:m.title}),v]})]})}const j=()=>null;(0,h.R5)(j,"core.gatherMountPoints",!0);function O(e){const o=(0,t.jsx)(j,{path:"",title:"",children:(0,t.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return O(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:m,children:v,tabProps:E}=l.props;return[{path:d,title:m,children:v,tabProps:E}]})}function M(e){const o=O(e.children);return(0,t.jsx)(p,{routes:o})}M.Route=j;const ie=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function be(e){const{value:o,subvalue:l}=e,d=ie();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{className:d.value,children:o}),(0,t.jsx)(w.Z,{className:d.subvalue,children:l})]})}var Te=r(67222),Ke=r(21070),vt=r(90324),At=r(98281),It=r(48049),zt=r(51209),Wt=r(33375),Zn=r(44233),cr=r(27604),nr=r(36444),jo=r(37971),Pi=r(59709),Li=r(17373),_o=r(3702),ki=r(93111);const zr=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Oa=e=>{var o;const l=zr(),{onChangeFilters:d}=e,[m,v]=(0,f.useState)({...e.selectedFilters}),[E,N]=(0,f.useState)(!1),G=()=>{v({}),N(F=>!F)};return(0,f.useEffect)(()=>{d(m)},[m,d]),(0,t.jsxs)(w.Z,{className:l.root,children:[(0,t.jsxs)(w.Z,{className:l.header,children:[(0,t.jsx)(w.Z,{className:l.value,children:"Filters"}),(0,t.jsx)(me.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,t.jsx)(w.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(F=>(0,t.jsx)(R,{triggerReset:E,...F.element,selected:m[F.element.label],onChange:fe=>v({...m,[F.element.label]:fe})},F.element.label))})]})},fa={Add:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ke.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,t.jsx)(At.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Wt.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Zn.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,t.jsx)(zt.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,t.jsx)(cr.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,t.jsx)(_o.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,t.jsx)(nr.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(jo.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Pi.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(zt.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(It.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Wt.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,t.jsx)(nr.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,t.jsx)(vt.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Li.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,t.jsx)(ki.Z,{...e,ref:o}))};function ga(e,o){const l=o.split(".");let d=e[l[0]];for(let m=1;m<l.length;++m){if(d===void 0)return d;const v=l[m];d=d[v]}return d}const Ba=(0,Sn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(Te.W$),ma=(0,Sn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(Te.UW),$a=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Da=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Za(e,o){return e.map(l=>{var d;const m=(d=l.headerStyle)!==null&&d!==void 0?d:{};let v=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof v=="object")v.fontWeight=o.typography.fontWeightBold;else{const E=v;v=(N,G,F)=>({...E(N,G,F),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:v}})}function Na(e,o){return(0,Jr.transform)(e,(l,d,m)=>{(0,Jr.isEqual)(d,o[m])||(l[m]=d)})}const va={search:"",filtersOpen:!1,filters:{}};function Fa(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:m,toggleFilters:v}=e,E=$a(),N=(0,f.useCallback)(G=>{e.onSearchChanged(G),l(G)},[e,l]);return d?(0,t.jsxs)(w.Z,{className:E.root,children:[(0,t.jsxs)(w.Z,{className:E.root,children:[(0,t.jsx)(T.Z,{onClick:v,"aria-label":"filter list",children:(0,t.jsx)(nr.Z,{})}),(0,t.jsxs)(at.Z,{className:E.title,children:["Filters (",m,")"]})]}),(0,t.jsx)(ma,{...e,ref:o,onSearchChanged:N})]}):(0,t.jsx)(ma,{...e,ref:o,onSearchChanged:N})}function ya(e){const{data:o,columns:l,options:d,title:m,subtitle:v,filters:E,initialState:N,emptyContent:G,onStateChange:F,components:fe,...he}=e,Le=Da(),Re=(0,se.Z)(),Me={...va,...N},[qe,Vt]=(0,f.useState)(Me.filtersOpen),hn=(0,f.useCallback)(()=>Vt(Fn=>!Fn),[Vt]),[Nn,rr]=(0,f.useState)(0),[Zt,on]=(0,f.useState)(o),[sn,dr]=(0,f.useState)(Me.filters),mr=Za(l,Re),[vr,yr]=(0,f.useState)(Me.search);(0,f.useEffect)(()=>{if(F){const Fn=Na({search:vr,filtersOpen:qe,filters:sn},va);F(Fn)}},[vr,qe,sn,F]);const ns={headerStyle:{textTransform:"uppercase"}},Wr=(0,f.useCallback)(Fn=>{var Tr;return(Tr=l.find(qr=>qr.title===Fn))===null||Tr===void 0?void 0:Tr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!sn){on(o);return}const Fn=Object.values(sn);if(o&&Fn.flat().length){const Tr=o.filter(qr=>!!Object.entries(sn).filter(([,_r])=>!!_r.length).every(([_r,pn])=>{const wn=ga(qr,Wr(_r));return Array.isArray(wn)&&Array.isArray(pn)?wn.some(To=>pn.includes(To)):Array.isArray(wn)?wn.includes(pn):Array.isArray(pn)?pn.includes(wn):wn===pn}));on(Tr)}else on(o);rr(Fn.flat().length)},[o,sn,Wr]);const Zi=(Fn,Tr)=>{const qr=pn=>{const wn=new Set,To=eo=>{eo!=null&&wn.add(eo)};return Tr&&Tr.forEach(eo=>{const rs=ga(eo,Wr(pn));Array.isArray(rs)?rs.forEach(To):To(rs)}),wn},_r=pn=>({placeholder:"All results",label:pn.column,multiple:pn.type==="multiple-select",items:[...qr(pn.column)].sort().map(wn=>({label:wn,value:wn}))});return Fn.map(pn=>({type:pn.type,element:_r(pn)}))},tn=!!(E!=null&&E.length),Ao=(0,f.useCallback)(Fn=>(0,t.jsx)(Fa,{setSearch:yr,hasFilters:tn,selectedFiltersLength:Nn,toggleFilters:hn,...Fn}),[hn,tn,Nn,yr]),Ms=typeof o!="function"&&o.length===0,Vr=l.length,Ni=(0,f.useCallback)(Fn=>G&&Ms?(0,t.jsx)("tbody",{children:(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:Vr,children:G})})}):(0,t.jsx)(Te.os,{...Fn}),[Ms,G,Vr]);return(0,t.jsxs)(w.Z,{className:Le.root,children:[qe&&o&&typeof o!="function"&&(E==null?void 0:E.length)&&(0,t.jsx)(Oa,{filters:Zi(E,o),selectedFilters:sn,onChangeFilters:dr}),(0,t.jsx)(Te.ZP,{components:{Header:Ba,Toolbar:Ao,Body:Ni,...fe},options:{...ns,...d},columns:mr,icons:fa,title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(at.Z,{variant:"h5",component:"h2",children:m}),v&&(0,t.jsx)(at.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:Zt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...he})]})}ya.icons=Object.freeze(fa);var Bl=r(44311);function Ua(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function $l(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:Ua(e.data,o)})]})}const Ma=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),za=({title:e="Unknown page",className:o})=>(0,t.jsx)(at.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Wa(e){const{description:o,title:l,titleComponent:d=void 0,children:m,textAlign:v="left"}=e,E=Ma({textAlign:v})(),N=d||(0,t.jsx)(za,{title:l,className:E.title});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ho.q,{title:l}),(0,t.jsxs)(w.Z,{className:E.container,children:[(0,t.jsxs)(w.Z,{className:E.leftItemsBox,children:[N,o&&(0,t.jsx)(at.Z,{className:E.description,variant:"body2",children:o})]}),(0,t.jsx)(w.Z,{className:E.rightItemsBox,children:m})]})]})}var Va=r.p+"static/mic-drop.fe3ef4d0..svg";const Ha=(0,g.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Ga=()=>{const e=Ha();return(0,t.jsx)("img",{src:Va,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ka=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Ya(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:m}=e,v=Ka(),E=(0,lr.s0)(),N=Ss();return(0,t.jsxs)(Rt.Z,{container:!0,spacing:0,className:v.container,children:[(0,t.jsxs)(Rt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,t.jsxs)(at.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",l]}),(0,t.jsx)(at.Z,{variant:"body1",className:v.subtitle,children:d}),(0,t.jsx)(at.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,t.jsxs)(at.Z,{variant:"h6",children:[(0,t.jsx)(ue.r,{to:"#","data-testid":"go-back-link",onClick:()=>E(-1),children:"Go back"}),"... or please"," ",(0,t.jsx)(ue.r,{to:m||N.url,children:"contact support"})," if you think this is a bug."]})]}),(0,t.jsx)(Ga,{})]})}var Ja=r(16173);const Qa=(0,Sn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(at.Z),Oi=(0,Sn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(w.Z);function Xa(e){const{children:o,...l}=e,[d,m]=f.useState(null),v=f.Children.toArray(o),[E,N,...G]=v,F=G.length?G.pop():v[v.length-1],fe=v.length>3,he=Me=>{m(Me.currentTarget)},Le=()=>{m(null)},Re=Boolean(d);return(0,t.jsxs)(f.Fragment,{children:[(0,t.jsxs)(Ja.Z,{"aria-label":"breadcrumb",...l,children:[v.length>1&&(0,t.jsx)(Oi,{clone:!0,children:E}),v.length>2&&(0,t.jsx)(Oi,{clone:!0,children:N}),fe&&(0,t.jsx)(Qa,{onClick:he,children:"..."}),(0,t.jsx)(w.Z,{style:{fontStyle:"italic"},children:F})]}),(0,t.jsx)(ms.ZP,{open:Re,anchorEl:d,onClose:Le,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,t.jsx)(kt.Z,{children:G.map((Me,qe)=>(0,t.jsx)(Ut.Z,{button:!0,children:(0,t.jsx)(Oi,{clone:!0,children:Me})},qe))})})]})}const qa=(0,g.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),_a=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,t.jsxs)(Xa,{className:l.breadcrumb,children:[(0,t.jsx)(ue.r,{to:o,children:e}),(0,t.jsx)(at.Z,{children:d})]}):(0,t.jsx)(at.Z,{className:l.type,children:e}):null,el=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,t.jsx)(at.Z,{className:o.title,variant:"h1",children:e});return l?(0,t.jsx)(P.ZP,{title:l,placement:"top-start",children:d}):d},tl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,t.jsx)(t.Fragment,{children:o}):(0,t.jsx)(at.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function xa(e){const{children:o,pageTitleOverride:l,style:d,subtitle:m,title:v,tooltip:E,type:N,typeLink:G}=e,F=qa(),he=(0,h.h_)(h.Ds).getOptionalString("app.title")||"Backstage",Le=l||v,Re=v||l,Me=`${Le} | %s | ${he}`,qe=`${Le} | ${he}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ho.q,{titleTemplate:Me,defaultTitle:qe}),(0,t.jsxs)("header",{style:d,className:F.header,children:[(0,t.jsxs)(w.Z,{className:F.leftItemsBox,children:[(0,t.jsx)(_a,{classes:F,type:N,typeLink:G,pageTitle:Re}),(0,t.jsx)(el,{classes:F,pageTitle:Re,tooltip:E}),(0,t.jsx)(tl,{classes:F,subtitle:m})]}),(0,t.jsx)(Rt.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:o})]})]})}const nl=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{m&&m(v)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function Dl(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,m]=React.useState(!1),v=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:v,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((E,N)=>_jsx(nl,{...E},`header-action-menu-${N}`))})})]})}const rl=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,Y.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),ol=({value:e,className:o})=>(0,t.jsx)(at.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function sl(e){const{label:o,value:l,url:d}=e,m=rl(),v=(0,t.jsx)(ol,{className:m.value,value:l||"<Unknown>"});return(0,t.jsx)(Rt.Z,{item:!0,children:(0,t.jsxs)(at.Z,{component:"span",className:m.root,children:[(0,t.jsx)(at.Z,{className:m.label,children:o}),d?(0,t.jsx)(ue.r,{to:d,children:v}):v]})})}const il=e=>(0,Vn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),al=(0,g.Z)(il,{name:"BackstageItemCardHeader"});function ll(e){const{title:o,subtitle:l,children:d}=e,m=al(e);return(0,t.jsxs)(w.Z,{className:m.root,children:[l&&(0,t.jsx)(at.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,t.jsx)(at.Z,{variant:"h6",component:"h4",children:o}),d]})}function Zl(e){const{description:o,tags:l,title:d,type:m,subtitle:v,label:E,onClick:N,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((F,fe)=>_jsx(Chip,{size:"small",label:F},fe))}):null,o]}),_jsxs(CardActions,{children:[!G&&_jsx(LinkButton,{to:"#",onClick:N,color:"primary",children:E}),G&&_jsx(LinkButton,{to:G,color:"primary",children:E})]})]})}const cl=e=>(0,Vn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),dl=(0,g.Z)(cl,{name:"BackstageItemCardGrid"});function ul(e){const{children:o,...l}=e,d=dl(l);return(0,t.jsx)(w.Z,{className:d.root,...l,children:o})}var hl=r(41547);const pl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"}}}),{name:"BackstagePage"});function ba(e){const{themeId:o,children:l}=e,d=pl();return(0,t.jsx)(hl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,t.jsx)("main",{className:d.root,children:l})})}function fl(e){const{themeId:o,children:l,...d}=e;return(0,t.jsxs)(ba,{themeId:o,children:[(0,t.jsx)(xa,{...d}),l]})}var Xn=r(30195);const Nl=Xn.z.object({providerInfo:Xn.z.object({}).catchall(Xn.z.unknown()).optional(),profile:Xn.z.object({email:Xn.z.string().optional(),displayName:Xn.z.string().optional(),picture:Xn.z.string().optional()}),backstageIdentity:Xn.z.object({token:Xn.z.string(),identity:Xn.z.object({type:Xn.z.literal("user"),userEntityRef:Xn.z.string(),ownershipEntityRefs:Xn.z.array(Xn.z.string())})})}),Sa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function gl(e){const o=new Date(Date.now()+Sa.defaultTokenExpiryMillis);if(!e)return o;const[l,d,m]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?o:new Date(v.exp*1e3-Sa.tokenExpiryMarginMillis)}class Fl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!d)throw new TypeError(`Invalid user entity reference "${l}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:gl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Ul=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:m}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},ml=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Bi=({children:e})=>{const o=ml();return(0,t.jsx)(Rt.Z,{component:"li",item:!0,classes:o,children:e})};var es=r(87612);class $i{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function vl(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class Di{getUserId(){return this.result.userId}static fromResult(o){return new Di(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:d}=vl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,es._)(this,"result",void 0),this.result=o}}class ts{static createGuest(){return new $i}static fromLegacy(o){return Di.fromResult(o)}static create(o){return new ts(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,d){(0,es._)(this,"identity",void 0),(0,es._)(this,"authApi",void 0),(0,es._)(this,"profile",void 0),(0,es._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const yl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:m,title:v,message:E}=e,N=(0,h.h_)(m),G=(0,h.h_)(h.VE),F=async()=>{try{o();const fe=await N.getBackstageIdentity({instantPopup:!0});if(!fe)throw d(),new Error(`The ${v} provider is not configured to support sign-in`);const he=await N.getProfile();l(ts.create({identity:fe.identity,profile:he,authApi:N}))}catch(fe){d(),G.post(new Jn.SP("Login failed",fe))}};return(0,t.jsx)(Bi,{children:(0,t.jsx)(Er,{variant:"fullHeight",title:v,actions:(0,t.jsx)(me.Z,{color:"primary",variant:"outlined",onClick:F,children:"Sign In"}),children:(0,t.jsx)(at.Z,{variant:"body1",children:E})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const m=await l.getProfile();return ts.create({identity:d.identity,profile:m,authApi:l})}},xl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,t.jsx)(Bi,{children:(0,t.jsx)(Er,{title:"Guest",variant:"fullHeight",actions:(0,t.jsx)(me.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new $i)},children:"Enter"}),children:(0,t.jsxs)(at.Z,{variant:"body1",children:["Enter as a Guest User.",(0,t.jsx)("br",{}),"You will not have a verified identity,",(0,t.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new $i};var bl=r(63955),Ca=r(86619),wa=r(74828),Sl=r(45455),Cl=r.n(Sl);const wl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,jl=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),ja=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},El={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=jl(),{register:d,handleSubmit:m,formState:v}=(0,bl.cI)({mode:"onChange"}),{errors:E}=v,N=({userId:G,idToken:F})=>{e(),o(ts.fromLegacy({userId:G,getIdToken:F!==void 0?async()=>F:void 0,profile:{email:`${G}@example.com`}}))};return(0,t.jsx)(Bi,{children:(0,t.jsxs)(Er,{title:"Custom User",variant:"fullHeight",children:[(0,t.jsxs)(at.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,t.jsx)("br",{}),"This selection will not be stored."]}),(0,t.jsxs)("form",{className:l.form,onSubmit:m(N),children:[(0,t.jsxs)(ho.Z,{children:[(0,t.jsx)(Ca.Z,{...ja(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(E.userId)}),E.userId&&(0,t.jsx)(wa.Z,{error:!0,children:E.userId.message})]}),(0,t.jsxs)(ho.Z,{children:[(0,t.jsx)(Ca.Z,{...ja(d("idToken",{required:!1,validate:G=>!G||wl.test(G)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(E.idToken)}),E.idToken&&(0,t.jsx)(wa.Z,{error:!0,children:E.idToken.message})]}),(0,t.jsx)(me.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(v!=null&&v.isDirty)||!Cl()(E),children:"Continue"})]})]})})},loader:async()=>{}},Eo="@backstage/core:SignInPage:provider",Ea={guest:xl,custom:El,common:yl};function Aa(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Kl(e){return e.reduce((l,d)=>{if(typeof d=="string")return Aa(d,l),l[d]={components:Ea[d],id:d},l;const{id:m}=d;return Aa(m,l),l[m]={components:Ea.common,id:m,config:d},l},{})}const Yl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[m,v]=useState(!0),E=useCallback(G=>{o(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var F;localStorage.removeItem(Eo),await((F=G.signOut)===null||F===void 0?void 0:F.call(G))}}))},[o]);useLayoutEffect(()=>{var G;if(!m)return;const F=localStorage.getItem(Eo);if(F===null){v(!1);return}const fe=e[F];if(!fe){v(!1);return}let he=!1;return fe.components.loader(d,(G=fe.config)===null||G===void 0?void 0:G.apiRef).then(Le=>{if(he){localStorage.removeItem(Eo);return}Le?E(Le):v(!1)}).catch(Le=>{localStorage.removeItem(Eo),!he&&(l.post(Le),v(!1))}),()=>{he=!0}},[m,l,o,d,e,E]);const N=useMemo(()=>Object.keys(e).map(G=>{const F=e[G],{Component:fe}=F.components,he=Me=>{E(Me)},Le=()=>{var Me;localStorage.setItem(Eo,(F==null||(Me=F.config)===null||Me===void 0?void 0:Me.id)||F.id)},Re=()=>{localStorage.removeItem(Eo)};return _jsx(fe,{config:F.config,onSignInStarted:Le,onSignInSuccess:he,onSignInFailure:Re},F.id)}),[e,E]);return[m,N]},Al=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const m=useApi(configApiRef),v=useStyles(),E=getSignInProviders(o),[N,G]=useSignInProviders(E,e);return N?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:G})]})]})},Tl=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),m=useApi(e.apiRef),v=useApi(configApiRef),[E,N]=useState(),[G,F]=useState(!1),fe=async({checkExisting:he,showPopup:Le})=>{try{let Re;if(he&&(Re=await m.getBackstageIdentity({optional:!0})),!Re&&(Le||o)&&(F(!0),Re=await m.getBackstageIdentity({instantPopup:!0}),!Re))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Re){F(!0);return}const Me=await m.getProfile();l(UserIdentity.create({identity:Re.identity,authApi:m,profile:Me}))}catch(Re){N(Re),F(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),E&&E.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:E.message})]})})})})]}):_jsx(Progress,{})};function Jl(e){return"provider"in e?_jsx(Tl,{...e}):_jsx(Al,{...e})}const Rl=(0,g.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Il=(0,Sn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(oo.Z);function Ql(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:m,deepLink:v,value:E,onChange:N}=e,G=Rl(),[F,fe]=useState(0),he=N||((Me,qe)=>fe(qe));let Le;E?React.Children.map(d,Me=>{if(React.isValidElement(Me)&&(Me==null?void 0:Me.props.value)===E){var qe;Le=Me==null||(qe=Me.props)===null||qe===void 0?void 0:qe.children}}):React.Children.map(d,(Me,qe)=>{React.isValidElement(Me)&&qe===F&&(Le=Me==null?void 0:Me.props.children)});const Re=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Re,children:[m&&_jsx(Il,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:E||F,onChange:he,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Le}),v&&_jsx(BottomLink,{...v})]})})}const Pl=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Xl(e){const{children:o,...l}=e,d=Pl();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(jt,De,r){"use strict";r.d(De,{fC:function(){return g},CL:function(){return Qe},sM:function(){return se},$v:function(){return We},v_:function(){return z},hg:function(){return xt},uB:function(){return ke},R5:function(){return nt},bq:function(){return k},Km:function(){return oe},Ds:function(){return ot},ni:function(){return w},T0:function(){return I},CO:function(){return at},x8:function(){return kn},rx:function(){return Tn},YO:function(){return xn},P4:function(){return Rt},NT:function(){return Kt},NW:function(){return Ye},VE:function(){return st},W0:function(){return Ct},gP:function(){return Tt},IY:function(){return yt},F4:function(){return te},ux:function(){return T},Kp:function(){return _},$4:function(){return bt},p_:function(){return P},ZM:function(){return it},D:function(){return $},gW:function(){return L},E6:function(){return Pt},z$:function(){return Qt},h_:function(){return me},I_:function(){return B},qD:function(){return ge},vJ:function(){return En},tg:function(){return jn},Oi:function(){return zn}});var t=r(52322),h=r(51837),H=r(2784);const f=(0,h.CT)("analytics-context"),W=()=>{const we=(0,H.useContext)(f);if(we===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ae=we.atVersion(1);if(ae===void 0)throw new Error("No context found for version 1.");return ae},g=we=>{const{attributes:ae,children:Be}=we,_e={...W(),...ae},ne=(0,h.EI)({1:_e});return(0,t.jsx)(f.Provider,{value:ne,children:Be})};function u(we,ae){const Be=ze=>_jsx(g,{attributes:ae,children:_jsx(we,{...ze})});return Be.displayName=`WithAnalyticsContext(${we.displayName||we.name||"Component"})`,Be}function B(){const we=(0,h.Vt)("api-context");if(!we)throw new Error("API context is not available");const ae=we.atVersion(1);if(!ae)throw new Error("ApiContext v1 not available");return ae}function me(we){const Be=B().get(we);if(!Be)throw new Error(`No implementation available for ${we}`);return Be}function ue(we){return function(Be){const ze=ne=>{const Z=B(),pe={};for(const Ze in we)if(we.hasOwnProperty(Ze)){const Xe=we[Ze],lt=Z.get(Xe);if(!lt)throw new Error(`No implementation available for ${Xe}`);pe[Ze]=lt}return _jsx(Be,{...ne,...pe})},_e=Be.displayName||Be.name||"Component";return ze.displayName=`withApis(${_e})`,ze}}var V=r(87612);class K{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(ae){if((0,V._)(this,"config",void 0),this.config=ae,!ae.id.split(".").flatMap(ze=>ze.split("-")).every(ze=>ze.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ae.id}'`)}}function I(we){return new K(we)}function w(we,ae){return"id"in we?{api:we,deps:{},factory:()=>ae}:we}var se;(function(we){we.SignedIn="SignedIn",we.SignedOut="SignedOut"})(se||(se={}));const _=I({id:"core.auth.google"}),te=I({id:"core.auth.github"}),$=I({id:"core.auth.okta"}),T=I({id:"core.auth.gitlab"}),P=I({id:"core.auth.microsoft"}),L=I({id:"core.auth.onelogin"}),k=I({id:"core.auth.bitbucket"}),oe=I({id:"core.auth.bitbucket-server"}),ke=I({id:"core.auth.atlassian"}),We=I({id:"core.alert"}),z=I({id:"core.analytics"}),xt=I({id:"core.apptheme"}),ot=I({id:"core.config"}),Ye=I({id:"core.discovery"}),st=I({id:"core.error"});var Qe;(function(we){we[we.None=0]="None",we[we.Active=1]="Active"})(Qe||(Qe={}));const Ct=I({id:"core.featureflags"}),Tt=I({id:"core.fetch"}),bt=I({id:"core.identity"}),it=I({id:"core.oauthrequest"}),Pt=I({id:"core.storage"});class Nt{setContext(ae){this.context=ae}captureEvent(ae,Be,{value:ze,attributes:_e}={}){try{this.analyticsApi.captureEvent({action:ae,subject:Be,value:ze,attributes:_e,context:this.context})}catch(ne){console.warn("Error during analytics event capture. %o",ne)}}constructor(ae,Be={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=ae,this.context=Be}}function Ge(){try{return me(z)}catch{return{captureEvent:()=>{}}}}function Qt(){const we=(0,H.useRef)(null),ae=W(),Be=Ge();function ze(){return we.current===null&&(we.current=new Nt(Be)),we.current}const _e=ze();return _e.setContext(ae),_e}const ge=()=>{const we=(0,h.Vt)("app-context");if(!we)throw new Error("App context is not available");const ae=we.atVersion(1);if(!ae)throw new Error("AppContext v1 not available");return ae},Se=(0,h.uW)("component-data-store",()=>new WeakMap),Ue="__backstage_data";function nt(we,ae,Be){const ze=we;var _e;let ne=(_e=ze[Ue])!==null&&_e!==void 0?_e:Se.get(we);if(ne||(ne={map:new Map},Object.defineProperty(ze,Ue,{enumerable:!1,configurable:!0,writable:!1,value:ne}),Se.set(we,ne)),ne.map.has(ae)){const Z=we.displayName||we.name;throw new Error(`Attempted to attach duplicate data "${ae}" to component "${Z}"`)}ne.map.set(ae,Be)}function yt(we,ae){if(!we)return;const Be=we.type;if(!Be)return;var ze;const _e=(ze=Be[Ue])!==null&&ze!==void 0?ze:Se.get(Be);if(_e)return _e.map.get(ae)}const gt=(0,h.uW)("route-ref-type",()=>Symbol("route-ref-type"));let pt=gt,Bt=pt;class Mt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ae,Be){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Bt,void 0),this.id=ae,this.params=Be,this[pt]="absolute"}}function Kt(we){var ae;return new Mt(we.id,(ae=we.params)!==null&&ae!==void 0?ae:[])}const $t=/^\w+$/;let Xt=null,qt=null;class gn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ae,Be,ze,_e){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,qt,void 0),this.id=ae,this.path=Be,this.parent=ze,this.params=_e,this[Xt]="sub"}}function Mn(we){const{id:ae,path:Be,parent:ze}=we,_e=Be.split("/").filter(pe=>pe.startsWith(":")).map(pe=>pe.substring(1)),ne=[...ze.params,..._e];if(ze.params.some(pe=>_e.includes(pe)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Be.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Be}'`);if(Be.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Be}'`);for(const pe of _e)if(!$t.test(pe))throw new Error(`SubRouteRef path has invalid param, got '${pe}'`);return new gn(ae,Be,ze,ne)}let Pn=gt,mn=Pn;class Ln{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ae,Be,ze){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,mn,void 0),this.id=ae,this.params=Be,this.optional=ze,this[Pn]="external"}}function kn(we){var ae;return new Ln(we.id,(ae=we.params)!==null&&ae!==void 0?ae:[],Boolean(we.optional))}var _t=r(73557);function jn(we){const{pathname:ae}=(0,_t.TH)(),Be=(0,h.Vt)("routing-context");if(!Be)throw new Error("Routing context is not available");const ze=Be.atVersion(1),_e=(0,H.useMemo)(()=>ze&&ze.resolve(we,{pathname:ae}),[ze,we,ae]);if(!Be)throw new Error("useRouteRef used outside of routing context");if(!ze)throw new Error("RoutingContext v1 not available");const ne="optional"in we&&we.optional;if(!_e&&!ne)throw new Error(`No path for ${we}`);return _e}function zn(we){return(0,_t.UO)()}class ft extends H.Component{static getDerivedStateFromError(ae){return{error:ae}}render(){const{error:ae}=this.state,{app:Be,plugin:ze}=this.props,{ErrorBoundaryFallback:_e}=Be.getComponents();return ae?(0,t.jsx)(_e,{error:ae,resetError:this.handleErrorReset,plugin:ze}):this.props.children}constructor(...ae){super(...ae),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var Kn=r(64355);function Rt(we){const{component:ae,mountPoint:Be,name:ze}=we;return xn({component:{lazy:()=>ae().then(_e=>{const ne=pe=>{try{jn(Be)}catch(Ze){if(typeof Ze=="object"&&Ze!==null){const{message:Xe}=Ze;if(typeof Xe=="string"&&Xe.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Be} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw Ze}return(0,t.jsx)(_e,{...pe})},Z=ze||_e.displayName||_e.name||"LazyComponent";return ne.displayName=`RoutableExtension(${Z})`,ne},_e=>Z=>{const pe=ge(),{BootErrorPage:Ze}=pe.getComponents();return(0,t.jsx)(Ze,{step:"load-chunk",error:_e})})},data:{"core.mountPoint":Be},name:ze})}function at(we){const{component:ae,name:Be}=we;return xn({component:ae,name:Be})}function xn(we){const{data:ae={},name:Be}=we;Be||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let ze;if("lazy"in we.component){const ne=we.component.lazy;ze=(0,H.lazy)(()=>ne().then(Z=>({default:Z})))}else ze=we.component.sync;const _e=Be||ze.displayName||ze.name||"Component";return{expose(ne){const Z=pe=>{const Ze=ge(),{Progress:Xe}=Ze.getComponents(),lt=ae==null?void 0:ae["core.mountPoint"];return(0,t.jsx)(H.Suspense,{fallback:(0,t.jsx)(Xe,{}),children:(0,t.jsx)(ft,{app:Ze,plugin:ne,children:(0,t.jsx)(g,{attributes:{pluginId:ne.getId(),...Be&&{extension:Be},...lt&&{routeRef:lt.id}},children:(0,t.jsx)(Kn.o,{plugin:ne,children:(0,t.jsx)(ze,{...pe})})})})})};nt(Z,"core.plugin",ne),nt(Z,"core.extensionName",Be);for(const[pe,Ze]of Object.entries(ae))nt(Z,pe,Ze);return Z.displayName=`Extension(${_e})`,Z}}}function Gt(we,ae,Be,ze){return H.Children.toArray(we).flatMap(_e=>{if(!(0,H.isValidElement)(_e))return[];if(_e.type===H.Fragment)return Gt(_e.props.children,ae,Be,ze);if(yt(_e,"core.featureFlagged")){const ne=_e.props;return("with"in ne?ae.isActive(ne.with):!ae.isActive(ne.without))?Gt(_e.props.children,ae,Be,ze):[]}if(Be===void 0||Be(_e))return[_e];if(ze)throw new Error(ze);return Gt(_e.props.children,ae,Be,ze)})}class an{selectByComponentData(ae){const Be=Gt(this.node,this.featureFlagsApi,ze=>yt(ze,ae.key)!==void 0,ae.withStrictError);return new an(Be,this.featureFlagsApi)}findComponentData(ae){return Gt(this.node,this.featureFlagsApi,ze=>yt(ze,ae.key)!==void 0).map(ze=>yt(ze,ae.key)).filter(ze=>ze!==void 0)}getElements(){return Gt(this.node,this.featureFlagsApi)}constructor(ae,Be){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=ae,this.featureFlagsApi=Be}}function En(we,ae,Be=[]){const ze=me(Ct),_e=new an(we,ze);return(0,H.useMemo)(()=>ae(_e),[we,...Be])}class dn{getId(){return this.config.id}getApis(){var ae;return(ae=this.config.apis)!==null&&ae!==void 0?ae:[]}getFeatureFlags(){var ae,Be;return(Be=(ae=this.config.featureFlags)===null||ae===void 0?void 0:ae.slice())!==null&&Be!==void 0?Be:[]}get routes(){var ae;return(ae=this.config.routes)!==null&&ae!==void 0?ae:{}}get externalRoutes(){var ae;return(ae=this.config.externalRoutes)!==null&&ae!==void 0?ae:{}}provide(ae){return ae.expose(this)}__experimentalReconfigure(ae){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ae))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ae;return(ae=this.options)!==null&&ae!==void 0?ae:{}}toString(){return`plugin{${this.config.id}}`}constructor(ae){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=ae,this.options=void 0}}function Tn(we){return new dn(we)}},64355:function(jt,De,r){"use strict";r.d(De,{o:function(){return W},y:function(){return g}});var t=r(52322),h=r(51837),H=r(2784);const f="plugin-context",W=u=>{const{children:B,plugin:me}=u,{Provider:ue}=(0,h.CT)(f);return(0,t.jsx)(ue,{value:(0,h.EI)({1:{plugin:me}}),children:B})};function g(){const u=(0,h.Vt)(f);if(!u)throw new Error("Plugin Options context is not available");const B=u.atVersion(1);if(!B)throw new Error("Plugin Options v1 is not available");return B.plugin.getPluginOptions()}},23054:function(jt,De,r){"use strict";r.d(De,{SP:function(){return _},dR:function(){return K},VL:function(){return $},BD:function(){return h}});function t(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const P=T;return!(typeof P.name!="string"||P.name===""||typeof P.message!="string")}function h(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const P=T;if(typeof P.name!="string"||P.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof P.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var H=r(87612),f=r(24852);function W(T,P){const k={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return P!=null&&P.includeStack||delete k.stack,k}function g(T){const P=(0,f.deserializeError)(T);return T.stack||(P.stack=void 0),P}function u(T){if(t(T)){const P=String(T);return P!=="[object Object]"?P:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class B extends Error{constructor(P,L){var k;let oe=P;if(L!==void 0){const ke=u(L);oe?oe+=`; caused by ${ke}`:oe=`caused by ${ke}`}super(oe),(0,H._)(this,"cause",void 0),(k=Error.captureStackTrace)===null||k===void 0||k.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=t(L)?L:void 0}}class me extends null{}class ue extends null{}class V extends null{}class K extends B{}class I extends null{}class w extends null{}class se extends null{}class _ extends B{constructor(P,L){super(P,L),this.name=t(L)?L.name:"Error"}}async function te(T){try{const L=await T.text();if(L){var P;if(!((P=T.headers.get("content-type"))===null||P===void 0)&&P.startsWith("application/json"))try{const k=JSON.parse(L);if(k.error&&k.response)return k}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${L}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class $ extends Error{static async fromResponse(P){const L=await te(P),k=L.response.statusCode||P.status,oe=L.error.name||P.statusText,ke=`Request failed with ${k} ${oe}`,We=g(L.error);return new $({message:ke,response:P,data:L,cause:We})}constructor(P){super(P.message),(0,H._)(this,"response",void 0),(0,H._)(this,"body",void 0),(0,H._)(this,"cause",void 0),this.name="ResponseError",this.response=P.response,this.body=P.data,this.cause=P.cause}}},32838:function(jt,De,r){"use strict";r.d(De,{nW:function(){return _},ae:function(){return V},q3:function(){return K}});var t=r(60871);const h=(0,t.T0)({id:"core.scmauth"});var H=new WeakMap;class f{async getCredentials($){const T=new URL($.url),P=_class_private_field_get(this,H).find(L=>L.isUrlSupported(T));if(!P)throw new Error(`No auth provider available for '${$.url}', see https://backstage.io/link?scm-auth`);return P.getCredentials($)}constructor($){_class_private_field_init(this,H,{writable:!0,value:void 0}),_class_private_field_set(this,H,$)}}var W=new WeakMap,g=new WeakMap,u=new WeakMap,B=new WeakMap;class me{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:$,gitlab:T,azure:P,bitbucket:L})=>me.merge(me.forGithub($),me.forGitlab(T),me.forAzure(P),me.forBitbucket(L))})}static forAuthApi($,T){return new me("generic",$,T.host,T.scopeMapping)}static forGithub($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"github.com";return new me("github",$,L,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"gitlab.com";return new me("gitlab",$,L,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"dev.azure.com";return new me("azure",$,L,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"bitbucket.org";return new me("bitbucket",$,L,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...$){return new f($)}isUrlSupported($){return $.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider($){var T;if(!($!=null&&$.customScopes)||_class_private_field_get(this,B)==="generic")return[];var P;return(P=(T=$.customScopes)===null||T===void 0?void 0:T[_class_private_field_get(this,B)])!==null&&P!==void 0?P:[]}async getCredentials($){const{url:T,additionalScope:P,...L}=$,k=_class_private_field_get(this,u).default.slice();P!=null&&P.repoWrite&&k.push(..._class_private_field_get(this,u).repoWrite);const oe=this.getAdditionalScopesForProvider(P);oe.length&&k.push(...oe);const ke=[...new Set(k)],We=await _class_private_field_get(this,W).getAccessToken(ke,L);return{token:We,headers:{Authorization:`Bearer ${We}`}}}constructor($,T,P,L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,u,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,W,T),_class_private_field_set(this,g,P),_class_private_field_set(this,u,L),_class_private_field_set(this,B,$)}}var ue=r(79158);class V{static fromConfig($){return ue.Lx.fromConfig($)}}const K=(0,t.T0)({id:"integration.scmintegrations"});var I=r(52322),w=r(73250),se=r(2784);const _=te=>{const{type:$}=te,T=(0,t.qD)(),P=w.Z;var L;const k=$&&(L=T.getSystemIcon($))!==null&&L!==void 0?L:P;return(0,I.jsx)(k,{})}},79158:function(jt,De,r){"use strict";r.d(De,{Lx:function(){return qn},BT:function(){return St}});var t=r(87612),h=r(82717),H=r.n(h),f=r(76635);function W(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function u(S,c){return{list(){return S},byUrl(b){try{const A=typeof b=="string"?new URL(b):b;return S.find(J=>c(J)===A.host)}catch{return}},byHost(b){return S.find(A=>c(A)===b)}}}function B(S){const{url:c,base:b,lineNumber:A}=S;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:xe}=H()(b);J=new URL(b);const je=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-xe.length),"/");J.pathname=`${je}${c}`}else J=new URL(c,b);return J.search=new URL(b).search,A&&(J.hash=`L${A}`),J.toString()}function me(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const ue="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var b;const A=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let J,xe;if(c){try{const vn=new URL(c);J=vn.host,xe=vn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(xe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=ue;const je=S.getOptionalString("accessKeyId"),Oe=S.getOptionalString("secretAccessKey"),ht=S.getOptionalString("roleArn"),mt=S.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:A,accessKeyId:je,secretAccessKey:Oe,roleArn:ht,externalId:mt}}function K(S){const c=S.map(V);return c.some(b=>b.host===ue)||c.push({host:ue}),c}class I{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(I,"factory",({config:S})=>{var c;const b=K((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return u(b.map(A=>new I(A)),A=>A.config.host)});var w=r(88412),se=r(50629),_=r(80956);const te="GB";var $=new WeakMap,T=new WeakMap,P=new WeakMap,L=new WeakMap,k=new WeakMap,oe=new WeakMap,ke=new WeakMap;class We{static fromRepoUrl(c){const b=new URL(c);let A,J,xe;const je=b.pathname.split("/").map(Bn=>decodeURIComponent(Bn));if(je[2]==="_git"?(A=je[1],J=xe=je[3]):je[3]==="_git"?(A=je[1],J=je[2],xe=je[4]):je[4]==="_git"&&(A=`${je[1]}/${je[2]}`,J=je[3],xe=je[5]),!A||!J||!xe)throw new Error("Azure URL must point to a git repository");var Oe;const ht=(Oe=b.searchParams.get("path"))!==null&&Oe!==void 0?Oe:void 0;let mt;const vn=b.searchParams.get("version");if(vn){if(vn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");mt=vn.slice(2)}return new We(b.origin,A,J,xe,ht,mt)}toRepoUrl(){let c;return(0,w._)(this,P)===(0,w._)(this,L)?c=(0,w._)(this,ke).call(this,(0,w._)(this,T),"_git",(0,w._)(this,L)):c=(0,w._)(this,ke).call(this,(0,w._)(this,T),(0,w._)(this,P),"_git",(0,w._)(this,L)),(0,w._)(this,k)&&c.searchParams.set("path",(0,w._)(this,k)),(0,w._)(this,oe)&&c.searchParams.set("version",te+(0,w._)(this,oe)),c.toString()}toFileUrl(){if(!(0,w._)(this,k))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,w._)(this,ke).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,w._)(this,k)),(0,w._)(this,oe)&&c.searchParams.set("version",(0,w._)(this,oe)),c.toString()}toArchiveUrl(){const c=(0,w._)(this,ke).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,w._)(this,k)&&c.searchParams.set("scopePath",(0,w._)(this,k)),(0,w._)(this,oe)&&c.searchParams.set("version",(0,w._)(this,oe)),c.toString()}toCommitsUrl(){const c=(0,w._)(this,ke).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"commits");return c.searchParams.set("api-version","6.0"),(0,w._)(this,oe)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,w._)(this,oe)),c.toString()}getOwner(){return(0,w._)(this,T)}getProject(){return(0,w._)(this,P)}getRepo(){return(0,w._)(this,L)}getPath(){return(0,w._)(this,k)}getRef(){return(0,w._)(this,oe)}constructor(c,b,A,J,xe,je){(0,se._)(this,$,{writable:!0,value:void 0}),(0,se._)(this,T,{writable:!0,value:void 0}),(0,se._)(this,P,{writable:!0,value:void 0}),(0,se._)(this,L,{writable:!0,value:void 0}),(0,se._)(this,k,{writable:!0,value:void 0}),(0,se._)(this,oe,{writable:!0,value:void 0}),(0,se._)(this,ke,{writable:!0,value:(...Oe)=>{const ht=new URL((0,w._)(this,$));return ht.pathname=Oe.map(mt=>encodeURIComponent(mt)).join("/"),ht}}),(0,_._)(this,$,c),(0,_._)(this,T,b),(0,_._)(this,P,A),(0,_._)(this,L,J),(0,_._)(this,k,xe),(0,_._)(this,oe,je)}}const z="dev.azure.com";function xt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:z,A=S.getOptionalString("token");if(!W(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);return{host:b,token:A}}function ot(S){const c=S.map(xt);return c.some(b=>b.host===z)||c.push({host:z}),c}class Ye{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:A}=c;if(g(b))return b;try{const xe=We.fromRepoUrl(A),je=new URL(A);var J;const Oe=new URL(`https://a.com${(J=xe.getPath())!==null&&J!==void 0?J:""}`),ht=new URL(b,Oe).pathname;return je.searchParams.set("path",ht),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(b,A).toString()}}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Ye,"factory",({config:S})=>{var c;const b=ot((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return u(b.map(A=>new Ye(A)),A=>A.config.host)});var st=r(48834).lW;function Qe(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function Ct(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function Tt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}function bt(S,c){const b=c?{...c}:{};if(S.token){const A=st.from(`:${S.token}`,"utf8");b.Authorization=`Basic ${A.toString("base64")}`}return{headers:b}}const it="bitbucket.org",Pt="https://api.bitbucket.org/2.0";function Nt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:it;let A=S.getOptionalString("apiBaseUrl");const J=S.getOptionalString("token"),xe=S.getOptionalString("username"),je=S.getOptionalString("appPassword");if(!W(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return A?A=(0,f.trimEnd)(A,"/"):b===it?A=Pt:A=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:A,token:J,username:xe,appPassword:je}}function Ge(S){const c=S.map(Nt);return c.some(b=>b.host===it)||c.push({host:it,apiBaseUrl:Pt}),c}class Qt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(!c.lineNumber)return b;const A=new URL(b);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${c.lineNumber}`:A.hash=`${c.lineNumber}`,A.toString()}resolveEditUrl(c){const b=H()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",b.ref),A.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Qt,"factory",({config:S})=>{var c,b,A;const J=Ge((A=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return u(J.map(xe=>new Qt(xe)),xe=>xe.config.host)});var ge=r(96279),Se=r(48834).lW;async function Ue(S,c){const{name:b,owner:A,resource:J}=parseGitUrl(S),xe=J==="bitbucket.org";let je=xe?`${c.apiBaseUrl}/repositories/${A}/${b}`:`${c.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,Oe=await fetch(je,gt(c));if(Oe.status===404&&!xe&&(je=`${c.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,Oe=await fetch(je,gt(c))),!Oe.ok){const mt=`Failed to retrieve default branch from ${je}, ${Oe.status} ${Oe.statusText}`;throw new Error(mt)}let ht;if(xe)ht=(await Oe.json()).mainbranch.name;else{const{displayId:mt}=await Oe.json();ht=mt}if(!ht)throw new Error(`Failed to read default branch from ${je}. Response ${Oe.status} ${Oe.json()}`);return ht}async function nt(S,c){const{name:b,owner:A,ref:J,protocol:xe,resource:je,filepath:Oe}=parseGitUrl(S),ht=je==="bitbucket.org";let mt=J;mt||(mt=await Ue(S,c));const vn=Oe?`&path=${encodeURIComponent(decodeURIComponent(Oe))}`:"";return ht?`${xe}://${je}/${A}/${b}/get/${mt}.tar.gz`:`${c.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${mt}&prefix=${A}-${b}${vn}`}function yt(S,c){try{const{owner:b,name:A,ref:J,filepathtype:xe,filepath:je}=parseGitUrl(S);if(!b||!A||xe!=="browse"&&xe!=="raw"&&xe!=="src")throw new Error("Invalid Bitbucket URL or file path");const Oe=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${A}/src/${J}/${Oe}`}return`${c.apiBaseUrl}/projects/${b}/repos/${A}/raw/${Oe}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function gt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=Se.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const pt="bitbucket.org",Bt="https://api.bitbucket.org/2.0";function Mt(S){const c=pt,b=Bt,A=S.getString("username"),J=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:A,appPassword:J}}function Kt(S){const c=S.map(Mt);return c.length===0&&c.push({host:pt,apiBaseUrl:Bt}),c}class $t{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(c.lineNumber){const A=new URL(b);return A.hash=`lines-${c.lineNumber}`,A.toString()}return b}resolveEditUrl(c){const b=H()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("at",b.ref),A.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)($t,"factory",({config:S})=>{var c;const b=Kt((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return u(b.map(A=>new $t(A)),A=>A.config.host)});var Xt=r(48834).lW;async function qt(S,c){const{name:b,owner:A}=parseGitUrl(S),J=`${c.apiBaseUrl}/repositories/${A}/${b}`,xe=await fetch(J,Pn(c));if(!xe.ok){const ht=`Failed to retrieve default branch from ${J}, ${xe.status} ${xe.statusText}`;throw new Error(ht)}const Oe=(await xe.json()).mainbranch.name;if(!Oe)throw new Error(`Failed to read default branch from ${J}. Response ${xe.status} ${xe.json()}`);return Oe}async function gn(S,c){const{name:b,owner:A,ref:J,protocol:xe,resource:je}=parseGitUrl(S);let Oe=J;return Oe||(Oe=await qt(S,c)),`${xe}://${je}/${A}/${b}/get/${Oe}.tar.gz`}function Mn(S,c){try{const{owner:b,name:A,ref:J,filepathtype:xe,filepath:je}=parseGitUrl(S);if(!b||!A||xe!=="src"&&xe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Oe=je.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${A}/src/${J}/${Oe}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Pn(S){const c={};if(S.username&&S.appPassword){const b=Xt.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function mn(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const A=S.getOptionalString("token"),J=S.getOptionalString("username"),xe=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:A,username:J,password:xe}}function Ln(S){return S.map(mn)}class kn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(c.lineNumber){const A=new URL(b);return A.hash=c.lineNumber.toString(),A.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(kn,"factory",({config:S})=>{var c;const b=Ln((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return u(b.map(A=>new kn(A)),A=>A.config.host)});var _t=r(48834).lW;async function jn(S,c){const{name:b,owner:A}=parseGitUrl(S);let J=`${c.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,xe=await fetch(J,Kn(c));if(xe.status===404&&(J=`${c.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,xe=await fetch(J,Kn(c))),!xe.ok){const ht=`Failed to retrieve default branch from ${J}, ${xe.status} ${xe.statusText}`;throw new Error(ht)}const{displayId:je}=await xe.json(),Oe=je;if(!Oe)throw new Error(`Failed to read default branch from ${J}. Response ${xe.status} ${xe.json()}`);return Oe}async function zn(S,c){const{name:b,owner:A,ref:J,filepath:xe}=parseGitUrl(S);let je=J;je||(je=await jn(S,c));const Oe=xe?`&path=${encodeURIComponent(decodeURIComponent(xe))}`:"";return`${c.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${je}&prefix=${A}-${b}${Oe}`}function ft(S,c){try{const{owner:b,name:A,ref:J,filepathtype:xe,filepath:je}=parseGitUrl(S);if(!b||!A||xe!=="browse"&&xe!=="raw"&&xe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Oe=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${A}/raw/${Oe}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Kn(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=_t.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Rt(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),A=S.getOptionalString("cloneUrl"),J=S.getOptionalString("gitilesBaseUrl");const xe=S.getOptionalString("username"),je=S.getOptionalString("password");if(W(c)){if(b&&!g(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(A&&!g(A))throw new Error(`Invalid Gerrit integration config, '${A}' is not a valid cloneUrl`);if(J&&!g(J))throw new Error(`Invalid Gerrit integration config, '${J}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,A?A=(0,f.trimEnd)(A,"/"):A=b,{host:c,baseUrl:b,cloneUrl:A,gitilesBaseUrl:J,username:xe,password:je}}function at(S){return S.map(Rt)}var xn=r(48834).lW;const Gt=")]}'";function an(S,c){const A=c.replace(S.gitilesBaseUrl,"").split("/").filter(mt=>!!mt),J=A.indexOf("+");if(J<=0)throw new Error(`Unable to parse project from url: ${c}`);const xe=(0,f.trimStart)(A.slice(0,J).join("/"),"/"),je=A.indexOf("heads");if(je<=0)throw new Error(`Unable to parse branch from url: ${c}`);const Oe=A[je+1],ht=A.slice(je+2).join("/");return{branch:Oe,filePath:ht===""?"/":ht,project:xe}}function En(S,c,b,A){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(A,"/")}`}function dn(S){return S.password?"/a/":"/"}function Tn(S,c){const{branch:b,project:A}=an(S,c);return`${S.baseUrl}${dn(S)}projects/${encodeURIComponent(A)}/branches/${b}`}function we(S,c){const{project:b}=an(S,c);return`${S.cloneUrl}${dn(S)}${b}`}function ae(S,c){const{branch:b,filePath:A,project:J}=an(S,c);return`${S.baseUrl}${dn(S)}projects/${encodeURIComponent(J)}/branches/${b}/files/${encodeURIComponent(A)}/content`}function Be(S){return`${S.baseUrl}${dn(S)}projects/`}function ze(S){const c={};if(!S.password)return c;const b=xn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function _e(S){const c=await S.text();if(c.startsWith(Gt))try{return JSON.parse(c.slice(Gt.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class ne{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:A,lineNumber:J}=c;let xe;if(b.startsWith("/")){const{branch:je,project:Oe}=an(this.config,A);return En(this.config,Oe,je,b)}return b?xe=new URL(b,A):xe=new URL(A),J&&(xe.hash=J.toString()),xe.toString()}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(ne,"factory",({config:S})=>{var c;const b=at((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return u(b.map(A=>new ne(A)),A=>A.config.host)});function Z(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const A=S.getOptionalString("username"),J=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:A,password:J}}var pe=r(48834).lW;function Ze(S,c){try{var b;const A=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[J,xe,je,Oe,ht,mt,...vn]=c.replace(A,"").split("/"),Bn=vn.join("/").replace(/^\//,"");return`${A}/${xe}/${je}/_edit/${mt}/${Bn}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function Xe(S,c){try{var b;const A=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[J,xe,je,Oe,ht,mt,...vn]=c.replace(A,"").split("/"),Bn=vn.join("/").replace(/^\//,"");return`${A}/api/v1/repos/${xe}/${je}/contents/${Bn}?ref=${mt}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function lt(S){const c={},{username:b,password:A}=S;return A?(b?c.Authorization=`basic ${pe.from(`${b}:${A}`).toString("base64")}`:c.Authorization=`token ${A}`,{headers:c}):c}class kt{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return B(c)}resolveEditUrl(c){return Ze(this.config,c)}constructor(c){(0,t._)(this,"config",void 0),this.config=c}}(0,t._)(kt,"factory",({config:S})=>{var c;const A=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>Z(J));return u(A.map(J=>new kt(J)),J=>J.config.host)});const Ut="github.com",X="https://api.github.com",Y="https://raw.githubusercontent.com";function le(S){var c,b;const A=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Ut;let J=S.getOptionalString("apiBaseUrl"),xe=S.getOptionalString("rawBaseUrl");const je=S.getOptionalString("token"),Oe=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(ht=>({appId:ht.getNumber("appId"),clientId:ht.getString("clientId"),clientSecret:ht.getString("clientSecret"),webhookSecret:ht.getString("webhookSecret"),privateKey:ht.getString("privateKey"),allowedInstallationOwners:ht.getOptionalStringArray("allowedInstallationOwners")}));if(!W(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):A===Ut&&(J=X),xe?xe=(0,f.trimEnd)(xe,"/"):A===Ut&&(xe=Y),{host:A,apiBaseUrl:J,rawBaseUrl:xe,token:je,apps:Oe}}function ce(S){const c=S.map(le);return c.some(b=>b.host===Ut)||c.push({host:Ut,apiBaseUrl:X,rawBaseUrl:Y}),c}function ye(S,c,b){try{const{owner:A,name:J,ref:xe,filepathtype:je,filepath:Oe}=parseGitUrl(S);if(!A||!J||!xe||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const ht=Oe.replace(/^\//,"");return y(c,b)==="api"?`${c.apiBaseUrl}/repos/${A}/${J}/contents/${ht}?ref=${xe}`:`${c.rawBaseUrl}/${A}/${J}/${xe}/${ht}`}catch(A){throw new Error(`Incorrect URL: ${S}, ${A}`)}}function Ce(S,c){const b={};return y(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function y(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var U=r(42822),re=r(89393),q=r(26228);class Ae{async getOrCreateToken(c,b,A){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await A(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:J.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,t._)(this,"tokenCache",new Map),(0,t._)(this,"isExpired",c=>q.ou.local()>c)}}const Pe={Accept:"application/vnd.github.machine-man-preview+json"};class et{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:J,suspended:xe}=await this.getInstallationData(c);if(xe)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:Pe});let Oe;if(je.data.repository_selection==="selected"){const mt=new re.v({baseUrl:this.baseUrl,auth:je.data.token}),vn=await mt.paginate(mt.apps.listReposAccessibleToInstallation);var ht;Oe=((ht=vn.repositories)!==null&&ht!==void 0?ht:vn).map(Sr=>Sr.name)}return{token:je.data.token,expiresAt:q.ou.fromISO(je.data.expires_at),repositories:Oe}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const A=(await this.getInstallations()).find(xe=>{var je,Oe;return((je=xe.account)===null||je===void 0||(Oe=je.login)===null||Oe===void 0?void 0:Oe.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,b){(0,t._)(this,"appClient",void 0),(0,t._)(this,"baseUrl",void 0),(0,t._)(this,"baseAuthConfig",void 0),(0,t._)(this,"cache",new Ae),(0,t._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
33
- `)},this.appClient=new re.v({baseUrl:b,headers:Pe,authStrategy:U.i,auth:this.baseAuthConfig})}}class wt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const A=await Promise.all(this.apps.map(Oe=>Oe.getInstallationCredentials(c,b).then(ht=>({credentials:ht,error:void 0}),ht=>({credentials:void 0,error:ht})))),J=A.find(Oe=>{var ht;return(ht=Oe.credentials)===null||ht===void 0?void 0:ht.accessToken});if(J)return J.credentials.accessToken;const je=A.map(Oe=>Oe.error).find(Oe=>(Oe==null?void 0:Oe.name)!=="NotFoundError");if(je)throw je}constructor(c){var b;(0,t._)(this,"apps",void 0);var A;this.apps=(A=(b=c.apps)===null||b===void 0?void 0:b.map(J=>new et(J,c.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class dt{async getCredentials(c){const b=H()(c.url),A=b.owner||b.name,J=b.owner?b.name:void 0;let xe="app",je=await this.githubAppCredentialsMux.getAppToken(A,J);return je||(xe="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:xe}}constructor(c,b){(0,t._)(this,"githubAppCredentialsMux",void 0),(0,t._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,t._)(dt,"create",S=>new dt(new wt(S),S.token));class Ve{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(A=>{const J=SingleInstanceGithubCredentialsProvider.create(A.config);b.set(A.config.host,J)}),new Ve(b)}async getCredentials(c){const b=new URL(c.url),A=this.providers.get(b.host);if(!A)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return A.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class ut{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return St(B(c),"tree")}resolveEditUrl(c){return St(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(ut,"factory",({config:S})=>{var c;const b=ce((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return u(b.map(A=>new ut(A)),A=>A.config.host)});function St(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,A,J,xe)=>`//${A}/${J}/${xe}/${c}/`)}const tt=null;class Ft extends ut{get config(){return super.config}constructor(c){super(c)}}(0,t._)(Ft,"factory",ut.factory);const nn=null,Yt=null,Ht=null,Dt="gitlab.com",en="https://gitlab.com/api/v4";function Lt(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const A=S.getOptionalString("token");let J=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===Dt&&(b=en),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,W(c)){if(!b||!g(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!g(J))throw new Error(`Invalid GitLab integration config, '${J}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:A,apiBaseUrl:b,baseUrl:J}}function Ot(S){const c=S.map(Lt);return c.some(b=>b.host===Dt)||c.push({host:Dt,apiBaseUrl:en,baseUrl:`https://${Dt}`}),c}function un(S){let c="";return S.host!==Dt&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function bn(S,c){const b=await ur(S,c);return Yn(S,b,c).toString()}function Wn(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Yn(S,c,b){try{const A=new URL(S),J=A.pathname.split("/blob/").slice(1).join("/blob/"),[xe,...je]=J.split("/"),Oe=getGitLabIntegrationRelativePath(b);return A.pathname=[...Oe?[Oe]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),A.search=`?ref=${xe}`,A}catch(A){throw new Error(`Incorrect url: ${S}, ${A}`)}}async function ur(S,c){const b=new URL(S);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(A=A.replace(J,""));const xe=new URL(`${b.origin}${J}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),je=await fetch(xe.toString(),Wn(c)),Oe=await je.json();if(!je.ok)throw new Error(`GitLab Error '${Oe.error}', ${Oe.error_description}`);return Number(Oe.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${S}, ${A}`)}}class An{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return On(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(An,"factory",({config:S})=>{var c;const b=Ot((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return u(b.map(A=>new An(A)),A=>A.config.host)});function On(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class qn{static fromConfig(c){return new qn({awsS3:I.factory({config:c}),azure:Ye.factory({config:c}),bitbucket:Qt.factory({config:c}),bitbucketCloud:$t.factory({config:c}),bitbucketServer:kn.factory({config:c}),gerrit:ne.factory({config:c}),github:ut.factory({config:c}),gitlab:An.factory({config:c}),gitea:kt.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(A=>A.byUrl(c)).filter(Boolean);if(b.length>1){const A=b.filter(J=>!(J instanceof Qt));A.length!==0&&(b=A)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):B(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,t._)(this,"byType",void 0),this.byType=c}}},6290:function(jt,De,r){"use strict";var t={};r.r(t),r.d(t,{TechDocsPlugin:function(){return L.s4}});var h=r(52322),H=r(2784),f=r(28316),W=r(73557),g=r(60871);const u=(0,g.T0)({id:"plugin.techdocs.storageservice"}),B=(0,g.T0)({id:"plugin.techdocs.service"});var me=r(92077),ue=r(95481),V=r(7476),K=r(93225),I=r(86317),w=r(65124),se=r(22478),_=r(85478),te=r(68435),$=r(3482),T=r(42081),P=r(48431),L=r(89258),k=r(52943),oe=r(61886),ke=r(13980),We=r.n(ke),z=r(87612);class xt{get(n){for(const s of this.holders){const a=s.get(n);if(a)return a}}constructor(...n){(0,z._)(this,"holders",void 0),this.holders=n}}var ot=r(51837);const Ye=(0,ot.CT)("api-context"),st=i=>{var n;const{apis:s,children:a}=i,p=(n=(0,H.useContext)(Ye))===null||n===void 0?void 0:n.atVersion(1),j=p?new xt(s,p):s;return(0,h.jsx)(Ye.Provider,{value:(0,ot.EI)({1:j}),children:a})};st.propTypes={apis:We().shape({get:We().func.isRequired}).isRequired,children:We().node};class Qe{static validateFactories(n,s){for(const a of s){const p=[a],j=new Set;for(;p.length;){const O=p.shift(),M=n.get(O);if(M)for(const ie of Object.values(M.deps)){if(ie.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);j.has(ie)||(j.add(ie),p.push(ie))}}}}get(n){return this.load(n)}load(n,s=[]){const a=this.apis.get(n.id);if(a)return a;const p=this.factories.get(n);if(!p)return;if(s.includes(p.api))throw new Error(`Circular dependency of api factory for ${p.api}`);const j=this.loadDeps(n,p.deps,[...s,p.api]),O=p.factory(j);return this.apis.set(n.id,O),O}loadDeps(n,s,a){const p={};for(const j in s)if(s.hasOwnProperty(j)){const O=s[j],M=this.load(O,a);if(!M)throw new Error(`No API factory available for dependency ${O} of dependent ${n}`);p[j]=M}return p}constructor(n){(0,z._)(this,"factories",void 0),(0,z._)(this,"apis",void 0),this.factories=n,this.apis=new Map}}var Ct;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Ct||(Ct={}));class Tt{register(n,s){const a=Ct[n],p=this.factories.get(s.api.id);return p&&p.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){(0,z._)(this,"factories",new Map)}}function bt(i){return new Promise((n,s)=>{const a=i.width||500,p=i.height||700,j=window.screen.width/2-a/2,O=window.screen.height/2-p/2,M=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${p},top=${O},left=${j}`);let ie="";if(!M||typeof M.closed=="undefined"||M.closed){const vt=new Error("Failed to open auth popup.");vt.name="PopupRejectedError",s(vt);return}const be=vt=>{if(vt.source!==M||vt.origin!==i.origin)return;const{data:At}=vt;if(At.type==="config_info"){ie=At.targetOrigin;return}if(At.type!=="authorization_response")return;const It=At;if("error"in It){const zt=new Error(It.error.message);zt.name=It.error.name,s(zt)}else n(It.response);Ke()},Te=setInterval(()=>{if(M.closed){const vt=`Login failed, ${ie&&ie!==window.location.origin?`Incorrect app origin, expected ${ie}`:"popup was closed"}`,At=new Error(vt);At.name="PopupClosedError",s(At),Ke()}},100);function Ke(){window.removeEventListener("message",be),clearInterval(Te)}window.addEventListener("message",be)})}let it=!1;function Pt(i){return[...i].join(" ")}class Nt{async createSession(n){return n.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(n.scopes):this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(n){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...n&&{scope:this.joinScopesFunc(n)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(p=>{throw new Error(`Auth refresh request failed, ${p}`)});if(!s.ok){const p=new Error(`Auth refresh request failed, ${s.statusText}`);throw p.status=s.status,p}const a=await s.json();if(a.error){const p=new Error(a.error.message);throw a.error.name&&(p.name=a.error.name),p}return await this.sessionTransform(a)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),p=await bt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(p)}async executeRedirect(n){const s=this.joinScopesFunc(n);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(n,s){const a=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${n}${p}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([a,p])=>{if(typeof p=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"joinScopesFunc",void 0),(0,z._)(this,"authRequester",void 0),(0,z._)(this,"sessionTransform",void 0),(0,z._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:p,provider:j,joinScopes:O=Pt,oauthRequestApi:M,sessionTransform:ie=Te=>Te}=n;!it&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),it=!0);var be;this.enableExperimentalRedirectFlow=s&&(be=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&be!==void 0?be:!1,this.authRequester=M.createAuthRequester({provider:j,onAuthRequest:async Te=>this.enableExperimentalRedirectFlow?this.executeRedirect(Te):this.showPopup(Te)}),this.discoveryApi=a,this.environment=p,this.provider=j,this.joinScopesFunc=O,this.sessionTransform=ie}}function Ge(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class Qt{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(n);return Ge(a,s)}getExtendedScope(n,s){const a=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const p=this.options.sessionScopes(n);for(const j of p)a.add(j)}if(s)for(const p of s)a.add(p);return a}constructor(n){(0,z._)(this,"options",void 0),this.options=n}}var ge=r(82394),Se=r.n(ge);let Ue=Symbol.observable;class nt{[Ue](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(){(0,z._)(this,"isClosed",!1),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",new(Se())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)}))),(0,z._)(this,"subscribers",new Set)}}let yt=Symbol.observable;class gt{[yt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(n){(0,z._)(this,"isClosed",void 0),(0,z._)(this,"currentValue",void 0),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",void 0),(0,z._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(Se())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class pt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,z._)(this,"subject",new gt(g.sM.SignedOut)),(0,z._)(this,"signedIn",!1)}}class Bt{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(n.scopes),p=this.sessionScopesFunc(this.currentSession),j=this.sessionScopesFunc(a);return Ge(j,p)&&(this.currentSession=a),a}catch(a){if(n.optional)return;throw a}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh(n.scopes);return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(n){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(n);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(n){(0,z._)(this,"connector",void 0),(0,z._)(this,"helper",void 0),(0,z._)(this,"sessionScopesFunc",void 0),(0,z._)(this,"sessionShouldRefreshFunc",void 0),(0,z._)(this,"stateTracker",new pt),(0,z._)(this,"refreshPromise",void 0),(0,z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p,sessionShouldRefresh:j}=n;this.connector=s,this.sessionScopesFunc=p,this.sessionShouldRefreshFunc=j,this.helper=new Qt({sessionScopes:p,defaultScopes:a})}}class Mt{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:p,defaultScopes:a})}}const Kt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class $t{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:j=Kt,oauthRequestApi:O,defaultScopes:M=[],scopeTransform:ie=Ke=>Ke}=n,be=new Nt({configApi:s,discoveryApi:a,environment:p,provider:j,oauthRequestApi:O,sessionTransform(Ke){return{...Ke,providerInfo:{idToken:Ke.providerInfo.idToken,accessToken:Ke.providerInfo.accessToken,scopes:$t.normalizeScopes(ie,Ke.providerInfo.scope),expiresAt:new Date(Date.now()+Ke.providerInfo.expiresInSeconds*1e3)}}}}),Te=new Bt({connector:be,defaultScopes:new Set(M),sessionScopes:Ke=>Ke.providerInfo.scopes,sessionShouldRefresh:Ke=>(Ke.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new $t({sessionManager:Te,scopeTransform:ie})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const a=$t.normalizeScopes(this.scopeTransform,n),p=await this.sessionManager.getSession({...s,scopes:a});var j;return(j=p==null?void 0:p.providerInfo.accessToken)!==null&&j!==void 0?j:""}async getIdToken(n={}){const s=await this.sessionManager.getSession({...n,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(a))}constructor(n){(0,z._)(this,"sessionManager",void 0),(0,z._)(this,"scopeTransform",void 0),this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const Xt={id:"github",title:"GitHub",icon:()=>null};class qt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:j=Xt,oauthRequestApi:O,defaultScopes:M=["read:user"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:j,environment:p,defaultScopes:M})}}const gn={id:"gitlab",title:"GitLab",icon:()=>null};class Mn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:j=gn,oauthRequestApi:O,defaultScopes:M=["read_user"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:j,environment:p,defaultScopes:M})}}const Pn={id:"google",title:"Google",icon:()=>null},mn="https://www.googleapis.com/auth/";class Ln{static create(n){const{configApi:s,discoveryApi:a,oauthRequestApi:p,environment:j="development",provider:O=Pn,defaultScopes:M=["openid",`${mn}userinfo.email`,`${mn}userinfo.profile`]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:p,provider:O,environment:j,defaultScopes:M,scopeTransform(ie){return ie.map(be=>be==="openid"?be:be==="profile"||be==="email"?`${mn}userinfo.${be}`:be.startsWith(mn)?be:`${mn}${be}`)}})}}const kn={id:"okta",title:"Okta",icon:()=>null},_t=new Set(["openid","profile","email","phone","address","groups","offline_access"]),jn="okta.";class zn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:j=kn,oauthRequestApi:O,defaultScopes:M=["openid","email","profile","offline_access"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:j,environment:p,defaultScopes:M,scopeTransform(ie){return ie.map(be=>_t.has(be)||be.startsWith(jn)?be:`${jn}${be}`)}})}}var ft=r(30195);const Kn=ft.z.object({profile:ft.z.object({email:ft.z.string().optional(),displayName:ft.z.string().optional(),picture:ft.z.string().optional()}),backstageIdentity:ft.z.object({token:ft.z.string(),identity:ft.z.object({type:ft.z.literal("user"),userEntityRef:ft.z.string(),ownershipEntityRefs:ft.z.array(ft.z.string())})})}),Rt={id:"saml",title:"SAML",icon:()=>null};class at{static create(n){const{discoveryApi:s,environment:a="development",provider:p=Rt}=n,j=new DirectAuthConnector({discoveryApi:s,environment:a,provider:p}),O=new StaticAuthSessionManager({connector:j}),M=new AuthSessionStore({manager:O,storageKey:`${p.id}Session`,schema:samlSessionSchema});return new at(M)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){_define_property(this,"sessionManager",void 0),this.sessionManager=n}}const xn={id:"microsoft",title:"Microsoft",icon:()=>null};class Gt{static create(n){return new Gt(n)}microsoftGraph(){return this.oauth2[Gt.MicrosoftGraphID]}static resourceForScopes(n){const s=n.split(" ").map(Gt.resourceForScope).filter(j=>j!=="openid");if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const p=(a=s[0])!==null&&a!==void 0?a:Gt.MicrosoftGraphID;return Promise.resolve(p)}static resourceForScope(n){var s;const a=(s=n.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:p}=a;return p.replace(/^api:\/\//,"")}switch(n){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Gt.MicrosoftGraphID}}async getAccessToken(n,s){const a=n===void 0?Gt.MicrosoftGraphID:await Gt.resourceForScopes(Array.isArray(n)?n.join(" "):n);return a in this.oauth2||(this.oauth2[a]=$t.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(n,s)}getIdToken(n){return this.microsoftGraph().getIdToken(n)}getProfile(n){return this.microsoftGraph().getProfile(n)}getBackstageIdentity(n){return this.microsoftGraph().getBackstageIdentity(n)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(n){(0,z._)(this,"oauth2",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"oauthRequestApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:p=xn,oauthRequestApi:j,discoveryApi:O,defaultScopes:M=["openid","offline_access","profile","email","User.Read"],scopeTransform:ie=be=>be.concat("offline_access")}=n;this.configApi=s,this.environment=a,this.provider=p,this.oauthRequestApi=j,this.discoveryApi=O,this.scopeTransform=ie,this.oauth2={[Gt.MicrosoftGraphID]:$t.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:M})}}}(0,z._)(Gt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const an={id:"onelogin",title:"onelogin",icon:()=>null},En=new Set(["openid","profile","email","phone","address","groups","offline_access"]),dn="onelogin.";class Tn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:j=an,oauthRequestApi:O}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:j,environment:p,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(M){return M.map(ie=>En.has(ie)||ie.startsWith(dn)?ie:`${dn}${ie}`)}})}}const we={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ae{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:j=we,oauthRequestApi:O,defaultScopes:M=["team"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:j,environment:p,defaultScopes:M})}}const Be={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class ze{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:j=Be,oauthRequestApi:O,defaultScopes:M=["PROJECT_ADMIN"]}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:j,environment:p,defaultScopes:M})}}const _e={id:"atlassian",title:"Atlassian",icon:()=>null};class ne{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:j=_e,oauthRequestApi:O}=n;return $t.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:j,environment:p})}}class Z{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){(0,z._)(this,"subject",new nt)}}class pe{captureEvent(n){}}const Ze="theme";class Xe{static createWithStorage(n){const s=new Xe(n);if(!window.localStorage)return s;var a;const p=(a=window.localStorage.getItem(Ze))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(p),s.activeThemeId$().subscribe(j=>{j?window.localStorage.setItem(Ze,j):window.localStorage.removeItem(Ze)}),window.addEventListener("storage",j=>{if(j.key===Ze){var O;const M=(O=localStorage.getItem(Ze))!==null&&O!==void 0?O:void 0;s.setActiveThemeId(M)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){(0,z._)(this,"themes",void 0),(0,z._)(this,"activeThemeId",void 0),(0,z._)(this,"subject",void 0),this.themes=n,this.subject=new gt(void 0)}}var lt=r(9850),kt=r.n(lt),Ut=r(12782),X=r.n(Ut);const Y=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function le(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ce(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const ye={type(i,n,s,a){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class Ce{static fromConfigs(n){return n.length===0?new Ce(void 0):n.reduce((s,{data:a,context:p,filteredKeys:j,deprecatedKeys:O})=>{const M=new Ce(a,p,s);if(M.filteredKeys=j,O)for(const{key:ie,description:be}of O)console.warn(`The configuration key '${ie}' of ${p} is deprecated and may be removed soon. ${be||""}`);return M},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var p;return(p=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&p!==void 0?p:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var a;const p=(a=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...p])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const a=kt()(this.readValue(n)),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(a===void 0){if(!1)var j;return p}else if(p===void 0)return a;return X()({},{value:p},{value:a},(O,M)=>!le(M)||!le(O)?M:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const a=this.readValue(n),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(le(a))return this.copy(a,n,p);if(a!==void 0)throw new TypeError(ye.type(this.fullKey(n),this.context,ce(a),"object"));return p}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,p=>{if(!Array.isArray(p))return{expected:"object-array"};for(const[j,O]of p.entries())if(!le(O))return{expected:"object-array",value:O,key:`${n}[${j}]`};return!0});if(!s){if(!1)var a;return}return s.map((p,j)=>this.copy(p,`${n}[${j}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,p=>typeof p=="number"||typeof p=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(ye.convert(this.fullKey(n),this.context,"number"));return a}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,p=>typeof p=="boolean"||typeof p=="number"||typeof p=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(ye.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(ye.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,p]of s.entries())if(typeof p!="string"||p==="")return{expected:"string-array",value:p,key:`${n}[${a}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,a){const p=new Ce(n,this.context,a,this.fullKey(s));return p.filteredKeys=this.filteredKeys,p}readConfigValue(n,s){const a=this.readValue(n);if(a===void 0){var p;if(!1)var j;return(p=this.fallback)===null||p===void 0?void 0:p.readConfigValue(n,s)}const O=s(a);if(O!==!0){const{key:M=n,value:ie=a,expected:be}=O;throw new TypeError(ye.type(this.fullKey(M),this.context,ce(ie),be))}return a}readValue(n){const s=n?n.split("."):[];for(const p of s)if(!Y.test(p))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let a=this.data;for(const[p,j]of s.entries())if(le(a))a=a[j];else if(a!==void 0){const O=this.fullKey(s.slice(0,p).join("."));throw new TypeError(ye.type(O,this.context,ce(a),"object"))}return a}constructor(n,s="mock-config",a,p=""){(0,z._)(this,"data",void 0),(0,z._)(this,"context",void 0),(0,z._)(this,"fallback",void 0),(0,z._)(this,"prefix",void 0),(0,z._)(this,"filteredKeys",void 0),(0,z._)(this,"notifiedFilteredKeys",void 0),this.data=n,this.context=s,this.fallback=a,this.prefix=p,this.notifiedFilteredKeys=new Set}}const y="Invalid discovery URL pattern,";class U{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let p;try{p=new URL(a)}catch{throw new Error(`${y} URL '${a}' is invalid`)}if(p.hash)throw new Error(`${y} URL must not have a hash`);if(p.search)throw new Error(`${y} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${y} URL must not end with a slash`);return new U(s)}async getBaseUrl(n){return this.parts.join(encodeURIComponent(n))}constructor(n){(0,z._)(this,"parts",void 0),this.parts=n}}class re{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){(0,z._)(this,"alertApi",void 0),(0,z._)(this,"errorApi",void 0),this.alertApi=n,this.errorApi=s}}class q{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){(0,z._)(this,"subject",new nt)}}class Ae{static forward(n,s){window.addEventListener("unhandledrejection",a=>{n.post(a.reason,s)})}}function Pe(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class et{registerFlag(n){Pe(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===g.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[a,p]of Object.entries(n.states))this.flags.set(a,p);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([p,j])=>(Pe(p),j===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,z._)(this,"registeredFeatureFlags",[]),(0,z._)(this,"flags",void 0)}}function wt(i){let n=i.baseImplementation||r.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const p of a)n=p.apply(n);return{fetch:n}}class dt{static create(n){var s,a;const p=Ve(n),j=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",O=((a=n.header)===null||a===void 0?void 0:a.value)||(M=>`Bearer ${M}`);return new dt(n.identityApi,p,j,O)}apply(n){return async(s,a)=>{const p=new Request(s,a),{token:j}=await this.identityApi.getCredentials();return p.headers.get(this.headerName)||typeof j!="string"||!j||!this.allowUrl(p.url)?n(s,a):(p.headers.set(this.headerName,this.headerValue(j)),n(p))}}constructor(n,s,a,p){(0,z._)(this,"identityApi",void 0),(0,z._)(this,"allowUrl",void 0),(0,z._)(this,"headerName",void 0),(0,z._)(this,"headerValue",void 0),this.identityApi=n,this.allowUrl=s,this.headerName=a,this.headerValue=p}}function Ve(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?ut(i.urlPrefixAllowlist):i.config?ut([i.config.getString("backend.baseUrl")]):()=>!1}function ut(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(a=>s===a||s.startsWith(`${a}/`))}function St(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class tt{apply(n){return async(s,a)=>{const p=new Request(s,a),j="plugin://";if(!p.url.startsWith(j))return n(s,a);const{hostname:O,pathname:M,search:ie,hash:be,username:Te,password:Ke}=new URL(`http://${p.url.substring(j.length)}`);let vt=await this.discoveryApi.getBaseUrl(O);if(Te||Ke){const It=new URL(vt),zt=`${Te}${Ke?`:${Ke}`:""}@`;vt=`${It.protocol}//${zt}${It.host}${It.pathname}`}const At=`${St(vt,M)}${ie}${be}`;return n(At,typeof s=="string"||Ft(s)?a:s)}}constructor(n){(0,z._)(this,"discoveryApi",void 0),this.discoveryApi=n}}function Ft(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class nn{static resolvePluginProtocol(n){return new tt(n.discoveryApi)}static injectIdentityAuth(n){return dt.create(n)}constructor(){}}function Yt(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function Ht(i,...n){const s=new Set(i);for(const a of n)for(const p of a)s.add(p);return s}class Dt{request(n){return new Promise((s,a)=>{this.requests.push({scopes:n,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(a=>Yt(n,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>Ht(s,a.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){(0,z._)(this,"requests",[]),(0,z._)(this,"subject",new gt(this.getCurrentPending()))}}class en{createAuthRequester(n){const s=new Dt,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:p=>{const j=this.currentRequests.slice(),O=this.makeAuthRequest(p,n);O?j[a]=O:delete j[a],this.currentRequests=j,this.subject.next(j.filter(Boolean))}}),p=>s.request(p)}makeAuthRequest(n,s){const{scopes:a}=n;if(a)return{provider:s.provider,trigger:async()=>{const p=await s.onAuthRequest(a);n.resolve(p)},reject:()=>{const p=new Error("Login failed, rejected by user");p.name="RejectedError",n.reject(p)}}}authRequest$(){return this.subject}constructor(){(0,z._)(this,"subject",new gt([])),(0,z._)(this,"currentRequests",[]),(0,z._)(this,"handlerCount",0)}}const Lt=new Map;class Ot{static create(n){var s;return new Ot((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[a,p]of Lt.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(a)&&p.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,a="absent";try{const p=localStorage.getItem(this.getKeyName(n));p&&(s=JSON.parse(p,(j,O)=>(typeof O=="object"&&O!==null&&Object.freeze(O),O)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:s,presence:a}}forBucket(n){const s=`${this.namespace}/${n}`;return Lt.has(s)||Lt.set(s,new Ot(s,this.errorApi)),Lt.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return Ot.hasSubscribed||(Ot.addStorageEventListener(),Ot.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const a of this.subscribers)a.next(s)}constructor(n,s){(0,z._)(this,"namespace",void 0),(0,z._)(this,"errorApi",void 0),(0,z._)(this,"subscribers",void 0),(0,z._)(this,"observable",void 0),this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(Se())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,z._)(Ot,"hasSubscribed",!1);const un=(0,H.createContext)(void 0);function bn(){const[i]=(0,W.is)((0,h.jsx)(W.AW,{index:!0,element:(0,h.jsx)("div",{})}));return!i.index}var Wn=r(84800);const Yn=(i,n)=>{try{var s;const a=(0,Wn.fp)(n,{pathname:i}),p=a==null?void 0:a.filter(ie=>{var be;return((be=ie==null?void 0:ie.route.routeRefs)===null||be===void 0?void 0:be.size)>0}).pop(),j=p==null?void 0:p.route;if(!j)return;let O;j.routeRefs.size===1&&(O=j.routeRefs.values().next().value);const M=Object.entries((p==null?void 0:p.params)||{}).reduce((ie,[be,Te])=>(Te!==void 0&&(ie[be]=Te),ie),{});return{extension:"App",pluginId:((s=j.plugin)===null||s===void 0?void 0:s.getId())||"root",...O?{routeRef:O.id}:{},params:M}}catch{return}},ur=({pathname:i,search:n,hash:s,attributes:a})=>{const p=(0,g.z$)();return(0,H.useEffect)(()=>{p.captureEvent("navigate",`${i}${n}${s}`,{attributes:a})},[p,i,n,s,a]),null},An=({routeObjects:i})=>{const{pathname:n,search:s,hash:a}=(0,W.TH)(),{params:p,...j}=Yn(n,i)||{params:{}};return(0,h.jsx)(g.fC,{attributes:j,children:(0,h.jsx)(ur,{pathname:n,search:s,hash:a,attributes:p})})};function On(i){return bn()?qn(i):""}function qn(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function S({component:i,appIdentityProxy:n,children:s}){const[a,p]=(0,H.useState)(),j=(0,g.h_)(g.Ds),O=On(j);return a?(n.setTarget(a,{signOutTargetUrl:O||"/"}),(0,h.jsx)(h.Fragment,{children:s})):(0,h.jsx)(i,{onSignInSuccess:p})}function c(i){const{Router:n,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),p=qn(a),j=`${p}/*`,O=(0,H.useContext)(un);if(!O)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:M,appIdentityProxy:ie}=O;return s?bn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(An,{routeObjects:M}),(0,h.jsx)(S,{component:s,appIdentityProxy:ie,children:(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:j,element:(0,h.jsx)(h.Fragment,{children:i.children})})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(An,{routeObjects:M}),(0,h.jsx)(S,{component:s,appIdentityProxy:ie,children:i.children})]}):(ie.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:p||"/"}),bn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(An,{routeObjects:M}),(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:j,element:(0,h.jsx)(h.Fragment,{children:i.children})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(An,{routeObjects:M}),i.children]}))}var b=r(88412),A=r(50629),J=r(80956),xe=r(64279);function je(i){const n={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(n[a]=i.collectors[a]());const s=[{node:H.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:p,contexts:j}=s.shift();H.Children.forEach(a,O=>{if(!(0,H.isValidElement)(O))return;const M={};for(const ie in n)if(n.hasOwnProperty(ie)){const be=n[ie];M[ie]=be.visit(be.accumulator,O,p,j[ie])}for(const ie of i.discoverers){const be=ie(O);be&&s.push({node:be,parent:O,contexts:M})}})}return Object.fromEntries(Object.entries(n).map(([a,p])=>[a,p.accumulator]))}function Oe(i,n){return()=>({accumulator:i(),visit:n})}function ht(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function mt(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const vn=Oe(()=>new Set,(i,n)=>{const s=(0,g.IY)(n,"core.plugin");s&&i.add(s)}),Bn=i=>{const{children:n}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,h.jsx)(h.Fragment,{children:a?n:null})};(0,g.R5)(Bn,"core.featureFlagged",!0);const Sr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function $r(i){const n=i;if(n!=null&&n.type){var s,a;return(a=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&a!==void 0?a:String(n.type)}return String(n)}function Dr(i,n=new Array){return H.Children.forEach(i,s=>{if(!(0,H.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const p=(0,g.IY)(s,"core.plugin");n.push({routeRef:a,plugin:p})}Dr(s.props.children,n)}),n}const Ro=Oe(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,j;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===n)return{...a,isElementAncestor:!0};const O=(p=n.props)===null||p===void 0?void 0:p.path,M=(0,g.IY)(n,"core.mountPoint");if(M&&O)throw new Error(`Path property may not be set directly on a routable extension "${$r(n)}"`);var ie;const be=(ie=a==null||(j=a.obj)===null||j===void 0?void 0:j.children)!==null&&ie!==void 0?ie:i.objects;if(O!==void 0){if(typeof O!="string")throw new Error(`Element path must be a string at "${$r(n)}"`);const At=O.startsWith("/")?O.slice(1):O,It=n.props.element;if((0,g.IY)(n,"core.gatherMountPoints")){var Te;if(It)throw new Error(`Mount point gatherers may not have an element prop "${$r(n)}"`);const zt={path:At,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Te=n.props)===null||Te===void 0?void 0:Te.caseSensitive),children:[Sr],plugin:void 0};return be.push(zt),{obj:zt,gatherPath:At,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(It){var Ke;const[zt,...Wt]=Dr(It);if(Wt.length>0)throw new Error(`Route element with path "${O}" may not contain multiple routable extensions`);if(!zt)return a;const{routeRef:Zn,plugin:cr}=zt,nr={path:At,element:"mounted",routeRefs:new Set([Zn]),caseSensitive:Boolean((Ke=n.props)===null||Ke===void 0?void 0:Ke.caseSensitive),children:[Sr],plugin:cr};return be.push(nr),i.paths.set(Zn,At),i.parents.set(Zn,a==null?void 0:a.routeRef),{obj:nr,routeRef:Zn!=null?Zn:a==null?void 0:a.routeRef,gatherPath:At,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(M){var vt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${$r(n)}" with mount point "${M}" must be assigned a path`);return a==null||(vt=a.obj)===null||vt===void 0||vt.routeRefs.add(M),i.paths.set(M,a.gatherPath),i.parents.set(M,a==null?void 0:a.gatherRouteRef),{...a,routeRef:M}}return a}),to=Oe(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,j,O;if((s==null?void 0:s.props.element)===n)return a;let M=a==null?void 0:a.obj,ie=a==null?void 0:a.routeRef,be=a==null?void 0:a.sticky;const Te=(p=n.props)===null||p===void 0?void 0:p.path;var Ke;const vt=(Ke=M==null?void 0:M.children)!==null&&Ke!==void 0?Ke:i.objects,At=Boolean((j=n.props)===null||j===void 0?void 0:j.caseSensitive);let It=a==null?void 0:a.path;if((0,g.IY)(n,"core.gatherMountPoints")){if(!Te)throw new Error("Mount point gatherer must have a path");It=Te}const zt=(O=n.props)===null||O===void 0?void 0:O.element;let Wt=(0,g.IY)(n,"core.mountPoint");if(!Wt&&(0,H.isValidElement)(zt)&&(Wt=(0,g.IY)(zt,"core.mountPoint")),Wt){let nr=Te;if(It&&(nr?It=void 0:nr=It),!nr)throw new Error("Mounted routable extension must have a path");i.paths.set(Wt,nr),ie&&be?(i.parents.set(Wt,ie),Te&&(ie=Wt,be=!1)):(i.parents.set(Wt,ie),ie=Wt),Te?(M={caseSensitive:At,path:Te,element:"mounted",routeRefs:new Set([Wt]),children:[Sr],plugin:(0,g.IY)(n.props.element,"core.plugin")},vt.push(M)):M==null||M.routeRefs.add(Wt)}if((0,g.IY)(n,"core.gatherMountPoints")&&(be=!0),(0,g.IY)(n,"core.gatherMountPoints")){if(!Te)throw new Error("Mount point gatherer must have a path");if(!Wt){var cr;M={caseSensitive:At,path:Te,element:"gathered",routeRefs:new Set,children:[Sr],plugin:a==null||(cr=a.obj)===null||cr===void 0?void 0:cr.plugin},vt.push(M)}}return{obj:M,path:It,routeRef:ie,sticky:be}}),Cr=Oe(()=>new Set,(i,n)=>{if(n.type===Bn){const s=n.props;i.add("with"in s?s.with:s.without)}}),Rr=(0,ot.uW)("route-ref-type",()=>Symbol("route-ref-type"));function or(i){return i[Rr]==="absolute"}function Jn(i){return i[Rr]==="sub"}function Ir(i){return i[Rr]==="external"}function wr(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function Io(i,n,s){let a,p="";if(or(i))a=i;else if(Jn(i))a=i.parent,p=i.path;else if(Ir(i)){const M=s.get(i);if(!M)return[void 0,""];if(or(M))a=M;else if(Jn(M))a=M.parent,p=M.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${M}`)}else throw i[Rr]?new Error(`Unknown or invalid route ref type, ${i[Rr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const j=n.get(a);if(j===void 0)return[void 0,""];const O=wr(j,p);return[a,O]}function Po(i,n,s,a,p){var j;const O=(j=(0,Wn.fp)(p,n))!==null&&j!==void 0?j:[],M=Array();let ie=-1;for(let Ke=i;Ke&&(ie=O.findIndex(vt=>vt.route.routeRefs.has(Ke)),ie===-1);Ke=a.get(Ke))M.unshift(Ke);M.length===0&&(ie-=1);const be=ie===-1?"":O[ie].pathname,Te=M.slice(0,-1).map(Ke=>{const vt=s.get(Ke);if(vt===void 0)throw new Error(`No path for ${Ke}`);if(vt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Ke} as it has parameters`);return vt});return`${wr(be,...Te)}/`}class no{resolve(n,s){const[a,p]=Io(n,this.routePaths,this.routeBindings);if(!a)return;let j;typeof s=="string"?j=this.trimPath(s):s.pathname?j={...s,pathname:this.trimPath(s.pathname)}:j=s;const O=this.appBasePath+Po(a,j,this.routePaths,this.routeParents,this.routeObjects);return(...[ie])=>wr(O,(0,Wn.Gn)(p,ie))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,a,p,j){(0,z._)(this,"routePaths",void 0),(0,z._)(this,"routeParents",void 0),(0,z._)(this,"routeObjects",void 0),(0,z._)(this,"routeBindings",void 0),(0,z._)(this,"appBasePath",void 0),this.routePaths=n,this.routeParents=s,this.routeObjects=a,this.routeBindings=p,this.appBasePath=j}}const Lo=(0,ot.CT)("routing-context"),ko=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:a,basePath:p="",children:j})=>{const O=new no(i,n,s,a,p),M=(0,ot.EI)({1:O});return(0,h.jsx)(Lo.Provider,{value:M,children:j})};function Hr(i,n){const s=new Set(n.values());s.delete(void 0);for(const a of n.keys()){if(s.has(a))continue;let p=a,j="";for(;p;){const M=i.get(p);if(M===void 0)throw new Error(`No path for ${p}`);j=wr(M,j),p=n.get(p)}const O=j.match(/:(\w+)/g);if(O){for(let M=0;M<O.length;M++)for(let ie=M+1;ie<O.length;ie++)if(O[ie]===O[M])throw new Error(`Parameter ${O[ie]} is duplicated in path ${j}`)}}}function _n(i,n){for(const s of n)if(s.externalRoutes){for(const[a,p]of Object.entries(s.externalRoutes))if(!p.optional&&!i.has(p))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Zr=(0,ot.CT)("app-context"),Nr=({appContext:i,children:n})=>{const s=(0,ot.EI)({1:i});return(0,h.jsx)(Zr.Provider,{value:s,children:n})};function ro(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Pr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Gr{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw ro("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Pr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw ro("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Pr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Pr("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,z._)(this,"target",void 0),(0,z._)(this,"waitForTarget",void 0),(0,z._)(this,"resolveTarget",()=>{}),(0,z._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Oo=r(72164);function oo(i,n,s){if(i!==void 0){const p=s.find(j=>j.id===i);if(p)return p}if(n){const p=s.find(j=>j.variant==="dark");if(p)return p}const a=s.find(p=>p.variant==="light");return a||s[0]}const Sn=()=>{const i=(0,H.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,H.useState)(i.matches);return(0,H.useEffect)(()=>{const a=p=>{s(p.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),n};function so({children:i}){const n=(0,g.h_)(g.hg),s=(0,Oo.Z)(n.activeThemeId$(),n.getActiveThemeId()),a=Boolean(window.matchMedia)?Sn():!1,p=oo(s,a,n.getInstalledThemes());if(!p)throw new Error("App has no themes");return(0,h.jsx)(p.Provider,{children:i})}const io=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const p=JSON.parse(i);Array.isArray(p)?s.push(...p):s.push({data:p,context:"env"})}catch(p){throw new Error(`Failed to load runtime configuration, ${p}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class ao{add(n,s){return this.apis.push([n.id,s]),s}build(){return new jr(new Map(this.apis))}constructor(){(0,z._)(this,"apis",[])}}class jr{static builder(){return new ao}static from(n){return new jr(new Map(n.map(([s,a])=>[s.id,a])))}static with(n,s){return new jr(new Map([[n.id,s]]))}with(n,s){return new jr(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){(0,z._)(this,"apis",void 0),this.apis=n}}function Bo(i){const n=new Map;return i&&i({bind:(a,p)=>{for(const[j,O]of Object.entries(p)){const M=a[j];if(!M)throw new Error(`Key ${j} is not an existing external route`);if(!O&&!M.optional)throw new Error(`External route ${j} is required but was undefined`);O&&n.set(M,O)}}}),n}function lo(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function $o(i,n,s){var a;const p=Boolean(i),j=(0,xe.default)(i||(()=>Promise.resolve([])));let O;if(p&&j.loading){const{Progress:be}=n;O=(0,h.jsx)(be,{})}else if(j.error){const{BootErrorPage:be}=n;O=(0,h.jsx)(be,{step:"load-config",error:j.error})}const{ThemeProvider:M=so}=n;if(O)return{node:(0,h.jsx)(st,{apis:jr.with(g.hg,s),children:(0,h.jsx)(M,{children:O})})};let ie;if(!((a=j.value)===null||a===void 0)&&a.length){const be=Ce.fromConfigs(j.value),Te=be.getOptionalString("app.baseUrl"),Ke=be.getOptionalString("backend.baseUrl");let vt=j.value;const At={data:{},context:"relative-resolver"};if(Te&&Ke){const It=new URL(Te).origin,zt=new URL(Ke).origin;if(It===zt){const Wt=lo(Ke);Ke!==Wt&&(At.data.backend={baseUrl:Wt})}}if(Te){const It=lo(Te);Te!==It&&(At.data.app={baseUrl:It})}Object.keys(At.data).length&&(vt=vt.concat([At])),ie=Ce.fromConfigs(vt)}else ie=Ce.fromConfigs([]);return{api:ie}}class co{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){(0,z._)(this,"app",void 0),this.app=n}}var Er=new WeakMap;class ss{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,h.jsx)(s,{children:n})}getProvider(){if((0,b._)(this,Er))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,J._)(this,Er,!0);const n=new co(this);let s=!1;return({children:p})=>{const j=(0,H.useRef)(!0),O=(0,H.useMemo)(()=>Xe.createWithStorage(this.themes),[]),{routing:M,featureFlags:ie,routeBindings:be}=(0,H.useMemo)(()=>{const At=je({root:p,discoverers:[ht,mt],collectors:{routing:bn()?to:Ro,collectedPlugins:vn,featureFlags:Cr}});return At.collectedPlugins.forEach(It=>this.plugins.add(It)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...At,routeBindings:Bo(this.bindRoutes)}},[p]);s||(s=!0,Hr(M.paths,M.parents),_n(be,this.plugins));const Te=$o(this.configLoader,this.components,O),Ke="api"in Te;if(Ke){const{api:At}=Te;this.configApi=At}if("node"in Te)return Te.node;if(Ke&&j.current){j.current=!1;const At=this.getApiHolder().get(g.W0);if(At){for(const Wt of this.featureFlags)At.registerFlag({...Wt,pluginId:""});for(const Wt of this.plugins.values())if("getFeatureFlags"in Wt)for(const Zn of Wt.getFeatureFlags())At.registerFlag({name:Zn.name,pluginId:Wt.getId()});else for(const Zn of Wt.output())Zn.type==="feature-flag"&&At.registerFlag({name:Zn.name,pluginId:Wt.getId()});const It=At.getRegisteredFlags(),zt=new Set(It.map(Wt=>Wt.name));for(const Wt of ie)zt.has(Wt)||At.registerFlag({name:Wt,pluginId:""})}}const{ThemeProvider:vt=so}=this.components;return(0,h.jsx)(st,{apis:this.getApiHolder(),children:(0,h.jsx)(Nr,{appContext:n,children:(0,h.jsx)(vt,{children:(0,h.jsx)(ko,{routePaths:M.paths,routeParents:M.parents,routeObjects:M.objects,routeBindings:be,basePath:On(Te.api),children:(0,h.jsx)(un.Provider,{value:{routeObjects:M.objects,appIdentityProxy:this.appIdentityProxy},children:p})})})})})}}getRouter(){return c}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>Xe.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new et});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Qe(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const a of n){const p=a.getId();if(s.has(p))throw new Error(`Duplicate plugin found '${p}'`);s.add(p)}}constructor(n){(0,z._)(this,"apiHolder",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"apis",void 0),(0,z._)(this,"icons",void 0),(0,z._)(this,"plugins",void 0),(0,z._)(this,"featureFlags",void 0),(0,z._)(this,"components",void 0),(0,z._)(this,"themes",void 0),(0,z._)(this,"configLoader",void 0),(0,z._)(this,"defaultApis",void 0),(0,z._)(this,"bindRoutes",void 0),(0,z._)(this,"appIdentityProxy",new Gr),(0,z._)(this,"apiFactoryRegistry",void 0),(0,A._)(this,Er,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var a;this.plugins=new Set((a=n.plugins)!==null&&a!==void 0?a:[]);var p;this.featureFlags=(p=n.featureFlags)!==null&&p!==void 0?p:[],this.components=n.components,this.themes=n.themes;var j;this.configLoader=(j=n.configLoader)!==null&&j!==void 0?j:io;var O;this.defaultApis=(O=n.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new Tt}}function uo(i){return new ss(i)}let hr=!1;const Lr=i=>{const n=(0,g.qD)(),{NotFoundErrorPage:s}=n.getComponents(),a=(0,H.useMemo)(()=>bn(),[]),j=[...(0,g.vJ)(i.children,O=>O.getElements().flatMap(M=>{let ie=M.props.path;if(ie==="")return[];var be;ie=(be=ie==null?void 0:ie.replace(/\/\*$/,""))!==null&&be!==void 0?be:"/";let Te=a?M:M.props.element;return!a&&!Te&&(Te=M,hr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),hr=!0)),[{path:ie,element:Te,children:M.props.children?[{path:ie==="/"?"/":"*",element:M.props.children}]:void 0}]}).sort((M,ie)=>ie.path.localeCompare(M.path)).map(M=>({...M,path:M.path==="/"?"/":`${M.path}/*`}))),{path:"*",element:(0,h.jsx)(s,{})}];return(0,W.V$)(j)},Do=(0,g.T0)({id:"plugin.permission.api"});var Qn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Qn||(Qn={}));function Ws(i,n){return i.name===n.name}function Zo(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function is(i){return i.attributes.action==="create"}function as(i){return i.attributes.action==="read"}function ls(i){return i.attributes.action==="update"}function ho(i){return i.attributes.action==="delete"}function cs(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const a=n;return i.authorize(a,s)}}}function pr({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var po=r(23054),No=r(96279),Vn=r.n(No),fo=r(9571);const Fr=ft.z.lazy(()=>ft.z.object({rule:ft.z.string(),resourceType:ft.z.string(),params:ft.z.record(ft.z.any()).optional()}).or(ft.z.object({anyOf:ft.z.array(Fr).nonempty()})).or(ft.z.object({allOf:ft.z.array(Fr).nonempty()})).or(ft.z.object({not:Fr}))),ds=ft.z.object({result:ft.z.literal(Qn.ALLOW).or(ft.z.literal(Qn.DENY))}),Fo=ft.z.union([ft.z.object({result:ft.z.literal(Qn.ALLOW).or(ft.z.literal(Qn.DENY))}),ft.z.object({result:ft.z.literal(Qn.CONDITIONAL),pluginId:ft.z.string(),resourceType:ft.z.string(),conditions:Fr})]),Uo=(i,n)=>ft.z.object({items:ft.z.array(ft.z.intersection(ft.z.object({id:ft.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:a})=>n.has(a)),{message:"Items in response do not match request"})});class us{async authorize(n,s){return this.makeRequest(n,ds,s)}async authorizeConditional(n,s){return this.makeRequest(n,Fo,s)}async makeRequest(n,s,a){if(!this.enabled)return n.map(Te=>({result:Qn.ALLOW}));const p={items:n.map(Te=>({id:fo.Z(),...Te}))},j=await this.discovery.getBaseUrl("permission"),O=await Vn()(`${j}/authorize`,{method:"POST",body:JSON.stringify(p),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!O.ok)throw await po.VL.fromResponse(O);const M=await O.json(),be=Uo(s,new Set(p.items.map(({id:Te})=>Te))).parse(M).items.reduce((Te,Ke)=>(Te[Ke.id]=Ke,Te),{});return p.items.map(Te=>be[Te.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){(0,z._)(this,"enabled",void 0),(0,z._)(this,"discovery",void 0),this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class go{static create(n){const{config:s,discovery:a,identity:p}=n,j=new us({discovery:a,config:s});return new go(j,p)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){(0,z._)(this,"permissionClient",void 0),(0,z._)(this,"identityApi",void 0),this.permissionClient=n,this.identityApi=s}}var x=r(69984);function C(i){const n=(0,g.h_)(Do),{data:s,error:a}=(0,x.ZP)(i,async p=>{if(Zo(p.permission)&&!p.resourceRef)return Qn.DENY;const{result:j}=await n.authorize(p);return j});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Qn.ALLOW}}const R=i=>{const{permission:n,resourceRef:s,errorComponent:a,...p}=i,j=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),O=useApp(),{NotFoundErrorPage:M}=O.getComponents();let ie=a===void 0?_jsx(M,{}):a;return j.loading?ie=null:j.allowed&&(ie=i.element),_jsx(Route,{...p,element:ie})};function D(i){const{permission:n,resourceRef:s}=i,a=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),p=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:j}=p.getComponents();return _jsx(j,{})}const ee=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>U.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new Z}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new pe}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const n=new re(i,new q);return Ae.forward(n,{hidden:!1}),n}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>Ot.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>wt({middleware:[nn.resolvePluginProtocol({discoveryApi:s}),nn.injectIdentityAuth({identityApi:n,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new en}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Ln.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Gt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>qt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>zn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Mn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Tn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>ae.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>ze.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>ne.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Do,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:n,identity:s})=>go.create({config:i,discovery:n,identity:s})})];var de=r(77277),Q=r(53974),ve=r(71597);function Ee({children:i}){return(0,W.GV)()?(0,h.jsx)(h.Fragment,{children:i}):(0,h.jsx)(W.VA,{children:i})}const Ie=()=>(0,h.jsx)(Q.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Ne=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,h.jsx)(Ee,{children:(0,h.jsx)(Q.mf,{status:"501",statusMessage:s})})},Fe=({error:i,resetError:n,plugin:s})=>(0,h.jsx)(Q.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,h.jsx)(de.Z,{variant:"outlined",onClick:n,children:"Retry"})}),rt={Progress:Q.Ex,Router:ve.VK,NotFoundErrorPage:Ie,BootErrorPage:Ne,ErrorBoundaryFallback:Fe};var ct=r(43642),He=r(80079),$e=r(90941),Je=r(32915),Et=r(40562),ln=r(21853),Jt=r(60744),rn=r(66569),cn=r(30254),Cn=r(13384),Rn=r(15933),Ar=r(58838),Ur=r(86737),Kr=r(4989),In=r(44407),$n=r(18628),kr=r(84219),Vs=r(98685),hs=r(39781),Fi=r(39412);const ps={brokenImage:He.Z,catalog:$n.Z,scaffolder:Je.Z,techdocs:Et.Z,search:ln.Z,chat:Jt.Z,dashboard:rn.Z,docs:cn.Z,email:Cn.Z,github:Ar.Z,group:kr.Z,help:Ur.Z,"kind:api":Rn.Z,"kind:component":In.Z,"kind:domain":ct.Z,"kind:group":kr.Z,"kind:location":Kr.Z,"kind:system":$e.Z,"kind:user":Vs.Z,"kind:resource":Fi.Z,user:Vs.Z,warning:hs.Z};var Hs=r(73689),Mo=r(48032);const er={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},sr={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function ir(i){const{colors:n,shape:s,options:a}=i,j=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,O=`${s}, ${j}`;var M;const ie=(M=a==null?void 0:a.fontColor)!==null&&M!==void 0?M:"#FFFFFF";return{colors:n,shape:s,backgroundImage:O,fontColor:ie}}const Yr={home:ir({colors:sr.teal,shape:er.wave}),documentation:ir({colors:sr.pinkSea,shape:er.wave2}),tool:ir({colors:sr.purpleSky,shape:er.round}),service:ir({colors:sr.marineBlue,shape:er.wave}),website:ir({colors:sr.veryBlue,shape:er.wave}),library:ir({colors:sr.rubyRed,shape:er.wave}),other:ir({colors:sr.darkGrey,shape:er.wave}),app:ir({colors:sr.toastyOrange,shape:er.wave}),apis:ir({colors:sr.teal,shape:er.wave2}),card:ir({colors:sr.greens,shape:er.wave})},Gs=16,Ks='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Ys(i){const{palette:n,htmlFontSize:s=Gs,fontFamily:a=Ks,defaultPageTheme:p,pageTheme:j=Yr}=i;if(!j[p])throw new Error(`${p} is not defined in pageTheme.`);var O;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:a,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:j[p],getPageTheme:({themeId:M})=>(O=j[M])!==null&&O!==void 0?O:j[p]}}function Ui(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Mo.darken)(i.palette.link,.3),background:(0,Mo.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function fs(i){const n=Ys(i),s=(0,Hs.Z)(n),a=Ui(s);return{...s,overrides:a}}var gs=r(34505);const ms=fs({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:gs.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Yr}),Jr=fs({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:gs.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Yr});var Js=r(98192),vs=r(15222),ys=r(41547),zo=r(87561);const xs=[{id:"light",title:"Light Theme",variant:"light",icon:(0,h.jsx)(vs.Z,{}),Provider:({children:i})=>(0,h.jsx)(ys.Z,{theme:ms,children:(0,h.jsx)(zo.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,h.jsx)(Js.Z,{}),Provider:({children:i})=>(0,h.jsx)(ys.Z,{theme:Jr,children:(0,h.jsx)(zo.ZP,{children:i})})}];function Qs(i){var n,s,a,p;return uo({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...rt,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:ee,icons:{...ps,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(p=i==null?void 0:i.themes)!==null&&p!==void 0?p:xs})}var Wo=r(25271),bs=r(76635);async function Ss({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=n.snapshot("starredEntities").value;if(!(0,bs.isArray)(a))return;var p;const j=new Set((p=s.snapshot("entityRefs").value)!==null&&p!==void 0?p:[]);a.filter(bs.isString).map(O=>O.split(":")).filter(O=>O.length===4&&O[0]==="entity").map(([O,M,ie,be])=>(0,Wo.eE)({kind:M,namespace:ie,name:be})).forEach(O=>j.add(O)),await s.set("entityRefs",Array.from(j)),await n.remove("starredEntities")}class Xs{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){(0,z._)(this,"settingsStore",void 0),(0,z._)(this,"starredEntities",void 0),(0,z._)(this,"subscribers",new Set),(0,z._)(this,"observable",new(Se())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),Ss(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var p;this.starredEntities=new Set((p=a.value)!==null&&p!==void 0?p:[]),this.notifyChanges()}})}}var ar=r(33414),Qr=r(79692),Mi=r(12420),Hn=r(43514),Ra=r(19928);function Ia(){const i=useApi(catalogApiRef),{error:n,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(j=>{var O;return((O=j.facets.kind)===null||O===void 0?void 0:O.map(M=>M.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:a!=null?a:[]}}function Pa(i,n,s){let a=i;return n&&(a=a.filter(j=>n.some(O=>O.toLocaleLowerCase("en-US")===j.toLocaleLowerCase("en-US")))),s&&!i.some(j=>j.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((j,O)=>(j[O.toLocaleLowerCase("en-US")]=O,j),{})}const zi=(0,Qr.Z)(i=>(0,Mi.Z)({root:{...i.typography.h4}}));function La(i){var n;const{initialFilter:s="component",allowedKinds:a}=i,p=zi(),{allKinds:j}=useAllKinds(),{filters:O,updateFilters:M,queryParameters:{kind:ie}}=useEntityList(),be=useMemo(()=>[ie].flat()[0],[ie]);var Te;const[Ke,vt]=useState((Te=be!=null?be:(n=O.kind)===null||n===void 0?void 0:n.value)!==null&&Te!==void 0?Te:s);useEffect(()=>{be&&vt(be)},[be]),useEffect(()=>{var It;if(!((It=O.kind)===null||It===void 0)&&It.value){var zt;vt((zt=O.kind)===null||zt===void 0?void 0:zt.value)}},[O.kind]),useEffect(()=>{M({kind:Ke?new EntityKindFilter(Ke):void 0})},[Ke,M]);const At=filterKinds(j,a,Ke);return _jsx(Select,{input:_jsx(InputBase,{}),value:Ke.toLocaleLowerCase("en-US"),onChange:It=>vt(It.target.value),classes:p,children:Object.keys(At).map(It=>_jsx(MenuItem,{value:It,children:`${pluralize(At[It])}`},It))})}var Vo=r(86359),Cs=r(95544),Wi=r(99688),mo=r(12231),vo=r(86136),Mr=r(49378),_s=r(85256),ws=r(80030),js=r(61837),Ho=r(79784),lr=r(50758),Go=r(31654),yo=r(43054),Es=r(65759),ei=r(49280),fr=r(96641);function ti(i){const{entity:n,loading:s,error:a}=(0,fr.ce)(),{allowed:p,loading:j,error:O}=C({permission:i,resourceRef:n?(0,Wo.eE)(n):void 0});return s||j?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:p,error:O}}const xo="catalog-entity",ni=pr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:xo}),Vi=pr({name:"catalog.entity.create",attributes:{action:"create"}}),tr=pr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:xo}),As=pr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:xo}),ri=pr({name:"catalog.location.read",attributes:{action:"read"}}),oi=pr({name:"catalog.location.create",attributes:{action:"create"}}),si=pr({name:"catalog.location.delete",attributes:{action:"delete"}}),Hi=[ni,Vi,tr,As,ri,oi,si];var bo=r(49166);function Ts(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:p}=i,j=typeof(n==null?void 0:n.disableUnregister)=="boolean";var O;const M=(O=!s||(j?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&O!==void 0?O:!1;let ie=(0,h.jsx)(h.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ie=(0,h.jsxs)(mo.Z,{onClick:()=>{p(),a()},disabled:M,children:[(0,h.jsx)(vo.Z,{children:(0,h.jsx)(bo.Z,{fontSize:"small"})}),(0,h.jsx)(Mr.Z,{primary:"Unregister entity"})]})),(0,h.jsx)(h.Fragment,{children:ie})}const Rs=(0,Qr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Is(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:p}=i,[j,O]=(0,H.useState)(),M=Rs(),be=ti(tr).allowed,Te=zt=>{O(zt.currentTarget)},Ke=()=>{O(void 0)},vt=(0,g.h_)(g.$v),At=(0,H.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>vt.post({message:"Copied!",severity:"info",display:"transient"}))},[vt]),It=n&&[...n.map(zt=>(0,h.jsxs)(mo.Z,{onClick:()=>{Ke(),zt.onClick()},children:[(0,h.jsx)(vo.Z,{children:(0,h.jsx)(zt.Icon,{fontSize:"small"})}),(0,h.jsx)(Mr.Z,{primary:zt.title})]},zt.title)),(0,h.jsx)(_s.Z,{},"the divider is here!")];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ws.ZP,{title:"More",arrow:!0,children:(0,h.jsx)(js.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!j,role:"button",onClick:Te,"data-testid":"menu-button",className:M.button,id:"long-menu",children:(0,h.jsx)(yo.Z,{})})}),(0,h.jsx)(Ho.ZP,{open:Boolean(j),onClose:Ke,anchorEl:j,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,h.jsxs)(lr.Z,{children:[It,(0,h.jsx)(Ts,{unregisterEntityOptions:s,isUnregisterAllowed:be,onUnregisterEntity:a,onClose:Ke}),(0,h.jsxs)(mo.Z,{onClick:()=>{Ke(),p()},children:[(0,h.jsx)(vo.Z,{children:(0,h.jsx)(Go.Z,{fontSize:"small"})}),(0,h.jsx)(Mr.Z,{primary:"Inspect entity"})]}),(0,h.jsxs)(mo.Z,{onClick:()=>{Ke(),At()},children:[(0,h.jsx)(vo.Z,{children:(0,h.jsx)(Es.Z,{fontSize:"small"})}),(0,h.jsx)(Mr.Z,{primary:"Copy entity URL"})]})]})})]})}const Ko="plugin.catalog.entityLayoutRoute",Xr=()=>null;(0,g.R5)(Xr,Ko,!0),(0,g.R5)(Xr,"core.gatherMountPoints",!0);function ii(i){const{entity:n,title:s}=i;return(0,h.jsxs)(Cs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,h.jsx)(Cs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,h.jsx)(Hn.LH,{entity:n})]})}function Ps(i,n,s,a){var p;const j=(p=i!=null?i:a==null?void 0:a.kind)!==null&&p!==void 0?p:"";var O;const M=(O=n!=null?n:a==null?void 0:a.metadata.namespace)!==null&&O!==void 0?O:"";var ie,be,Te;return{headerTitle:`${(Te=(be=(ie=a==null?void 0:a.metadata.title)!==null&&ie!==void 0?ie:s)!==null&&be!==void 0?be:a==null?void 0:a.metadata.name)!==null&&Te!==void 0?Te:""}${M&&M!==Wo.zG?` in ${M}`:""}`,headerType:(()=>{let vt=j.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(vt+=" \u2014 ",vt+=a.spec.type.toLocaleLowerCase("en-US")),vt})()}}function Ls(i){var n;const{entity:s}=i,a=(0,Hn.hF)(s,Wo.S4);return(0,h.jsxs)(h.Fragment,{children:[a.length>0&&(0,h.jsx)(Q.i9,{label:"Owner",value:(0,h.jsx)(Hn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,h.jsx)(Q.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const ks=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,children:j,NotFoundComponent:O}=i,{kind:M,namespace:ie,name:be}=(0,g.Oi)(Hn.wi),{entity:Te,loading:Ke,error:vt}=(0,Hn.ce)(),At=(0,W.TH)(),It=(0,g.vJ)(j,ki=>ki.selectByComponentData({key:Ko,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:zr})=>{if(Te){if(zr.if&&!zr.if(Te))return[]}else return[];return[{path:zr.path,title:zr.title,children:zr.children,tabProps:zr.tabProps}]}),[Te]),{headerTitle:zt,headerType:Wt}=Ps(M,ie,be,Te),[Zn,cr]=(0,H.useState)(!1),[nr,jo]=(0,H.useState)(!1),Pi=(0,W.s0)(),Li=async()=>{cr(!1),jo(!1),Pi("/")};(0,H.useEffect)(()=>{cr(!1),jo(!1)},[At.pathname]);var _o;return(0,h.jsxs)(Q.T3,{themeId:(_o=Te==null||(n=Te.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&_o!==void 0?_o:"home",children:[(0,h.jsx)(Q.h4,{title:(0,h.jsx)(ii,{title:zt,entity:Te}),pageTitleOverride:zt,type:Wt,children:Te&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ls,{entity:Te}),(0,h.jsx)(Is,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,onUnregisterEntity:()=>cr(!0),onInspectEntity:()=>jo(!0)})]})}),Ke&&(0,h.jsx)(Q.Ex,{}),Te&&(0,h.jsx)(Q.tn,{routes:It}),vt&&(0,h.jsx)(Q.VY,{children:(0,h.jsx)(Wi.Z,{severity:"error",children:vt.toString()})}),!Ke&&!vt&&!Te&&(0,h.jsx)(Q.VY,{children:O||(0,h.jsxs)(Q.GB,{title:"Entity not found",children:["There is no ",M," with the requested"," ",(0,h.jsx)(Q.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,h.jsx)(Hn.pp,{open:Zn,entity:Te,onConfirm:Li,onClose:()=>cr(!1)}),(0,h.jsx)(Hn.U_,{open:nr,entity:Te,onClose:()=>jo(!1)})]})};ks.Route=Xr;function Gi(i){const{open:n,onClose:s,onConfirm:a,entity:p}=i,[j,O]=useState(!1),M=useApi(catalogApiRef),ie=useApi(alertApiRef),be=async()=>{O(!0);try{const Te=p.metadata.uid;await M.removeEntityByUid(Te),a()}catch(Te){assertError(Te),ie.post({message:Te.message})}finally{O(!1)}};return _jsxs(Dialog,{open:n,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:j,onClick:be,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var Or=r(19625);function Ki(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function Yi(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:p}=useEntity(),j=async()=>{a(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:p,onConfirm:j,onClose:()=>a(!1)})]})}var Os=r(4791);const Bs=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function $s(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(p=>{var j,O;return{errors:((O=(j=p.entity.status)===null||j===void 0?void 0:j.items)!==null&&O!==void 0?O:[]).filter(Bs).map(be=>be.error).filter(be=>Boolean(be)),entity:p.entity}}).filter(p=>p.errors.length>0)}}async function Ji(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await $s(stringifyEntityRef(i),s)).items.length>0}function Qi(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:p,value:j}=useAsync(async()=>$s(n,s),[n,s]);return p?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:p})}):a||!j?null:_jsx(_Fragment,{children:j.items.map((O,M)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(O.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:O.entity})]}),O.errors.map((ie,be)=>_jsx(ResponseErrorPanel,{error:ie},be))]},M))})}const Yo="core.backstage.entitySwitch",Ds=i=>null;(0,g.R5)(Ds,Yo,!0);const So=i=>{var n;const{entity:s,loading:a}=(0,Hn.ce)(),p=(0,g.I_)(),j=(0,g.vJ)(i.children,ie=>ie.selectByComponentData({key:Yo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(be=>{if(a)return[];const{if:Te,children:Ke}=be.props;return s?[{if:Te==null?void 0:Te(s,{apis:p}),children:Ke}]:[{if:Te===void 0,children:Ke}]}),[p,s,a]);if(j.some(ie=>typeof ie.if=="object"&&"then"in ie.if))return(0,h.jsx)(Zs,{results:j,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ie=j.filter(be=>be.if).map(be=>be.children);return ie.length===0?Co(j):(0,h.jsx)(h.Fragment,{children:ie})}var M;return(M=(n=j.find(ie=>ie.if))===null||n===void 0?void 0:n.children)!==null&&M!==void 0?M:Co(j)};function Zs({results:i,renderMultipleMatches:n}){const{loading:s,value:a}=(0,xe.default)(async()=>{const p=i.map(async({if:O,children:M})=>{try{if(await O)return M}catch{}return null});if(n==="all"){const O=(await Promise.all(p)).filter(Boolean);return O.length===0?Co(i):(0,h.jsx)(h.Fragment,{children:O})}var j;return(j=(await Promise.all(p)).find(Boolean))!==null&&j!==void 0?j:Co(i)},[i]);return s||!a?null:a}function Co(i){var n,s;return(s=(n=i.filter(a=>a.if===void 0)[0])===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:null}So.Case=Ds;const ai=null,Xi=Hn._i.Filters,li=Hn._i.Content;var ci=r(85877),Gn=r(15096);const Dn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Hn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:n})=>new Os.MS({discoveryApi:i,fetchApi:n})}),(0,g.ni)({api:Hn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new Xs({storageApi:i})})],routes:{catalogIndex:Or._Z,catalogEntity:Hn.wi},externalRoutes:{createComponent:Or.yw,viewTechDoc:Or.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),qi=Dn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>r.e(9323).then(r.bind(r,89323)).then(i=>i.CatalogPage),mountPoint:Or._Z})),di=Dn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>r.e(8951).then(r.bind(r,78951)).then(i=>i.CatalogEntityPage),mountPoint:Hn.wi})),ui=Dn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,33414)).then(i=>i.AboutCard)}})),_i=Dn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>r.e(7750).then(r.bind(r,17750)).then(i=>i.EntityLinksCard)}})),ka=Dn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,85877)).then(i=>i.EntityLabelsCard)}})),Ns=Dn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>r.e(5458).then(r.bind(r,5458)).then(i=>i.HasSystemsCard)}})),ea=Dn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>r.e(1105).then(r.bind(r,1105)).then(i=>i.HasComponentsCard)}})),ta=Dn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>r.e(2440).then(r.bind(r,82440)).then(i=>i.HasSubcomponentsCard)}})),na=Dn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>r.e(9770).then(r.bind(r,79770)).then(i=>i.HasResourcesCard)}})),Jo=Dn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>r.e(9545).then(r.bind(r,19545)).then(i=>i.DependsOnComponentsCard)}})),ra=Dn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>r.e(184).then(r.bind(r,40184)).then(i=>i.DependencyOfComponentsCard)}})),oa=Dn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>r.e(1032).then(r.bind(r,81032)).then(i=>i.DependsOnResourcesCard)}})),hi=Dn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>r.e(732).then(r.bind(r,732)).then(i=>i.RelatedEntitiesCard)}})),sa=Dn.provide((0,Gn.E5)({name:"CatalogSearchResultListItem",component:()=>r.e(7670).then(r.bind(r,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var pi=r(32838);class ia{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,s){const p=`${await this.getApiOrigin()}/${s}`,j=await fetch(`${p.endsWith("/")?p:`${p}/`}index.html`);if(j.status===404)throw new Error("Page not found");return j.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,a){const p=await this.getApiOrigin();return new URL(n,`${p}/${a}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}class fi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}const aa=[(0,g.ni)({api:oe.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new ia({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:oe.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new fi({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:pi.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>pi.ae.fromConfig(i)})],la={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Qo={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Xo(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function gi(){const i=await io(),n=await Xo();return[...i,{context:"detected",data:n?la:Qo}]}var wo=r(58845);const mi=(0,Qr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var vi=()=>{const i=mi();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,h.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const yi=(0,Qr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var bi=()=>{const i=yi();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,h.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const Us=(0,Qr.Z)({root:{width:Q.po.drawerWidthClosed,height:3*Q.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Q.po.drawerWidthClosed,marginLeft:24}}),ca=()=>{const i=Us(),{isOpen:n}=(0,Q.mZ)();return(0,h.jsx)("div",{className:i.root,children:(0,h.jsx)(Q.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,h.jsx)(vi,{}):(0,h.jsx)(bi,{})})})},da=({children:i})=>(0,h.jsxs)(Q.tR,{children:[(0,h.jsxs)(Q.YE,{children:[(0,h.jsx)(ca,{}),(0,h.jsx)(Q.v7,{}),(0,h.jsx)(Q.R6,{icon:wo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var ua=r(32388),Si=r(4142);const Ci=(0,Qr.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var gr;(function(i){i.LIGHT="light",i.DARK="dark"})(gr||(gr={}));const ha=()=>{const i=(0,g.h_)(g.hg),n=Ci(),[s,a]=(0,H.useState)(i.getActiveThemeId()===gr.DARK?gr.DARK:gr.LIGHT),p={[gr.LIGHT]:{icon:Si.Z,title:"Dark theme"},[gr.DARK]:{icon:ua.Z,title:"Light theme"}},{title:j,icon:O}=p[s],M=()=>{a(ie=>{const be=ie===gr.LIGHT?gr.DARK:gr.LIGHT;return i.setActiveThemeId(be),be})};return(0,h.jsx)(Cs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,h.jsx)(ws.ZP,{title:j,arrow:!0,children:(0,h.jsx)(js.Z,{size:"small",onClick:M,children:(0,h.jsx)(O,{className:n.headerIcon})})})})},wi=()=>(0,h.jsxs)(L.I6,{children:[(0,h.jsx)(K.S,{}),(0,h.jsx)(I.F,{withSearch:!1})]}),ji=(0,h.jsx)(wi,{}),qo=Qs({apis:aa,configLoader:gi,plugins:Object.values(t)}),Ei=qo.getProvider(),Ai=qo.getRouter(),pa=L.s4.provide((0,oe.KY)({name:"ThemeToggleAddon",component:ha,location:oe.oZ.Header})),Ti=(0,h.jsxs)(Lr,{children:[(0,h.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,h.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,h.jsx)(di,{})}),(0,h.jsx)(W.AW,{path:"/docs",element:(0,h.jsx)(L.Jl,{}),children:(0,h.jsx)($.u,{})}),(0,h.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,h.jsx)(L.I6,{}),children:[ji,(0,h.jsx)(oe.DR,{children:(0,h.jsx)(pa,{})})]})]});var Ii=()=>(0,h.jsx)(Ei,{children:(0,h.jsx)(Ai,{children:(0,h.jsx)(da,{children:Ti})})});f.render((0,h.jsx)(Ii,{}),document.getElementById("root"))},51837:function(jt,De,r){"use strict";r.d(De,{CT:function(){return g},EI:function(){return me},uW:function(){return f},Vt:function(){return u}});function t(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const h=t(),H=ue=>`__@backstage/${ue}__`;function f(ue,V){const K=H(ue);let I=h[K];return I||(I=V(),h[K]=I,I)}var W=r(2784);function g(ue){return f(ue,()=>(0,W.createContext)(void 0))}function u(ue){return(0,W.useContext)(g(ue))}function B(ue){return{set(V){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function me(ue){Object.freeze(ue);const V={atVersion(K){return ue[K]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),V}},96641:function(jt,De,r){"use strict";r.d(De,{X2:function(){return me},ce:function(){return ue},h$:function(){return u}});var t=r(52322),h=r(25271),H=r(60871),f=r(51837),W=r(2784);const g=(0,f.CT)("entity-context"),u=V=>{const{children:K,entity:I,loading:w,error:se,refresh:_}=V,te={entity:I,loading:w,error:se,refresh:_};return(0,t.jsx)(g.Provider,{value:(0,f.EI)({1:te}),children:(0,t.jsx)(H.fC,{attributes:{...I?{entityRef:(0,h.eE)(I)}:void 0},children:K})})},B=V=>_jsx(u,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function me(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");if(!K.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:K.entity}}function ue(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");const{entity:I,loading:w,error:se,refresh:_}=K;return{entity:I,loading:w,error:se,refresh:_}}},43514:function(jt,De,r){"use strict";r.d(De,{h$:function(){return bt.h$},n3:function(){return t.n3},_i:function(){return T},tW:function(){return Kn},df:function(){return ze},UO:function(){return nt},ph:function(){return us},dq:function(){return kt},nl:function(){return Fo},dx:function(){return ce},rI:function(){return Ce},u3:function(){return Ft},xE:function(){return Yn},sL:function(){return ur},LH:function(){return b},U_:function(){return Do},pp:function(){return ls},EW:function(){return Vn},Ah:function(){return H},wi:function(){return X},hF:function(){return oe.hF},CV:function(){return oe.CV},$3:function(){return Z},p3:function(){return f},ce:function(){return bt.ce},X2:function(){return bt.X2},wp:function(){return yt},ZW:function(){return _t},eK:function(){return qt},CR:function(){return Pn}});var t=r(4791),h=r(60871);const H=(0,h.T0)({id:"plugin.catalog.service"}),f=(0,h.T0)({id:"catalog-react.starred-entities"});var W=r(82394);class g{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const R of this.subscribers)R.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}}var u=r(52322),B=r(2784),me=r(41156),ue=r(60364),V=r(77277),K=r(4190),I=r(95544),w=r(90436),se=r(60905),_=r(36444);const te=x=>{const C=(0,me.Z)(de=>de.breakpoints.down("md")),R=(0,ue.Z)(),[D,ee]=(0,B.useState)(!1);return C?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>ee(!0),startIcon:(0,u.jsx)(_.Z,{}),children:"Filters"}),(0,u.jsx)(K.ZP,{open:D,onClose:()=>ee(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,u.jsxs)(I.Z,{m:2,children:[(0,u.jsx)(w.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),x.children]})})]}):(0,u.jsx)(se.Z,{item:!0,lg:2,children:x.children})},$=x=>(0,u.jsx)(se.Z,{item:!0,xs:12,lg:10,children:x.children}),T=x=>(0,u.jsx)(se.Z,{container:!0,style:{position:"relative"},children:x.children});T.Filters=te,T.Content=$;var P=r(53974),L=r(87612),k=r(25271),oe=r(49280);class ke{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class We{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class z{filterEntity(C){var R;return this.values.every(D=>((R=C.metadata.tags)!==null&&R!==void 0?R:[]).includes(D))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class xt{filterEntity(C){const R=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([C.metadata.tags]),ee=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const de of R)if(D.every(Q=>Q!==de)&&ee.every(Q=>!Q.includes(de)))return!1;return!0}toUpperArray(C){return C.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(C){_define_property(this,"value",void 0),this.value=C}}class ot{filterEntity(C){return this.values.some(R=>(0,oe.hF)(C,k.S4).some(D=>(0,k.eE)(D)===R))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C.reduce((R,D)=>{try{return R.push((0,k.eE)((0,k.of)(D,{defaultKind:"Group"}))),R}catch{return R}},[])}}class Ye{filterEntity(C){return this.values.some(R=>{var D;return((D=C.spec)===null||D===void 0?void 0:D.lifecycle)===R})}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class st{filterEntity(C){return this.values.some(R=>C.metadata.namespace===R)}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class Qe{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,R,D){(0,L._)(this,"value",void 0),(0,L._)(this,"isOwnedEntity",void 0),(0,L._)(this,"isStarredEntity",void 0),this.value=C,this.isOwnedEntity=R,this.isStarredEntity=D}}class Ct{filterEntity(C){var R;const D=(R=C.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class Tt{filterEntity(C){var R,D;const ee=(C==null||(R=C.status)===null||R===void 0||(D=R.items)===null||D===void 0?void 0:D.length)>0;return ee!==void 0&&this.value===ee}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}var bt=r(96641),it=r(76635),Pt=r(19126),Nt=r.n(Pt),Ge=r(73557),Qt=r(69294),ge=r(48760),Se=r(90736);const Ue=(0,B.createContext)(void 0),nt=x=>{const C=(0,Se.default)(),R=(0,h.h_)(H),[D,ee]=(0,B.useState)({}),de=(0,Ge.TH)();var Q;const ve=(0,B.useMemo)(()=>(Q=Nt().parse(de.search,{ignoreQueryPrefix:!0}).filters)!==null&&Q!==void 0?Q:{},[de]),[Ee,Ie]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ne,error:Fe},rt]=(0,Qt.default)(async()=>{const $e=(0,it.compact)(Object.values(D)),Je=(0,oe.Gz)($e),Et=(0,oe.wq)($e),ln=(0,oe.wq)((0,it.compact)(Object.values(Ee.appliedFilters))),Jt=Object.keys(D).reduce((cn,Cn)=>{const Rn=D[Cn];return Rn!=null&&Rn.toQueryValue&&(cn[Cn]=Rn.toQueryValue()),cn},{});if((0,it.isEqual)(ln,Et))Ie({appliedFilters:D,backendEntities:Ee.backendEntities,entities:Ee.backendEntities.filter(Je)});else{const cn=await R.getEntities({filter:Et});Ie({appliedFilters:D,backendEntities:cn.items,entities:cn.items.filter(Je)})}if(C()){var rn;const cn=Nt().parse(de.search,{ignoreQueryPrefix:!0}),Cn=Nt().stringify({...cn,filters:Jt},{addQueryPrefix:!0,arrayFormat:"repeat"}),Rn=`${window.location.pathname}${Cn}`;(rn=window.history)===null||rn===void 0||rn.replaceState(null,document.title,Rn)}},[R,ve,D,Ee],{loading:!0});(0,ge.Z)(rt,10,[D]);const ct=(0,B.useCallback)($e=>{ee(Je=>{const Et=typeof $e=="function"?$e(Je):$e;return{...Je,...Et}})},[]),He=(0,B.useMemo)(()=>({filters:Ee.appliedFilters,entities:Ee.entities,backendEntities:Ee.backendEntities,updateFilters:ct,queryParameters:ve,loading:Ne,error:Fe}),[Ee,ct,ve,Ne,Fe]);return(0,u.jsx)(Ue.Provider,{value:He,children:x.children})};function yt(){const x=(0,B.useContext)(Ue);if(!x)throw new Error("useEntityList must be used within EntityListProvider");return x}var gt=r(64279),pt=r(18149),Bt=r.n(pt),Mt=r(829),Kt=r.n(Mt);function $t(){const x=(0,h.h_)(H),{filters:{kind:C,type:R},queryParameters:{type:D},updateFilters:ee}=yt(),de=(0,B.useMemo)(()=>[D].flat().filter(Boolean),[D]);var Q;const[ve,Ee]=(0,B.useState)(de.length?de:(Q=R==null?void 0:R.getTypes())!==null&&Q!==void 0?Q:[]);(0,B.useEffect)(()=>{de.length&&Ee(de)},[de]);const[Ie,Ne]=(0,B.useState)([]),Fe=(0,B.useMemo)(()=>C==null?void 0:C.value,[C]),{error:rt,loading:ct,value:He}=(0,gt.default)(async()=>Fe?await x.getEntityFacets({filter:{kind:Fe},facets:["spec.type"]}).then(Et=>Et.facets["spec.type"]||[]):[],[Fe,x]),$e=(0,B.useRef)(He);return(0,B.useEffect)(()=>{const Je=$e.current;if($e.current=He,ct||!Fe||Je===He||!He)return;const Et=[...new Set(Kt()(He,Jt=>-Jt.count).map(Jt=>Jt.value.toLocaleLowerCase("en-US")))];Ne(Et);const ln=ve.filter(Jt=>Et.includes(Jt));Bt()(ve,ln)||Ee(ln)},[ct,Fe,ve,Ee,He]),(0,B.useEffect)(()=>{ee({type:ve.length?new We(ve):void 0})},[ve,ee]),{loading:ct,error:rt,availableTypes:Ie,selectedTypes:ve,setSelectedTypes:Ee}}const Xt=20;function qt(x,C){var R,D;const ee=C==null||(R=C.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),de=C==null||(D=C.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),Q=(0,h.h_)(H),{loading:ve,value:Ee,error:Ie}=(0,gt.default)(async()=>{var Ne;const Fe=(Ne=x.relations)===null||Ne===void 0?void 0:Ne.map($e=>({type:$e.type,target:(0,k.of)($e.targetRef)})).filter($e=>(!ee||$e.type.toLocaleLowerCase("en-US")===ee)&&(!de||$e.target.kind===de));if(!Fe)return[];const rt=Object.values((0,it.groupBy)(Fe,({target:$e})=>`${$e.kind}:${$e.namespace}`.toLocaleLowerCase("en-US"))),ct=[];for(const $e of rt)ct.push({kind:$e[0].target.kind,namespace:$e[0].target.namespace,nameBatches:(0,it.chunk)($e.map(Je=>Je.target.name),Xt)});return(await Promise.all(ct.flatMap($e=>$e.nameBatches.map(Je=>Q.getEntities({filter:{kind:$e.kind,"metadata.namespace":$e.namespace,"metadata.name":Je}}))))).flatMap($e=>$e.items)},[x,ee,de]);return{entities:Ee,loading:ve,error:Ie}}var gn=r(72164);function Mn(x){return typeof x=="string"?x:(0,k.eE)(x)}function Pn(){const x=(0,h.h_)(f),C=(0,gn.Z)(x.starredEntitie$(),new Set),R=(0,B.useCallback)(ee=>C.has(Mn(ee)),[C]),D=(0,B.useCallback)(ee=>x.toggleStarred(Mn(ee)).then(),[x]);return{starredEntities:C,toggleStarredEntity:D,isStarredEntity:R}}function mn(x){return typeof x=="string"?x:(0,k.eE)(x)}function Ln(x){const C=(0,h.h_)(f),[R,D]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const de=C.starredEntitie$().subscribe({next(Q){D(Q.has(mn(x)))}});return()=>{de.unsubscribe()}},[x,C]),{toggleStarredEntity:(0,B.useCallback)(()=>C.toggleStarred(mn(x)).then(),[x,C]),isStarredEntity:R}}var kn=r(75435);function _t(){const x=(0,h.h_)(h.$4),{loading:C,value:R}=(0,gt.default)(async()=>{const{ownershipEntityRefs:ee}=await x.getBackstageIdentity();return ee},[]),D=(0,B.useMemo)(()=>{const ee=new Set(R!=null?R:[]);return de=>{const Q=(0,kn.h)(de,k.S4).map(k.eE);for(const ve of Q)if(ee.has(ve))return!0;return!1}},[R]);return(0,B.useMemo)(()=>({loading:C,isOwnedEntity:D}),[C,D])}function jn(){const x=(0,h.h_)(H),{error:C,loading:R,value:D}=(0,gt.default)(async()=>await x.getEntityFacets({facets:["kind"]}).then(de=>{var Q;return((Q=de.facets.kind)===null||Q===void 0?void 0:Q.map(ve=>ve.value).sort())||[]}),[x]);return{loading:R,error:C,allKinds:D!=null?D:[]}}function zn(x,C,R){let D=x;return C&&(D=D.filter(de=>C.some(Q=>Q.toLocaleLowerCase("en-US")===de.toLocaleLowerCase("en-US")))),R&&!x.some(de=>de.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US"))&&(D=D.concat([R])),D.sort().reduce((de,Q)=>(de[Q.toLocaleLowerCase("en-US")]=Q,de),{})}function ft(x){var C;const{filters:R,queryParameters:{kind:D},updateFilters:ee}=yt(),de=(0,B.useMemo)(()=>[D].flat()[0],[D]);var Q;const[ve,Ee]=(0,B.useState)((Q=de!=null?de:(C=R.kind)===null||C===void 0?void 0:C.value)!==null&&Q!==void 0?Q:x.initialFilter);(0,B.useEffect)(()=>{de&&Ee(de)},[de]),(0,B.useEffect)(()=>{var rt;if(!((rt=R.kind)===null||rt===void 0)&&rt.value){var ct;Ee((ct=R.kind)===null||ct===void 0?void 0:ct.value)}},[R.kind]),(0,B.useEffect)(()=>{ee({kind:ve?new ke(ve):void 0})},[ve,ee]);const{allKinds:Ie,loading:Ne,error:Fe}=jn();return{loading:Ne,error:Fe,allKinds:Ie!=null?Ie:[],selectedKind:ve,setSelectedKind:Ee}}const Kn=x=>{const{allowedKinds:C,hidden:R,initialFilter:D="component"}=x,ee=(0,h.h_)(h.$v),{error:de,allKinds:Q,selectedKind:ve,setSelectedKind:Ee}=ft({initialFilter:D});if((0,B.useEffect)(()=>{de&&ee.post({message:"Failed to load entity kinds",severity:"error"})},[de,ee]),de)return null;const Ie=zn(Q,C,ve),Ne=Object.keys(Ie).map(Fe=>({value:Fe,label:Ie[Fe]}));return R?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Kind",items:Ne,selected:ve.toLocaleLowerCase("en-US"),onChange:Fe=>Ee(String(Fe))})})};var Rt=r(79692),at=r(5806),xn=r(21324),Gt=r(86619),an=r(19996),En=r(25505),dn=r(38016),Tn=r(88013);const we=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),ae=(0,u.jsx)(En.Z,{fontSize:"small"}),Be=(0,u.jsx)(an.Z,{fontSize:"small"}),ze=x=>{var C;const{initialFilter:R=[]}=x,D=we(),{updateFilters:ee,backendEntities:de,filters:Q,queryParameters:{lifecycles:ve}}=yt(),Ee=(0,B.useMemo)(()=>[ve].flat().filter(Boolean),[ve]);var Ie;const[Ne,Fe]=(0,B.useState)(Ee.length?Ee:(Ie=(C=Q.lifecycles)===null||C===void 0?void 0:C.values)!==null&&Ie!==void 0?Ie:R);(0,B.useEffect)(()=>{Ee.length&&Fe(Ee)},[Ee]);const rt=(0,B.useMemo)(()=>[...new Set(de.map(ct=>{var He;return(He=ct.spec)===null||He===void 0?void 0:He.lifecycle}).filter(Boolean))].sort(),[de]);return(0,B.useEffect)(()=>{ee({lifecycles:Ne.length&&rt.length?new Ye(Ne):void 0})},[Ne,ee,rt]),rt.length?(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Lifecycle",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rt,value:Ne,onChange:(ct,He)=>Fe(He),renderOption:(ct,{selected:He})=>(0,u.jsx)(at.Z,{control:(0,u.jsx)(xn.Z,{icon:ae,checkedIcon:Be,checked:He}),onClick:$e=>$e.preventDefault(),label:ct}),size:"small",popupIcon:(0,u.jsx)(dn.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:ct=>(0,u.jsx)(Gt.Z,{...ct,className:D.input,variant:"outlined"})})]})}):null};var _e=r(72579),ne=r.n(_e);function Z(x,C){const R=C==null?void 0:C.defaultKind;let D,ee,de;return"metadata"in x?(D=x.kind,ee=x.metadata.namespace,de=x.metadata.name):(D=x.kind,ee=x.namespace,de=x.name),(ee===void 0||ee==="")&&(ee=k.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===ee&&(ee=void 0):ee===k.zG&&(ee=void 0),D=D.toLocaleLowerCase("en-US"),D=R&&R.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${ee?`${ee}/`:""}${de}`}function pe(x,C){for(const R of["spec.profile.displayName","metadata.title"]){const D=ne()(x,R);if(D&&typeof D=="string")return D}return Z(x,C)}const Ze=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Xe=(0,u.jsx)(En.Z,{fontSize:"small"}),lt=(0,u.jsx)(an.Z,{fontSize:"small"}),kt=()=>{var x;const C=Ze(),{updateFilters:R,backendEntities:D,filters:ee,queryParameters:{owners:de}}=yt(),Q=(0,h.h_)(H),ve=(0,h.h_)(h.VE),Ee=(0,B.useMemo)(()=>[de].flat().filter(Boolean),[de]);var Ie;const[Ne,Fe]=(0,B.useState)(Ee.length?new ot(Ee).values:(Ie=(x=ee.owners)===null||x===void 0?void 0:x.values)!==null&&Ie!==void 0?Ie:[]),{loading:rt,error:ct,value:He}=(0,gt.default)(async()=>{const Je=[...new Set(D.flatMap(Jt=>(0,oe.hF)(Jt,k.S4).map(rn=>(0,k.eE)(rn))).filter(Boolean))],{items:Et}=await Q.getEntitiesByRefs({entityRefs:Je,fields:["kind","metadata.name","metadata.title","metadata.namespace","spec.profile.displayName"]});return Et.map((Jt,rn)=>Jt?{label:pe(Jt,{defaultKind:"Group"}),entityRef:(0,k.eE)(Jt)}:{label:Z((0,k.of)(Je[rn]),{defaultKind:"group"}),entityRef:Je[rn]}).sort((Jt,rn)=>Jt.label.localeCompare(rn.label,"en-US",{ignorePunctuation:!0,caseFirst:"upper"}))},[D]);if((0,B.useEffect)(()=>{ct&&ve.post({...ct,message:`EntityOwnerPicker failed to initialize: ${ct.message}`},{})},[ct,ve]),(0,B.useEffect)(()=>{if(Ee.length){const Je=new ot(Ee);Fe(Je.values)}},[Ee]),(0,B.useEffect)(()=>{!rt&&He&&R({owners:Ne.length&&He.length?new ot(Ne):void 0})},[Ne,R,He,rt]),!rt&&!(He!=null&&He.length))return null;var $e;return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Owner",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:rt,options:He||[],value:($e=He==null?void 0:He.filter(Je=>Ne.some(Et=>Et===Je.entityRef)))!==null&&$e!==void 0?$e:[],onChange:(Je,Et)=>Fe(Et.map(ln=>ln.entityRef)),getOptionLabel:Je=>Je.label,renderOption:(Je,{selected:Et})=>(0,u.jsx)(at.Z,{control:(0,u.jsx)(xn.Z,{icon:Xe,checkedIcon:lt,checked:Et}),onClick:ln=>ln.preventDefault(),label:Je.label}),size:"small",popupIcon:(0,u.jsx)(dn.Z,{"data-testid":"owner-picker-expand"}),renderInput:Je=>(0,u.jsx)(Gt.Z,{...Je,className:C.input,variant:"outlined"})})]})})};var Ut=r(51837);const X=(0,Ut.uW)("catalog:entity-route-ref",()=>(0,h.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Y(x){var C,R;return{kind:x.kind.toLocaleLowerCase("en-US"),namespace:(R=(C=x.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:x.metadata.name}}var le=r(80030);const ce=(0,B.forwardRef)((x,C)=>{const{entityRef:R,defaultKind:D,title:ee,children:de,...Q}=x,ve=(0,h.tg)(X);let Ee,Ie,Ne;if(typeof R=="string"){const $e=(0,k.of)(R);Ee=$e.kind,Ie=$e.namespace,Ne=$e.name}else"metadata"in R?(Ee=R.kind,Ie=R.metadata.namespace,Ne=R.metadata.name):(Ee=R.kind,Ie=R.namespace,Ne=R.name);Ee=Ee.toLocaleLowerCase("en-US");var Fe;Ie=(Fe=Ie==null?void 0:Ie.toLocaleLowerCase("en-US"))!==null&&Fe!==void 0?Fe:k.zG;const rt={kind:Ee,namespace:Ie,name:Ne},ct=Z({kind:Ee,namespace:Ie,name:Ne},{defaultKind:D}),He=(0,u.jsxs)(P.rU,{...Q,ref:C,to:ve(rt),children:[de,!de&&(ee!=null?ee:ct)]});return ee?(0,u.jsx)(le.ZP,{title:ct,children:He}):He});function ye(x){const{entityRefs:C,defaultKind:R,getTitle:D,...ee}=x,de=(0,h.h_)(H),{value:Q=new Array,loading:ve,error:Ee}=(0,gt.default)(async()=>{const Ie=C.reduce((Fe,rt)=>typeof rt=="object"&&"metadata"in rt?Fe:[...Fe,(0,k.of)(rt)],new Array),Ne=C.filter(Fe=>typeof Fe=="object"&&"metadata"in Fe);return Ie.length>0?[...(await de.getEntities({filter:Ie.map(Fe=>({kind:Fe.kind,"metadata.namespace":Fe.namespace,"metadata.name":Fe.name}))})).items,...Ne]:Ne},[C]);return ve?(0,u.jsx)(P.Ex,{}):Ee?(0,u.jsx)(P.yu,{error:Ee}):(0,u.jsx)(u.Fragment,{children:Q.map((Ie,Ne)=>(0,u.jsxs)(B.Fragment,{children:[Ne>0&&", ",(0,u.jsx)(ce,{...ee,defaultKind:R,entityRef:Ie,title:D(Ie)})]},Ne))})}function Ce(x){const{entityRefs:C,defaultKind:R,fetchEntities:D,getTitle:ee,...de}=x;return D?(0,u.jsx)(ye,{...de,defaultKind:R,entityRefs:C,getTitle:ee}):(0,u.jsx)(u.Fragment,{children:C.map((Q,ve)=>(0,u.jsxs)(B.Fragment,{children:[ve>0&&", ",(0,u.jsx)(ce,{...de,defaultKind:R,entityRef:Q,title:ee?ee(Q):void 0})]},ve))})}const y=x=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(x.entity)),children:_jsx(InfoIcon,{})})},U=x=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${x.email}`,to:`mailto:${x.email}`,children:_jsx(EmailIcon,{})}),re=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},q=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},Ae=(0,Rt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Pe=4,et=x=>{var C,R,D;const{entityRef:ee,children:de,delayTime:Q=500}=x,ve=Ae(),Ee=useApiHolder(),Ie=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Ne,Fe]=useState(!1),rt=useMemo(()=>debounce(()=>Fe(!0),Q),[Q]),[{loading:ct,error:He,value:$e},Je]=useAsyncFn(async()=>{const ln=Ee.get(catalogApiRef);if(ln){const Jt=await ln.getEntityByRef(ee);if(!Jt)throw new Error(`${ee} not found`);return Jt}},[Ee,ee]),Et=()=>{Fe(!1),rt.cancel()};return useEffect(()=>{Ie.isOpen&&!$e&&!He&&!ct&&Je()},[Ie.isOpen,Je,$e,He,ct]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:rt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Ie),children:de})}),Ne&&_jsx(HoverPopover,{PaperProps:{className:ve.popoverPaper},...bindPopover(Ie),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Et,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[He&&_jsx(ResponseErrorPanel,{error:He}),ct&&_jsx(Progress,{}),$e&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:$e.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:$e.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:$e.kind}),$e.metadata.description&&_jsx(Typography,{className:ve.descriptionTypography,paragraph:!0,children:$e.metadata.description}),_jsx(Typography,{children:(C=$e.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[($e.metadata.tags||[]).slice(0,Pe).map(ln=>_jsx(Chip,{size:"small",label:ln},ln)),((R=$e.metadata.tags)===null||R===void 0?void 0:R.length)&&((D=$e.metadata.tags)===null||D===void 0?void 0:D.length)>Pe&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!He&&$e&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity($e)&&_jsx(UserCardActions,{entity:$e}),isGroupEntity($e)&&_jsx(GroupCardActions,{entity:$e}),_jsx(EntityCardActions,{entity:$e})]})})]})})]})},wt=(0,Rt.Z)(x=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),dt=()=>{var x;const C=wt(),{filters:R,updateFilters:D}=useEntityList();var ee;const[de,Q]=useState((ee=(x=R.text)===null||x===void 0?void 0:x.value)!==null&&ee!==void 0?ee:"");return useDebounce(()=>{D({text:de.length?new EntityTextFilter(de):void 0})},250,[de,D]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:ve=>Q(ve.target.value),value:de,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>Q(""),edge:"end",disabled:de.length===0,children:_jsx(Clear,{})})})})})})},Ve=Object.freeze({createEntityRefColumn(x){const{defaultKind:C}=x;function R(D){var ee;return((ee=D.metadata)===null||ee===void 0?void 0:ee.title)||Z(D,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(D,ee){return R(ee).includes(D)},customSort(D,ee){return R(D).localeCompare(R(ee))},render:D=>{var ee;return(0,u.jsx)(ce,{entityRef:D,defaultKind:C,title:(ee=D.metadata)===null||ee===void 0?void 0:ee.title})}}},createEntityRelationColumn(x){const{title:C,relation:R,defaultKind:D,filter:ee}=x;function de(ve){return(0,oe.hF)(ve,R,ee)}function Q(ve){return de(ve).map(Ee=>Z(Ee,{defaultKind:D})).join(", ")}return{title:C,customFilterAndSearch(ve,Ee){return Q(Ee).includes(ve)},customSort(ve,Ee){return Q(ve).localeCompare(Q(Ee))},render:ve=>(0,u.jsx)(Ce,{entityRefs:de(ve),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:k.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:k.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:k.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:x=>(0,u.jsx)(P.Or,{text:x.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ut=[Ve.createEntityRefColumn({defaultKind:"system"}),Ve.createDomainColumn(),Ve.createOwnerColumn(),Ve.createMetadataDescriptionColumn()],St=[Ve.createEntityRefColumn({defaultKind:"component"}),Ve.createSystemColumn(),Ve.createOwnerColumn(),Ve.createSpecTypeColumn(),Ve.createSpecLifecycleColumn(),Ve.createMetadataDescriptionColumn()],tt=(0,Rt.Z)(x=>({empty:{padding:x.spacing(2),display:"flex",justifyContent:"center"}})),Ft=x=>{const{entities:C,title:R,emptyContent:D,variant:ee="gridItem",columns:de}=x,Q=tt(),ve={minWidth:"0",width:"100%"};return ee==="gridItem"&&(ve.height="calc(100% - 10px)"),(0,u.jsx)(P.iA,{columns:de,title:R,style:ve,emptyContent:D&&(0,u.jsx)("div",{className:Q.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Ft.columns=Ve,Ft.systemEntityColumns=ut,Ft.componentEntityColumns=St;const nn=(0,u.jsx)(En.Z,{fontSize:"small"}),Yt=(0,u.jsx)(an.Z,{fontSize:"small"});function Ht({selected:x}){return(0,u.jsx)(xn.Z,{icon:nn,checkedIcon:Yt,checked:x})}const Dt=(0,B.memo)(x=>{const{selected:C,value:R,availableOptions:D,showCounts:ee}=x,de=ee?`${R} (${D==null?void 0:D[R]})`:R;return(0,u.jsx)(at.Z,{control:(0,u.jsx)(Ht,{selected:C}),label:de,onClick:Q=>Q.preventDefault()})});var en=r(72779),Lt=r.n(en);const Ot=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function un(x){const C=Ot();return(0,u.jsx)(Gt.Z,{variant:"outlined",...x,className:Lt()(C.input,x.className)})}function bn(x){var C;const{label:R,name:D,path:ee,showCounts:de,Filter:Q,InputProps:ve}=x,{updateFilters:Ee,filters:Ie,queryParameters:{[D]:Ne}}=yt(),Fe=(0,h.h_)(H),{value:rt}=(0,gt.default)(async()=>{var rn;const cn=ee,{facets:Cn}=await Fe.getEntityFacets({facets:[cn],filter:(rn=Ie.kind)===null||rn===void 0?void 0:rn.getCatalogFilters()});return Object.fromEntries(Cn[cn].map(({value:Rn,count:Ar})=>[Rn,Ar]))},[Ie.kind]),ct=(0,B.useMemo)(()=>[Ne].flat().filter(Boolean),[Ne]);var He;const[$e,Je]=(0,B.useState)(ct.length?ct:(He=(C=Ie[D])===null||C===void 0?void 0:C.values)!==null&&He!==void 0?He:[]);(0,B.useEffect)(()=>{ct.length&&Je(ct)},[ct]);const Et=Object.keys(rt!=null?rt:{}),ln=$e.length&&Et.length;(0,B.useEffect)(()=>{Ee({[D]:ln?new Q($e):void 0})},[D,ln,$e,Q,Ee]);const Jt=Ie[D];return Jt&&typeof Jt=="object"&&!("values"in Jt)||!Et.length||Et.length<=1?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:[R,(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Et,value:$e,onChange:(rn,cn)=>Je(cn),renderOption:(rn,{selected:cn})=>(0,u.jsx)(Dt,{selected:cn,value:rn,availableOptions:rt,showCounts:!!de}),size:"small",popupIcon:(0,u.jsx)(dn.Z,{"data-testid":`${String(D)}-picker-expand`}),renderInput:rn=>(0,u.jsx)(un,{...rn,...ve})})]})})}const Wn=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Yn=x=>{const C=Wn();return(0,u.jsx)(bn,{label:"Tags",name:"tags",path:"metadata.tags",Filter:z,showCounts:x.showCounts,InputProps:{className:C.input}})},ur=x=>{const{hidden:C,initialFilter:R}=x,D=(0,h.h_)(h.$v),{error:ee,availableTypes:de,selectedTypes:Q,setSelectedTypes:ve}=$t();if((0,B.useEffect)(()=>{ee&&D.post({message:"Failed to load entity types",severity:"error"}),R&&ve([R])},[ee,D,R,ve]),de.length===0||ee)return null;const Ee=[{value:"all",label:"all"},...de.map(Ne=>({value:Ne,label:Ne}))];var Ie;return C?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Type",items:Ee,selected:(Ie=Ee.length>1?Q[0]:void 0)!==null&&Ie!==void 0?Ie:"all",onChange:Ne=>ve(Ne==="all"?[]:[String(Ne)])})})};var An=r(15459),On=r(61837),qn=r(11640),S=r(28347);const c=(0,An.Z)({root:{color:"#f3ba37"}})(qn.Z),b=x=>{const{toggleStarredEntity:C,isStarredEntity:R}=Ln(x.entity);return(0,u.jsx)(On.Z,{"aria-label":"favorite",color:"inherit",...x,onClick:()=>C(),children:(0,u.jsx)(le.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,u.jsx)(c,{}):(0,u.jsx)(S.Z,{})})})};var A=r(8629),J=r(79249),xe=r(38724),je=r(99152),Oe=r(6487),ht=r(49429),mt=r(55999),vn=r(39412);const Bn=vn.Z;function Sr(x,C){if(x)return x.toLocaleLowerCase("en-US");if(C)try{return(0,k.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function $r(x,C){const R=(0,h.qD)(),D=Sr(x,C);return D&&R.getSystemIcon(`kind:${D}`)||Bn}function Dr(x){const{kind:C,entityRef:R,...D}=x,ee=$r(C,R);return(0,u.jsx)(ee,{...D})}const Ro=(0,Rt.Z)(x=>({node:{fill:x.palette.grey[300],stroke:x.palette.grey[300],"&.primary":{fill:x.palette.primary.light,stroke:x.palette.primary.light},"&.secondary":{fill:x.palette.secondary.light,stroke:x.palette.secondary.light}},text:{fill:x.palette.getContrastText(x.palette.grey[300]),"&.primary":{fill:x.palette.primary.contrastText},"&.secondary":{fill:x.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function to(x){const C=(0,h.h_)(H),R=(0,k.eE)(x),{loading:D,error:ee,value:de}=(0,gt.default)(async()=>{const Q=await C.getEntityAncestors({entityRef:R}),ve=new Array,Ee=new Array;for(const Ie of Q.items){const Ne=(0,k.eE)(Ie.entity),Fe=Ne===Q.rootEntityRef;ve.push({id:Ne,root:Fe,...Ie.entity});for(const rt of Ie.parentEntityRefs)Ee.push({from:Ne,to:rt})}return{nodes:ve,edges:Ee}},[R]);return{loading:D,error:ee,nodes:(de==null?void 0:de.nodes)||[],edges:(de==null?void 0:de.edges)||[]}}function Cr({node:x}){const C=Ro(),R=(0,Ge.s0)(),D=(0,h.tg)(X),[ee,de]=(0,B.useState)(0),[Q,ve]=(0,B.useState)(0),Ee=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Ee.current){let{height:Je,width:Et}=Ee.current.getBBox();Je=Math.round(Je),Et=Math.round(Et),(Je!==Q||Et!==ee)&&(de(Et),ve(Je))}},[ee,Q]);const Ie=10,Ne=Q,Fe=Ne+Ie,rt=Fe+ee+Ie*2,ct=Q+Ie*2,He=x.metadata.title||(x.kind&&x.metadata.name&&x.metadata.namespace?Z({kind:x.kind,name:x.metadata.name,namespace:x.metadata.namespace||""}):x.id),$e=()=>{R(D({kind:x.kind,namespace:x.metadata.namespace||k.zG,name:x.metadata.name}))};return(0,u.jsxs)("g",{onClick:$e,className:C.clickable,children:[(0,u.jsx)("rect",{className:Lt()(C.node,x.root?"secondary":"primary"),width:rt,height:ct,rx:10}),(0,u.jsx)(Dr,{kind:x.kind,y:Ie,x:Ie,width:Ne,height:Ne,className:Lt()(C.text,x.root?"secondary":"primary")}),(0,u.jsx)("text",{ref:Ee,className:Lt()(C.text,x.root?"secondary":"primary"),y:ct/2,x:Fe+(ee+Ie*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:He})]})}function Rr(x){const{loading:C,error:R,nodes:D,edges:ee}=to(x.entity);return C?(0,u.jsx)(P.Ex,{}):R?(0,u.jsx)(P.Gk,{error:R}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(mt.Z,{variant:"h2",children:"Ancestry"}),(0,u.jsxs)(mt.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,u.jsx)(P.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,u.jsx)(I.Z,{mt:4,children:(0,u.jsx)(P.mn,{nodes:D,edges:ee,renderNode:Cr,direction:P.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var or=r(11776),Jn=r(38402),Ir=r(86136),wr=r(99688),Io=r(49378),Po=r(54506),no=r(94339),Lo=r(24579),ko=r(27685);const Hr=(0,Rt.Z)(x=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:x.spacing(2)},helpIcon:{marginLeft:x.spacing(1),color:x.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function _n(x){const C=Hr();return(0,u.jsx)(Io.Z,{...x,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function Zr(x){const C=Hr();return(0,u.jsx)(Po.Z,{className:C.monospace,children:x.children})}function Nr(x){return(0,u.jsx)(I.Z,{mt:2,children:(0,u.jsx)(no.Z,{variant:"outlined",children:(0,u.jsxs)(Lo.Z,{children:[(0,u.jsxs)(w.Z,{variant:"h6",gutterBottom:!0,children:[x.title,x.helpLink&&(0,u.jsx)(Gr,{to:x.helpLink})]}),x.children]})})})}function ro(x){if(x.match(/^url:https?:\/\//))return x.slice(4);if(x.match(/^https?:\/\//))return x}function Pr(x){const[C,R]=x.entry,D=ro(R);return(0,u.jsxs)(Jn.Z,{children:[x.indent&&(0,u.jsx)(Ir.Z,{}),(0,u.jsx)(_n,{primary:C,secondary:D?(0,u.jsx)(P.rU,{to:D,children:R}):R})]})}function Gr(x){const C=Hr();return(0,u.jsx)(P.rU,{to:x.to,className:C.helpIcon,children:(0,u.jsx)(ko.Z,{fontSize:"inherit"})})}const Oo=(0,Rt.Z)({root:{display:"flex",flexDirection:"column"}});function oo(x){var C,R;const D=(0,h.h_)(H),ee=(0,k.eE)(x),de=(C=x.metadata.annotations)===null||C===void 0?void 0:C[k.P1],Q=(R=x.metadata.annotations)===null||R===void 0?void 0:R[k.q1],{loading:ve,error:Ee,value:Ie}=(0,gt.default)(async()=>!de&&!Q?[]:(await D.getEntities({filter:[...de?[{[`metadata.annotations.${k.P1}`]:de}]:[],...Q?[{[`metadata.annotations.${k.q1}`]:Q}]:[]]})).items,[de,Q]);return{loading:ve,error:Ee,location:de,originLocation:Q,colocatedEntities:Ie==null?void 0:Ie.filter(Ne=>(0,k.eE)(Ne)!==ee)}}function Sn(x){return(0,u.jsxs)(or.Z,{dense:!0,children:[x.header&&(0,u.jsx)(Pr,{entry:x.header},"header"),x.entities.map(C=>(0,u.jsxs)(Jn.Z,{children:[(0,u.jsx)(Ir.Z,{children:(0,u.jsx)(Dr,{kind:C.kind})}),(0,u.jsx)(_n,{primary:(0,u.jsx)(ce,{entityRef:C})})]},(0,k.eE)(C)))]})}function so(x){const{entity:C}=x,{loading:R,error:D,location:ee,originLocation:de,colocatedEntities:Q}=oo(C);if(R)return(0,u.jsx)(P.Ex,{});if(D)return(0,u.jsx)(P.Gk,{error:D});if(!ee&&!de)return(0,u.jsx)(wr.Z,{severity:"warning",children:"Entity had no location information."});if(!(Q!=null&&Q.length))return(0,u.jsx)(wr.Z,{severity:"info",children:"There were no other entities on this location."});if(ee===de)return(0,u.jsx)(Sn,{entities:Q});const ve=Q.filter(Ie=>{var Ne;return((Ne=Ie.metadata.annotations)===null||Ne===void 0?void 0:Ne[k.P1])===ee}),Ee=Q.filter(Ie=>{var Ne;return((Ne=Ie.metadata.annotations)===null||Ne===void 0?void 0:Ne[k.q1])===de});return(0,u.jsxs)(u.Fragment,{children:[ve.length>0&&(0,u.jsx)(Sn,{entities:ve,header:["At the same location",ee]}),Ee.length>0&&(0,u.jsx)(Sn,{entities:Ee,header:["At the same origin",de]})]})}function io(x){const C=Oo();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(mt.Z,{variant:"h2",children:"Colocated"}),(0,u.jsx)(mt.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,u.jsx)("div",{className:C.root,children:(0,u.jsx)(so,{entity:x.entity})})]})}function ao(x){return Object.fromEntries([...Object.entries(x)].sort((C,R)=>C[0]<R[0]?-1:1))}function jr(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(mt.Z,{variant:"h2",children:"Entity as JSON"}),(0,u.jsx)(mt.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,u.jsx)(mt.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:JSON.stringify(ao(x.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Bo=r(3440),lo=r.n(Bo);const $o=(0,Rt.Z)({root:{display:"flex",flexDirection:"column"}});function co(x){var C,R;const D=$o(),{apiVersion:ee,kind:de,metadata:Q,spec:ve,relations:Ee=[],status:Ie={}}=x.entity,Ne=lo()(Kt()(Ee,Fe=>Fe.targetRef),"type");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(mt.Z,{variant:"h2",children:"Overview"}),(0,u.jsxs)("div",{className:D.root,children:[(0,u.jsx)(Nr,{title:"Identity",children:(0,u.jsxs)(or.Z,{dense:!0,children:[(0,u.jsx)(Jn.Z,{children:(0,u.jsx)(_n,{primary:"apiVersion",secondary:ee})}),(0,u.jsx)(Jn.Z,{children:(0,u.jsx)(_n,{primary:"kind",secondary:de})}),(ve==null?void 0:ve.type)&&(0,u.jsx)(Jn.Z,{children:(0,u.jsx)(_n,{primary:"spec.type",secondary:ve.type})}),Q.uid&&(0,u.jsx)(Jn.Z,{children:(0,u.jsx)(_n,{primary:"uid",secondary:Q.uid})}),Q.etag&&(0,u.jsx)(Jn.Z,{children:(0,u.jsx)(_n,{primary:"etag",secondary:Q.etag})})]})}),(0,u.jsxs)(Nr,{title:"Metadata",children:[!!Object.keys(Q.annotations||{}).length&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsxs)(Zr,{children:["Annotations",(0,u.jsx)(Gr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(Q.annotations).map(Fe=>(0,u.jsx)(Pr,{indent:!0,entry:Fe},Fe[0]))}),!!Object.keys(Q.labels||{}).length&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Zr,{children:"Labels"}),children:Object.entries(Q.labels).map(Fe=>(0,u.jsx)(Pr,{indent:!0,entry:Fe},Fe[0]))}),!!(!((C=Q.tags)===null||C===void 0)&&C.length)&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Zr,{children:"Tags"}),children:Q.tags.map((Fe,rt)=>(0,u.jsxs)(Jn.Z,{children:[(0,u.jsx)(Ir.Z,{}),(0,u.jsx)(_n,{primary:Fe})]},`${Fe}-${rt}`))})]}),!!Ee.length&&(0,u.jsx)(Nr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ne).map(([Fe,rt],ct)=>(0,u.jsx)("div",{children:(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Zr,{children:Fe}),children:rt.map(He=>(0,u.jsxs)(Jn.Z,{children:[(0,u.jsx)(Ir.Z,{children:(0,u.jsx)(Dr,{entityRef:He.targetRef})}),(0,u.jsx)(_n,{primary:(0,u.jsx)(ce,{entityRef:He.targetRef})})]},He.targetRef))})},ct))}),!!(!((R=Ie.items)===null||R===void 0)&&R.length)&&(0,u.jsx)(Nr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ie.items.map((Fe,rt)=>(0,u.jsxs)("div",{children:[(0,u.jsxs)(w.Z,{children:[Fe.level,": ",Fe.type]}),(0,u.jsx)(I.Z,{ml:2,children:Fe.message})]},rt))})]})]})}var Er=r(72847);function ss(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(mt.Z,{variant:"h2",children:"Entity as YAML"}),(0,u.jsx)(mt.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,u.jsx)(mt.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:Er.ZP.stringify(ao(x.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const uo=(0,Rt.Z)(x=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:x.palette.background.paper},tabs:{borderRight:`1px solid ${x.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function hr(x){const{children:C,value:R,index:D,...ee}=x,de=uo();return(0,u.jsx)("div",{role:"tabpanel",hidden:R!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:de.tabContents,...ee,children:R===D&&(0,u.jsx)(I.Z,{pl:3,pr:3,children:C})})}function Lr(x){return{id:`vertical-tab-${x}`,"aria-controls":`vertical-tabpanel-${x}`}}function Do(x){const C=uo(),[R,D]=B.useState(0);return(0,B.useEffect)(()=>{D(0)},[x.open]),x.entity?(0,u.jsxs)(A.Z,{fullWidth:!0,maxWidth:"xl",open:x.open,onClose:x.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,u.jsx)(J.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,u.jsx)(xe.Z,{dividers:!0,children:(0,u.jsxs)("div",{className:C.root,children:[(0,u.jsxs)(je.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(ee,de)=>D(de),"aria-label":"Inspector options",className:C.tabs,children:[(0,u.jsx)(Oe.Z,{label:"Overview",...Lr(0)}),(0,u.jsx)(Oe.Z,{label:"Ancestry",...Lr(1)}),(0,u.jsx)(Oe.Z,{label:"Colocated",...Lr(2)}),(0,u.jsx)(Oe.Z,{label:"Raw JSON",...Lr(3)}),(0,u.jsx)(Oe.Z,{label:"Raw YAML",...Lr(4)})]}),(0,u.jsx)(hr,{value:R,index:0,children:(0,u.jsx)(co,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:1,children:(0,u.jsx)(Rr,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:2,children:(0,u.jsx)(io,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:3,children:(0,u.jsx)(jr,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:4,children:(0,u.jsx)(ss,{entity:x.entity})})]})}),(0,u.jsx)(ht.Z,{children:(0,u.jsx)(V.Z,{onClick:x.onClose,color:"primary",children:"Close"})})]}):null}var Qn=r(85256);function Ws(x){var C;const R=(0,h.h_)(H),D=(C=x.metadata.annotations)===null||C===void 0?void 0:C[k.q1],ee=x.metadata.uid,de=D==="bootstrap:bootstrap",Q=(0,gt.default)(async()=>{const He=R.getLocationByRef(D);let $e;if(!D)$e=Promise.resolve([]);else{const Je=`metadata.annotations.${k.q1}`;$e=R.getEntities({filter:{[Je]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Et=>Et.items)}return Promise.all([He,$e]).then(([Je,Et])=>({location:Je,colocatedEntities:Et}))},[R,x]),ve=(0,B.useCallback)(async function(){const{location:$e}=Q.value;await R.removeLocationById($e.id)},[R,Q]),Ee=(0,B.useCallback)(async function(){await R.removeEntityByUid(ee)},[R,ee]);if(de)return{type:"bootstrap",location:D,deleteEntity:Ee};const{loading:Ie,error:Ne,value:Fe}=Q;if(Ie)return{type:"loading"};if(Ne)return{type:"error",error:Ne};const{location:rt,colocatedEntities:ct}=Fe;return rt?{type:"unregister",location:D,colocatedEntities:ct.map(k.iB),unregisterLocation:ve,deleteEntity:Ee}:{type:"only-delete",deleteEntity:Ee}}var Zo=r(23054);const is=(0,Rt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),as=({entity:x,onConfirm:C,onClose:R})=>{const D=(0,h.h_)(h.$v),ee=(0,h.h_)(h.Ds),de=is(),Q=Ws(x),[ve,Ee]=(0,B.useState)(!1),[Ie,Ne]=(0,B.useState)(!1);var Fe;const rt=(Fe=ee.getOptionalString("app.title"))!==null&&Fe!==void 0?Fe:"Backstage",ct=(0,B.useCallback)(async function(){if("unregisterLocation"in Q){Ne(!0);try{await Q.unregisterLocation(),C()}catch(Et){(0,Zo.BD)(Et),D.post({message:Et.message})}finally{Ne(!1)}}},[D,C,Q]),He=(0,B.useCallback)(async function(){if("deleteEntity"in Q){Ne(!0);try{await Q.deleteEntity(),C()}catch(Et){(0,Zo.BD)(Et),D.post({message:Et.message})}finally{Ne(!1)}}},[D,C,Q]),$e=()=>(0,u.jsx)(ht.Z,{className:de.dialogActions,children:(0,u.jsx)(V.Z,{onClick:R,color:"primary",children:"Cancel"})});return Q.type==="loading"?(0,u.jsx)(P.Ex,{}):Q.type==="error"?(0,u.jsx)(P.Gk,{error:Q.error}):Q.type==="bootstrap"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(wr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',Q.location,'"). If you believe this is in error, please contact the ',rt," ","integrator."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[!ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"}),(0,u.jsx)($e,{})]}),ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(mt.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:He,children:"Delete Entity"}),(0,u.jsx)($e,{})]})]})]}):Q.type==="only-delete"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(mt.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:He,children:"Delete Entity"}),(0,u.jsx)($e,{})]}):Q.type==="unregister"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(mt.Z,{children:"This action will unregister the following entities:"}),(0,u.jsx)(mt.Z,{component:"ul",children:Q.colocatedEntities.map(Je=>(0,u.jsx)("li",{children:(0,u.jsx)(ce,{entityRef:Je})},`${Je.kind}:${Je.namespace}/${Je.name}`))}),(0,u.jsx)(mt.Z,{children:"Located at the following location:"}),(0,u.jsx)(mt.Z,{component:"ul",children:(0,u.jsx)("li",{children:Q.location})}),(0,u.jsxs)(mt.Z,{children:["To undo, just re-register the entity in ",rt,"."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:ct,children:"Unregister Location"}),!ve&&(0,u.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"})})]}),ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,u.jsx)(Qn.Z,{})}),(0,u.jsx)(mt.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Ie,onClick:He,children:"Delete Entity"})]})]}):(0,u.jsx)(wr.Z,{severity:"error",children:"Internal error: Unknown state"})},ls=x=>{const{open:C,onConfirm:R,onClose:D,entity:ee}=x;return(0,u.jsxs)(A.Z,{open:C,onClose:D,children:[(0,u.jsx)(J.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,u.jsx)(xe.Z,{children:(0,u.jsx)(as,{entity:ee,onConfirm:R,onClose:D})})]})};var ho=r(12231),cs=r(9520),pr=r(47603);const po=(0,Rt.Z)(x=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:x.spacing(1,0,1,0)},title:{margin:x.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:x.palette.text.primary},menuItem:{minHeight:x.spacing(6)},groupWrapper:{margin:x.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function No(x){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:pr.Z},{id:"starred",label:"Starred",icon:qn.Z}]},{name:x!=null?x:"Company",items:[{id:"all",label:"All"}]}]}const Vn=x=>{const{initialFilter:C,availableFilters:R}=x,D=po(),ee=(0,h.h_)(h.Ds);var de;const Q=(de=ee.getOptionalString("organization.name"))!==null&&de!==void 0?de:"Company",{filters:ve,updateFilters:Ee,backendEntities:Ie,queryParameters:{kind:Ne,user:Fe},loading:rt}=yt(),ct=["starred","all"],He=No(Q).map(In=>({...In,items:In.items.filter(({id:$n})=>["group","user"].some(kr=>kr===Ne)?ct.includes($n):!R||R.includes($n))})).filter(({items:In})=>!!In.length),{isStarredEntity:$e}=Pn(),{isOwnedEntity:Je,loading:Et}=_t(),ln=rt||Et,Jt=(0,B.useMemo)(()=>new Qe("owned",Je,$e),[Je,$e]),rn=(0,B.useMemo)(()=>new Qe("starred",Je,$e),[Je,$e]),cn=(0,B.useMemo)(()=>[Fe].flat()[0],[Fe]),[Cn,Rn]=(0,B.useState)(cn!=null?cn:C),Ar=(0,B.useMemo)(()=>Ie.filter((0,oe.Gz)((0,it.compact)(Object.values({...ve,user:void 0})))),[ve,Ie]),Ur=(0,B.useMemo)(()=>({all:Ar.length,starred:Ar.filter(In=>rn.filterEntity(In)).length,owned:Ar.filter(In=>Jt.filterEntity(In)).length}),[Ar,rn,Jt]);(0,B.useEffect)(()=>{cn&&Rn(cn)},[cn]),(0,B.useEffect)(()=>{!ln&&Cn&&Cn!=="all"&&Ur[Cn]===0&&Rn("all")},[ln,Ur,Cn,Rn]),(0,B.useEffect)(()=>{Ee({user:Cn?new Qe(Cn,Je,$e):void 0})},[Cn,Je,$e,Ee]);var Kr;return(0,u.jsx)(no.Z,{className:D.root,children:He.map(In=>(0,u.jsxs)(B.Fragment,{children:[(0,u.jsx)(w.Z,{variant:"subtitle2",component:"span",className:D.title,children:In.name}),(0,u.jsx)(no.Z,{className:D.groupWrapper,children:(0,u.jsx)(or.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":In.name,children:In.items.map($n=>{var kr;return(0,u.jsxs)(ho.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Rn($n.id),selected:$n.id===((kr=ve.user)===null||kr===void 0?void 0:kr.value),className:D.menuItem,disabled:Ur[$n.id]===0,"data-testid":`user-picker-${$n.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[$n.icon&&(0,u.jsx)(Ir.Z,{className:D.listIcon,children:(0,u.jsx)($n.icon,{fontSize:"small"})}),(0,u.jsx)(Io.Z,{children:(0,u.jsxs)(w.Z,{variant:"body1",children:[$n.label," "]})}),(0,u.jsx)(cs.Z,{children:(Kr=Ur[$n.id])!==null&&Kr!==void 0?Kr:"-"})]},$n.id)})})})]},In.name))})},fo=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Fr=(0,u.jsx)(En.Z,{fontSize:"small"}),ds=(0,u.jsx)(an.Z,{fontSize:"small"}),Fo=()=>{const x=fo(),{updateFilters:C}=yt(),[R,D]=(0,B.useState)([]);function ee(ve){C({orphan:ve?new Ct(ve):void 0})}function de(ve){C({error:ve?new Tt(ve):void 0})}const Q=["Is Orphan","Has Error"];return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Processing Status",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:Q,value:R,onChange:(ve,Ee)=>{D(Ee),ee(Ee.includes("Is Orphan")),de(Ee.includes("Has Error"))},renderOption:(ve,{selected:Ee})=>(0,u.jsx)(at.Z,{control:(0,u.jsx)(xn.Z,{icon:Fr,checkedIcon:ds,checked:Ee}),onClick:Ie=>Ie.preventDefault(),label:ve}),size:"small",popupIcon:(0,u.jsx)(dn.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ve=>(0,u.jsx)(Gt.Z,{...ve,className:x.input,variant:"outlined"})})]})})},Uo=(0,Rt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),us=()=>{const x=Uo();return(0,u.jsx)(bn,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:st,InputProps:{className:x.input}})};function go(x){const{children:C,value:R}=x;var D;const[ee,de]=useState((D=R==null?void 0:R.filters)!==null&&D!==void 0?D:{}),Q=useCallback(He=>{de($e=>{const Je=typeof He=="function"?He($e):He;return{...$e,...Je}})},[]),ve=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ee,Ie,Ne,Fe,rt;const ct=useMemo(()=>({entities:(Ee=R==null?void 0:R.entities)!==null&&Ee!==void 0?Ee:ve.entities,backendEntities:(Ie=R==null?void 0:R.backendEntities)!==null&&Ie!==void 0?Ie:ve.backendEntities,updateFilters:(Ne=R==null?void 0:R.updateFilters)!==null&&Ne!==void 0?Ne:Q,filters:ee,loading:(Fe=R==null?void 0:R.loading)!==null&&Fe!==void 0?Fe:!1,queryParameters:(rt=R==null?void 0:R.queryParameters)!==null&&rt!==void 0?rt:ve.queryParameters,error:R==null?void 0:R.error}),[R,ve,ee,Q]);return _jsx(EntityListContext.Provider,{value:ct,children:C})}},75435:function(jt,De,r){"use strict";r.d(De,{h:function(){return h}});var t=r(25271);function h(H,f,W){var g;let u=(H==null||(g=H.relations)===null||g===void 0?void 0:g.filter(B=>B.type===f).map(B=>(0,t.of)(B.targetRef)))||[];return W!=null&&W.kind&&(u=u.filter(B=>B.kind.toLocaleLowerCase("en-US")===W.kind.toLocaleLowerCase("en-US"))),u}},49280:function(jt,De,r){"use strict";r.d(De,{hF:function(){return H.h},CV:function(){return W},wq:function(){return t},Gz:function(){return h}});function t(u){return u.reduce((B,me)=>({...B,...me.getCatalogFilters?me.getCatalogFilters():{}}),{})}function h(u){return B=>u.every(me=>!me.filterEntity||me.filterEntity(B))}var H=r(75435),f=r(25271);function W(u,B){var me;const ue=(me=u.metadata.annotations)===null||me===void 0?void 0:me[f.M6];if(ue)try{const V=(0,f.Ou)(ue),K=B.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:K==null?void 0:K.type}}catch{return}}function g(u,B){const me=new Set([...getEntityRelations(u,RELATION_MEMBER_OF,{kind:"group"}),...u?[getCompoundEntityRef(u)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of ue)if(me.has(V))return!0;return!1}},33414:function(jt,De,r){"use strict";r.r(De),r.d(De,{AboutCard:function(){return ot},AboutContent:function(){return z},AboutField:function(){return k}});var t=r(52322),h=r(25271),H=r(53974),f=r(60871),W=r(32838),g=r(43514),u=r(79692),B=r(94339),me=r(32552),ue=r(61837),V=r(85256),K=r(24579),I=r(52866),w=r(30254),se=r(27604),_=r(2784),te=r(19625),$=r(60905),T=r(7089),P=r(90436);const L=(0,u.Z)(Ye=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ye.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function k(Ye){const{label:st,value:Qe,gridSizes:Ct,children:Tt}=Ye,bt=L(),it=(0,f.vJ)(Tt,Nt=>Nt.getElements()),Pt=it.length>0?it:(0,t.jsx)(P.Z,{variant:"body2",className:bt.value,children:Qe||"unknown"});return(0,t.jsxs)($.Z,{item:!0,...Ct,children:[(0,t.jsx)(P.Z,{variant:"h2",className:bt.label,children:st}),Pt]})}var oe=r(24851);const ke=(0,u.Z)({description:{wordBreak:"break-word"}});function We(Ye,st,Qe){if(st==="url"||Ye.includes("://"))return Ye;const Ct=Qe.type==="file"?`file://${Qe.target}`:Qe.target;return st==="file"||Qe.type==="file"?new URL(Ye,Ct).href:Ct}function z(Ye){var st,Qe,Ct,Tt,bt,it,Pt,Nt;const{entity:Ge}=Ye,Qt=ke(),ge=Ge.kind.toLocaleLowerCase("en-US")==="system",Se=Ge.kind.toLocaleLowerCase("en-US")==="resource",Ue=Ge.kind.toLocaleLowerCase("en-US")==="component",nt=Ge.kind.toLocaleLowerCase("en-US")==="api",yt=Ge.kind.toLocaleLowerCase("en-US")==="template",gt=Ge.kind.toLocaleLowerCase("en-US")==="location",pt=Ge.kind.toLocaleLowerCase("en-US")==="group",Bt=(0,g.hF)(Ge,h.cz,{kind:"system"}),Mt=(0,g.hF)(Ge,h.cz,{kind:"component"}),Kt=(0,g.hF)(Ge,h.cz,{kind:"domain"}),$t=(0,g.hF)(Ge,h.S4);let Xt;try{Xt=(0,h.CV)(Ge)}catch{Xt=void 0}return(0,t.jsxs)($.Z,{container:!0,children:[(0,t.jsx)(k,{label:"Description",gridSizes:{xs:12},children:(0,t.jsx)(H.SA,{className:Qt.description,content:(Ge==null||(st=Ge.metadata)===null||st===void 0?void 0:st.description)||"No description"})}),(0,t.jsx)(k,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:$t.length>0&&(0,t.jsx)(g.rI,{entityRefs:$t,defaultKind:"group"})}),(ge||Kt.length>0)&&(0,t.jsx)(k,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Kt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Kt,defaultKind:"domain"})}),(nt||Ue||Se||Bt.length>0)&&(0,t.jsx)(k,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Bt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Bt,defaultKind:"system"})}),Ue&&Mt.length>0&&(0,t.jsx)(k,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,t.jsx)(g.rI,{entityRefs:Mt,defaultKind:"component"})}),(nt||Ue||Se||yt||pt||gt||typeof(Ge==null||(Qe=Ge.spec)===null||Qe===void 0?void 0:Qe.type)=="string")&&(0,t.jsx)(k,{label:"Type",value:Ge==null||(Ct=Ge.spec)===null||Ct===void 0?void 0:Ct.type,gridSizes:{xs:12,sm:6,lg:4}}),(nt||Ue||typeof(Ge==null||(Tt=Ge.spec)===null||Tt===void 0?void 0:Tt.lifecycle)=="string")&&(0,t.jsx)(k,{label:"Lifecycle",value:Ge==null||(bt=Ge.spec)===null||bt===void 0?void 0:bt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,t.jsx)(k,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ge==null||(it=Ge.metadata)===null||it===void 0?void 0:it.tags)||[]).map(qt=>(0,t.jsx)(T.Z,{size:"small",label:qt},qt))}),gt&&((Ge==null||(Pt=Ge.spec)===null||Pt===void 0?void 0:Pt.targets)||(Ge==null||(Nt=Ge.spec)===null||Nt===void 0?void 0:Nt.target))&&(0,t.jsx)(k,{label:"Targets",gridSizes:{xs:12},children:(0,t.jsx)(oe.s,{cols:1,items:(Ge.spec.targets||[Ge.spec.target]).map(qt=>qt).map(qt=>{var gn;return{text:qt,href:We(qt,(Ge==null||(gn=Ge.spec)===null||gn===void 0?void 0:gn.type)||"unknown",Xt)}})})})]})}const xt=(0,u.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function ot(Ye){var st,Qe,Ct;const{variant:Tt}=Ye,bt=xt(),{entity:it}=(0,g.X2)(),Pt=(0,f.h_)(W.q3),Nt=(0,f.h_)(g.Ah),Ge=(0,f.h_)(f.$v),Qt=(0,f.h_)(f.VE),ge=(0,f.tg)(te.jU),Se=(0,g.CV)(it,Pt),Ue=(st=it.metadata.annotations)===null||st===void 0?void 0:st[h.Tf],nt={label:"View Source",disabled:!Se,icon:(0,t.jsx)(W.nW,{type:Se==null?void 0:Se.integrationType}),href:Se==null?void 0:Se.locationTargetUrl},yt={label:"View TechDocs",disabled:!(!((Qe=it.metadata.annotations)===null||Qe===void 0)&&Qe["backstage.io/techdocs-ref"])||!ge,icon:(0,t.jsx)(w.Z,{}),href:ge&&ge({namespace:it.metadata.namespace||h.zG,kind:it.kind,name:it.metadata.name})};let gt="";Tt==="gridItem"?gt=bt.gridItemCard:Tt==="fullHeight"&&(gt=bt.fullHeightCard);let pt="";Tt==="gridItem"?pt=bt.gridItemCardContent:Tt==="fullHeight"&&(pt=bt.fullHeightCardContent);const Bt=(Ct=it.metadata.annotations)===null||Ct===void 0?void 0:Ct[h.P1],Mt=(Bt==null?void 0:Bt.startsWith("url:"))||(Bt==null?void 0:Bt.startsWith("file:")),Kt=(0,_.useCallback)(async()=>{try{await Nt.refreshEntity((0,h.eE)(it)),Ge.post({message:"Refresh scheduled",severity:"info"})}catch($t){Qt.post($t)}},[Nt,Ge,Qt,it]);return(0,t.jsxs)(B.Z,{className:gt,children:[(0,t.jsx)(me.Z,{title:"About",action:(0,t.jsxs)(t.Fragment,{children:[Mt&&(0,t.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Kt,children:(0,t.jsx)(I.Z,{})}),(0,t.jsx)(ue.Z,{component:H.rU,"aria-label":"Edit",disabled:!Ue,title:"Edit Metadata",to:Ue!=null?Ue:"#",children:(0,t.jsx)(se.Z,{})})]}),subheader:(0,t.jsx)(H.M6,{links:[nt,yt]})}),(0,t.jsx)(V.Z,{}),(0,t.jsx)(K.Z,{className:pt,children:(0,t.jsx)(z,{entity:it})})]})}},86359:function(jt,De,r){"use strict";r.d(De,{E:function(){return te}});var t=r(52322),h=r(25271),H=r(53974),f=r(43514),W=r(90436),g=r(15459),u=r(27604),B=r(2997),me=r(11640),ue=r(28347),V=r(76635),K=r(2784),I=r(7089);const w=Object.freeze({createNameColumn($){function T(P){var L;return((L=P.metadata)===null||L===void 0?void 0:L.title)||(0,f.$3)(P,{defaultKind:$==null?void 0:$.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:L}){return T(P).localeCompare(T(L))},render:({entity:P})=>{var L;return(0,t.jsx)(f.dx,{entityRef:P,defaultKind:($==null?void 0:$.defaultKind)||"Component",title:(L=P.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:$})=>{var T,P;return(0,t.jsx)(t.Fragment,{children:(($==null||(T=$.spec)===null||T===void 0?void 0:T.targets)||($==null||(P=$.spec)===null||P===void 0?void 0:P.target))&&(0,t.jsx)(H.Or,{text:($.spec.targets||[$.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:$})=>(0,t.jsx)(H.Or,{text:$.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>(0,t.jsx)(t.Fragment,{children:$.metadata.tags&&$.metadata.tags.map(T=>(0,t.jsx)(I.Z,{label:T,size:"small",variant:"outlined",style:{marginBottom:"0px"}},T))}),width:"auto"}},createTitleColumn($){return{title:"Title",field:"entity.metadata.title",hidden:$==null?void 0:$.hidden,searchable:!0}},createLabelColumn($,T){return{title:(T==null?void 0:T.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var L;const k=(L=P.metadata)===null||L===void 0?void 0:L.labels,oe=k&&k[$]||(T==null?void 0:T.defaultValue);return(0,t.jsx)(t.Fragment,{children:oe&&(0,t.jsx)(I.Z,{label:oe,size:"small",variant:"outlined"},oe)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}}),se=(0,g.Z)({root:{color:"#f3ba37"}})(me.Z),_=($,T)=>{const P=L=>L.metadata.title||(0,f.$3)(L,{defaultKind:"Component"});return P($).localeCompare(P(T))},te=$=>{var T,P;const{columns:L,actions:k,tableOptions:oe,subtitle:ke,emptyContent:We}=$,{isStarredEntity:z,toggleStarredEntity:xt}=(0,f.CR)(),{loading:ot,error:Ye,entities:st,filters:Qe}=(0,f.wp)(),Ct=(0,K.useMemo)(()=>{var ge;return[w.createTitleColumn({hidden:!0}),w.createNameColumn({defaultKind:(ge=Qe.kind)===null||ge===void 0?void 0:ge.value}),...Se(),w.createMetadataDescriptionColumn(),w.createTagsColumn()];function Se(){var Ue;const nt=[w.createSystemColumn(),w.createOwnerColumn(),w.createSpecTypeColumn(),w.createSpecLifecycleColumn()];switch((Ue=Qe.kind)===null||Ue===void 0?void 0:Ue.value){case"user":return[];case"domain":case"system":return[w.createOwnerColumn()];case"group":case"template":return[w.createSpecTypeColumn()];case"location":return[w.createSpecTypeColumn(),w.createSpecTargetsColumn()];default:return st.every(yt=>yt.metadata.namespace==="default")?nt:[...nt,w.createNamespaceColumn()]}}},[(T=Qe.kind)===null||T===void 0?void 0:T.value,st]),Tt=Qe.type===void 0;var bt;const it=(0,V.capitalize)((bt=(P=Qe.user)===null||P===void 0?void 0:P.value)!==null&&bt!==void 0?bt:"all");if(Ye)return(0,t.jsx)("div",{children:(0,t.jsx)(H.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,t.jsx)(H.Oi,{language:"text",text:Ye.toString()})})});const Pt=[({entity:ge})=>{var Se;const Ue=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[h.l2],nt="View";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:nt}),(0,t.jsx)(B.Z,{fontSize:"small"})]}),tooltip:nt,disabled:!Ue,onClick:()=>{Ue&&window.open(Ue,"_blank")}}},({entity:ge})=>{var Se;const Ue=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[h.Tf],nt="Edit";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:nt}),(0,t.jsx)(u.Z,{fontSize:"small"})]}),tooltip:nt,disabled:!Ue,onClick:()=>{Ue&&window.open(Ue,"_blank")}}},({entity:ge})=>{const Se=z(ge),Ue=Se?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:Ue}),Se?(0,t.jsx)(se,{}):(0,t.jsx)(ue.Z,{})]}),tooltip:Ue,onClick:()=>xt(ge)}}],Nt=st.sort(_).map(ge=>{const Se=(0,f.hF)(ge,h.cz,{kind:"system"}),Ue=(0,f.hF)(ge,h.S4);return{entity:ge,resolved:{name:(0,f.$3)(ge,{defaultKind:"Component"}),ownedByRelationsTitle:Ue.map(nt=>(0,f.$3)(nt,{defaultKind:"group"})).join(", "),ownedByRelations:Ue,partOfSystemRelationTitle:Se.map(nt=>(0,f.$3)(nt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Se}}}),Ge=(L||Ct).find(ge=>ge.title==="Type");Ge&&(Ge.hidden=!Tt);const Qt=Nt.length>20;return(0,t.jsx)(H.iA,{isLoading:ot,columns:L||Ct,options:{paging:Qt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!ot,padding:"dense",pageSizeOptions:[20,50,100],...oe},title:`${it} (${st.length})`,data:Nt,actions:k||Pt,subtitle:ke,emptyContent:We})};te.columns=w},85877:function(jt,De,r){"use strict";r.r(De),r.d(De,{EntityLabelsCard:function(){return K},hasLabels:function(){return I}});var t=r(52322),h=r(43514),H=r(2784),f=r(53974),W=r(79692),g=r(90436),u=r(77277);const B=`metadata:
34
- name: example
35
- labels:
36
- javaVersion: 1.2.3`,me=(0,W.Z)(w=>({code:{borderRadius:6,margin:`${w.spacing(2)}px 0px`,background:w.palette.type==="dark"?"#444":w.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const w=me();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,t.jsx)("div",{className:w.code,children:(0,t.jsx)(f.Oi,{text:B,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(u.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const V=(0,W.Z)(w=>({key:{fontWeight:"bold"}})),K=w=>{var se;const{variant:_,title:te}=w,{entity:$}=(0,h.X2)(),T=V(),P=[{render:k=>(0,t.jsx)(g.Z,{className:T.key,variant:"body2",children:k.key})},{field:"value"}],L=$==null||(se=$.metadata)===null||se===void 0?void 0:se.labels;return(0,t.jsx)(f.rJ,{title:te||"Labels",variant:_,children:!L||Object.keys(L).length===0?(0,t.jsx)(ue,{}):(0,t.jsx)(f.iA,{columns:P,data:Object.keys(L).map(k=>({key:k,value:L[k]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(L).length>5}})})};function I(w){var se,_;return!(w==null||(se=w.metadata)===null||se===void 0)&&se.labels?Object.keys(w==null||(_=w.metadata)===null||_===void 0?void 0:_.labels).some(Boolean):!1}},24851:function(jt,De,r){"use strict";r.d(De,{s:function(){return se}});var t=r(52322),h=r(90348),H=r(11861),f=r(2784),W=r(79692),g=r(95544),u=r(90436),B=r(52160),me=r(53974);const ue=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function V(_){const{href:te,text:$,Icon:T}=_,P=ue();return(0,t.jsxs)(g.Z,{display:"flex",children:[(0,t.jsx)(g.Z,{mr:1,className:P.svgIcon,children:(0,t.jsx)(u.Z,{component:"div",children:T?(0,t.jsx)(T,{}):(0,t.jsx)(B.Z,{})})}),(0,t.jsx)(g.Z,{flexGrow:"1",children:(0,t.jsx)(me.rU,{to:te,target:"_blank",rel:"noopener",children:$||te})})]})}var K=r(41156);const I={xs:1,sm:1,md:1,lg:2,xl:3};function w(_){const te=[(0,K.Z)(L=>L.breakpoints.up("xl"))?"xl":null,(0,K.Z)(L=>L.breakpoints.up("lg"))?"lg":null,(0,K.Z)(L=>L.breakpoints.up("md"))?"md":null,(0,K.Z)(L=>L.breakpoints.up("sm"))?"sm":null,(0,K.Z)(L=>L.breakpoints.up("xs"))?"xs":null];let $=1;if(typeof _=="number")$=_;else{var T;const L=(T=te.find(k=>k!==null))!==null&&T!==void 0?T:"xs";var P;$=(P=_==null?void 0:_[L])!==null&&P!==void 0?P:I[L]}return $}function se(_){const{items:te,cols:$=void 0}=_,T=w($);return(0,t.jsx)(h.Z,{rowHeight:"auto",cols:T,children:te.map(({text:P,href:L,Icon:k},oe)=>(0,t.jsx)(H.Z,{children:(0,t.jsx)(V,{href:L,text:P!=null?P:L,Icon:k})},oe))})}},19625:function(jt,De,r){"use strict";r.d(De,{_Z:function(){return f},jU:function(){return H},yw:function(){return h}});var t=r(60871);const h=(0,t.x8)({id:"create-component",optional:!0}),H=(0,t.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,t.NT)({id:"catalog"})},15096:function(jt,De,r){"use strict";r.d(De,{FA:function(){return me},qO:function(){return bt},Nd:function(){return z},E5:function(){return lt},Rx:function(){return L}});var t=r(60871);const h=(0,t.T0)({id:"plugin.search.queryservice"});class H{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Y){_define_property(this,"mockedResults",void 0),this.mockedResults=Y}}var f=r(52322),W=r(2784),g=r(38402),u=r(79692);const B=(0,u.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),me=X=>{const{text:Y,preTag:le,postTag:ce}=X,ye=B(),Ce=(0,W.useMemo)(()=>Y.split(new RegExp(`(${le}.+?${ce})`)),[ce,le,Y]);return(0,f.jsx)(f.Fragment,{children:Ce.map((y,U)=>y.includes(le)?(0,f.jsx)("mark",{className:ye.highlight,children:y.replace(new RegExp(`${le}|${ce}`,"g"),"")},U):y)})};var ue=r(50581),V=r(61837),K=r(86619),I=r(77277),w=r(21853),se=r(48760),_=r(76635),te=r(64279),$=r(1849),T=r(51837);const P=(0,T.CT)("search-context"),L=()=>{const X=(0,W.useContext)(P);if(!X)throw new Error("useSearch must be used within a SearchContextProvider");const Y=X.atVersion(1);if(!Y)throw new Error("No SearchContext v1 found");return Y},k=()=>(0,W.useContext)(P)!==void 0,oe={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},ke=(X=oe)=>{var Y,le,ce,ye;const Ce=(0,t.h_)(h),[y,U]=(0,W.useState)(X.term),[re,q]=(0,W.useState)(X.types),[Ae,Pe]=(0,W.useState)(X.filters),[et,wt]=(0,W.useState)(X.pageLimit),[dt,Ve]=(0,W.useState)(X.pageCursor),ut=(0,$.Z)(y),St=(0,$.Z)(Ae),tt=(0,te.default)(()=>Ce.query({term:y,types:re,filters:Ae,pageLimit:et,pageCursor:dt}),[y,re,Ae,et,dt]),Ft=!tt.loading&&!tt.error&&((Y=tt.value)===null||Y===void 0?void 0:Y.nextPageCursor),nn=!tt.loading&&!tt.error&&((le=tt.value)===null||le===void 0?void 0:le.previousPageCursor),Yt=(0,W.useCallback)(()=>{var en;Ve((en=tt.value)===null||en===void 0?void 0:en.nextPageCursor)},[(ce=tt.value)===null||ce===void 0?void 0:ce.nextPageCursor]),Ht=(0,W.useCallback)(()=>{var en;Ve((en=tt.value)===null||en===void 0?void 0:en.previousPageCursor)},[(ye=tt.value)===null||ye===void 0?void 0:ye.previousPageCursor]);return(0,W.useEffect)(()=>{ut!==void 0&&y!==ut&&Ve(void 0)},[y,ut,Ve]),(0,W.useEffect)(()=>{St!==void 0&&!(0,_.isEqual)(Ae,St)&&Ve(void 0)},[Ae,St,Ve]),{result:tt,term:y,setTerm:U,types:re,setTypes:q,filters:Ae,setFilters:Pe,pageLimit:et,setPageLimit:wt,pageCursor:dt,setPageCursor:Ve,fetchNextPage:Ft?Yt:void 0,fetchPreviousPage:nn?Ht:void 0}},We=X=>{const{initialState:Y,children:le}=X,ce=ke(Y);return(0,f.jsx)(t.fC,{attributes:{searchTypes:ce.types.sort().join(",")},children:(0,f.jsx)(P.Provider,{value:(0,T.EI)({1:ce}),children:le})})},z=X=>{const{initialState:Y,inheritParentContextIfAvailable:le,children:ce}=X;return k()&&le?(0,f.jsx)(f.Fragment,{children:ce}):(0,f.jsx)(We,{initialState:Y,children:ce})},xt=({children:X})=>{var Y;const le=Ae=>(0,$.Z)(Ae)!==Ae,ce=(0,t.z$)(),{term:ye,result:Ce}=L();var y;const U=(y=(Y=Ce.value)===null||Y===void 0?void 0:Y.numberOfResults)!==null&&y!==void 0?y:void 0,q=le(Ce.loading)&&!Ce.loading;return(0,W.useEffect)(()=>{ye&&q&&ce.captureEvent("search",ye,{value:U})},[ce,ye,U,q]),(0,f.jsx)(f.Fragment,{children:X})};function ot(X){return(0,W.forwardRef)((Y,le)=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(X,{...Y,ref:le})}))}const Ye=ot((0,W.forwardRef)((X,Y)=>{const{onChange:le,onKeyDown:ce=()=>{},onClear:ye=()=>{},onSubmit:Ce=()=>{},debounceTime:y=200,clearButton:U=!0,fullWidth:re=!0,value:q,label:Ae,placeholder:Pe,inputProps:et={},endAdornment:wt,...dt}=X,Ve=(0,t.h_)(t.Ds),[ut,St]=(0,W.useState)("");(0,W.useEffect)(()=>{St(Lt=>Lt!==q?String(q):Lt)},[q]),(0,se.Z)(()=>le(ut),y,[ut]);const tt=(0,W.useCallback)(Lt=>{St(Lt.target.value)},[St]),Ft=(0,W.useCallback)(Lt=>{ce&&ce(Lt),Ce&&Lt.key==="Enter"&&Ce()},[ce,Ce]),nn=(0,W.useCallback)(()=>{le(""),ye&&ye()},[le,ye]),Yt=Ae?void 0:"Search",Ht=Pe!=null?Pe:`Search in ${Ve.getOptionalString("app.title")||"Backstage"}`,Dt=(0,f.jsx)(ue.Z,{position:"start",children:(0,f.jsx)(V.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(w.Z,{})})}),en=(0,f.jsx)(ue.Z,{position:"end",children:(0,f.jsx)(I.Z,{"aria-label":"Clear",size:"small",onClick:nn,onKeyDown:Lt=>{Lt.key==="Enter"&&Lt.stopPropagation()},children:"Clear"})});return(0,f.jsx)(xt,{children:(0,f.jsx)(K.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:Y,value:ut,label:Ae,placeholder:Ht,InputProps:{startAdornment:Dt,endAdornment:U?en:wt},inputProps:{"aria-label":Yt,...et},fullWidth:re,onChange:tt,onKeyDown:Ft,...dt})})})),st=ot((0,W.forwardRef)((X,Y)=>{const{value:le="",onChange:ce,...ye}=X,{term:Ce,setTerm:y}=L();(0,W.useEffect)(()=>{le&&y(String(le))},[le,y]);const U=(0,W.useCallback)(re=>{ce?ce(re):y(re)},[ce,y]);return(0,f.jsx)(t.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Ye,{...ye,ref:Y,value:Ce,onChange:U})})}));var Qe=r(4614),Ct=r(88013);const bt=(X=>Y=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(X,{...Y})}))(function(Y){const{loading:le,value:ce,onChange:ye=()=>{},options:Ce=[],getOptionLabel:y=Ft=>String(Ft),inputPlaceholder:U,inputDebounceTime:re,freeSolo:q=!0,fullWidth:Ae=!0,clearOnBlur:Pe=!1,"data-testid":et="search-autocomplete",...wt}=Y,{setTerm:dt}=L(),Ve=(0,W.useCallback)(Ft=>Ft?typeof Ft=="string"?Ft:y(Ft):"",[y]),ut=(0,W.useMemo)(()=>Ve(ce),[ce,Ve]),St=(0,W.useCallback)((Ft,nn,Yt,Ht)=>{dt(Ve(nn)),ye(Ft,nn,Yt,Ht)},[Ve,dt,ye]),tt=(0,W.useCallback)(({InputProps:{ref:Ft,endAdornment:nn},InputLabelProps:Yt,...Ht})=>(0,f.jsx)(st,{...Ht,ref:Ft,clearButton:!1,value:ut,placeholder:U,debounceTime:re,endAdornment:le?(0,f.jsx)(Qe.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):nn}),[le,ut,U,re]);return(0,f.jsx)(Ct.ZP,{...wt,"data-testid":et,value:ce,onChange:St,options:Ce,getOptionLabel:y,renderInput:tt,freeSolo:q,fullWidth:Ae,clearOnBlur:Pe})}),it=X=>{const{icon:Y,primaryText:le,primaryTextTypographyProps:ce,secondaryText:ye,secondaryTextTypographyProps:Ce,disableTextTypography:y}=X;return _jsxs(_Fragment,{children:[Y?_jsx(ListItemIcon,{children:Y}):null,_jsx(ListItemText,{primary:le,primaryTypographyProps:ce,secondary:ye,secondaryTypographyProps:Ce,disableTypography:y})]})};var Pt=r(42494),Nt=r(84899),Ge=r(5806),Qt=r(21324),ge=r(56939),Se=r(73698),Ue=r(12231),nt=r(7089),yt=r(69294);const gt=(X,Y,le=[],ce=250)=>{const ye=(0,W.useRef)({}),Ce=X||(()=>Promise.resolve([])),[y,U]=(0,yt.default)(Ce,[Y],{loading:!0});if((0,se.Z)(()=>{ye.current[Y]===void 0&&(ye.current[Y]=U(Y).then(q=>(ye.current[Y]=q,q)))},ce,[U,Y]),le.length)return{loading:!1,value:le};const re=ye.current[Y];return Array.isArray(re)?{loading:!1,value:re}:y},pt=(X,Y)=>{const{setFilters:le}=L();(0,W.useEffect)(()=>{Y&&[Y].flat().length>0&&le(ce=>({...ce,[X]:Y}))},[])},Bt=X=>{const{className:Y,defaultValue:le,name:ce,values:ye,valuesDebounceMs:Ce,label:y,filterSelectedOptions:U,limitTags:re,multiple:q}=X,[Ae,Pe]=(0,W.useState)("");pt(ce,le);const et=typeof ye=="function"?ye:void 0,wt=typeof ye=="function"?void 0:ye,{value:dt,loading:Ve}=gt(et,Ae,wt,Ce),{filters:ut,setFilters:St}=L(),tt=ut[ce]||(q?[]:null),Ft=(Ht,Dt)=>{St(en=>{const{[ce]:Lt,...Ot}=en;return Dt?{...Ot,[ce]:Dt}:{...Ot}})},nn=Ht=>(0,f.jsx)(K.Z,{...Ht,name:"search",variant:"outlined",label:y,fullWidth:!0}),Yt=(Ht,Dt)=>Ht.map((en,Lt)=>(0,f.jsx)(nt.Z,{label:en,color:"primary",...Dt({index:Lt})}));return(0,f.jsx)(Ct.ZP,{filterSelectedOptions:U,limitTags:re,multiple:q,className:Y,id:`${q?"multi-":""}select-filter-${ce}--select`,options:dt||[],loading:Ve,value:tt,onChange:Ft,onInputChange:(Ht,Dt)=>Pe(Dt),renderInput:nn,renderTags:Yt})},Mt=(0,u.Z)({label:{textTransform:"capitalize"}}),Kt=X=>{const{className:Y,defaultValue:le,label:ce,name:ye,values:Ce=[],valuesDebounceMs:y}=X,U=Mt(),{filters:re,setFilters:q}=L();pt(ye,le);const Ae=typeof Ce=="function"?Ce:void 0,Pe=typeof Ce=="function"?void 0:Ce,{value:et=[],loading:wt}=gt(Ae,"",Pe,y),dt=ut=>{const{target:{value:St,checked:tt}}=ut;q(Ft=>{const{[ye]:nn,...Yt}=Ft,Ht=(nn||[]).filter(en=>en!==St),Dt=tt?[...Ht,St]:Ht;return Dt.length?{...Yt,[ye]:Dt}:Yt})};var Ve;return(0,f.jsxs)(Pt.Z,{className:Y,disabled:wt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[ce?(0,f.jsx)(Nt.Z,{className:U.label,children:ce}):null,et.map(ut=>(0,f.jsx)(Ge.Z,{control:(0,f.jsx)(Qt.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":ut},value:ut,name:ut,onChange:dt,checked:((Ve=re[ye])!==null&&Ve!==void 0?Ve:[]).includes(ut)}),label:ut},ut))]})},$t=X=>{const{className:Y,defaultValue:le,label:ce,name:ye,values:Ce,valuesDebounceMs:y}=X,U=Mt();pt(ye,le);const re=typeof Ce=="function"?Ce:void 0,q=typeof Ce=="function"?void 0:Ce,{value:Ae=[],loading:Pe}=gt(re,"",q,y),{filters:et,setFilters:wt}=L(),dt=Ve=>{const{target:{value:ut}}=Ve;wt(St=>{const{[ye]:tt,...Ft}=St;return ut?{...Ft,[ye]:ut}:Ft})};return(0,f.jsxs)(Pt.Z,{disabled:Pe,className:Y,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[ce?(0,f.jsx)(ge.Z,{className:U.label,margin:"dense",children:ce}):null,(0,f.jsxs)(Se.Z,{variant:"outlined",value:et[ye]||"",onChange:dt,children:[(0,f.jsx)(Ue.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Ae.map(Ve=>(0,f.jsx)(Ue.Z,{value:Ve,children:Ve},Ve))]})]})},Xt=X=>{const{component:Y,...le}=X;return(0,f.jsx)(Y,{...le})};Xt.Checkbox=X=>(0,f.jsx)(Xt,{...X,component:Kt}),Xt.Select=X=>(0,f.jsx)(Xt,{...X,component:$t}),Xt.Autocomplete=X=>(0,f.jsx)(Xt,{...X,component:Bt});var qt=r(48834).lW;const gn=X=>qt.from(X.toString(),"utf-8").toString("base64"),Mn=X=>X?Number(qt.from(X,"base64").toString("utf-8")):0,Pn=X=>{const{total:Y=-1,cursor:le,hasNextPage:ce,onCursorChange:ye,limit:Ce=25,limitLabel:y="Results per page:",limitText:U=({from:dt,to:Ve})=>Y>0?`of ${Y}`:`${dt}-${Ve}`,limitOptions:re,onLimitChange:q,...Ae}=X,Pe=useMemo(()=>Mn(le),[le]),et=useCallback((dt,Ve)=>{ye==null||ye(gn(Ve))},[ye]),wt=useCallback(dt=>{const Ve=dt.target.value;q==null||q(parseInt(Ve,10))},[q]);return _jsx(TablePagination,{...Ae,component:"div",count:Y,page:Pe,nextIconButtonProps:{...ce!==void 0&&{disabled:!ce}},onPageChange:et,rowsPerPage:Ce,labelRowsPerPage:y,labelDisplayedRows:U,rowsPerPageOptions:re,onRowsPerPageChange:wt})},mn=X=>{const{pageLimit:Y,setPageLimit:le,pageCursor:ce,setPageCursor:ye,fetchNextPage:Ce}=useSearch();return _jsx(Pn,{...X,hasNextPage:!!Ce,limit:Y,onLimitChange:le,cursor:ce,onCursorChange:ye})};var Ln=r(53974);const kn=X=>{const{children:Y}=X,le=useSearch(),{result:ce,...ye}=le;return Y(ce,ye)},_t=X=>{const{query:Y,children:le}=X,ce=useApi(searchApiRef),ye=useAsync(()=>{const{term:Ce="",types:y=[],filters:U={},...re}=Y;return ce.query({...re,term:Ce,types:y,filters:U})},[Y]);return le(ye,Y)},jn=X=>{const{query:Y,children:le}=X;return Y?_jsx(_t,{query:Y,children:le}):_jsx(kn,{children:le})},zn=X=>{const{query:Y,children:le,noResultsComponent:ce=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ye}=X;return _jsx(jn,{query:Y,children:({loading:Ce,error:y,value:U})=>Ce?_jsx(Progress,{}):y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:y}):U!=null&&U.results.length?isFunction(le)?le(U):_jsx(SearchResultListItemExtensions,{...ye,results:U.results,children:le}):ce})},ft=X=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(zn,{...X})}),Kn=({result:X,highlight:Y,icon:le,secondaryAction:ce,lineClamp:ye=5})=>X?_jsxs(_Fragment,{children:[le&&_jsx(ListItemIcon,{children:le}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:X.location,children:Y!=null&&Y.fields.title?_jsx(HighlightedSearchResultText,{text:(Y==null?void 0:Y.fields.title)||"",preTag:(Y==null?void 0:Y.preTag)||"",postTag:(Y==null?void 0:Y.postTag)||""}):X.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ye,overflow:"hidden"},color:"textSecondary",variant:"body2",children:Y!=null&&Y.fields.text?_jsx(HighlightedSearchResultText,{text:Y.fields.text,preTag:Y.preTag,postTag:Y.postTag}):X.text})}),ce&&_jsx(Box,{alignItems:"flex-end",children:ce})]}):null,Rt=X=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Kn,{...X})}),at=X=>{const{error:Y,loading:le,resultItems:ce,renderResultItem:ye=re=>_jsx(DefaultResultListItem,{result:re.document},re.document.location),disableRenderingWithNoResults:Ce,noResultsComponent:y=Ce?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...U}=X;return le?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):ce!=null&&ce.length?_jsx(List,{...U,children:ce.map(ye)}):_jsx(_Fragment,{children:y})},xn=X=>{const{query:Y,renderResultItem:le,children:ce,...ye}=X,Ce=useSearchResultListItemExtensions(ce);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Y,children:({loading:y,error:U,value:re})=>_jsx(at,{...ye,error:U,loading:y,resultItems:re==null?void 0:re.results,renderResultItem:le!=null?le:Ce})})})};var Gt=r(19126);const an=(0,u.Z)(X=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:X.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:X.palette.text.secondary,margin:X.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:X.palette.text.secondary,margin:X.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:X.spacing(.5)}})),En=X=>{const Y=an(),{label:le,children:ce,...ye}=X;return _jsx(Chip,{...ye,className:Y.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[le,": ",ce]})})},dn=()=>null,Tn=(0,u.Z)(X=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:X.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:X.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),we=X=>{const Y=Tn(),{label:le,value:ce="None",onChange:ye,onDelete:Ce}=X,y=useCallback(U=>{ye(U.target.value)},[ye]);return _jsx(En,{label:le,onDelete:Ce,children:_jsx(Typography,{role:"textbox",component:"span",className:Y.root,onChange:y,contentEditable:!0,suppressContentEditableWarning:!0,children:ce})})},ae=(0,u.Z)(X=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:X.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Be=X=>{const Y=ae(),{label:le,value:ce="none",onChange:ye,onDelete:Ce,children:y}=X,U=useCallback(re=>{ye(re.target.value)},[ye]);return _jsx(En,{label:le,onDelete:Ce,children:_jsxs(Select,{className:Y.root,value:ce,onChange:U,input:_jsx(InputBase,{}),IconComponent:dn,children:[_jsx(MenuItem,{value:"none",children:"None"}),y]})})};function ze(X){const Y=an(),[le,ce]=useState(null),{error:ye,loading:Ce,icon:y,title:U,titleProps:re={},link:q=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Y.listSubheaderLinkIcon})]}),linkProps:Ae={},filterOptions:Pe,renderFilterOption:et=Dt=>_jsx(MenuItem,{value:String(Dt),children:Dt},String(Dt)),filterFields:wt,renderFilterField:dt,resultItems:Ve,renderResultItem:ut=Dt=>_jsx(DefaultResultListItem,{result:Dt.document},Dt.document.location),disableRenderingWithNoResults:St,noResultsComponent:tt=St?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Ft}=X,nn=useCallback(Dt=>{ce(Dt.currentTarget)},[]),Yt=useCallback(()=>{ce(null)},[]);if(Ce)return _jsx(Progress,{});if(ye)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ye});if(!(Ve!=null&&Ve.length))return _jsx(_Fragment,{children:tt});var Ht;return _jsxs(List,{...Ft,children:[_jsxs(ListSubheader,{className:Y.listSubheader,children:[y,_jsx(Typography,{className:Y.listSubheaderName,component:"strong",...re,children:U}),Pe?_jsx(Chip,{className:Y.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:nn}):null,Pe?_jsx(Menu,{id:"filters-menu",anchorEl:le,open:Boolean(le),onClose:Yt,onClick:Yt,keepMounted:!0,children:Pe.map(et)}):null,wt==null?void 0:wt.map(Dt=>(Ht=dt==null?void 0:dt(Dt))!==null&&Ht!==void 0?Ht:null),_jsx(Link,{className:Y.listSubheaderLink,to:"/search",...Ae,children:q})]}),Ve.map(ut)]})}function _e(X){const{query:Y,children:le,renderResultItem:ce,linkProps:ye={},...Ce}=X,y=useSearchResultListItemExtensions(le);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:Y,children:({loading:U,error:re,value:q},{term:Ae,types:Pe,pageCursor:et,filters:wt={}})=>{const dt=`/search?${qs.stringify({term:Ae,types:Pe,filters:wt,pageCursor:et,query:Ae},{arrayFormat:"brackets"})}`;return _jsx(ze,{...Ce,error:re,loading:U,linkProps:{to:dt,...ye},filterFields:Object.keys(wt),resultItems:q==null?void 0:q.results,renderResultItem:ce!=null?ce:y})}})})}const ne=(0,u.Z)(X=>({root:{display:"flex",justifyContent:"space-between",gap:X.spacing(2),margin:X.spacing(2,0)}})),Z=()=>{const{fetchNextPage:X,fetchPreviousPage:Y}=useSearch(),le=ne();return!X&&!Y?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:le.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Y,onClick:Y,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!X,onClick:X,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},pe="search.results.list.items.extensions.v1",Ze=(X,Y)=>{for(const le of X){if(!isValidElement(le))continue;const ce=getComponentData(le,pe);if(ce!=null&&ce(Y))return cloneElement(le,{rank:Y.rank,highlight:Y.highlight,result:Y.document,...le.props})}return null},Xe=X=>{const{rank:Y,result:le,noTrack:ce,children:ye,alignItems:Ce="flex-start",...y}=X,U=(0,t.z$)(),re=(0,W.useCallback)(()=>{ce||le&&U.captureEvent("discover",le.title,{attributes:{to:le.location},value:Y})},[Y,le,ce,U]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:Ce,onClickCapture:re,...y,children:ye})},lt=X=>{const{name:Y,component:le,predicate:ce=()=>!0}=X;return(0,t.YO)({name:Y,component:{lazy:()=>le().then(ye=>Ce=>(0,f.jsx)(Xe,{rank:Ce.rank,result:Ce.result,noTrack:Ce.noTrack,children:(0,W.createElement)(ye,Ce)}))},data:{[pe]:ce}})},kt=X=>{const Y=useElementFilter(X,le=>le.selectByComponentData({key:pe}).getElements(),[X]);return useCallback((le,ce)=>{const ye=Ze(Y,le);return _jsx(Fragment,{children:ye!=null?ye:_jsx(Xe,{rank:le.rank,result:le.document,children:_jsx(DefaultResultListItem,{rank:le.rank,highlight:le.highlight,result:le.document})})},ce)},[Y])},Ut=X=>{const{results:Y,children:le,...ce}=X,ye=kt(le);return _jsx(List,{...ce,children:Y.map(ye)})}},61886:function(jt,De,r){"use strict";r.d(De,{Ox:function(){return Qe},jM:function(){return W},Zz:function(){return g},oZ:function(){return z},DR:function(){return u},ZS:function(){return ke},VA:function(){return bt},KY:function(){return me},gT:function(){return w},Dl:function(){return se},ux:function(){return Tt},$L:function(){return I},x1:function(){return We}});var t=r(52322),h=r(2784),H=r(73557),f=r(60871);const W="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",u=()=>null;(0,f.R5)(u,g,!0);const B=ge=>`${W}.${ge.toLocaleLowerCase("en-US")}`;function me(ge){const{name:Se,component:Ue}=ge;return(0,f.YO)({name:Se,component:{sync:nt=>(0,t.jsx)(Ue,{...nt})},data:{[W]:ge,[B(Se)]:!0}})}const ue=(ge,Se)=>ge.selectByComponentData({key:Se}).getElements()[0],V=ge=>ge.selectByComponentData({key:g}).selectByComponentData({key:W}),K=ge=>ge.selectByComponentData({key:g}).findComponentData({key:W}),I=()=>{const ge=(0,H.pC)(),Se=(0,f.vJ)(ge,V),Ue=(0,f.vJ)(ge,K),nt=(0,h.useCallback)(pt=>{if(!Se||!pt)return null;const Bt=B(pt.name);var Mt;return(Mt=ue(Se,Bt))!==null&&Mt!==void 0?Mt:null},[Se]),yt=(0,h.useCallback)(pt=>{const Bt=Ue.find(Mt=>Mt.name===pt);return Bt?nt(Bt):null},[Ue,nt]),gt=(0,h.useCallback)(pt=>{const Bt=Ue.filter(Mt=>Mt.location===pt);return Bt.length?Bt.map(nt):null},[Ue,nt]);return{renderComponentByName:yt,renderComponentsByLocation:gt}},w=(0,f.T0)({id:"plugin.techdocs.service"}),se=(0,f.T0)({id:"plugin.techdocs.storageservice"});var _=r(64279),te=r(77446),$=r(25271),T=r(51837);function P(ge,Se){return Se.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ge.kind=ge.kind.toLocaleLowerCase(),ge.name=ge.name.toLocaleLowerCase(),ge.namespace=ge.namespace.toLocaleLowerCase()),ge}const L=(ge,Se)=>(0,$.eE)(ge)===(0,$.eE)(Se),k={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},oe=(0,T.CT)("techdocs-reader-page-context"),ke=(0,h.memo)(ge=>{const{entityRef:Se,children:Ue}=ge,nt=(0,f.h_)(w),yt=(0,f.h_)(f.Ds),gt=(0,_.default)(async()=>nt.getEntityMetadata(Se),[Se]),pt=(0,te.Z)(async()=>nt.getTechDocsMetadata(Se),[Se]),[Bt,Mt]=(0,h.useState)(k.title),[Kt,$t]=(0,h.useState)(k.subtitle),[Xt,qt]=(0,h.useState)(k.shadowRoot);(0,h.useEffect)(()=>{Xt&&!pt.value&&!pt.loading&&pt.retry()},[pt.value,pt.loading,Xt,pt.retry,pt]);const gn={metadata:pt,entityRef:P(Se,yt),entityMetadata:gt,shadowRoot:Xt,setShadowRoot:qt,title:Bt,setTitle:Mt,subtitle:Kt,setSubtitle:$t},Mn=(0,T.EI)({1:gn});return(0,t.jsx)(f.fC,{attributes:{entityRef:(0,$.eE)(Se)},children:(0,t.jsx)(oe.Provider,{value:Mn,children:Ue instanceof Function?Ue(gn):Ue})})},(ge,Se)=>L(ge.entityRef,Se.entityRef)),We=()=>{const ge=(0,h.useContext)(oe);if(ge===void 0)return k;const Se=ge.atVersion(1);if(Se===void 0)throw new Error("No context found for version 1.");return Se},z=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var xt=r(70882),ot=r(50236),Ye=r(19219),st=r(53974);const Qe="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Ct=ge=>{(0,h.useEffect)(()=>{if(!ge)return()=>{};const Se=ge.querySelectorAll('head > link[rel="stylesheet"]');var Ue;let nt=(Ue=Se==null?void 0:Se.length)!==null&&Ue!==void 0?Ue:0;const yt=new CustomEvent(Qe);if(!nt)return ge.dispatchEvent(yt),()=>{};const gt=()=>{--nt===0&&ge.dispatchEvent(yt)};return Se==null||Se.forEach(pt=>{pt.addEventListener("load",gt)}),()=>{Se==null||Se.forEach(pt=>{pt.removeEventListener("load",gt)})}},[ge])},Tt=ge=>{const[Se,Ue]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{if(!ge)return()=>{};Ue(!0);const nt=ge.style;nt.setProperty("opacity","0");const yt=()=>{Ue(!1),nt.setProperty("opacity","1")};return ge.addEventListener(Qe,yt),()=>{ge.removeEventListener(Qe,yt)}},[ge]),Se},bt=ge=>{const{element:Se,onAppend:Ue,children:nt}=ge,[yt,gt]=(0,h.useState)((0,xt.Ue)({...(0,ot.Z)(),insertionPoint:void 0}));Ct(Se);const pt=Tt(Se),Bt=(0,h.useCallback)(Mt=>{if(!Se||!Mt)return;gt((0,xt.Ue)({...(0,ot.Z)(),insertionPoint:Se.querySelector("head")||void 0}));let Kt=Mt.shadowRoot;Kt||(Kt=Mt.attachShadow({mode:"open"})),Kt.replaceChildren(Se),typeof Ue=="function"&&Ue(Kt)},[Se,Ue]);return(0,t.jsxs)(t.Fragment,{children:[pt&&(0,t.jsx)(st.Ex,{}),(0,t.jsxs)(Ye.ZP,{jss:yt,sheetsManager:new Map,children:[(0,t.jsx)("div",{ref:Bt,"data-testid":"techdocs-native-shadowroot"}),nt]})]})};var it=r(54073);const Pt=()=>{const{shadowRoot:ge}=useTechDocsReaderPage();return ge},Nt=ge=>{const Se=Pt();return Se?ge.map(Ue=>Se==null?void 0:Se.querySelectorAll(Ue)).filter(Ue=>Ue.length).map(Ue=>Array.from(Ue)).flat():[]},Ge=ge=>ge.toString()&&ge.rangeCount&&ge.getRangeAt(0).getBoundingClientRect().top,Qt=(ge=0)=>{const Se=Pt(),[Ue,nt]=useState(null),yt=useMemo(()=>debounce(()=>{const gt=Se,pt=gt.getSelection?gt.getSelection():document.getSelection();pt&&Ge(pt)?nt(pt):nt(null)},ge),[Se,nt,ge]);return useEffect(()=>(window.document.addEventListener("selectionchange",yt),()=>{yt.cancel(),window.document.removeEventListener("selectionchange",yt)}),[yt]),Ue}},52943:function(jt,De,r){"use strict";r.r(De),r.d(De,{EmbeddedDocsRouter:function(){return _},Router:function(){return se},isTechDocsAvailable:function(){return w}});var t=r(52322),h=r(2784),H=r(73557),f=r(43514),W=r(53974),g=r(25271),u=r(89258),B=r(65124),me=r(86317);const ue=({entity:te})=>{const $=(0,g.iB)(te);return(0,t.jsxs)(u.I6,{entityRef:$,children:[(0,t.jsx)(B.b,{}),(0,t.jsx)(me.F,{withSearch:!1})]})};var V=r(18662),K=r(7476);const I="backstage.io/techdocs-ref",w=te=>{var $,T;return Boolean(te==null||($=te.metadata)===null||$===void 0||(T=$.annotations)===null||T===void 0?void 0:T[I])},se=()=>(0,t.jsxs)(H.Z5,{children:[(0,t.jsx)(H.AW,{path:"/",element:(0,t.jsx)(V.TechDocsIndexPage,{})}),(0,t.jsx)(H.AW,{path:"/:namespace/:kind/:name/*",element:(0,t.jsx)(K.TechDocsReaderPage,{})})]}),_=te=>{var $;const{children:T}=te,{entity:P}=(0,f.X2)(),L=(0,H.V$)([{path:"/*",element:(0,t.jsx)(ue,{entity:P}),children:[{path:"*",element:T}]}]);return(($=P.metadata.annotations)===null||$===void 0?void 0:$[I])?L:(0,t.jsx)(W.sk,{annotation:I})}},92077:function(jt,De,r){"use strict";r.d(De,{k:function(){return g},p:function(){return W}});var t=r(87612),h=r(23054),H=r(76372),f=r.n(H);class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(B){const{kind:me,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${me}/${V}`,w=await this.fetchApi.fetch(`${I}`);if(!w.ok)throw await h.VL.fromResponse(w);return await w.json()}async getEntityMetadata(B){const{kind:me,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/entity/${ue}/${me}/${V}`,w=await this.fetchApi.fetch(`${I}`);if(!w.ok)throw await h.VL.fromResponse(w);return await w.json()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var B;return(B=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&B!==void 0?B:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(B,me){const{kind:ue,namespace:V,name:K}=B,w=`${await this.getStorageUrl()}/${V}/${ue}/${K}/${me}`,se=await this.fetchApi.fetch(`${w.endsWith("/")?w:`${w}/`}index.html`);let _="";switch(se.status){case 404:throw _="Page not found. ",me||(_+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(_);case 500:throw _="Could not generate documentation or an error in the TechDocs backend. ",new Error(_);default:break}return se.text()}async syncEntityDocs(B,me=()=>{}){const{kind:ue,namespace:V,name:K}=B,w=`${await this.getApiOrigin()}/sync/${V}/${ue}/${K}`,{token:se}=await this.identityApi.getCredentials();return new Promise((_,te)=>{const $=new H.EventSourcePolyfill(w,{withCredentials:!0,headers:se?{Authorization:`Bearer ${se}`}:{}});$.addEventListener("log",T=>{T.data&&me(JSON.parse(T.data))}),$.addEventListener("finish",T=>{let P=!1;T.data&&({updated:P}=JSON.parse(T.data)),_(P?"updated":"cached")}),$.onerror=T=>{switch($.close(),T.status){case 404:te(new h.dR(T.message));return;default:te(new Error(T.data));return}}})}async getBaseUrl(B,me,ue){const{kind:V,namespace:K,name:I}=me,se=`${await this.getApiOrigin()}/static/docs/${K}/${V}/${I}/${ue}`;return new URL(B,se.endsWith("/")?se:`${se}/`).toString()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"identityApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.identityApi=B.identityApi,this.fetchApi=B.fetchApi}}},51953:function(jt,De,r){"use strict";r.d(De,{D:function(){return t}});function t(h,H){return H.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?h:h.toLocaleLowerCase("en-US")}},3482:function(jt,De,r){"use strict";r.d(De,{u:function(){return B}});var t=r(52322),h=r(2784),H=r(53974),f=r(43514),W=r(42081),g=r(48431),u=r(68435);const B=me=>{const{initialFilter:ue="owned",columns:V,actions:K}=me;return(0,t.jsx)(W.j,{children:(0,t.jsxs)(H.VY,{children:[(0,t.jsx)(H.yW,{title:"",children:(0,t.jsx)(H.qt,{children:"Discover documentation in your ecosystem."})}),(0,t.jsx)(f.UO,{children:(0,t.jsxs)(f._i,{children:[(0,t.jsxs)(f._i.Filters,{children:[(0,t.jsx)(g.f,{}),(0,t.jsx)(f.EW,{initialFilter:ue}),(0,t.jsx)(f.dq,{}),(0,t.jsx)(f.xE,{})]}),(0,t.jsx)(f._i.Content,{children:(0,t.jsx)(u.n,{actions:K,columns:V})})]})})]})})}},85478:function(jt,De,r){"use strict";r.d(De,{f:function(){return V}});var t=r(52322),h=r(95573),H=r(51953),f=r(60871),W=r(53974),g=r(94339),u=r(16111),B=r(24579),me=r(14503),ue=r(2784);const V=_=>{const{entities:te}=_,$=(0,f.tg)(h.Fw),T=(0,f.h_)(f.Ds);if(!te)return null;var P,L;return(0,t.jsx)(W.Oh,{"data-testid":"docs-explore",children:te!=null&&te.length?te.map((k,oe)=>(0,t.jsxs)(g.Z,{children:[(0,t.jsx)(u.Z,{children:(0,t.jsx)(W.hu,{title:(P=k.metadata.title)!==null&&P!==void 0?P:k.metadata.name})}),(0,t.jsx)(B.Z,{children:k.metadata.description}),(0,t.jsx)(me.Z,{children:(0,t.jsx)(W.Qj,{to:$({namespace:(0,H.D)((L=k.metadata.namespace)!==null&&L!==void 0?L:"default",T),kind:(0,H.D)(k.kind,T),name:(0,H.D)(k.metadata.name,T)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},oe)):null})};var K=r(43514);const I={title:"All Documentation",filterPredicate:()=>!0},w=_=>{const{entities:te,group:$}=_,{loading:T,isOwnedEntity:P}=useEntityOwnership(),L=te.filter(oe=>$.filterPredicate==="ownedByUser"?T?!1:P(oe):typeof $.filterPredicate=="function"&&$.filterPredicate(oe)),k=(()=>typeof $.title=="string"?_jsx(ContentHeader,{title:$.title}):$.title)();return L.length===0?null:_jsxs(Content,{children:[k,_jsx(DocsCardGrid,{entities:L})]})},se=_=>{const{loading:te,error:$,entities:T}=useEntityList();if($)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:$.toString()})});if(te)return _jsx(Progress,{});if(T.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var P,L;return T.sort((k,oe)=>((P=k.metadata.title)!==null&&P!==void 0?P:k.metadata.name).localeCompare((L=oe.metadata.title)!==null&&L!==void 0?L:oe.metadata.name)),_jsx(Content,{children:(_.groups||[I]).map((k,oe)=>_jsx(w,{entities:T,group:k},`${k.title}-${oe}`))})}},68435:function(jt,De,r){"use strict";r.d(De,{H:function(){return T},n:function(){return P}});var t=r(52322),h=r(2784),H=r(95074),f=r(76635),W=r(53974),g=r(43514),u=r(60871),B=r(25271),me=r(95573),ue=r(39981),V=r(2337),K=r(11640),I=r(28347);const w=(0,V.Z)({root:{color:"#f3ba37"}})(K.Z),se={createCopyDocsUrlAction(L){return k=>({icon:()=>(0,t.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>L(`${window.location.origin}${k.resolved.docsUrl}`)})},createStarEntityAction(L,k){return oe=>{const ke=oe.entity,We=L(ke);return{cellStyle:{paddingLeft:"1em"},icon:()=>We?(0,t.jsx)(w,{}):(0,t.jsx)(I.Z,{}),tooltip:We?"Remove from favorites":"Add to favorites",onClick:()=>k(ke)}}}};function _(L){return L.metadata.title||L.metadata.name}const te={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:L=>(0,t.jsx)(W.uw,{value:(0,t.jsx)(W.rU,{to:L.resolved.docsUrl,children:_(L.entity)}),subvalue:L.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:L})=>(0,t.jsx)(g.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var $=r(51953);const T=L=>{const{entities:k,title:oe,loading:ke,columns:We,actions:z,options:xt}=L,[,ot]=(0,H.Z)(),Ye=(0,u.tg)(me.Fw),st=(0,u.h_)(u.Ds);if(!k)return null;const Qe=k.map(bt=>{const it=(0,g.hF)(bt,B.S4);var Pt;return{entity:bt,resolved:{docsUrl:Ye({namespace:(0,$.D)((Pt=bt.metadata.namespace)!==null&&Pt!==void 0?Pt:"default",st),kind:(0,$.D)(bt.kind,st),name:(0,$.D)(bt.metadata.name,st)}),ownedByRelations:it,ownedByRelationsTitle:it.map(Nt=>(0,g.$3)(Nt,{defaultKind:"group"})).join(", ")}}}),Ct=[te.createNameColumn(),te.createOwnerColumn(),te.createTypeColumn()],Tt=[se.createCopyDocsUrlAction(ot)];return(0,t.jsx)(t.Fragment,{children:ke||Qe&&Qe.length>0?(0,t.jsx)(W.iA,{isLoading:ke,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...xt},data:Qe,columns:We||Ct,actions:z||Tt,title:oe?`${oe} (${Qe.length})`:`All (${Qe.length})`}):(0,t.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,t.jsx)(W.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};T.columns=te,T.actions=se;const P=L=>{var k;const{columns:oe,actions:ke,options:We}=L,{loading:z,error:xt,entities:ot,filters:Ye}=(0,g.wp)(),{isStarredEntity:st,toggleStarredEntity:Qe}=(0,g.CR)(),[,Ct]=(0,H.Z)();var Tt;const bt=(0,f.capitalize)((Tt=(k=Ye.user)===null||k===void 0?void 0:k.value)!==null&&Tt!==void 0?Tt:"all"),it=[se.createCopyDocsUrlAction(Ct),se.createStarEntityAction(st,Qe)];return xt?(0,t.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,t.jsx)(W.Oi,{language:"text",text:xt.toString()})}):(0,t.jsx)(T,{title:bt,entities:ot,loading:z,actions:ke||it,columns:oe,options:We})};P.columns=te,P.actions=se},18662:function(jt,De,r){"use strict";r.r(De),r.d(De,{TechDocsIndexPage:function(){return W}});var t=r(52322),h=r(2784),H=r(73557),f=r(3482);const W=g=>(0,H.pC)()||(0,t.jsx)(f.u,{...g})},42081:function(jt,De,r){"use strict";r.d(De,{j:function(){return W}});var t=r(52322),h=r(2784),H=r(53974),f=r(60871);const W=g=>{const{children:u}=g,B=(0,f.h_)(f.Ds);var me;const ue=`Documentation available in ${(me=B.getOptionalString("organization.name"))!==null&&me!==void 0?me:"Backstage"}`;return(0,t.jsx)(H.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:u})}},48431:function(jt,De,r){"use strict";r.d(De,{f:function(){return f}});var t=r(2784),h=r(43514);class H{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":h.n3}}}const f=()=>{const{updateFilters:W}=(0,h.wp)();return(0,t.useEffect)(()=>{W({techdocs:new H})},[W]),null}},89258:function(jt,De,r){"use strict";r.d(De,{I6:function(){return V},Jl:function(){return ue},s4:function(){return g}});var t=r(61886),h=r(92077),H=r(95573),f=r(60871),W=r(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:t.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:I,discoveryApi:w,identityApi:se,fetchApi:_})=>new h.k({configApi:I,discoveryApi:w,identityApi:se,fetchApi:_})}),(0,f.ni)({api:t.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:I,discoveryApi:w,fetchApi:se})=>new h.p({configApi:I,discoveryApi:w,fetchApi:se})})],routes:{root:H._Z,docRoot:H.Fw,entityContent:H.pd}}),u=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.Router),mountPoint:H._Z})),B=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.EmbeddedDocsRouter),mountPoint:H.pd})),me=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>r.e(7560).then(r.bind(r,27560)).then(I=>I.TechDocsCustomHome),mountPoint:H._Z})),ue=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(r.bind(r,18662)).then(I=>I.TechDocsIndexPage),mountPoint:H._Z})),V=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(r.bind(r,7476)).then(I=>I.TechDocsReaderPage),mountPoint:H.Fw})),K=g.provide((0,W.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(r.bind(r,55511)).then(I=>I.TechDocsSearchResultListItem),predicate:I=>I.type==="techdocs"}))},7476:function(jt,De,r){"use strict";r.r(De),r.d(De,{TechDocsReaderLayout:function(){return V},TechDocsReaderPage:function(){return K}});var t=r(52322),h=r(2784),H=r(73557),f=r(53974),W=r(61886),g=r(86317),u=r(93225),B=r(65124),me=r(95573),ue=r(60871);const V=I=>{const{withSearch:w,withHeader:se=!0}=I;return(0,t.jsxs)(f.T3,{themeId:"documentation",children:[se&&(0,t.jsx)(u.S,{}),(0,t.jsx)(B.b,{}),(0,t.jsx)(g.F,{withSearch:w})]})},K=I=>{const{kind:w,name:se,namespace:_}=(0,ue.Oi)(me.Fw),{children:te,entityRef:$={kind:w,name:se,namespace:_}}=I,T=(0,H.pC)();if(!te){const L=T?h.Children.toArray(T.props.children):[];var P;const oe=L.flatMap(ke=>{var We;return(P=ke==null||(We=ke.props)===null||We===void 0?void 0:We.children)!==null&&P!==void 0?P:[]}).find(ke=>!(0,ue.IY)(ke,W.Zz)&&!(0,ue.IY)(ke,W.jM));return(0,t.jsx)(W.ZS,{entityRef:$,children:oe||(0,t.jsx)(V,{})})}return(0,t.jsx)(W.ZS,{entityRef:$,children:({metadata:L,entityMetadata:k,onReady:oe})=>(0,t.jsx)("div",{className:"techdocs-reader-page",children:(0,t.jsx)(f.T3,{themeId:"documentation",children:te instanceof Function?te({entityRef:$,techdocsMetadataValue:L.value,entityMetadataValue:k.value,onReady:oe}):te})})})}},86317:function(jt,De,r){"use strict";r.d(De,{F:function(){return ye}});var t=r(52322),h=r(2784),H=r(79692),f=r(60905),W=r(61886),g=r(53974),u=r(22478),B=r(4614),me=r(77277),ue=r(99688),V=r(12420),K=r(90436),I=r(61837),w=r(4190),se=r(87685);const _=(0,H.Z)(y=>(0,V.Z)({paper:{width:"100%",[y.breakpoints.up("sm")]:{width:"75%"},[y.breakpoints.up("md")]:{width:"50%"},padding:y.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:y.palette.background.default}})),te=({buildLog:y,onClose:U})=>{const re=_(),q=y.length===0?"Waiting for logs...":y.join(`
37
- `);return(0,t.jsxs)(f.Z,{container:!0,direction:"column",className:re.root,spacing:0,wrap:"nowrap",children:[(0,t.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,t.jsx)(K.Z,{variant:"h5",children:"Build Details"}),(0,t.jsx)(I.Z,{title:"Close the drawer",onClick:U,color:"inherit",children:(0,t.jsx)(se.Z,{})},"dismiss")]}),(0,t.jsx)(f.Z,{item:!0,xs:!0,children:(0,t.jsx)(g.nU,{text:q,classes:{root:re.logs}})})]})},$=({buildLog:y})=>{const U=_(),[re,q]=(0,h.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(me.Z,{color:"inherit",onClick:()=>q(!0),children:"Show Build Logs"}),(0,t.jsx)(w.ZP,{classes:{paper:U.paper},anchor:"right",open:re,onClose:()=>q(!1),children:(0,t.jsx)(te,{buildLog:y,onClose:()=>q(!1)})})]})};var T=r(60871);const P=({errorMessage:y})=>{const U=(0,T.h_)(T.Ds).getOptionalString("techdocs.builder");let re="";return U!=="local"&&(re="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,t.jsx)(g.mf,{status:"404",statusMessage:y||"Documentation not found",additionalInfo:re})};var L=r(95481);const k=(0,H.Z)(y=>({root:{marginBottom:y.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),oe=()=>{let y=null;const U=k(),{state:re,contentReload:q,contentErrorMessage:Ae,syncErrorMessage:Pe,buildLog:et}=(0,L.DK)();return re==="INITIAL_BUILD"&&(y=(0,t.jsx)(ue.Z,{classes:{root:U.root},variant:"outlined",severity:"info",icon:(0,t.jsx)(B.Z,{size:"24px"}),action:(0,t.jsx)($,{buildLog:et}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),re==="CONTENT_STALE_REFRESHING"&&(y=(0,t.jsx)(ue.Z,{variant:"outlined",severity:"info",icon:(0,t.jsx)(B.Z,{size:"24px"}),action:(0,t.jsx)($,{buildLog:et}),classes:{root:U.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),re==="CONTENT_STALE_READY"&&(y=(0,t.jsx)(ue.Z,{variant:"outlined",severity:"success",action:(0,t.jsx)(me.Z,{color:"inherit",onClick:()=>q(),children:"Refresh"}),classes:{root:U.root},children:"A newer version of this documentation is now available, please refresh to view."})),re==="CONTENT_STALE_ERROR"&&(y=(0,t.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,t.jsx)($,{buildLog:et}),classes:{root:U.root,message:U.message},children:["Building a newer version of this documentation failed."," ",Pe]})),re==="CONTENT_NOT_FOUND"&&(y=(0,t.jsxs)(t.Fragment,{children:[Pe&&(0,t.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,t.jsx)($,{buildLog:et}),classes:{root:U.root,message:U.message},children:["Building a newer version of this documentation failed."," ",Pe]}),(0,t.jsx)(P,{errorMessage:Ae})]})),y};var ke=r(60364),We=r(41156),z=r(32838),xt=r(35368),ot=r.n(xt);const Ye=/main\.[A-Fa-f0-9]{8}\.min\.css$/,st=/^https:\/\/fonts\.googleapis\.com/,Qe=/^https:\/\/fonts\.gstatic\.com/,Ct=y=>y.nodeName==="LINK",Tt=y=>{const U=(y==null?void 0:y.getAttribute("href"))||"",re=U.match(Ye),q=U.match(st),Ae=U.match(Qe);return re||q||Ae},bt=y=>(Ct(y)&&!Tt(y)&&y.remove(),y),it=y=>y.nodeName==="IFRAME",Pt=(y,U)=>{const re=y.getAttribute("src")||"";try{const{host:q}=new URL(re);return U.includes(q)}catch{return!1}},Nt=y=>U=>(it(U)&&!Pt(U,y)&&U.remove(),U),Ge=()=>{const y=(0,T.h_)(T.Ds);return(0,h.useMemo)(()=>y.getOptionalConfig("techdocs.sanitizer"),[y])},Qt=()=>{const y=Ge();return(0,h.useCallback)(async U=>{const re=y==null?void 0:y.getOptionalStringArray("allowedIframeHosts");ot().addHook("beforeSanitizeElements",bt);const q=["link"];return re&&(q.push("iframe"),ot().addHook("beforeSanitizeElements",Nt(re))),ot().sanitize(U.outerHTML,{ADD_TAGS:q,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[y])};var ge=r(41128),Se=({theme:y})=>`
38
- /*================== Variables ==================*/
39
- /*
40
- As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
41
- As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
42
- */
43
-
44
- :host {
45
- /* FONT */
46
- --md-default-fg-color: ${y.palette.text.primary};
47
- --md-default-fg-color--light: ${y.palette.text.secondary};
48
- --md-default-fg-color--lighter: ${(0,ge.$n)(y.palette.text.secondary,.7)};
49
- --md-default-fg-color--lightest: ${(0,ge.$n)(y.palette.text.secondary,.3)};
50
-
51
- /* BACKGROUND */
52
- --md-default-bg-color:${y.palette.background.default};
53
- --md-default-bg-color--light: ${y.palette.background.paper};
54
- --md-default-bg-color--lighter: ${(0,ge.$n)(y.palette.background.paper,.7)};
55
- --md-default-bg-color--lightest: ${(0,ge.$n)(y.palette.background.paper,.3)};
56
-
57
- /* PRIMARY */
58
- --md-primary-fg-color: ${y.palette.primary.main};
59
- --md-primary-fg-color--light: ${y.palette.primary.light};
60
- --md-primary-fg-color--dark: ${y.palette.primary.dark};
61
- --md-primary-bg-color: ${y.palette.primary.contrastText};
62
- --md-primary-bg-color--light: ${(0,ge.$n)(y.palette.primary.contrastText,.7)};
63
-
64
- /* ACCENT */
65
- --md-accent-fg-color: var(--md-primary-fg-color);
66
-
67
- /* SHADOW */
68
- --md-shadow-z1: ${y.shadows[1]};
69
- --md-shadow-z2: ${y.shadows[2]};
70
- --md-shadow-z3: ${y.shadows[3]};
71
-
72
- /* EXTENSIONS */
73
- --md-admonition-fg-color: var(--md-default-fg-color);
74
- --md-admonition-bg-color: var(--md-default-bg-color);
75
- /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
76
- --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
77
- --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
78
- --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
79
- --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
80
- --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
81
- --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
82
- --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
83
- --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
84
- --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
85
- --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
86
- --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
87
- --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
88
- --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
89
- --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
90
- --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
91
- --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
92
- --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
93
- --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
94
- --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
95
- --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
96
- --md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
97
- --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
98
- --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
99
- --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
100
- --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
101
- --md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
102
- }
103
-
104
- :host > * {
105
- /* CODE */
106
- --md-code-fg-color: ${y.palette.text.primary};
107
- --md-code-bg-color: ${y.palette.background.paper};
108
- --md-code-hl-color: ${(0,ge.Fq)(y.palette.warning.main,.5)};
109
- --md-code-hl-keyword-color: ${y.palette.type==="dark"?y.palette.primary.light:y.palette.primary.dark};
110
- --md-code-hl-function-color: ${y.palette.type==="dark"?y.palette.secondary.light:y.palette.secondary.dark};
111
- --md-code-hl-string-color: ${y.palette.type==="dark"?y.palette.success.light:y.palette.success.dark};
112
- --md-code-hl-number-color: ${y.palette.type==="dark"?y.palette.error.light:y.palette.error.dark};
113
- --md-code-hl-constant-color: var(--md-code-hl-function-color);
114
- --md-code-hl-special-color: var(--md-code-hl-function-color);
115
- --md-code-hl-name-color: var(--md-code-fg-color);
116
- --md-code-hl-comment-color: var(--md-default-fg-color--light);
117
- --md-code-hl-generic-color: var(--md-default-fg-color--light);
118
- --md-code-hl-variable-color: var(--md-default-fg-color--light);
119
- --md-code-hl-operator-color: var(--md-default-fg-color--light);
120
- --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
121
-
122
- /* TYPESET */
123
- --md-typeset-font-size: 1rem;
124
- --md-typeset-color: var(--md-default-fg-color);
125
- --md-typeset-a-color: ${y.palette.link};
126
- --md-typeset-table-color: ${y.palette.text.primary};
127
- --md-typeset-del-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.error.dark,.5):(0,ge.Fq)(y.palette.error.light,.5)};
128
- --md-typeset-ins-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.success.dark,.5):(0,ge.Fq)(y.palette.success.light,.5)};
129
- --md-typeset-mark-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.warning.dark,.5):(0,ge.Fq)(y.palette.warning.light,.5)};
130
- }
131
-
132
- @media screen and (max-width: 76.1875em) {
133
- :host > * {
134
- /* TYPESET */
135
- --md-typeset-font-size: .9rem;
136
- }
137
- }
138
-
139
- @media screen and (max-width: 600px) {
140
- :host > * {
141
- /* TYPESET */
142
- --md-typeset-font-size: .7rem;
143
- }
144
- }
145
- `,Ue=({theme:y})=>`
146
- /*================== Reset ==================*/
147
-
148
- body {
149
- --md-text-color: var(--md-default-fg-color);
150
- --md-text-link-color: var(--md-accent-fg-color);
151
- --md-text-font-family: ${y.typography.fontFamily};
152
- font-family: var(--md-text-font-family);
153
- background-color: unset;
154
- }
155
- `;const nt="224px";var yt=({theme:y,sidebar:U})=>`
156
- /*================== Layout ==================*/
157
-
158
- /* mkdocs material v9 compat */
159
- .md-nav__title {
160
- color: var(--md-default-fg-color);
161
- }
162
-
163
- .md-grid {
164
- max-width: 100%;
165
- margin: 0;
166
- }
167
-
168
- .md-nav {
169
- font-size: calc(var(--md-typeset-font-size) * 0.9);
170
- }
171
- .md-nav__link {
172
- display: flex;
173
- align-items: center;
174
- justify-content: space-between;
175
- }
176
- .md-nav__icon {
177
- height: 20px !important;
178
- width: 20px !important;
179
- margin-left:${y.spacing(1)}px;
180
- }
181
- .md-nav__icon svg {
182
- margin: 0;
183
- width: 20px !important;
184
- height: 20px !important;
185
- }
186
- .md-nav__icon:after {
187
- width: 20px !important;
188
- height: 20px !important;
189
- }
190
-
191
- .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
192
- text-decoration: underline;
193
- color: var(--md-typeset-a-color);
194
- }
195
-
196
- .md-main__inner {
197
- margin-top: 0;
198
- }
199
-
200
- .md-sidebar {
201
- bottom: 75px;
202
- position: fixed;
203
- width: 16rem;
204
- overflow-y: auto;
205
- overflow-x: hidden;
206
- scrollbar-color: rgb(193, 193, 193) #eee;
207
- scrollbar-width: thin;
208
- }
209
- .md-sidebar .md-sidebar__scrollwrap {
210
- width: calc(12.1rem);
211
- }
212
- .md-sidebar--secondary {
213
- right: ${y.spacing(3)}px;
214
- }
215
- .md-sidebar::-webkit-scrollbar {
216
- width: 5px;
217
- }
218
- .md-sidebar::-webkit-scrollbar-button {
219
- width: 5px;
220
- height: 5px;
221
- }
222
- .md-sidebar::-webkit-scrollbar-track {
223
- background: #eee;
224
- border: 1 px solid rgb(250, 250, 250);
225
- box-shadow: 0px 0px 3px #dfdfdf inset;
226
- border-radius: 3px;
227
- }
228
- .md-sidebar::-webkit-scrollbar-thumb {
229
- width: 5px;
230
- background: rgb(193, 193, 193);
231
- border: transparent;
232
- border-radius: 3px;
233
- }
234
- .md-sidebar::-webkit-scrollbar-thumb:hover {
235
- background: rgb(125, 125, 125);
236
- }
237
-
238
- .md-content {
239
- max-width: calc(100% - 16rem * 2);
240
- margin-left: 16rem;
241
- margin-bottom: 50px;
242
- }
243
-
244
- .md-footer {
245
- position: fixed;
246
- bottom: 0px;
247
- pointer-events: none;
248
- }
249
-
250
- .md-footer-nav__link, .md-footer__link {
251
- pointer-events: all;
252
- }
253
-
254
- .md-footer__title {
255
- background-color: unset;
256
- }
257
- .md-footer-nav__link {
258
- width: 16rem;
259
- }
260
-
261
- .md-dialog {
262
- background-color: unset;
263
- }
264
-
265
- @media screen and (min-width: 76.25em) {
266
- .md-sidebar {
267
- height: auto;
268
- }
269
- }
270
-
271
- @media screen and (max-width: 76.1875em) {
272
- .md-nav {
273
- transition: none !important;
274
- background-color: var(--md-default-bg-color)
275
- }
276
- .md-nav--primary .md-nav__title {
277
- cursor: auto;
278
- color: var(--md-default-fg-color);
279
- font-weight: 700;
280
- white-space: normal;
281
- line-height: 1rem;
282
- height: auto;
283
- display: flex;
284
- flex-flow: column;
285
- row-gap: 1.6rem;
286
- padding: 1.2rem .8rem .8rem;
287
- background-color: var(--md-default-bg-color);
288
- }
289
- .md-nav--primary .md-nav__title~.md-nav__list {
290
- box-shadow: none;
291
- }
292
- .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
293
- border-top: none;
294
- }
295
- .md-nav--primary .md-nav__title .md-nav__button {
296
- display: none;
297
- }
298
- .md-nav--primary .md-nav__title .md-nav__icon {
299
- color: var(--md-default-fg-color);
300
- position: static;
301
- height: auto;
302
- margin: 0 0 0 -0.2rem;
303
- }
304
- .md-nav--primary > .md-nav__title [for="none"] {
305
- padding-top: 0;
306
- }
307
- .md-nav--primary .md-nav__item {
308
- border-top: none;
309
- }
310
- .md-nav--primary :is(.md-nav__title,.md-nav__item) {
311
- font-size : var(--md-typeset-font-size);
312
- }
313
- .md-nav .md-source {
314
- display: none;
315
- }
316
-
317
- .md-sidebar {
318
- height: 100%;
319
- }
320
- .md-sidebar--primary {
321
- width: 12.1rem !important;
322
- z-index: 200;
323
- left: ${U.isPinned?`calc(-12.1rem + ${nt})`:"calc(-12.1rem + 72px)"} !important;
324
- }
325
- .md-sidebar--secondary:not([hidden]) {
326
- display: none;
327
- }
328
-
329
- .md-content {
330
- max-width: 100%;
331
- margin-left: 0;
332
- }
333
-
334
- .md-header__button {
335
- margin: 0.4rem 0;
336
- margin-left: 0.4rem;
337
- padding: 0;
338
- }
339
-
340
- .md-overlay {
341
- left: 0;
342
- }
343
-
344
- .md-footer {
345
- position: static;
346
- padding-left: 0;
347
- }
348
- .md-footer-nav__link {
349
- /* footer links begin to overlap at small sizes without setting width */
350
- width: 50%;
351
- }
352
- }
353
-
354
- @media screen and (max-width: 600px) {
355
- .md-sidebar--primary {
356
- left: -12.1rem !important;
357
- width: 12.1rem;
358
- }
359
- }
360
- `;const gt=["h1","h2","h3","h4","h5","h6"];var pt=({theme:y})=>`
361
- /*================== Typeset ==================*/
362
-
363
- .md-typeset {
364
- font-size: var(--md-typeset-font-size);
365
- }
366
-
367
- ${gt.reduce((U,re)=>{var q;const Ae=(q=y.typography.htmlFontSize)!==null&&q!==void 0?q:16,Pe=y.typography[re],{lineHeight:et,fontFamily:wt,fontWeight:dt,fontSize:Ve}=Pe,ut=St=>{let tt=1;return typeof St=="number"&&(tt=St/Ae*.6),typeof St=="string"&&(tt=St.replace("rem","")),`calc(${tt} * var(--md-typeset-font-size))`};return U.concat(`
368
- .md-typeset ${re} {
369
- color: var(--md-default-fg-color);
370
- line-height: ${et};
371
- font-family: ${wt};
372
- font-weight: ${dt};
373
- font-size: ${ut(Ve)};
374
- }
375
- `)},"")}
376
-
377
- .md-typeset .md-content__button {
378
- color: var(--md-default-fg-color);
379
- }
380
-
381
- .md-typeset hr {
382
- border-bottom: 0.05rem dotted ${y.palette.divider};
383
- }
384
-
385
- .md-typeset details {
386
- font-size: var(--md-typeset-font-size) !important;
387
- }
388
- .md-typeset details summary {
389
- padding-left: 2.5rem !important;
390
- }
391
- .md-typeset details summary:before,
392
- .md-typeset details summary:after {
393
- top: 50% !important;
394
- width: 20px !important;
395
- height: 20px !important;
396
- transform: rotate(0deg) translateY(-50%) !important;
397
- }
398
- .md-typeset details[open] > summary:after {
399
- transform: rotate(90deg) translateX(-50%) !important;
400
- }
401
-
402
- .md-typeset blockquote {
403
- color: var(--md-default-fg-color--light);
404
- border-left: 0.2rem solid var(--md-default-fg-color--light);
405
- }
406
-
407
- .md-typeset table:not([class]) {
408
- font-size: var(--md-typeset-font-size);
409
- border: 1px solid var(--md-default-fg-color);
410
- border-bottom: none;
411
- border-collapse: collapse;
412
- }
413
- .md-typeset table:not([class]) th {
414
- font-weight: bold;
415
- }
416
- .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
417
- border-bottom: 1px solid var(--md-default-fg-color);
418
- }
419
-
420
- .md-typeset pre > code::-webkit-scrollbar-thumb {
421
- background-color: hsla(0, 0%, 0%, 0.32);
422
- }
423
- .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
424
- background-color: hsla(0, 0%, 0%, 0.87);
425
- }
426
- `,Bt=()=>`
427
- /*================== Animations ==================*/
428
- /*
429
- Disable CSS animations on link colors as they lead to issues in dark mode.
430
- The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
431
- */
432
- .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
433
- transition: none;
434
- }
435
- `,Mt=({theme:y})=>`
436
- /*================== Extensions ==================*/
437
-
438
- /* HIGHLIGHT */
439
- .highlight .md-clipboard:after {
440
- content: unset;
441
- }
442
-
443
- .highlight .nx {
444
- color: ${y.palette.type==="dark"?"#ff53a3":"#ec407a"};
445
- }
446
-
447
- /* CODE HILITE */
448
- .codehilite .gd {
449
- background-color: ${y.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
450
- }
451
-
452
- .codehilite .gi {
453
- background-color: ${y.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
454
- }
455
-
456
- /* TABBED */
457
- .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
458
- .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
459
- .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
460
- .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
461
- .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
462
- .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
463
- .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
464
- .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
465
- .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
466
- .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
467
- .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
468
- .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
469
- .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
470
- .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
471
- .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
472
- .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
473
- .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
474
- .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
475
- .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
476
- .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
477
- color: var(--md-accent-fg-color);
478
- border-color: var(--md-accent-fg-color);
479
- }
480
-
481
- /* TASK-LIST */
482
- .task-list-control .task-list-indicator::before {
483
- background-color: ${y.palette.action.disabledBackground};
484
- }
485
- .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
486
- background-color: ${y.palette.success.main};
487
- }
488
-
489
- /* ADMONITION */
490
- .admonition {
491
- font-size: var(--md-typeset-font-size) !important;
492
- }
493
- .admonition .admonition-title {
494
- padding-left: 2.5rem !important;
495
- }
496
-
497
- .admonition .admonition-title:before {
498
- top: 50% !important;
499
- width: 20px !important;
500
- height: 20px !important;
501
- transform: translateY(-50%) !important;
502
- }
503
- `;const Kt=[Se,Ue,yt,pt,Bt,Mt],$t=()=>(0,g.Pf)(),Xt=()=>{const y=$t(),U=(0,ke.Z)();return(0,h.useMemo)(()=>{const re={theme:U,sidebar:y};return Kt.reduce((q,Ae)=>q+Ae(re),"")},[U,y])},qt=()=>{const y=Xt();return(0,h.useCallback)(U=>(U.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${y}</style>`),U),[y])},gn=(y,U,re)=>{const q=y==="src"&&U.endsWith(".svg"),Ae=!U.match(/^([a-z]*:)?\/\//i),Pe=U.startsWith(re);return q&&(Ae||Pe)},Mn=({techdocsStorageApi:y,entityId:U,path:re})=>async q=>{const Ae=await y.getApiOrigin(),Pe=async(et,wt)=>{for(const dt of et)if(dt.hasAttribute(wt)){const Ve=dt.getAttribute(wt);if(!Ve)return;const ut=await y.getBaseUrl(Ve,U,re);if(gn(wt,Ve,Ae))try{const tt=await(await fetch(ut,{credentials:"include"})).text();dt.setAttribute(wt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(tt)))}`)}catch{dt.setAttribute("alt",`Error: ${Ve}`)}else dt.setAttribute(wt,ut)}};return await Promise.all([Pe(q.querySelectorAll("img"),"src"),Pe(q.querySelectorAll("script"),"src"),Pe(q.querySelectorAll("source"),"src"),Pe(q.querySelectorAll("link"),"href"),Pe(q.querySelectorAll("a[download]"),"href")]),q};var Pn=r(79158),mn=r(67097),Ln=r(28316),kn=r(82717),_t=r.n(kn);const jn=y=>U=>{var re;const q=U.querySelector('[title="Edit this page"]');if(!q||!q.href)return U;const Ae=new URL(q.href),Pe=y.byUrl(Ae);if((Pe==null?void 0:Pe.type)!=="github"&&(Pe==null?void 0:Pe.type)!=="gitlab")return U;const et=((re=U.querySelector("article>h1"))===null||re===void 0?void 0:re.childNodes[0].textContent)||"",wt=encodeURIComponent(`Documentation Feedback: ${et}`),dt=encodeURIComponent(`Page source:
504
- ${q.href}
505
-
506
- Feedback:`),Ve=(Pe==null?void 0:Pe.type)==="github"?(0,Pn.BT)(Ae.href,"blob"):Ae.href,ut=_t()(Ve),St=`/${ut.organization}/${ut.name}`,tt=q.cloneNode();switch(Pe==null?void 0:Pe.type){case"gitlab":tt.href=`${Ae.origin}${St}/issues/new?issue[title]=${wt}&issue[description]=${dt}`;break;case"github":tt.href=`${Ae.origin}${St}/issues/new?title=${wt}&body=${dt}`;break;default:return U}return Ln.render(h.createElement(mn.Z),tt),tt.style.paddingLeft="5px",tt.title="Leave feedback for this page",tt.id="git-feedback-link",q==null||q.insertAdjacentElement("beforebegin",tt),U};var zn=r(44882);const ft=()=>y=>{const U=y.querySelector('.md-header label[for="__drawer"]'),re=y.querySelector("article");if(!U||!re)return y;const q=U.cloneNode();return Ln.render(h.createElement(zn.Z),q),q.id="toggle-sidebar",q.title="Toggle Sidebar",q.classList.add("md-content__button"),q.style.setProperty("padding","0 0 0 5px"),q.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),re==null||re.prepend(q),y},Kn=()=>y=>(((re,q)=>{Array.from(re).filter(Ae=>Ae.hasAttribute(q)).forEach(Ae=>{const Pe=Ae.getAttribute(q);if(Pe){Pe.match(/^https?:\/\//i)&&Ae.setAttribute("target","_blank");try{const et=Rt(window.location.href);Ae.setAttribute(q,new URL(Pe,et).toString())}catch{Ae.replaceWith(Ae.textContent||Pe)}}})})(Array.from(y.getElementsByTagName("a")),"href"),y);function Rt(y){const U=new URL(y);return!U.pathname.endsWith("/")&&!U.pathname.endsWith(".html")&&(U.pathname+="/"),U.toString()}const at=({baseUrl:y,onClick:U})=>re=>(Array.from(re.getElementsByTagName("a")).forEach(q=>{q.addEventListener("click",Ae=>{const et=q.getAttribute("href");et&&et.startsWith(y)&&!q.hasAttribute("download")&&(Ae.preventDefault(),U(Ae,et))})}),re);var xn=r(15459),Gt=r(80030),an=r(72379),En=r(41547),dn=r(95074);const Tn=(0,xn.Z)(y=>({tooltip:{fontSize:"inherit",color:y.palette.text.primary,margin:0,padding:y.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Gt.ZP),we=()=>(0,t.jsx)(an.Z,{children:(0,t.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),ae=({text:y})=>{const[U,re]=(0,h.useState)(!1),[,q]=(0,dn.Z)(),Ae=(0,h.useCallback)(()=>{q(y),re(!0)},[y,q]),Pe=(0,h.useCallback)(()=>{re(!1)},[re]);return(0,t.jsx)(Tn,{title:"Copied to clipboard",placement:"left",open:U,onClose:Pe,leaveDelay:1e3,children:(0,t.jsx)(I.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:Ae,children:(0,t.jsx)(we,{})})})},Be=y=>U=>{const re=U.querySelectorAll("pre > code");for(const Ae of re){var q;const Pe=Ae.textContent||"",et=document.createElement("div");Ae==null||(q=Ae.parentElement)===null||q===void 0||q.prepend(et),Ln.render((0,t.jsx)(En.Z,{theme:y,children:(0,t.jsx)(ae,{text:Pe})}),et)}return U},ze=()=>y=>{var U;return(U=y.querySelector(".md-header"))===null||U===void 0||U.remove(),y},_e=()=>y=>{var U,re;return(U=y.querySelector(".md-footer .md-copyright"))===null||U===void 0||U.remove(),(re=y.querySelector(".md-footer-copyright"))===null||re===void 0||re.remove(),y},ne=({onLoading:y,onLoaded:U})=>re=>(y(),re.addEventListener(W.Ox,function q(){U(),re.removeEventListener(W.Ox,q)}),re),Z=()=>y=>(y.addEventListener(W.Ox,function U(){if(window.location.hash){var re;const q=window.location.hash.slice(1);(re=y==null?void 0:y.querySelector(`[id="${q}"]`))===null||re===void 0||re.scrollIntoView()}y.removeEventListener(W.Ox,U)}),y),pe=()=>y=>(setTimeout(()=>{const U=y==null?void 0:y.querySelectorAll("li.md-nav__item--active");U.length!==0&&(U.forEach(q=>{const Ae=q==null?void 0:q.querySelector("input");Ae!=null&&Ae.checked||Ae==null||Ae.click()}),U[U.length-1].scrollIntoView())},200),y),Ze=async(y,U)=>{let re;if(typeof y=="string")re=new DOMParser().parseFromString(y,"text/html").documentElement;else if(y instanceof Element)re=y;else throw new Error("dom is not a recognized type");for(const q of U)re=await q(re);return re};var Xe=r(73557);function lt(y,U){const re=new URL(U),q=`${re.origin}${re.pathname.replace(/\/$/,"")}`,Ae=y.replace(q,"").replace(/^\/+/,""),Pe=new URL(`http://localhost/${Ae}`);return`${Pe.pathname}${Pe.search}${Pe.hash}`}function kt(){const y=(0,Xe.s0)(),re=(0,T.h_)(T.Ds).getOptionalString("app.baseUrl");return(0,h.useCallback)(Ae=>{let Pe=Ae;if(re)try{Pe=lt(Ae,re)}catch{}y(Pe)},[y,re])}const Ut="screen and (max-width: 76.1875em)",X=y=>{const U=kt(),re=(0,ke.Z)(),q=(0,We.Z)(Ut),Ae=Qt(),Pe=qt(),et=(0,T.z$)(),wt=(0,T.h_)(W.Dl),dt=(0,T.h_)(z.q3),{state:Ve,path:ut,content:St}=(0,L.DK)(),[tt,Ft]=(0,h.useState)(null),nn=(0,W.ux)(tt),Yt=(0,h.useCallback)(()=>{if(!tt)return;tt.querySelectorAll(".md-sidebar").forEach(Ot=>{if(q)Ot.style.top="0px";else{const Yn=document==null?void 0:document.querySelector(".techdocs-reader-page");var un;const ur=(un=Yn==null?void 0:Yn.getBoundingClientRect().top)!==null&&un!==void 0?un:0;var bn;let An=(bn=tt.getBoundingClientRect().top)!==null&&bn!==void 0?bn:0;const On=tt.querySelector(".md-container > .md-tabs");var Wn;const qn=(Wn=On==null?void 0:On.getBoundingClientRect().height)!==null&&Wn!==void 0?Wn:0;An<ur&&(An=ur),Ot.style.top=`${Math.max(An,0)+qn}px`}Ot.style.setProperty("opacity","1")})},[tt,q]);(0,h.useEffect)(()=>(window.addEventListener("resize",Yt),window.addEventListener("scroll",Yt,!0),()=>{window.removeEventListener("resize",Yt),window.removeEventListener("scroll",Yt,!0)}),[tt,Yt]);const Ht=(0,h.useCallback)(()=>{if(!tt)return;const Lt=tt.querySelector(".md-footer");Lt&&(Lt.style.width=`${tt.getBoundingClientRect().width}px`)},[tt]);(0,h.useEffect)(()=>(window.addEventListener("resize",Ht),()=>{window.removeEventListener("resize",Ht)}),[tt,Ht]),(0,h.useEffect)(()=>{nn||(Ht(),Yt())},[Ve,nn,Ht,Yt]);const Dt=(0,h.useCallback)((Lt,Ot)=>Ze(Lt,[Ae,Mn({techdocsStorageApi:wt,entityId:y,path:Ot}),Kn(),ft(),ze(),_e(),jn(dt),Pe]),[y,dt,wt,Ae,Pe]),en=(0,h.useCallback)(async Lt=>Ze(Lt,[Z(),pe(),Be(re),at({baseUrl:window.location.origin,onClick:(Ot,un)=>{var bn;const Wn=Ot.ctrlKey||Ot.metaKey,Yn=new URL(un),ur=((bn=Ot.target)===null||bn===void 0?void 0:bn.innerText)||un,An=un.replace(window.location.origin,"");if(et.captureEvent("click",ur,{attributes:{to:An}}),Yn.hash)if(Wn)window.open(un,"_blank");else{var On;U(un),(On=Lt==null?void 0:Lt.querySelector(`[id="${Yn.hash.slice(1)}"]`))===null||On===void 0||On.scrollIntoView()}else Wn?window.open(un,"_blank"):U(un)}}),ne({onLoading:()=>{},onLoaded:()=>{var Ot;(Ot=Lt.querySelector(".md-nav__title"))===null||Ot===void 0||Ot.removeAttribute("for")}}),ne({onLoading:()=>{Array.from(Lt.querySelectorAll(".md-sidebar")).forEach(un=>{un.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[re,U,et]);return(0,h.useEffect)(()=>{if(!St)return()=>{};let Lt=!0;return Dt(St,ut).then(async Ot=>{if(!(Ot!=null&&Ot.innerHTML)||!Lt)return;window.scroll({top:0});const un=await en(Ot);Ft(un)}),()=>{Lt=!1}},[St,ut,Dt,en]),tt};var Y=r(8560);const le=()=>{const y=(0,W.$L)(),{shadowRoot:U}=(0,W.x1)(),re=U==null?void 0:U.querySelector('[data-md-component="content"]'),q=U==null?void 0:U.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ae=q==null?void 0:q.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ae||(Ae=document.createElement("div"),Ae.setAttribute("data-techdocs-addons-location","primary sidebar"),q==null||q.prepend(Ae));const Pe=U==null?void 0:U.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let et=Pe==null?void 0:Pe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return et||(et=document.createElement("div"),et.setAttribute("data-techdocs-addons-location","secondary sidebar"),Pe==null||Pe.prepend(et)),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.Z,{container:Ae,children:y.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,t.jsx)(Y.Z,{container:re,children:y.renderComponentsByLocation(W.oZ.Content)}),(0,t.jsx)(Y.Z,{container:et,children:y.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},ce=(0,H.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),ye=(0,L.m1)(y=>{var U;const{withSearch:re=!0,onReady:q}=y,Ae=ce(),{entityMetadata:{value:Pe,loading:et},entityRef:wt,setShadowRoot:dt}=(0,W.x1)(),Ve=X(wt),ut=(0,h.useCallback)(St=>{dt(St),q instanceof Function&&q()},[dt,q]);return et===!1&&!Pe?(0,t.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ve?(0,t.jsx)(g.VY,{children:(0,t.jsxs)(f.Z,{container:!0,children:[(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(oe,{})}),re&&(0,t.jsx)(f.Z,{className:Ae.search,xs:"auto",item:!0,children:(0,t.jsx)(u.S,{entityId:wt,entityTitle:Pe==null||(U=Pe.metadata)===null||U===void 0?void 0:U.title})}),(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(W.VA,{element:Ve,onAppend:ut,children:(0,t.jsx)(le,{})})})]})}):(0,t.jsx)(g.VY,{children:(0,t.jsx)(f.Z,{container:!0,children:(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(oe,{})})})})}),Ce=null},93225:function(jt,De,r){"use strict";r.d(De,{S:function(){return _}});var t=r(52322),h=r(2784),H=r(18671),f=r(60905),W=r(98069),g=r(60364),u=r(73250),B=r(61886),me=r(43514),ue=r(25271),V=r(53974),K=r(60871),I=r(76635),w=r(95573);const se=(0,t.jsx)(W.Z,{animation:"wave",variant:"text",height:40}),_=te=>{const{palette:{common:{white:$}}}=(0,g.Z)(),{children:T}=te,P=(0,B.$L)(),L=(0,K.h_)(K.Ds),{title:k,setTitle:oe,subtitle:ke,setSubtitle:We,entityRef:z,metadata:{value:xt,loading:ot},entityMetadata:{value:Ye,loading:st}}=(0,B.x1)();(0,h.useEffect)(()=>{xt&&(oe(xt.site_name),We(()=>{let{site_description:Se}=xt;return(!Se||Se==="None")&&(Se=""),Se}))},[xt,oe,We]);const Qe=L.getOptional("app.title")||"Backstage",Ct=[k,ke,Qe].filter(Boolean).join(" | "),{locationMetadata:Tt,spec:bt}=Ye||{},it=bt==null?void 0:bt.lifecycle,Pt=Ye?(0,me.hF)(Ye,ue.S4):[],Nt=(0,K.tg)(w._Z)(),Ge=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V.i9,{label:(0,I.capitalize)((Ye==null?void 0:Ye.kind)||"entity"),value:(0,t.jsx)(me.dx,{color:"inherit",entityRef:z,title:Ye==null?void 0:Ye.metadata.title,defaultKind:"Component"})}),Pt.length>0&&(0,t.jsx)(V.i9,{label:"Owner",value:(0,t.jsx)(me.rI,{color:"inherit",entityRefs:Pt,defaultKind:"group"})}),it?(0,t.jsx)(V.i9,{label:"Lifecycle",value:it}):null,Tt&&Tt.type!=="dir"&&Tt.type!=="file"?(0,t.jsx)(V.i9,{label:"",value:(0,t.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:$},children:[(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,t.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Tt.target}):null]});return!st&&Ye===void 0||!ot&&xt===void 0?null:(0,t.jsxs)(V.h4,{type:"Documentation",typeLink:Nt,title:k||se,subtitle:ke===""?void 0:ke||se,children:[(0,t.jsx)(H.Z,{titleTemplate:"%s",children:(0,t.jsx)("title",{children:Ct})}),Ge,T,P.renderComponentsByLocation(B.oZ.Header)]})}},65124:function(jt,De,r){"use strict";r.d(De,{b:function(){return K}});var t=r(52322),h=r(2784),H=r(79692),f=r(15223),W=r(95544),g=r(80030),u=r(61837),B=r(48348),me=r(47603),ue=r(61886);const V=(0,H.Z)(I=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:I.spacing(3,3,0)}})),K=I=>{const w=V(),[se,_]=(0,h.useState)(null),te=(0,h.useCallback)(ke=>{_(ke.currentTarget)},[]),$=(0,h.useCallback)(()=>{_(null)},[]),{entityMetadata:{value:T,loading:P}}=(0,ue.x1)(),L=(0,ue.$L)(),k=L.renderComponentsByLocation(ue.oZ.Subheader),oe=L.renderComponentsByLocation(ue.oZ.Settings);return!k&&!oe||P===!1&&!T?null:(0,t.jsx)(f.Z,{classes:w,...I.toolbarProps,children:(0,t.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[k,oe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.ZP,{title:"Settings",children:(0,t.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:te,children:(0,t.jsx)(me.Z,{})})}),(0,t.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:se,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(se),onClose:$,keepMounted:!0,children:(0,t.jsx)("div",{children:oe})})]}):null]})})}},95481:function(jt,De,r){"use strict";r.d(De,{DK:function(){return K},m1:function(){return w}});var t=r(52322),h=r(2784),H=r(73557),f=r(61886),W=r(60871),g=r(64279),u=r(77446);function B({contentLoading:se,content:_,activeSyncState:te}){return se||te==="BUILD_READY_RELOAD"||!_&&te==="CHECKING"?"CHECKING":!_&&te==="BUILDING"?"INITIAL_BUILD":_?te==="BUILDING"?"CONTENT_STALE_REFRESHING":te==="BUILD_READY"?"CONTENT_STALE_READY":te==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function me(se,_){const te={...se};switch(_.type){case"sync":_.state==="CHECKING"&&(te.buildLog=[]),te.activeSyncState=_.state,te.syncError=_.syncError;break;case"contentLoading":te.contentLoading=!0,te.contentError=void 0;break;case"content":typeof _.path=="string"&&(te.path=_.path),te.contentLoading=!1,te.content=_.content,te.contentError=_.contentError;break;case"buildLog":te.buildLog=te.buildLog.concat(_.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(te.activeSyncState)&&["contentLoading","content"].includes(_.type)&&(te.activeSyncState="UP_TO_DATE",te.buildLog=[]),te}function ue(se,_,te,$){var T,P;const[L,k]=(0,h.useReducer)(me,{activeSyncState:"CHECKING",path:$,contentLoading:!0,buildLog:[]}),oe=(0,W.h_)(f.Dl),{retry:ke}=(0,u.Z)(async()=>{k({type:"contentLoading"});try{const xt=await oe.getEntityDocs({kind:se,namespace:_,name:te},$);return k({type:"content",content:xt,path:$}),xt}catch(xt){k({type:"content",contentError:xt,path:$})}},[oe,se,_,te,$]),We=(0,h.useRef)({content:void 0,reload:()=>{}});return We.current={content:L.content,reload:ke},(0,g.default)(async()=>{k({type:"sync",state:"CHECKING"});const xt=setTimeout(()=>{k({type:"sync",state:"BUILDING"})},1e3);try{switch(await oe.syncEntityDocs({kind:se,namespace:_,name:te},Ye=>{k({type:"buildLog",log:Ye})})){case"updated":We.current.content?k({type:"sync",state:"BUILD_READY"}):(We.current.reload(),k({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":k({type:"sync",state:"UP_TO_DATE"});break;default:k({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ot){k({type:"sync",state:"ERROR",syncError:ot})}finally{clearTimeout(xt)}},[se,te,_,oe,k,We]),{state:(0,h.useMemo)(()=>B({activeSyncState:L.activeSyncState,contentLoading:L.contentLoading,content:L.content}),[L.activeSyncState,L.content,L.contentLoading]),contentReload:ke,path:L.path,content:L.content,contentErrorMessage:(T=L.contentError)===null||T===void 0?void 0:T.toString(),syncErrorMessage:(P=L.syncError)===null||P===void 0?void 0:P.toString(),buildLog:L.buildLog}}const V=(0,h.createContext)({}),K=()=>(0,h.useContext)(V),I=se=>{const{children:_}=se,{"*":te=""}=(0,H.UO)(),{entityRef:$}=(0,f.x1)(),{kind:T,namespace:P,name:L}=$,k=ue(T,P,L,te);return(0,t.jsx)(V.Provider,{value:k,children:_ instanceof Function?_(k):_})},w=se=>_=>(0,t.jsx)(I,{children:(0,t.jsx)(se,{..._})})},95573:function(jt,De,r){"use strict";r.d(De,{Fw:function(){return H},_Z:function(){return h},pd:function(){return f}});var t=r(60871);const h=(0,t.NT)({id:"techdocs:index-page"}),H=(0,t.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,t.NT)({id:"techdocs:catalog-reader-view"})},55511:function(jt,De,r){"use strict";r.r(De),r.d(De,{TechDocsSearchResultListItem:function(){return ue}});var t=r(52322),h=r(2784),H=r(79692),f=r(49378),W=r(86136),g=r(90436),u=r(53974),B=r(15096);const me=(0,H.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=V=>{const{result:K,highlight:I,lineClamp:w=5,asListItem:se=!0,asLink:_=!0,title:te,icon:$}=V,T=me(),P=({children:oe})=>_?(0,t.jsx)(u.rU,{noTrack:!0,to:K.location,children:oe}):(0,t.jsx)(t.Fragment,{children:oe}),L=()=>{const oe=I!=null&&I.fields.title?(0,t.jsx)(B.FA,{text:I.fields.title,preTag:I.preTag,postTag:I.postTag}):K.title,ke=I!=null&&I.fields.entityTitle?(0,t.jsx)(B.FA,{text:I.fields.entityTitle,preTag:I.preTag,postTag:I.postTag}):K.entityTitle,We=I!=null&&I.fields.name?(0,t.jsx)(B.FA,{text:I.fields.name,preTag:I.preTag,postTag:I.postTag}):K.name;return K?(0,t.jsx)(f.Z,{className:T.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,t.jsx)(P,{children:te||(0,t.jsxs)(t.Fragment,{children:[oe," | ",ke!=null?ke:We," docs"]})}),secondary:(0,t.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:w,overflow:"hidden"},color:"textSecondary",variant:"body2",children:I!=null&&I.fields.text?(0,t.jsx)(B.FA,{text:I.fields.text,preTag:I.preTag,postTag:I.postTag}):K.text})}):null},k=({children:oe})=>se?(0,t.jsxs)(t.Fragment,{children:[$&&(0,t.jsx)(W.Z,{children:typeof $=="function"?$(K):$}),(0,t.jsx)("div",{className:T.flexContainer,children:oe})]}):(0,t.jsx)(t.Fragment,{children:oe});return(0,t.jsx)(k,{children:(0,t.jsx)(L,{})})}},22478:function(jt,De,r){"use strict";r.d(De,{S:function(){return V}});var t=r(52322),h=r(15096),H=r(79692),f=r(27556),W=r(2784),g=r(73557),u=r(55511);const B=(0,H.Z)(K=>({root:{width:"100%"},bar:{padding:K.spacing(1)}})),me=K=>K==null?void 0:K.document,ue=K=>{const{entityId:I,entityTitle:w,debounceTime:se=150}=K,[_,te]=(0,W.useState)(!1),$=(0,g.s0)(),{setFilters:T,result:{loading:P,value:L}}=(0,h.Rx)(),k=B(),[oe,ke]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Ye=!0;if(Ye&&L){const st=L.results.slice(0,10);ke(st)}return()=>{Ye=!1}},[P,L]);const{kind:We,name:z,namespace:xt}=I;(0,W.useEffect)(()=>{T(Ye=>({...Ye,kind:We,namespace:xt,name:z}))},[We,xt,z,T]);const ot=(Ye,st)=>{if(me(st)){const{location:Qe}=st.document;$(Qe)}};return(0,t.jsx)(f.Z,{className:k.bar,variant:"outlined",children:(0,t.jsx)(h.qO,{classes:{root:k.root},"data-testid":"techdocs-search-bar",size:"small",open:_,getOptionLabel:()=>"",filterOptions:Ye=>Ye,onClose:()=>{te(!1)},onFocus:()=>{te(!0)},onChange:ot,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:oe,renderOption:({document:Ye,highlight:st})=>(0,t.jsx)(u.TechDocsSearchResultListItem,{result:Ye,lineClamp:3,asListItem:!1,asLink:!1,title:Ye.title,highlight:st}),loading:P,inputDebounceTime:se,inputPlaceholder:`Search ${w||I.name} docs`,freeSolo:!1})})},V=K=>{const I={term:"",types:["techdocs"],pageCursor:"",filters:K.entityId};return(0,t.jsx)(h.Nd,{initialState:I,children:(0,t.jsx)(ue,{...K})})}},53260:function(){}},function(jt){var De=function(t){return jt(jt.s=t)};jt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return De(6290)});var r=jt.O()}]);})();
507
-
508
- //# sourceMappingURL=main.c470e19b.js.map