@techdocs/cli 1.2.2-next.2 → 1.2.3-next.0

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/embedded-app/.config-schema.json +34 -5
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/static/{1032.98bf1656.chunk.js → 1032.eb3b9695.chunk.js} +2 -2
  5. package/dist/embedded-app/static/{1032.98bf1656.chunk.js.map → 1032.eb3b9695.chunk.js.map} +1 -1
  6. package/dist/embedded-app/static/{1105.c44a4e31.chunk.js → 1105.40283456.chunk.js} +2 -2
  7. package/dist/embedded-app/static/{1105.c44a4e31.chunk.js.map → 1105.40283456.chunk.js.map} +1 -1
  8. package/dist/embedded-app/static/{184.9b13e518.chunk.js → 184.1cc84853.chunk.js} +2 -2
  9. package/dist/embedded-app/static/{184.9b13e518.chunk.js.map → 184.1cc84853.chunk.js.map} +1 -1
  10. package/dist/embedded-app/static/{2440.d2ba00eb.chunk.js → 2440.99fc794a.chunk.js} +2 -2
  11. package/dist/embedded-app/static/{2440.d2ba00eb.chunk.js.map → 2440.99fc794a.chunk.js.map} +1 -1
  12. package/dist/embedded-app/static/{5458.75ad4388.chunk.js → 5458.c2cfc48a.chunk.js} +2 -2
  13. package/dist/embedded-app/static/{5458.75ad4388.chunk.js.map → 5458.c2cfc48a.chunk.js.map} +1 -1
  14. package/dist/embedded-app/static/5837.ebb0f422.chunk.js +3 -0
  15. package/dist/embedded-app/static/5837.ebb0f422.chunk.js.map +1 -0
  16. package/dist/embedded-app/static/{732.dc28074b.chunk.js → 732.426f89e4.chunk.js} +2 -2
  17. package/dist/embedded-app/static/{732.dc28074b.chunk.js.map → 732.426f89e4.chunk.js.map} +1 -1
  18. package/dist/embedded-app/static/{7560.7f574fa6.chunk.js → 7560.b3ed3a97.chunk.js} +2 -2
  19. package/dist/embedded-app/static/{7560.7f574fa6.chunk.js.map → 7560.b3ed3a97.chunk.js.map} +1 -1
  20. package/dist/embedded-app/static/{7750.f1fbf797.chunk.js → 7750.0f3395fe.chunk.js} +2 -2
  21. package/dist/embedded-app/static/{7750.f1fbf797.chunk.js.map → 7750.0f3395fe.chunk.js.map} +1 -1
  22. package/dist/embedded-app/static/{8951.dbc0ba7e.chunk.js → 8951.b74cd97a.chunk.js} +1 -1
  23. package/dist/embedded-app/static/{8951.dbc0ba7e.chunk.js.map → 8951.b74cd97a.chunk.js.map} +1 -1
  24. package/dist/embedded-app/static/{9545.d96fa9ec.chunk.js → 9545.59bf7391.chunk.js} +2 -2
  25. package/dist/embedded-app/static/{9545.d96fa9ec.chunk.js.map → 9545.59bf7391.chunk.js.map} +1 -1
  26. package/dist/embedded-app/static/{9770.f5e0b19c.chunk.js → 9770.ae81d806.chunk.js} +2 -2
  27. package/dist/embedded-app/static/{9770.f5e0b19c.chunk.js.map → 9770.ae81d806.chunk.js.map} +1 -1
  28. package/dist/embedded-app/static/main.ee853139.js +492 -0
  29. package/dist/embedded-app/static/main.ee853139.js.map +1 -0
  30. package/dist/embedded-app/static/{module-octokit.67523b24.js → module-octokit.9fb0d235.js} +2 -2
  31. package/dist/embedded-app/static/{module-octokit.67523b24.js.map → module-octokit.9fb0d235.js.map} +1 -1
  32. package/dist/embedded-app/static/{runtime.8dc9310c.js → runtime.ee853139.js} +2 -2
  33. package/dist/embedded-app/static/{runtime.8dc9310c.js.map → runtime.ee853139.js.map} +1 -1
  34. package/dist/embedded-app/static/vendor.ee853139.js +236 -0
  35. package/dist/embedded-app/static/vendor.ee853139.js.map +1 -0
  36. package/dist/index.cjs.js +1 -1
  37. package/package.json +6 -6
  38. package/dist/embedded-app/static/5837.b13b9c05.chunk.js +0 -3
  39. package/dist/embedded-app/static/5837.b13b9c05.chunk.js.map +0 -1
  40. package/dist/embedded-app/static/main.8dc9310c.js +0 -492
  41. package/dist/embedded-app/static/main.8dc9310c.js.map +0 -1
  42. package/dist/embedded-app/static/vendor.8dc9310c.js +0 -236
  43. package/dist/embedded-app/static/vendor.8dc9310c.js.map +0 -1
@@ -0,0 +1,492 @@
1
+ (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(wt,Ue,t){"use strict";t.d(Ue,{n3:function(){return z},MS:function(){return x}});var h=t(25271),n=t(23054),g=t(96279),L=t.n(g);const z=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class x{async getEntityAncestors(k,ne){const{kind:q,namespace:ee,name:F}=(0,h.of)(k.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(ee)}/${encodeURIComponent(F)}/ancestry`,ne)}async getLocationById(k,ne){return await this.requestOptional("GET",`/locations/${encodeURIComponent(k)}`,ne)}async getEntities(k,ne){const{filter:q=[],fields:ee=[],offset:F,limit:Q,after:_}=k!=null?k:{},ve=[];for(const $ of[q].flat()){const E=[];for(const[T,X]of Object.entries($))for(const je of[X].flat())je===z?E.push(encodeURIComponent(T)):typeof je=="string"&&E.push(`${encodeURIComponent(T)}=${encodeURIComponent(je)}`);E.length&&ve.push(`filter=${E.join(",")}`)}ee.length&&ve.push(`fields=${ee.map(encodeURIComponent).join(",")}`),F!==void 0&&ve.push(`offset=${F}`),Q!==void 0&&ve.push(`limit=${Q}`),_!==void 0&&ve.push(`after=${encodeURIComponent(_)}`);const ue=ve.length?`?${ve.join("&")}`:"",A=await this.requestRequired("GET",`/entities${ue}`,ne),I=($,E)=>{var T,X;if(((T=$.metadata)===null||T===void 0?void 0:T.name)===void 0||$.kind===void 0||((X=E.metadata)===null||X===void 0?void 0:X.name)===void 0||E.kind===void 0)return 0;const je=(0,h.eE)($),Ke=(0,h.eE)(E);return je<Ke?-1:je>Ke?1:0};return{items:A.sort(I)}}async getEntityByRef(k,ne){const{kind:q,namespace:ee,name:F}=(0,h.of)(k);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(ee)}/${encodeURIComponent(F)}`,ne)}async getEntityByName(k,ne){const{kind:q,namespace:ee="default",name:F}=k;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(ee)}/${encodeURIComponent(F)}`,ne)}async refreshEntity(k,ne){const q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({entityRef:k})});if(q.status!==200)throw new Error(await q.text())}async getEntityFacets(k,ne){const{filter:q=[],facets:ee}=k,F=[];for(const _ of[q].flat()){const ve=[];for(const[ue,A]of Object.entries(_))for(const I of[A].flat())I===z?ve.push(encodeURIComponent(ue)):typeof I=="string"&&ve.push(`${encodeURIComponent(ue)}=${encodeURIComponent(I)}`);ve.length&&F.push(`filter=${ve.join(",")}`)}for(const _ of ee)F.push(`facet=${encodeURIComponent(_)}`);const Q=F.length?`?${F.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${Q}`,ne)}async addLocation(k,ne){const{type:q="url",target:ee,dryRun:F}=k,Q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${F?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(ne==null?void 0:ne.token)&&{Authorization:`Bearer ${ne==null?void 0:ne.token}`}},method:"POST",body:JSON.stringify({type:q,target:ee})});if(Q.status!==201)throw new Error(await Q.text());const{location:_,entities:ve,exists:ue}=await Q.json();if(!_)throw new Error(`Location wasn't added: ${ee}`);return{location:_,entities:ve,exists:ue}}async getLocationByRef(k,ne){return(await this.requestRequired("GET","/locations",ne)).map(ee=>ee.data).find(ee=>k===(0,h.NZ)(ee))}async removeLocationById(k,ne){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(k)}`,ne)}async removeEntityByUid(k,ne){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(k)}`,ne)}async validateEntity(k,ne,q){const ee=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(q==null?void 0:q.token)&&{Authorization:`Bearer ${q==null?void 0:q.token}`}},method:"POST",body:JSON.stringify({entity:k,location:ne})});if(ee.ok)return{valid:!0};if(ee.status!==400)throw await n.VL.fromResponse(ee);const{errors:F=[]}=await ee.json();return{valid:!1,errors:F}}async requestIgnored(k,ne,q){const ee=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},Q=await this.fetchApi.fetch(ee,{method:k,headers:F});if(!Q.ok)throw await n.VL.fromResponse(Q)}async requestRequired(k,ne,q){const ee=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},Q=await this.fetchApi.fetch(ee,{method:k,headers:F});if(!Q.ok)throw await n.VL.fromResponse(Q);return await Q.json()}async requestOptional(k,ne,q){const ee=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},Q=await this.fetchApi.fetch(ee,{method:k,headers:F});if(!Q.ok){if(Q.status===404)return;throw await n.VL.fromResponse(Q)}return await Q.json()}constructor(k){this.discoveryApi=k.discoveryApi,this.fetchApi=k.fetchApi||{fetch:L()}}}},25271:function(wt,Ue,t){"use strict";t.d(Ue,{Tf:function(){return g},P1:function(){return ge},q1:function(){return te},M6:function(){return Ae},l2:function(){return n},zG:function(){return h},w$:function(){return cn},nP:function(){return Rn},aS:function(){return Ln},S4:function(){return en},cz:function(){return bn},iB:function(){return at},CV:function(){return yt},of:function(){return rt},Ou:function(){return Ne},eE:function(){return ct},NZ:function(){return Xe}});const h="default",n="backstage.io/view-url",g="backstage.io/edit-url",L="kubernetes.io/api-server",z="kubernetes.io/api-server-certificate-authority",x="kubernetes.io/auth-provider";var l=t(76635),k=t.n(l);class ne{async enforce(P){return P.metadata.namespace?P:lodash.merge({metadata:{namespace:this.namespace}},P)}constructor(P=DEFAULT_NAMESPACE){this.namespace=P}}class q{static isValidPrefixAndOrSuffix(P,J,He,M){if(typeof P!="string")return!1;const Z=P.split(J);return Z.length===1?M(Z[0]):Z.length===2?He(Z[0])&&M(Z[1]):!1}static isJsonSafe(P){try{return k().isEqual(P,JSON.parse(JSON.stringify(P)))}catch{return!1}}static isValidDnsSubdomain(P){return typeof P=="string"&&P.length>=1&&P.length<=253&&P.split(".").every(q.isValidDnsLabel)}static isValidDnsLabel(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(P)}static isValidTag(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(P)}static isValidUrl(P){if(typeof P!="string")return!1;try{return new URL(P),!0}catch{return!1}}static isValidString(P){var J;return typeof P=="string"&&((J=P==null?void 0:P.trim())===null||J===void 0?void 0:J.length)>=1}static isNonEmptyString(P){var J;return typeof P=="string"&&((J=P==null?void 0:P.trim())===null||J===void 0?void 0:J.length)>=1}}var ee=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}}}}}'),F=t(27991),Q=t.n(F),_=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"}}}`),ve=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}}}}}}'),ue=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 A=new Map,I=[ee,_,ve,ue];function $(ie){if(!(ie!=null&&ie.length))throw new TypeError("Unknown error");const P=ie[0];throw new TypeError(`${P.instancePath||"<root>"} ${P.message}${P.params?` - ${Object.entries(P.params).map(([J,He])=>`${J}: ${He}`).join(", ")}`:""}`)}function E(ie,P={}){var J;const He=(J=P==null?void 0:P.disableCache)!==null&&J!==void 0?J:!1,M=He?"":JSON.stringify(ie);if(!He){const Se=A.get(M);if(Se)return Se}const Z=T(ie),ce=new(Q())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Z.length&&ce.addSchema(Z,void 0,void 0,!0);const pe=ce.compile(ie);return He||A.set(M,pe),pe}function T(ie){if(typeof ie!="object")return[];const P=new Set;ie.$id&&P.add(ie.$id);const J=new Array,He=[ie];for(;He.length;){const M=He.pop();for(const Z of X(M))if(!P.has(Z)){P.add(Z);const ce=I.find(pe=>pe.$id===Z);ce&&(J.push(ce),He.push(ce))}}return J}function*X(ie){const P=[ie];for(;P.length;){const J=P.pop();if(typeof J=="object"&&J)for(const[He,M]of Object.entries(J))He==="$ref"&&typeof M=="string"?yield M.split("#")[0]:P.push(M)}}function je(ie){const P=compileAjvSchema(ie||entityEnvelopeSchema);return J=>{if(P(J)===!0)return J;throw throwAjvError(P.errors)}}function Ke(ie){const P=E(ie);return J=>{var He;if(P(J)===!0)return J;const Z=(He=P.errors)===null||He===void 0?void 0:He.filter(ce=>["/kind","/apiVersion"].includes(ce.instancePath));if((Z==null?void 0:Z.length)&&Z.every(ce=>ce.keyword==="enum"))return!1;throw $(P.errors)}}function Me(ie){const P=compileAjvSchema(ie||entitySchema);return J=>{if(P(J)===!0)return J;throw throwAjvError(P.errors)}}class Ee{static isValidApiVersion(P){return q.isValidPrefixAndOrSuffix(P,"/",q.isValidDnsSubdomain,J=>J.length>=1&&J.length<=63&&/^[a-z0-9A-Z]+$/.test(J))}static isValidKind(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(P)}static isValidObjectName(P){return typeof P=="string"&&P.length>=1&&P.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(P)}static isValidNamespace(P){return q.isValidDnsLabel(P)}static isValidLabelKey(P){return q.isValidPrefixAndOrSuffix(P,"/",q.isValidDnsSubdomain,Ee.isValidObjectName)}static isValidLabelValue(P){return P===""||Ee.isValidObjectName(P)}static isValidAnnotationKey(P){return q.isValidPrefixAndOrSuffix(P,"/",q.isValidDnsSubdomain,Ee.isValidObjectName)}static isValidAnnotationValue(P){return typeof P=="string"}}const qe={isValidApiVersion:Ee.isValidApiVersion,isValidKind:Ee.isValidKind,isValidEntityName:Ee.isValidObjectName,isValidNamespace:Ee.isValidNamespace,isValidLabelKey:Ee.isValidLabelKey,isValidLabelValue:Ee.isValidLabelValue,isValidAnnotationKey:Ee.isValidAnnotationKey,isValidAnnotationValue:Ee.isValidAnnotationValue,isValidTag:ie=>typeof ie=="string"&&ie.length>=1&&ie.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ie)};function gt(ie={}){return{...qe,...ie}}class Ze{async enforce(P){function J(C,H,he){if(H==null)throw new Error(`${C} must have a value`);let se;try{se=he(H)}catch(xe){throw new Error(`${C} could not be validated, ${xe}`)}if(!se){let xe;switch(he.name){case"isValidLabelValue":case"isValidObjectName":xe="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":xe="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":xe="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":xe="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":xe="a string";break;case"isValidKind":xe="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":xe="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":xe="a non empty string";break;default:xe=void 0;break}const Oe=xe?` expected ${xe} but found "${H}".`:"";throw new Error(`"${C}" is not valid;${Oe} 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 He(C,H,he){return H===void 0||J(C,H,he)}J("apiVersion",P.apiVersion,this.validators.isValidApiVersion),J("kind",P.kind,this.validators.isValidKind),J("metadata.name",P.metadata.name,this.validators.isValidEntityName),He("metadata.namespace",P.metadata.namespace,this.validators.isValidNamespace);var M;for(const[C,H]of Object.entries((M=P.metadata.labels)!==null&&M!==void 0?M:[]))J(`labels.${C}`,C,this.validators.isValidLabelKey),J(`labels.${C}`,H,this.validators.isValidLabelValue);var Z;for(const[C,H]of Object.entries((Z=P.metadata.annotations)!==null&&Z!==void 0?Z:[]))J(`annotations.${C}`,C,this.validators.isValidAnnotationKey),J(`annotations.${C}`,H,this.validators.isValidAnnotationValue);var ce;const pe=(ce=P.metadata.tags)!==null&&ce!==void 0?ce:[];for(let C=0;C<pe.length;++C)J(`tags.${C}`,pe[C],this.validators.isValidTag);var Se;const De=(Se=P.metadata.links)!==null&&Se!==void 0?Se:[];for(let C=0;C<De.length;++C){var $e,Ge,tt;J(`links.${C}.url`,($e=De[C])===null||$e===void 0?void 0:$e.url,CommonValidatorFunctions.isValidUrl),He(`links.${C}.title`,(Ge=De[C])===null||Ge===void 0?void 0:Ge.title,CommonValidatorFunctions.isNonEmptyString),He(`links.${C}.icon`,(tt=De[C])===null||tt===void 0?void 0:tt.icon,KubernetesValidatorFunctions.isValidObjectName)}return P}constructor(P=makeValidator()){this.validators=P}}class Ie{async enforce(P){if(!this.validate){const M=new Ajv({allowUnionTypes:!0});this.validate=M.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(P)===!0)return P;const[He]=this.validate.errors||[];throw He?new Error(`Malformed envelope, ${He.instancePath||"<root>"} ${He.message}`):new Error("Malformed envelope, Unknown error")}}function nt(ie){let P=ie.indexOf(":");const J=ie.indexOf("/");J!==-1&&J<P&&(P=-1);const He=P===-1?void 0:ie.slice(0,P),M=J===-1?void 0:ie.slice(P+1,J),Z=ie.slice(Math.max(P+1,J+1));if(He===""||M===""||Z==="")throw new TypeError(`Entity reference "${ie}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:He,namespace:M,name:Z}}function at(ie){return{kind:ie.kind,namespace:ie.metadata.namespace||h,name:ie.metadata.name}}function rt(ie,P){if(!ie)throw new Error("Entity reference must not be empty");const J=P==null?void 0:P.defaultKind,He=(P==null?void 0:P.defaultNamespace)||h;let M,Z,ce;if(typeof ie=="string"){const Ge=nt(ie);var pe;M=(pe=Ge.kind)!==null&&pe!==void 0?pe:J;var Se;Z=(Se=Ge.namespace)!==null&&Se!==void 0?Se:He,ce=Ge.name}else{var De;M=(De=ie.kind)!==null&&De!==void 0?De:J;var $e;Z=($e=ie.namespace)!==null&&$e!==void 0?$e:He,ce=ie.name}if(M)if(Z){if(!ce){const Ge=JSON.stringify(ie);throw new Error(`Entity reference ${Ge} had missing or empty name`)}}else{const Ge=JSON.stringify(ie);throw new Error(`Entity reference ${Ge} had missing or empty namespace`)}else{const Ge=JSON.stringify(ie);throw new Error(`Entity reference ${Ge} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:M,namespace:Z,name:ce}}function ct(ie){let P,J,He;if("metadata"in ie){P=ie.kind;var M;J=(M=ie.metadata.namespace)!==null&&M!==void 0?M:h,He=ie.metadata.name}else{P=ie.kind;var Z;J=(Z=ie.namespace)!==null&&Z!==void 0?Z:h,He=ie.name}return`${P.toLocaleLowerCase("en-US")}:${J.toLocaleLowerCase("en-US")}/${He.toLocaleLowerCase("en-US")}`}class lt{async enforce(P){let J=P;for(const He of this.policies){const M=await He.enforce(J);if(!M)throw new Error(`Policy ${He.constructor.name} did not return a result`);J=M}return J}constructor(P){this.policies=P}}class mt{async enforce(P){for(const J of this.policies){const He=await J.enforce(P);if(He)return He}throw new Error("The entity did not match any known policy")}constructor(P){this.policies=P}}const dt={allOf(ie){return new lt(ie)},oneOf(ie){return new mt(ie)}};var We=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"],"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 le(ie){let P;return{async check(J){return P||(P=Ke(ie)),P(J)===J}}}const Re=le(We);var ke=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 st=le(ke);var vt=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 At=le(vt);var ht=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=le(ht);var kt=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 $t=le(kt),en="ownedBy",on="ownerOf",Vt="consumesApi",Wt="apiConsumedBy",un="providesApi",_t="apiProvidedBy",Rn="dependsOn",cn="dependencyOf",Pn="parentOf",hn="childOf",Jn="memberOf",Ht="hasMember",bn="partOf",Ln="hasPart";var Gt=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 pn=le(Gt);var dn=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 Sn=le(dn);var kn=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 vn=le(kn),ge="backstage.io/managed-by-location",te="backstage.io/managed-by-origin-location",Ae="backstage.io/source-location";function Ne(ie){if(typeof ie!="string")throw new TypeError(`Unable to parse location ref '${ie}', unexpected argument ${typeof ie}`);const P=ie.indexOf(":");if(P<0)throw new TypeError(`Unable to parse location ref '${ie}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const J=ie.substring(0,P).trim(),He=ie.substring(P+1).trim();if(!J||!He)throw new TypeError(`Unable to parse location ref '${ie}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(J==="http"||J==="https")throw new TypeError(`Invalid location ref '${ie}', please prefix it with 'url:', e.g. 'url:${ie}'`);return{type:J,target:He}}function Xe(ie){const{type:P,target:J}=ie;if(P){if(!J)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${P}:${J}`}function yt(ie){var P,J,He,M,Z;const ce=(Z=(P=ie.metadata)===null||P===void 0||(J=P.annotations)===null||J===void 0?void 0:J[Ae])!==null&&Z!==void 0?Z:(He=ie.metadata)===null||He===void 0||(M=He.annotations)===null||M===void 0?void 0:M[ge];if(!ce)throw new Error(`Entity '${ct(ie)}' is missing location`);return Ne(ce)}},93414:function(wt,Ue,t){"use strict";t.d(Ue,{zx:function(){return qe},Oi:function(){return dt},VY:function(){return wi},yW:function(){return Fa},XF:function(){return Re},mn:function(){return Ne},NX:function(){return h},ub:function(){return $e},mf:function(){return Wa},yu:function(){return rn},h4:function(){return $i},M6:function(){return Bt},i9:function(){return tl},aR:function(){return ji},rJ:function(){return Pr},Oh:function(){return al},hu:function(){return sl},rU:function(){return Me},nU:function(){return Tr},sk:function(){return C},Or:function(){return as},T3:function(){return Bi},g9:function(){return dl},Ex:function(){return cs},Gk:function(){return On},tn:function(){return Ei},Ph:function(){return Qe},YE:function(){return bi},v7:function(){return qi},R6:function(){return Si},tR:function(){return No},uw:function(){return ua},qt:function(){return vi},iA:function(){return Oi},GB:function(){return zn},po:function(){return fr},mZ:function(){return oo},Pf:function(){return Nr}});var h={};t.r(h),t.d(h,{Nm:function(){return ke},ht:function(){return At},LJ:function(){return vt}});var n=t(52322),g=t(2784),L=t(25248),z=t(19928);function x(e){const[s,i]=useState([]),u=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"}}=e;if(useEffect(()=>{const B=u.alert$().subscribe(W=>i(N=>N.concat(W)));return()=>{B.unsubscribe()}},[u]),s.length===0)return null;const[v]=s,j=()=>{i(B=>B.filter(W=>W!==v))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:j,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:v.severity,children:_jsxs("span",{children:[v.message.toString(),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),k=t(12420);const ne=(0,l.Z)(e=>(0,k.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function q(e){const{displayName:s,picture:i,customStyles:u}=e,p=ne();let v={...u};return i||(v={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:v,children:s&&extractInitials(s)})}var ee=t(77277),F=t(72779),Q=t.n(F),_=t(86689),ve=t(62833),ue=t(76635),A=t(10289);function I(){const[e]=(0,A.is)((0,n.jsx)(A.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}const $=(0,l.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"}),E=e=>/^([a-z+.-]+):/.test(e),T=()=>{try{return(0,L.h_)(L.Ds).getOptionalString("app.baseUrl")}catch{return}},X=()=>{const e="http://dummy.dev";var s;const i=(s=T())!==null&&s!==void 0?s:"/",{pathname:u}=new URL(i,e);return(0,ue.trimEnd)(u,"/")},je=e=>{let s=String(e);const i=X(),u=E(s),p=s.startsWith(i);return!u&&!p&&(s=i.concat(s)),s},Ke=e=>{if(e instanceof Array)return e.map(Ke).join(" ").trim();if(typeof e=="object"&&e){var s;return Ke(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Me=g.forwardRef(({onClick:e,noTrack:s,...i},u)=>{const p=$(),v=(0,L.z$)(),j=I()?je(i.to):i.to,B=Ke(i.children)||j,W=E(j),N=W&&!!/^https?:/.exec(j),ye=oe=>{e==null||e(oe),s||v.captureEvent("click",B,{attributes:{to:j}})};return W?(0,n.jsxs)(_.Z,{...N?{target:"_blank",rel:"noopener"}:{},...i,ref:u,href:j,onClick:ye,className:Q()(p.externalLink,i.className),children:[i.children,(0,n.jsx)("span",{className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(_.Z,{...i,ref:u,component:ve.rU,to:j,onClick:ye})}),Ee=g.forwardRef((e,s)=>(0,n.jsx)(Me,{ref:s,...e,color:"initial"})),qe=g.forwardRef((e,s)=>(0,n.jsx)(ee.Z,{ref:s,component:Ee,...e}));var gt=t(60364),Ze=t(61837),Ie=t(80030),nt=t(19353),at=t(95074);function rt(e){const{text:s,tooltipDelay:i=1e3,tooltipText:u="Text copied to clipboard","aria-label":p="Copy text"}=e,v=(0,L.h_)(L.VE),[j,B]=(0,g.useState)(!1),[{error:W},N]=(0,at.Z)();(0,g.useEffect)(()=>{W&&v.post(W)},[W,v]);const ye=oe=>{oe.stopPropagation(),B(!0),N(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ie.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:i,onClose:()=>B(!1),open:j,children:(0,n.jsx)(Ze.Z,{onClick:ye,"aria-label":p,children:(0,n.jsx)(nt.Z,{})})})})}var ct=t(83229),lt=t(26639),mt=t(39595);function dt(e){const{text:s,language:i,showLineNumbers:u=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,B=(0,gt.Z)(),W=B.palette.type==="dark"?lt.Z:mt.Z,N=B.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(ct.Z,{customStyle:v,language:i,style:W,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:B.palette.textVerySubtle},lineProps:ye=>p!=null&&p.includes(ye)?{style:{backgroundColor:N}}:{},children:s}),j&&(0,n.jsx)("div",{style:{position:"absolute",top:0,right:0},children:(0,n.jsx)(rt,{text:s})})]})}var We=t(41156),le=t(88188);function Re(e){const{title:s,to:i}=e,u=(0,We.Z)(p=>p.breakpoints.down("xs"));return i?u?(0,n.jsx)(Ze.Z,{component:ve.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(le.Z,{})}):(0,n.jsx)(ee.Z,{component:ve.rU,variant:"contained",color:"primary",to:i,children:s}):null}var ke;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(ke||(ke={}));var st;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(st||(st={}));var vt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(vt||(vt={}));var At;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(At||(At={}));var ht=t(84945),bt=t(11105),kt=t(97963),$t=t(46506),en=t.n($t),on=t(54073),Vt=t.n(on),Wt=t(10368);const un=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function _t({node:{id:e}}){const s=un(),[i,u]=g.useState(0),[p,v]=g.useState(0),j=g.useRef(null);g.useLayoutEffect(()=>{if(j.current){let{height:ye,width:oe}=j.current.getBBox();ye=Math.round(ye),oe=Math.round(oe),(ye!==p||oe!==i)&&(u(oe),v(ye))}},[i,p]);const B=10,W=i+B*2,N=p+B*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:W,height:N,rx:10}),(0,n.jsx)("text",{ref:j,className:s.text,y:N/2,x:W/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Rn="arrow-marker",cn="node",Pn="edge",hn="label",Jn=(0,Wt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Ht=e=>(0,n.jsx)(_t,{...e});function bn({render:e=Ht,setNode:s,node:i}){const{width:u,height:p,x:v=0,y:j=0}=i,B=i,W=Jn(),N=g.useRef(null);return g.useLayoutEffect(()=>{if(N.current){let{height:ye,width:oe}=N.current.getBBox();ye=Math.round(ye),oe=Math.round(oe),(ye!==p||oe!==u)&&s(i.id,{...i,height:ye,width:oe})}},[i,u,p,s]),(0,n.jsx)("g",{ref:N,"data-testid":cn,className:W.node,transform:`translate(${v-u/2},${j-p/2})`,children:e({node:B})})}var Ln=t(76985),Gt=t(27916),pn=t(19574),dn=t.n(pn);const Sn=(0,Wt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function kn({edge:{label:e}}){const s=Sn();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const vn=(0,Wt.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"}),ge=e=>(0,n.jsx)(kn,{...e});function te({render:e=ge,setEdge:s,id:i,edge:u,curve:p}){const{x:v=0,y:j=0,width:B,height:W,points:N}=u,ye=u,oe=vn(),fe=g.useRef(null);g.useLayoutEffect(()=>{if(fe.current){let{height:et,width:Pt}=fe.current.getBBox();et=Math.round(et),Pt=Math.round(Pt),(et!==W||Pt!==B)&&s(i,{...u,height:et,width:Pt})}},[u,W,B,s,i]);let Le="";const Ye=g.useMemo(()=>Ln.Z().x(et=>et.x).y(et=>et.y).curve(Gt[p]),[p]);if(N){const et=N.filter(Pt=>dn()(Pt.x)&&dn()(Pt.y));Le=Ye(et)||""}return(0,n.jsxs)(n.Fragment,{children:[Le&&(0,n.jsx)("path",{"data-testid":Pn,className:oe.path,d:Le}),ye.label?(0,n.jsx)("g",{ref:fe,"data-testid":hn,className:oe.label,transform:`translate(${v},${j})`,children:e({edge:ye})}):null]})}const Ae="workspace";function Ne(e){var s,i;const{edges:u,nodes:p,renderNode:v,direction:j=ke.TOP_BOTTOM,align:B,nodeMargin:W=50,edgeMargin:N=10,rankMargin:ye=50,paddingX:oe=0,paddingY:fe=0,acyclicer:Le,ranker:Ye=vt.NETWORK_SIMPLEX,labelPosition:et=At.RIGHT,labelOffset:Pt=10,edgeRanks:Mt=1,edgeWeight:Xt=1,renderLabel:qt,defs:Lt,zoom:Yt="enabled",curve:zt="curveMonotoneX",...Cr}=e,wr=(0,kt.Z)(),[ir,Fr]=g.useState(100),[Os,$s]=g.useState(100),Jt=g.useRef(new(en()).graphlib.Graph),[Ur,ai]=g.useState(((s=Jt.current.graph())===null||s===void 0?void 0:s.width)||0),[Mr,ho]=g.useState(((i=Jt.current.graph())===null||i===void 0?void 0:i.height)||0),[li,Tn]=g.useState([]),[gr,zr]=g.useState([]),ar=Math.max(Ur,ir),nn=Math.max(Mr,Os),Mn=g.useMemo(()=>Vt()(ln=>{if(!ln)return;const In=bt.Z(ln),sn=bt.Z(ln.getElementById(Ae));function cr(){In.call(ht.sP().scaleExtent([1,10]).on("zoom",jr=>{jr.transform.x=Math.min(0,Math.max(jr.transform.x,ar-ar*jr.transform.k)),jr.transform.y=Math.min(0,Math.max(jr.transform.y,nn-nn*jr.transform.k)),sn.attr("transform",jr.transform)}))}Yt==="enabled"?cr():Yt==="enable-on-click"&&In.on("click",()=>cr());const{width:dr,height:po}=ln.getBoundingClientRect();ir!==dr&&Fr(dr),Os!==po&&$s(po)},100),[Os,ir,ar,nn,Yt]),Vr=g.useCallback(()=>{const ln=Jt.current.nodes(),In=Jt.current.edges();ln.forEach(sn=>{p.some(dr=>dr.id===sn)||Jt.current.removeNode(sn)}),In.forEach(sn=>{u.some(dr=>dr.from===sn.v&&dr.to===sn.w)||Jt.current.removeEdge(sn.v,sn.w)}),p.forEach(sn=>{const cr=Jt.current.nodes().find(dr=>sn.id===dr);if(cr&&Jt.current.node(cr)){const{width:dr,height:po,x:jr,y:Il}=Jt.current.node(cr);Jt.current.setNode(cr,{...sn,width:dr,height:po,x:jr,y:Il})}else Jt.current.setNode(sn.id,{...sn,width:0,height:0})}),u.forEach(sn=>{Jt.current.setEdge(sn.from,sn.to,{...sn,label:sn.label,width:0,height:0,labelpos:et,labeloffset:Pt,weight:Xt,minlen:Mt})})},[u,p,et,Pt,Xt,Mt]),lr=g.useMemo(()=>Vt()(()=>{en().layout(Jt.current);const{height:ln,width:In}=Jt.current.graph(),sn=Math.max(0,ln||0),cr=Math.max(0,In||0);ai(cr),ho(sn),Tn(Jt.current.nodes()),zr(Jt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Jt.current.setGraph({rankdir:j,align:B,nodesep:W,edgesep:N,ranksep:ye,marginx:oe,marginy:fe,acyclicer:Le,ranker:Ye}),Vr(),lr(),lr.cancel),[Le,B,j,N,oe,fe,W,ye,Ye,Vr,lr]);function Bs(ln,In){return Jt.current.setNode(ln,In),lr(),Jt.current}function Tl(ln,In){return Jt.current.setEdge(ln,In),lr(),Jt.current}return(0,n.jsxs)("svg",{ref:Mn,...Cr,width:"100%",height:nn,viewBox:`0 0 ${ar} ${nn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:Rn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:wr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Lt]}),(0,n.jsx)("g",{id:Ae,children:(0,n.jsxs)("svg",{width:Ur,height:Mr,y:nn/2-Mr/2,x:ar/2-Ur/2,viewBox:`0 0 ${Ur} ${Mr}`,children:[gr.map(ln=>{const In=Jt.current.edge(ln);return In?(0,n.jsx)(te,{id:ln,setEdge:Tl,render:qt,edge:In,curve:zt},`${ln.v}-${ln.w}`):null}),li.map(ln=>{const In=Jt.current.node(ln);return In?(0,n.jsx)(bn,{setNode:Bs,render:v,node:In},ln):null})]})})]})}var Xe;const yt=(0,l.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:20},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Xe=e.palette.banner.warning)!==null&&Xe!==void 0?Xe:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),ie=e=>{const{variant:s,message:i,id:u,fixed:p=!1}=e,v=yt(),B=useApi(storageApiRef).forBucket("notifications");var W;const N=(W=B.snapshot("dismissedBanners").value)!==null&&W!==void 0?W:[],[ye,oe]=useState(new Set(N)),fe=useObservable(B.observe$("dismissedBanners"));useEffect(()=>{if(fe!=null&&fe.value){var Ye;const et=(Ye=fe==null?void 0:fe.value)!==null&&Ye!==void 0?Ye:[];oe(new Set(et))}},[fe==null?void 0:fe.value]);const Le=()=>{B.set("dismissedBanners",[...ye,u])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ye.has(u),classes:{root:classNames(v.root,!p&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[s]),message:v.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Le,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var P=t(60905),J=t(90436),He=t.p+"static/missingAnnotation.67f79e98..svg",M=t.p+"static/noInformation.4b426325..svg",Z=t.p+"static/createComponent.975d1e1e..svg",ce=t.p+"static/noBuild.1715fa71..svg";const pe=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Se=({missing:e})=>{const s=pe();switch(e){case"field":return(0,n.jsx)("img",{src:He,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:M,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:Z,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:ce,alt:"no Build",className:s.generalImg});default:return null}},De=(0,l.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 $e(e){const{title:s,description:i,missing:u,action:p}=e,v=De();return(0,n.jsxs)(P.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,n.jsx)(P.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(P.Z,{container:!0,direction:"column",children:[(0,n.jsx)(P.Z,{item:!0,xs:!0,children:(0,n.jsx)(J.Z,{variant:"h5",children:s})}),(0,n.jsx)(P.Z,{item:!0,xs:!0,children:(0,n.jsx)(J.Z,{variant:"body1",children:i})}),(0,n.jsx)(P.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,n.jsx)(P.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof u=="string"?(0,n.jsx)(Se,{missing:u}):u.customImage})]})}const Ge=`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`,tt=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function C(e){const{annotation:s,readMoreUrl:i}=e,u=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",p=tt(),v=(0,n.jsxs)(n.Fragment,{children:["The ",(0,n.jsx)("code",{children:s})," annotation is missing. You need to add the annotation to your component if you want to enable this tool."]});return(0,n.jsx)($e,{missing:"field",title:"Missing Annotation",description:v,action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(J.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:p.code,children:(0,n.jsx)(dt,{text:Ge.replace("ANNOTATION",s),language:"yaml",showLineNumbers:!0,highlightedNumbers:[6,7],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(ee.Z,{color:"primary",component:Me,to:u,children:"Read more"})]})})}var H=t(11776),he=t(38402),se=t(49378),xe=t(41128),Oe=t(27616),Fe=t(8284),it=t(70660),jt=t(91750),ft=t(38016);const _e=(e,s)=>(s.palette.type==="light"?xe._j:xe.$n)(s.palette[e].light,.6),ot=(e,s)=>(s.palette.type==="light"?xe.$n:xe._j)(s.palette[e].light,.9),St=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>_e(s,e)}})),Tt=({severity:e})=>{const s=St({severity:e});return(0,n.jsx)(jt.Z,{classes:s})},Rt=({severity:e})=>{const s=St({severity:e});return(0,n.jsx)(ft.Z,{classes:s})},Ut=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>ot(s,e),color:({severity:s})=>_e(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>_e(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>_e(s,e),backgroundColor:({severity:s})=>ot(s,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"}),Qn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function zn(e){const{severity:s="warning",title:i,message:u,children:p,defaultExpanded:v}=e,j=Ut({severity:s}),B=Qn(s)+(i?`: ${i}`:"");return(0,n.jsxs)(Oe.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,n.jsxs)(Fe.Z,{expandIcon:(0,n.jsx)(Rt,{severity:s}),className:j.summary,children:[(0,n.jsx)(Tt,{severity:s}),(0,n.jsx)(J.Z,{className:j.summaryText,variant:"subtitle1",children:B})]}),(u||p)&&(0,n.jsx)(it.Z,{children:(0,n.jsxs)(P.Z,{container:!0,children:[u&&(0,n.jsx)(P.Z,{item:!0,xs:12,children:(0,n.jsx)(J.Z,{className:j.message,variant:"body1",children:u})}),p&&(0,n.jsx)(P.Z,{item:!0,xs:12,className:j.details,children:p})]})})]})}const Nt=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Dt=({error:e,message:s,stack:i,children:u})=>{const p=Nt();return(0,n.jsxs)(H.Z,{dense:!0,children:[(0,n.jsxs)(he.Z,{alignItems:"flex-start",children:[(0,n.jsx)(se.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(rt,{text:e})]}),(0,n.jsxs)(he.Z,{alignItems:"flex-start",children:[(0,n.jsx)(se.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(rt,{text:s})]}),i&&(0,n.jsxs)(he.Z,{alignItems:"flex-start",children:[(0,n.jsx)(se.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(rt,{text:i})]}),u]})};function rn(e){const{title:s,error:i,defaultExpanded:u,children:p}=e;return(0,n.jsx)(zn,{severity:"error",title:s!=null?s:i.message,defaultExpanded:u,children:(0,n.jsx)(Dt,{error:i.name,message:i.message,stack:i.stack,children:p})})}var Cn=t(85256);const an=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function On(e){var s;const{title:i,error:u,defaultExpanded:p}=e,v=an();if(u.name!=="ResponseError")return(0,n.jsx)(rn,{title:i!=null?i:u.message,defaultExpanded:p,error:u});const{body:j,cause:B}=u,{request:W,response:N}=j,ye=`${N.statusCode}: ${B.name}`,oe=W&&`${W.method} ${W.url}`,fe=B.message.replace(/\\n/g,`
12
+ `),Le=(s=B.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
13
+ `),Ye=JSON.stringify(j,void 0,2);return(0,n.jsxs)(rn,{title:i!=null?i:u.message,defaultExpanded:p,error:{name:ye,message:fe,stack:Le},children:[oe&&(0,n.jsxs)(he.Z,{alignItems:"flex-start",children:[(0,n.jsx)(se.Z,{classes:{secondary:v.text},primary:"Request",secondary:W?`${oe}`:void 0}),(0,n.jsx)(rt,{text:oe})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Cn.Z,{component:"li",className:v.divider}),(0,n.jsx)(he.Z,{alignItems:"flex-start",children:(0,n.jsx)(se.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,n.jsx)(dt,{language:"json",text:Ye,showCopyCodeButton:!0})]})]})}var Vn=t(28316);function er(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function Wn(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Zn(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||er(e);return p||Wn(v),v.appendChild(s.current),function(){s.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var ur=null;const Xn="core.calloutSeen";function S(){const[e,s]=useState(()=>{const u=localStorage.getItem(Xn);return u?JSON.parse(u):{}}),i=useCallback((u,p)=>{const v=localStorage.getItem(Xn),B={...v?JSON.parse(v):{},[u]:p};s(B),localStorage.setItem(Xn,JSON.stringify(B))},[]);return{states:e,setState:i}}function d(e){const{states:s,setState:i}=S(),u=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:u}}function m(e){const{seen:s,markSeen:i}=d(e);return{show:s===!1,hide:i}}const w=(0,l.Z)({"@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 white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function Y(e){const{featureId:s,title:i,description:u,children:p}=e,{show:v,hide:j}=useShowCallout(s),B=usePortal("core.callout"),W=useRef(null),[N,ye]=useState(),oe=w(),fe=useCallback(()=>{if(W.current){const Le=W.current.getBoundingClientRect(),Ye=Math.max(Le.width,Le.height),et=800,Pt=Le.x-(Ye-Le.width)/2-et,Mt=Le.y-(Ye-Le.height)/2-et,Xt=Ye+2*et,qt=450,Lt=Le.x+Le.width/2-qt,Yt=Le.y-(Ye-Le.height)/2+Ye+20;ye({dotLeft:Pt,dotTop:Mt,dotSize:Xt,borderWidth:et,textTop:Yt,textLeft:Lt,textWidth:qt})}},[]);return useEffect(()=>(window.addEventListener("resize",fe),window.addEventListener("scroll",fe),()=>{window.removeEventListener("resize",fe),window.removeEventListener("scroll",fe)}),[fe]),useLayoutEffect(fe,[W.current,fe]),v?_jsxs(_Fragment,{children:[_jsx("div",{className:oe.featureWrapper,ref:W,children:p}),createPortal(_jsx("div",{className:oe.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx("div",{className:oe.dot,"data-testid":"dot",style:{left:N==null?void 0:N.dotLeft,top:N==null?void 0:N.dotTop,width:N==null?void 0:N.dotSize,height:N==null?void 0:N.dotSize,borderWidth:N==null?void 0:N.borderWidth},onClick:j,onKeyDown:j,role:"button",tabIndex:0,children:_jsx("div",{className:oe.pulseCircle})}),_jsxs("div",{className:oe.text,"data-testid":"text",style:{left:N==null?void 0:N.textLeft,top:N==null?void 0:N.textTop,width:N==null?void 0:N.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:i}),_jsx(Typography,{children:u})]})]})})}),B)]}):_jsx(_Fragment,{children:p})}var me=t(35292);const Ce=(0,l.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:{fontSize:"0.7rem",textTransform:"uppercase",fontWeight:600,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function Be({color:e="primary",disabled:s=!1,href:i="#",icon:u=(0,n.jsx)(me.Z,{}),label:p,onClick:v,title:j}){const B=Ce();return s?(0,n.jsxs)("div",{title:j,className:Q()(B.link,B.disabled),children:[u,(0,n.jsx)("span",{className:B.label,children:p})]}):(0,n.jsxs)(Me,{title:j,className:Q()(B.link,B[e]),to:i,onClick:v,children:[u,(0,n.jsx)("span",{className:B.label,children:p})]})}const pt=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Bt(e){const{links:s}=e,i=pt();return(0,n.jsx)("nav",{className:i.links,children:s.map((u,p)=>(0,n.jsx)(Be,{...u},p+1))})}const tn=e=>{const s=e==="dark"?"16%":"97%";return`
14
+ hsl(0, 0%, ${s}) 0%,
15
+ hsla(0, 0%, ${s}, 0.987) 8.1%,
16
+ hsla(0, 0%, ${s}, 0.951) 15.5%,
17
+ hsla(0, 0%, ${s}, 0.896) 22.5%,
18
+ hsla(0, 0%, ${s}, 0.825) 29%,
19
+ hsla(0, 0%, ${s}, 0.741) 35.3%,
20
+ hsla(0, 0%, ${s}, 0.648) 41.2%,
21
+ hsla(0, 0%, ${s}, 0.55) 47.1%,
22
+ hsla(0, 0%, ${s}, 0.45) 52.9%,
23
+ hsla(0, 0%, ${s}, 0.352) 58.8%,
24
+ hsla(0, 0%, ${s}, 0.259) 64.7%,
25
+ hsla(0, 0%, ${s}, 0.175) 71%,
26
+ hsla(0, 0%, ${s}, 0.104) 77.5%,
27
+ hsla(0, 0%, ${s}, 0.049) 84.5%,
28
+ hsla(0, 0%, ${s}, 0.013) 91.9%,
29
+ hsla(0, 0%, ${s}, 0) 100%
30
+ `},Dn=100,mr=10,rs=(0,l.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:Dn,height:`calc(100% + ${mr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-mr,background:`linear-gradient(90deg, ${tn(e.palette.type)})`},fadeRight:{right:-mr,background:`linear-gradient(270deg, ${tn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function tr(e){const[[s,i],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){u([0,0]);return}const v=()=>{const j=p.scrollLeft,B=p.scrollWidth-p.offsetWidth-p.scrollLeft;u([j,B])};return v(),p.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{p.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[s,i]}function wn(e,s,i){const[u,p]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const v=performance.now(),j=requestAnimationFrame(B=>{if(!e.current)return;const W=B-v,N=Math.abs(u)*W/s,oe=Math.max(i,N)*Math.sign(u);e.current.scrollBy({left:oe});const fe=u-oe;Math.sign(u)!==Math.sign(fe)?p(0):p(fe)});return()=>cancelAnimationFrame(j)},[e,u,s,i]),p}function Er(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:u=5,children:p,...v}=e,j=rs(e),B=React.useRef(),[W,N]=tr(B),ye=wn(B,i,u),oe=fe=>{!B.current||ye(fe?s:-s)};return _jsxs("div",{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:B,children:p}),_jsx("div",{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:W===0})}),_jsx("div",{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:N===0})}),W>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>oe(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>oe(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Ar=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function ss(e){const s=Ar(e),{shorthand:i,alpha:u}=e;return i?_jsx("span",{className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx("span",{className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const os=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function Tr(e){const{Progress:s}=(0,L.qD)().getComponents();return(0,n.jsx)(g.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(os,{...e})})}const kr=(0,l.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"}),Wr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(Wr,e):e,qn=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(Wr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},Hn={code:({inline:e,className:s,children:i,...u})=>{const p=String(i).replace(/\n+$/,""),v=/language-(\w+)/.exec(s||"");return!e&&v?(0,n.jsx)(dt,{language:v[1],text:p}):(0,n.jsx)("code",{className:s,...u,children:i})},h1:qn,h2:qn,h3:qn,h4:qn,h5:qn,h6:qn};function Or(e){const{content:s,dialect:i="gfm",linkTarget:u,transformLinkUri:p,transformImageUri:v,className:j}=e,B=kr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${B.markdown} ${j}`,children:s,components:Hn,linkTarget:u,transformLinkUri:p,transformImageUri:v})}var vr=t(23054);const Hr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Gr=({request:e,busy:s,setBusy:i})=>{const u=Hr(),[p,v]=useState(),j=async()=>{i(!0);try{await e.trigger()}catch(W){v(isError(W)?W.message:"An unspecified error occurred")}finally{i(!1)}},B=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(B,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var hr=null;const is=(0,l.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 Ir(e){const s=is(),[i,u]=useState(!1),p=useApi(oauthRequestApiRef),v=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),j=()=>{v.forEach(B=>B.reject())};return _jsxs(Dialog,{open:Boolean(v.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:s.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:v.map(B=>_jsx(LoginRequestListItem,{request:B,busy:i,setBusy:u},B.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:j,children:"Reject All"})})]})}var Rr=t(15277),Kr=t.n(Rr),Yr=t(29862);const Jr=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function as(e){const[s,i]=(0,g.useState)(!1),u=(0,Yr.t)(),p=Jr(),v=B=>{u()&&i(B)};var j;return(0,n.jsx)(Ie.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(Kr(),{text:e.text,line:e.line,onToggled:v,containerClassName:p.container})})}var ls=t(67358);function cs(e){const[s,i]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const u=setTimeout(()=>i(!0),250);return()=>clearTimeout(u)},[]),s?(0,n.jsx)(ls.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var Qr=t(94339),Xr=t(14503),qr=t(24579),_r=t(32552),fn=t(15459),It=t(95544),yr=t(27597);const ds=(0,l.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 us(e){const{link:s,title:i,onClick:u}=e,p=ds();return(0,n.jsxs)("div",{children:[(0,n.jsx)(Cn.Z,{}),(0,n.jsx)(Me,{to:s,onClick:u,underline:"none",children:(0,n.jsxs)(It.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(It.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(J.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(yr.Z,{className:p.arrow})]})})]})}const hs=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(qe,{to:s.href,variant:"contained",children:s.name})},es=class extends g.Component{componentDidCatch(s,i){console.error(`ErrorBoundary, error: ${s}, info: ${i}`),this.setState({error:s,errorInfo:i})}render(){const{slackChannel:s,children:i}=this.props,{error:u}=this.state;return u?(0,n.jsx)(rn,{title:"Something Went Wrong",error:u,children:(0,n.jsx)(hs,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},ps=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:700},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),fs=(0,fn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Xr.Z),ts={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 Pr(e){const{title:s,subheader:i,divider:u=!0,deepLink:p,slackChannel:v,errorBoundaryProps:j,variant:B,children:W,headerStyle:N,headerProps:ye,icon:oe,action:fe,actionsClassName:Le,actions:Ye,cardClassName:et,actionsTopRight:Pt,className:Mt,noPadding:Xt,titleTypographyProps:qt}=e,Lt=ps();let Yt={},zt={};B&&B.split(/[\s]+/g).forEach(Fr=>{Yt={...Yt,...ts.card[Fr]},zt={...zt,...ts.cardContent[Fr]}});const Cr=()=>(0,n.jsxs)("div",{className:Lt.headerSubheader,children:[i&&(0,n.jsx)("div",{className:Lt.subheader,children:i}),oe]}),wr=j||(v?{slackChannel:v}:{});return(0,n.jsx)(Qr.Z,{style:Yt,className:Mt,children:(0,n.jsxs)(es,{...wr,children:[s&&(0,n.jsx)(_r.Z,{classes:{root:Lt.header,title:Lt.headerTitle,subheader:Lt.headerSubheader,avatar:Lt.headerAvatar,action:Lt.headerAction,content:Lt.headerContent},title:s,subheader:Cr(),action:fe,style:{...N},titleTypographyProps:qt,...ye}),Pt&&(0,n.jsx)(fs,{children:Pt}),u&&(0,n.jsx)(Cn.Z,{}),(0,n.jsx)(qr.Z,{className:Q()(et,{[Lt.noPadding]:Xt}),style:zt,children:W}),Ye&&(0,n.jsx)(Xr.Z,{className:Le,children:Ye}),p&&(0,n.jsx)(us,{...p})]})})}var Zs=t(39307);const gs=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:45,fontWeight:"bold",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"}),ns={fractional:!0,inverse:!1,unit:"%",max:100},ms=({palette:e,value:s,inverse:i,max:u})=>{if(isNaN(s))return"#ddd";const p=u||ns.max,v=i?p-s:s;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function Ds(e){const[s,i]=useState(null),{getColor:u=ms}=e,p=gs(e),{palette:v}=useTheme(),{value:j,fractional:B,inverse:W,unit:N,max:ye,description:oe}={...ns,...e},fe=B?Math.round(j*ye):j,Le=ye!==100?Math.round(j):fe,[Ye,et]=useState(!1);return useEffect(()=>{const Pt=s,Mt=()=>et(!0),Xt=()=>et(!1);return Pt&&oe?(Pt.addEventListener("mouseenter",Mt),Pt.addEventListener("mouseleave",Xt),()=>{Pt.removeEventListener("mouseenter",Mt),Pt.removeEventListener("mouseleave",Xt)}):()=>{et(!1)}},[oe,s]),_jsxs("div",{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:fe,strokeWidth:12,trailWidth:12,strokeColor:u({palette:v,value:Le,inverse:W,max:ye}),className:p.circle}),oe&&Ye?_jsx("div",{className:p.description,children:oe}):_jsx("div",{className:p.overlay,children:isNaN(j)?"N/A":`${Le}${N}`})]})}const vs=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Ns(e){const s=vs(e),{title:i,subheader:u,progress:p,inverse:v,deepLink:j,description:B,icon:W,variant:N,getColor:ye}=e,oe={inverse:v,description:B,getColor:ye,value:p};return _jsx("div",{className:s.root,children:_jsx(InfoCard,{title:i,subheader:u,deepLink:j,variant:N,icon:W,children:_jsx(Gauge,{...oe})})})}function Fs(e){const{value:s,getColor:i=getProgressColor}=e,{palette:u}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const v=i({palette:u,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx("span",{children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var ys=t(21324),Us=t(7089),y=t(1292),b=t(42494),R=t(74603),D=t(56939),G=t(12231),K=t(73698),ae=t(72379);const de=(0,l.Z)(()=>(0,k.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var we=()=>{const e=de();return(0,n.jsx)(ae.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Pe=(0,l.Z)(()=>(0,k.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Je=()=>{const e=Pe();return(0,n.jsx)(ae.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const xt=(0,fn.Z)(e=>(0,k.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:4,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:16,padding:"10px 26px 10px 12px",transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:4}}}),{name:"BackstageSelectInputBase"})(R.Z),Et=(0,l.Z)(e=>(0,k.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:14,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 Qe(e){const{multiple:s,items:i,label:u,placeholder:p,selected:v,onChange:j,triggerReset:B,native:W=!1,disabled:N=!1,margin:ye}=e,oe=Et(),[fe,Le]=(0,g.useState)(v||(s?[]:"")),[Ye,et]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Le(s?[]:"")},[B,s]),(0,g.useEffect)(()=>{v!==void 0&&Le(v)},[v]);const Pt=Lt=>{Le(Lt.target.value),j(Lt.target.value)},Mt=Lt=>{if(N){Lt.preventDefault();return}et(Yt=>s&&!(Lt.target instanceof HTMLElement)?!0:!Yt)},Xt=()=>{et(!1)},qt=Lt=>()=>{const Yt=fe.filter(zt=>zt!==Lt);Le(Yt),j(Yt)};return(0,n.jsx)("div",{className:oe.root,children:(0,n.jsx)(y.Z,{onClickAway:Xt,children:(0,n.jsxs)(b.Z,{className:oe.formControl,children:[(0,n.jsx)(D.Z,{className:oe.formLabel,children:u}),(0,n.jsxs)(K.Z,{"aria-label":u,value:fe,native:W,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ye,onChange:Pt,onClick:Mt,open:Ye,input:(0,n.jsx)(xt,{}),label:u,tabIndex:0,renderValue:Lt=>{var Yt;return s&&fe.length!==0?(0,n.jsx)("div",{className:oe.chips,children:Lt.map(zt=>{var Cr,wr;return(0,n.jsx)(Us.Z,{label:(Cr=i.find(ir=>ir.value===zt))===null||Cr===void 0?void 0:Cr.label,clickable:!0,onDelete:qt(zt),className:oe.chip},(wr=i.find(ir=>ir.value===zt))===null||wr===void 0?void 0:wr.value)})}):(0,n.jsx)(J.Z,{children:fe.length===0?p||"":(Yt=i.find(zt=>zt.value===Lt))===null||Yt===void 0?void 0:Yt.label})},IconComponent:()=>Ye?(0,n.jsx)(Je,{}):(0,n.jsx)(we,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(G.Z,{value:[],children:p}),W?i&&i.map(Lt=>(0,n.jsx)("option",{value:Lt.value,children:Lt.label},Lt.value)):i&&i.map(Lt=>(0,n.jsxs)(G.Z,{value:Lt.value,children:[s&&(0,n.jsx)(ys.Z,{color:"primary",checked:fe.includes(Lt.value)||!1,className:oe.checkbox}),Lt.label]},Lt.value))]})]})})})}const Ot=()=>{},Kt=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:Ot,stepHistory:[],setStepHistory:Ot,onStepChange:Ot});function nr(e){const{children:s,elevated:i,onStepChange:u,activeStep:p=0}=e,[v,j]=useState(p),[B,W]=useState([0]);useEffect(()=>{j(p)},[p]);const N=[];let ye;return Children.forEach(s,oe=>{isValidElement(oe)&&(oe.props.end?ye=oe:N.push(oe))}),_jsxs(_Fragment,{children:[_jsx(Kt.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:B,setStepHistory:W,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:i?2:0,children:N})}),v>=Children.count(s)-1&&ye]})}const Nn=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),pr=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),gn=({text:e,handleClick:s,disabled:i,last:u,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(u?"Finish":"Next")}),jn=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:i,children:e||"Back"}),$n=({actions:e={},children:s})=>{const i=Nn(),{stepperLength:u,stepIndex:p,setStepIndex:v,stepHistory:j,setStepHistory:B,onStepChange:W}=useContext(VerticalStepperContext),N=(Le,Ye)=>{Ye&&Ye(),W&&W(p,Le),v(Le)},ye=()=>{const Le=e.nextStep?e.nextStep(p,u-1):p+1;N(Le,e.onNext),B([...j,Le])},oe=()=>{j.pop(),N(j[j.length-1],e.onBack),B([...j])},fe=()=>{N(0,e.onRestart),B([0])};return _jsxs("div",{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(jn,{text:e.backText,handleClick:oe,disabled:p===0,stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(gn,{text:e.nextText,handleClick:ye,disabled:!!u&&p>=u||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(pr,{text:e.restartText,handleClick:fe,stepIndex:p}),s]})},xr=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function $r(e){const{title:s,children:i,end:u,actions:p,...v}=e,j=xr();return u?_jsxs("div",{className:j.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const _n=(0,l.Z)(e=>({status:{fontWeight:500,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:8,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 mn(e){const s=_n(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function En(e){const s=_n(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Lr(e){const s=_n(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ci(e){const s=_n(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function zi(e){const s=_n(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Vi(e){const s=_n(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Br=t(74600),fo=t(15584);const go=e=>(0,k.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),di={root:{border:"0",verticalAlign:"top"}},ui=e=>(0,k.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),yn=e=>(0,k.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),xs=(0,fn.Z)(go,{name:"BackstageMetadataTableTitleCell"})(fo.Z),mo=(0,fn.Z)(di,{name:"BackstageMetadataTableCell"})(fo.Z),bs=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Ss=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(xs,{children:e}),_jsx(mo,{colSpan:e?1:2,...i,children:s})]}),Zr=(0,fn.Z)(ui,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),hi=(0,fn.Z)(yn,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),Cs=(0,k.Z)({root:{margin:"0 0",listStyleType:"none"}}),vo=e=>(0,k.Z)({root:{...Cs.root,paddingLeft:e.spacing(1)}}),Ms=(0,fn.Z)(Cs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Zr,{classes:e,children:s})),zs=(0,fn.Z)(vo,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Zr,{classes:e,children:s}));function yo(e,s){const i=e.map((u,p)=>_jsx(MetadataListItem,{children:rr(u)},p));return s?_jsx(zs,{children:i}):_jsx(Ms,{children:i})}function xo(e,s,i){const u=Object.keys(e).map(p=>{const v=rr(e[p],!0),j=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${j}: `,v]},p)});return s?_jsx(zs,{children:u}):_jsx(Ms,{children:u})}function rr(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?xo(e,s,i):Array.isArray(e)?yo(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const ws=({value:e,options:s})=>_jsx(Fragment,{children:rr(e,s)}),bo=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(ws,{value:s,options:i})});function So(e,s){return Object.keys(e).map(i=>_jsx(bo,{title:i,value:e[i],options:s},i))}function Co(e){const{metadata:s,dense:i=!0,options:u}=e,p=So(s,u||{});return _jsx(MetadataTable,{dense:i,children:p})}var wo=t(49429),jo=t(86136),Vs=t(79784),Eo=t(19126),Ao=t.n(Eo);function To(e){return qs.stringify(e,{strictNullHandling:!0})}function Ws(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Hs(e,s){return Ws(e)[s]}function Io(e,s,i){const u={...Ws(e),[s]:i};return To(u)}function Ro(e,s=250){const[i,u]=useSearchParams(),p=i.toString(),[v,j]=useState(Hs(p,e));return useEffect(()=>{const B=Hs(p,e);j(W=>isEqual(B,W)?W:B)},[p,j,e]),useDebouncedEffect(()=>{const B=Io(p,e,v);p!==B&&u(B,{replace:!0})},[u,v,p,e],s),[v,j]}const js={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 Gs(){const s=(0,L.I_)().get(L.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return js;var u;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((u=p.getOptionalConfigArray("links"))!==null&&u!==void 0?u:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var Po=t(80079);function Gn(e,s){const u=(0,L.qD)().getSystemIcon(e);return u?(0,n.jsx)(u,{...s}):(0,n.jsx)(Po.Z,{...s})}function pi(e){return Gn("brokenImage",e)}function Wi(e){return Gn("catalog",e)}function Hi(e){return Gn("chat",e)}function Es(e){return Gn("dashboard",e)}function Gi(e){return Gn("docs",e)}function Ki(e){return Gn("email",e)}function fi(e){return Gn("github",e)}function gi(e){return Gn("group",e)}function Dr(e){return Gn("help",e)}function Yi(e){return Gn("user",e)}function Ji(e){return Gn("warning",e)}const Ks=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Ys=({icon:e})=>{const s=(0,L.qD)();var i;const u=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:Dr;return(0,n.jsx)(u,{})};var As;const Lo=({link:e})=>(0,n.jsx)(Me,{to:e.url,children:(As=e.title)!==null&&As!==void 0?As:e.url}),mi=({item:e})=>{var s;return(0,n.jsxs)(he.Z,{children:[(0,n.jsx)(jo.Z,{children:(0,n.jsx)(Ys,{icon:e.icon})}),(0,n.jsx)(se.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,u,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(Lo,{link:u},u.url)],[])})]})};function vi(e){const{title:s,children:i}=e,{items:u}=Gs(),[p,v]=(0,g.useState)(!1),[j,B]=(0,g.useState)(null),W=Ks(),N=(0,We.Z)(fe=>fe.breakpoints.down("sm")),ye=fe=>{B(fe.currentTarget),v(!0)},oe=()=>{v(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(It.Z,{display:"flex",ml:1,children:N?(0,n.jsx)(Ze.Z,{color:"primary",size:"small",onClick:ye,"data-testid":"support-button",children:(0,n.jsx)(Dr,{})}):(0,n.jsx)(ee.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ye,startIcon:(0,n.jsx)(Dr,{}),children:"Support"})}),(0,n.jsxs)(Vs.ZP,{"data-testid":"support-button-popover",open:p,anchorEl:j,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:oe,children:[(0,n.jsxs)(H.Z,{className:W.popoverList,children:[s&&(0,n.jsx)(he.Z,{alignItems:"flex-start",children:(0,n.jsx)(J.Z,{variant:"subtitle1",children:s})}),g.Children.map(i,(fe,Le)=>(0,n.jsx)(he.Z,{alignItems:"flex-start",children:fe},`child-${Le}`)),u&&u.map((fe,Le)=>(0,n.jsx)(mi,{item:fe},`item-${Le}`))]}),(0,n.jsx)(wo.Z,{children:(0,n.jsx)(ee.Z,{color:"primary",onClick:oe,children:"Close"})})]})]})}var Js=t(18671);const xn=72,ko=24,Qs=18,fr={drawerWidthClosed:xn,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:xn,iconSize:xn-ko*2,iconPadding:ko,selectedIndicatorWidth:3,userBadgePadding:Qs,userBadgeDiameter:xn-Qs*2,mobileSidebarHeight:56},yi=e=>({...fr,...e,iconContainerWidth:fr.drawerWidthClosed,iconSize:fr.drawerWidthClosed-fr.iconPadding*2,userBadgeDiameter:fr.drawerWidthClosed-fr.userBadgePadding*2}),Oo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:fr.defaultOpenDelayMs+200},xi=e=>({...Oo,...e}),Qi="@backstage/core/sidebar-intro-dismissed",sr=(0,g.createContext)({sidebarConfig:fr,submenuConfig:Oo}),$o=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Ts;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Ts||(Ts={}));const Bo={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Ts.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Ts.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var Is=t(51837);const Rs={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Xs=(0,g.createContext)(Rs),_s=(0,Is.CT)("sidebar-pin-state-context");function Zo(e){const{children:s,value:i}=e;return(0,n.jsx)(Xs.Provider,{value:i,children:(0,n.jsx)(_s.Provider,{value:(0,Is.EI)({1:i}),children:s})})}const Nr=()=>{const e=(0,g.useContext)(_s),s=(0,g.useContext)(Xs);if(e===void 0)return s||Rs;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Do=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),eo=(0,g.createContext)({content:{contentRef:void 0}});function No(e){const[s,i]=(0,g.useState)(()=>Bo.getSidebarPinState()),{sidebarConfig:u}=(0,g.useContext)(sr),p=(0,g.useRef)(null),v=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{Bo.setSidebarPinState(s)},[s]);const j=(0,We.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),B=()=>i(!s),W=Do({isPinned:s,sidebarConfig:u});return(0,n.jsx)(Zo,{value:{isPinned:s,toggleSidebarPinState:B,isMobile:j},children:(0,n.jsx)(eo.Provider,{value:v,children:(0,n.jsx)("div",{className:W.root,children:e.children})})})}function to(){const{content:e}=(0,g.useContext)(eo);return{focusContent:(0,g.useCallback)(()=>{var i,u;e==null||(i=e.contentRef)===null||i===void 0||(u=i.current)===null||u===void 0||u.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const no={isOpen:!1,setOpen:()=>{}},Fo=(0,g.createContext)(no),ro=(0,Is.CT)("sidebar-open-state-context");function so(e){const{children:s,value:i}=e;return(0,n.jsx)(Fo.Provider,{value:i,children:(0,n.jsx)(ro.Provider,{value:(0,Is.EI)({1:i}),children:s})})}const oo=()=>{const e=(0,g.useContext)(ro),s=(0,g.useContext)(Fo);if(e===void 0)return s||no;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Uo=t(50023),Mo=t(4190),zo=t(87685),Vo=t(44882),Wo=t(57998);const Ho=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Go=e=>{const{to:s,label:i,icon:u,value:p}=e,{sidebarConfig:v}=(0,g.useContext)(sr),j=Ho({sidebarConfig:v}),B=(0,A.TH)(),{selectedMenuItemIndex:W,setSelectedMenuItemIndex:N}=(0,g.useContext)(Ps),ye=(fe,Le)=>{N(Le===W?-1:Le)},oe=p===W&&W>=0||p!==W&&!(W>=0)&&s===B.pathname;return(0,n.jsx)(Wo.Z,{label:i,icon:u,component:Me,to:s||B.pathname,onChange:ye,value:p,selected:oe,classes:j})},io=e=>{const{children:s,to:i,label:u,icon:p,value:v}=e,{isMobile:j}=Nr();return j?(0,n.jsx)(Go,{to:i,label:u,icon:p,value:v}):(0,n.jsx)(n.Fragment,{children:s})},Kn=(0,l.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:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.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:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),Ko=e=>(0,ue.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Yo=g.createElement(io).type,Jo=({children:e,label:s="Menu",open:i,onClose:u})=>{const{sidebarConfig:p}=(0,g.useContext)(sr),v=Kn({sidebarConfig:p});return(0,n.jsxs)(Mo.ZP,{anchor:"bottom",open:i,onClose:u,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,n.jsxs)(It.Z,{className:v.overlayHeader,children:[(0,n.jsx)(J.Z,{variant:"h3",children:s}),(0,n.jsx)(Ze.Z,{onClick:u,classes:{root:v.overlayHeaderClose},children:(0,n.jsx)(zo.Z,{})})]}),(0,n.jsx)(It.Z,{component:"nav",children:e})]})},Ps=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Qo=e=>{const{sidebarConfig:s}=(0,g.useContext)(sr),{children:i}=e,u=Kn({sidebarConfig:s}),p=(0,A.TH)(),[v,j]=(0,g.useState)(-1);(0,g.useEffect)(()=>{j(-1)},[p.pathname]);let B=(0,L.vJ)(i,N=>N.getElements().filter(ye=>ye.type===Yo));if(i)B.length?B=Ko(B):B.push((0,n.jsx)(io,{icon:(0,n.jsx)(Vo.Z,{}),children:i},"default_menu"));else return null;const W=v>=0&&!B[v].props.to;return(0,n.jsx)(so,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(Ps.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,n.jsx)(Jo,{label:B[v]&&B[v].props.label,open:W,onClose:()=>j(-1),children:B[v]&&B[v].props.children}),(0,n.jsx)(Uo.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:B})]})})},ao=(0,l.Z)(e=>({drawer:s=>({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",width:s.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),drawerOpen:s=>({width:s.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 Bn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Bn||(Bn={}));const Xo=e=>{const{sidebarConfig:s}=(0,g.useContext)(sr),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,j=ao({sidebarConfig:s}),B=(0,We.Z)(Mt=>Mt.breakpoints.down("md"),{noSsr:!0}),[W,N]=(0,g.useState)(Bn.Closed),ye=(0,g.useRef)(),{isPinned:oe,toggleSidebarPinState:fe}=Nr(),Le=()=>{oe||p||(ye.current&&(clearTimeout(ye.current),ye.current=void 0),W!==Bn.Open&&!B&&(ye.current=window.setTimeout(()=>{ye.current=void 0,N(Bn.Open)},i),N(Bn.Idle)))},Ye=()=>{oe||p||(ye.current&&(clearTimeout(ye.current),ye.current=void 0),W===Bn.Idle?N(Bn.Closed):W===Bn.Open&&(ye.current=window.setTimeout(()=>{ye.current=void 0,N(Bn.Closed)},u)))},et=W===Bn.Open&&!B||oe,Pt=Mt=>{Mt?(N(Bn.Open),fe()):(N(Bn.Closed),fe())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(qo,{}),(0,n.jsx)(so,{value:{isOpen:et,setOpen:Pt},children:(0,n.jsx)("div",{className:j.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Le,onFocus:p?()=>{}:Le,onMouseLeave:p?()=>{}:Ye,onBlur:p?()=>{}:Ye,children:(0,n.jsx)("div",{className:Q()(j.drawer,{[j.drawerOpen]:et}),children:v})})})]})},bi=e=>{var s;const i=yi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const p=xi((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:v,disableExpandOnHover:j,openDelayMs:B,closeDelayMs:W}=e,{isMobile:N}=Nr();return N?(0,n.jsx)(Qo,{children:v}):(0,n.jsx)(sr.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(Xo,{openDelayMs:B,closeDelayMs:W,disableExpandOnHover:j,children:v})})};function qo(){const{sidebarConfig:e}=(0,g.useContext)(sr),{focusContent:s,contentRef:i}=to(),u=ao({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(ee.Z,{onClick:s,variant:"contained",className:Q()(u.visuallyHidden),children:"Skip to content"}):null}function a(e,s){const i=new URLSearchParams(s.search).toString(),u=Ao().parse(i),p=new URLSearchParams(e.search).toString(),v=Ao().parse(p);return(0,ue.isEqual)(s.pathname,e.pathname)&&(0,ue.isMatch)(v,u)}const r=(0,l.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:20,cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:14,marginLeft:7,fontSize:14,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:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),o=e=>{const{title:s,subtitle:i,to:u,icon:p,dropdownItems:v}=e,j=r(),{setIsHoveredOn:B}=useContext(SidebarItemWithSubmenuContext),W=()=>{B(!1)},N=useResolvedPath(u!=null?u:""),ye=useLocation();let oe=isLocationMatch(ye,N);const[fe,Le]=useState(!1),Ye=()=>{Le(!fe)};return v!==void 0?(v.some(et=>{const Pt=resolvePath(et.to);return oe=isLocationMatch(ye,Pt),oe}),_jsxs("div",{className:j.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Ye,onTouchStart:et=>et.stopPropagation(),className:classnames(j.item,oe?j.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:i})]}),fe?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&fe&&_jsx("div",{className:j.dropdown,children:v.map((et,Pt)=>_jsx(Tooltip,{title:et.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:et.to,underline:"none",className:j.dropdownItem,onClick:W,onTouchStart:Mt=>Mt.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:et.title})})},Pt))})]})):_jsx("div",{className:j.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(j.item,oe?j.selected:void 0),onClick:W,onTouchStart:et=>et.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:i})]})]})})})};var c;const f=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var i;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(c=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&c!==void 0?c:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:24,fontWeight:500,color:"#FFF",padding:20,[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),O=e=>{const{isOpen:s}=oo(),{sidebarConfig:i,submenuConfig:u}=(0,g.useContext)(sr),p=s?i.drawerWidthOpen:i.drawerWidthClosed,v=f({left:p,submenuConfig:u}),{isHoveredOn:j}=(0,g.useContext)($o),[B,W]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{W(j)},[j]),(0,n.jsxs)("div",{className:Q()(v.drawer,{[v.drawerOpen]:B}),children:[(0,n.jsx)(J.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var U=t(76600),V=t(26739),re=t(98989),Ve=t(59797),ze=t(83543);const Ct=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ut=()=>{const e=Ct();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var Zt=null;const Ft=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Qt=()=>{const e=Ft();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var An=null,Yn,Fn;const or=e=>(0,l.Z)(s=>{var i,u;return{root:{color:s.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"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Yn=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&Yn!==void 0?Yn:"#404040"}},highlighted:{background:(Fn=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&Fn!==void 0?Fn:"#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:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:"bold",fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function br(e){return(0,g.useMemo)(()=>or(e),[e])()}const _o=(e,s)=>(0,L.vJ)(e.props.children,i=>{let u=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:v}})=>{if(!u){if(v!=null&&v.length){v.forEach(({to:j})=>u=u||a(s,(0,A.i3)(j)));return}p&&(u=a(s,(0,A.i3)(p)))}}),u},[s.pathname]);function lo(e){return e.to===void 0}const Ls=g.createElement(O).type,ei=g.forwardRef(function({to:s,end:i,style:u,className:p,activeStyle:v,caseSensitive:j,activeClassName:B="active","aria-current":W="page",...N},ye){let{pathname:oe}=(0,A.TH)(),{pathname:fe}=(0,A.WU)(s);j||(oe=oe.toLocaleLowerCase("en-US"),fe=fe.toLocaleLowerCase("en-US"));let Le=oe===fe;!Le&&!i&&(Le=oe.startsWith(`${fe}/`));const Ye=Le?W:void 0;return(0,n.jsx)(ve.rU,{...N,to:s,ref:ye,"aria-current":Ye,style:{...u,...Le?v:void 0},className:Q()([p,Le?B:void 0])})}),Sr=(0,g.forwardRef)((e,s)=>{const{icon:i,text:u,hasNotifications:p=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:B,children:W,className:N,...ye}=e,{sidebarConfig:oe}=(0,g.useContext)(sr),fe=br(oe),{isOpen:Le}=oo(),Ye=!Le&&v?{display:"flex",marginLeft:"24px"}:{},et=(0,n.jsxs)("div",{style:Ye,children:[(0,n.jsx)(i,{fontSize:"small"}),!Le&&v?(0,n.jsx)(re.Z,{}):(0,n.jsx)(n.Fragment,{})]}),Pt=(0,n.jsx)(V.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:Q()({[fe.closedItemIcon]:!Le}),children:et}),Mt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"login-button",className:fe.iconContainer,children:Pt}),u&&(0,n.jsx)(J.Z,{variant:"subtitle2",className:fe.label,children:u}),(0,n.jsx)("div",{className:fe.secondaryAction,children:W})]}),Xt=Le?Mt:Pt,qt={onClick:B,className:Q()(N,fe.root,Le?fe.open:fe.closed,lo(e)&&fe.buttonItem,{[fe.highlightable]:!j})};return lo(e)?(0,n.jsx)("button",{"aria-label":u,...qt,ref:s,children:Xt}):(0,n.jsx)(ei,{...qt,activeClassName:fe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ye,children:Xt})}),Xi=({children:e,...s})=>{const{sidebarConfig:i}=(0,g.useContext)(sr),u=br(i),[p,v]=(0,g.useState)(!1),j=(0,A.TH)(),B=_o(e,j),W=(0,We.Z)(fe=>fe.breakpoints.down("sm")),N=()=>{v(!0)},ye=()=>{v(!1)},oe=()=>W?p?(0,n.jsx)(Ve.Z,{fontSize:"small",className:u.submenuArrow}):(0,n.jsx)(ze.Z,{fontSize:"small",className:u.submenuArrow}):!p&&(0,n.jsx)(re.Z,{fontSize:"small",className:u.submenuArrow});return(0,n.jsx)($o.Provider,{value:{isHoveredOn:p,setIsHoveredOn:v},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ye,onTouchStart:p?ye:N,onMouseEnter:N,className:Q()(p&&u.highlighted),children:[(0,n.jsx)(Sr,{hasSubmenu:!0,className:B?u.selected:"",...s,children:oe()}),p&&e]})})},Si=(0,g.forwardRef)((e,s)=>{const[i]=(0,L.vJ)(e.children,u=>u.getElements().filter(p=>p.type===Ls));return i?(0,n.jsx)(Xi,{...e,children:i}):(0,n.jsx)(Sr,{...e,ref:s})});function Rl(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,u]=useState(""),p=br(s),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(i),u("")},B=oe=>{oe.key==="Enter"&&(oe.preventDefault(),j())},W=oe=>{u(oe.target.value)},N=oe=>{oe.preventDefault(),oe.stopPropagation()},ye=oe=>{j(),oe.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(Si,{icon:v,to:e.to,onClick:ye,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:N,onChange:W,onKeyDown:B,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Pl=(0,U.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ll=(0,U.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),qi=(0,U.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),_i=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),kl=(0,U.Z)("div")(({theme:e})=>{const s=_i(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Ol=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=br(e),{isOpen:i,setOpen:u}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{u(!i)};return _jsx("button",{onClick:v,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx("div",{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ea=(0,l.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:18,marginBottom:12,paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:4,"&: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:12}}),{name:"BackstageSidebarIntro"});function ta(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=ea({sidebarConfig:s}),{text:u,onClose:p}=e,v=()=>p();return _jsxs("div",{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx("div",{className:i.introDismiss,children:_jsxs(IconButton,{onClick:v,className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Ci=e=>{const{text:s,onDismiss:i}=e,[u,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!u,onExited:i,children:_jsx(ta,{text:s,onClose:v})})},na=null,ra="And your recently viewed plugins will pop up here!";function $l(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[u,p]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=u!=null?u:{},B=()=>{p(N=>({...i,...N,starredItemsDismissed:!0}))},W=()=>{p(N=>({...i,...N,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ci,{text:na,onDismiss:B}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ci,{text:ra,onDismiss:W})]}):null}const sa=(0,l.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 wi(e){const{className:s,stretch:i,noPadding:u,children:p,...v}=e,{contentRef:j}=to(),B=sa();return(0,n.jsx)("article",{ref:j,tabIndex:-1,...v,className:Q()(B.root,s,{[B.stretch]:i,[B.noPadding]:u}),children:p})}var oa=t(6487),ia=t(99152);const aa=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{padding:e.spacing(3,3),...e.typography.caption,textTransform:"uppercase",fontWeight:"bold",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 ji(e){const{tabs:s,onChange:i,selectedIndex:u}=e,[p,v]=(0,g.useState)(u!=null?u:0),j=aa(),B=(0,g.useCallback)((W,N)=>{u===void 0&&v(N),i&&u!==N&&i(N)},[u,i]);return(0,g.useEffect)(()=>{u!==void 0&&v(u)},[u]),(0,n.jsx)("div",{className:j.tabsWrapper,children:(0,n.jsx)(ia.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:B,value:p,children:s.map((W,N)=>(0,g.createElement)(oa.Z,{...W.tabProps,"data-testid":`header-tab-${N}`,label:W.label,key:W.id,value:N,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function la(e){const s=(0,A.UO)(),u=e.map(({path:fe,children:Le})=>({caseSensitive:!1,path:`${fe}/*`,element:Le})).sort((fe,Le)=>Le.path.replace(/\/\*$/,"").localeCompare(fe.path.replace(/\/\*$/,"")));var p;const v=(p=(0,A.V$)(u))!==null&&p!==void 0?p:e[0].children;var j;let B=(j=s["*"])!==null&&j!==void 0?j:"";B.startsWith("/")||(B=`/${B}`);var W;const[N]=(W=(0,A.fp)(u,B))!==null&&W!==void 0?W:[],ye=N?e.findIndex(fe=>`${fe.path}/*`===N.route.path):0;var oe;return{index:ye===-1?0:ye,element:v,route:(oe=e[ye])!==null&&oe!==void 0?oe:e[0]}}function Ei(e){const{routes:s}=e,i=(0,A.s0)(),{index:u,route:p,element:v}=la(s),j=(0,g.useMemo)(()=>s.map(W=>({id:W.path,label:W.title,tabProps:W.tabProps})),[s]),B=W=>{let{path:N}=s[W];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),i(N)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ji,{tabs:j,selectedIndex:u,onChange:B}),(0,n.jsxs)(wi,{children:[(0,n.jsx)(Js.q,{title:p.title}),v]})]})}const ti=()=>null;(0,L.R5)(ti,"core.gatherMountPoints",!0);function Ai(e){const s=(0,n.jsx)(ti,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(i=>{if(!(0,g.isValidElement)(i))return[];if(i.type===g.Fragment)return Ai(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:p,children:v,tabProps:j}=i.props;return[{path:u,title:p,children:v,tabProps:j}]})}function ca(e){const s=Ai(e.children);return(0,n.jsx)(Ei,{routes:s})}ca.Route=ti;const da=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ua(e){const{value:s,subvalue:i}=e,u=da();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:u.value,children:s}),(0,n.jsx)("div",{className:u.subvalue,children:i})]})}var ha=t(21070),pa=t(90324),fa=t(98281),ga=t(48049),Ti=t(51209),Ii=t(33375),ma=t(44233),va=t(27604),ni=t(36444),ya=t(37971),xa=t(59709),ba=t(17373),Sa=t(3702),Ca=t(93111),co=t(67222);const wa=(0,l.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:"60px",justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),ja=e=>{var s;const i=wa(),{onChangeFilters:u}=e,[p,v]=(0,g.useState)({...e.selectedFilters}),[j,B]=(0,g.useState)(!1),W=()=>{v({}),B(N=>!N)};return(0,g.useEffect)(()=>{u(p)},[p,u]),(0,n.jsxs)("div",{className:i.root,children:[(0,n.jsxs)("div",{className:i.header,children:[(0,n.jsx)("div",{className:i.value,children:"Filters"}),(0,n.jsx)(ee.Z,{color:"primary",onClick:W,children:"Clear all"})]}),(0,n.jsx)("div",{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(N=>(0,n.jsx)(Qe,{triggerReset:j,...N.element,selected:p[N.element.label],onChange:ye=>v({...p,[N.element.label]:ye})},N.element.label))})]})},Ri={Add:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ha.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,n.jsx)(fa.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ma.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ti.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,n.jsx)(va.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Sa.Z,{...e,ref:s})),Filter:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ni.Z,{...e,ref:s})),FirstPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ya.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(xa.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ti.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ga.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),Search:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ni.Z,{...e,ref:s})),SortArrow:(0,g.forwardRef)((e,s)=>(0,n.jsx)(pa.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ba.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ca.Z,{...e,ref:s}))};function Pi(e,s){const i=s.split(".");let u=e[i[0]];for(let p=1;p<i.length;++p){if(u===void 0)return u;const v=i[p];u=u[v]}return u}const Ea=(0,fn.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"})(co.W$),Li=(0,fn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(co.UW),Aa=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ta=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ia(e,s){return e.map(i=>{const u={};let p=i.cellStyle||{};if(i.highlight)if(u.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const v=p;p=(j,B,W)=>({...v(j,B,W),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:u,cellStyle:p}})}function Ra(e,s){return(0,ue.transform)(e,(i,u,p)=>{(0,ue.isEqual)(u,s[p])||(i[p]=u)})}const ki={search:"",filtersOpen:!1,filters:{}};function Pa(e){const{toolbarRef:s,setSearch:i,hasFilters:u,selectedFiltersLength:p,toggleFilters:v}=e,j=Aa(),B=(0,g.useCallback)(W=>{e.onSearchChanged(W),i(W)},[e,i]);return u?(0,n.jsxs)("div",{className:j.root,children:[(0,n.jsxs)("div",{className:j.root,children:[(0,n.jsx)(Ze.Z,{onClick:v,"aria-label":"filter list",children:(0,n.jsx)(ni.Z,{})}),(0,n.jsxs)(J.Z,{className:j.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Li,{...e,ref:s,onSearchChanged:B})]}):(0,n.jsx)(Li,{...e,ref:s,onSearchChanged:B})}function Oi(e){const{data:s,columns:i,options:u,title:p,subtitle:v,filters:j,initialState:B,emptyContent:W,onStateChange:N,components:ye,...oe}=e,fe=Ta(),Le=(0,gt.Z)(),Ye={...ki,...B},[et,Pt]=(0,g.useState)(Ye.filtersOpen),Mt=(0,g.useCallback)(()=>Pt(Tn=>!Tn),[Pt]),[Xt,qt]=(0,g.useState)(0),[Lt,Yt]=(0,g.useState)(s),[zt,Cr]=(0,g.useState)(Ye.filters),wr=Ia(i,Le),[ir,Fr]=(0,g.useState)(Ye.search);(0,g.useEffect)(()=>{if(N){const Tn=Ra({search:ir,filtersOpen:et,filters:zt},ki);N(Tn)}},[ir,et,zt,N]);const Os={headerStyle:{textTransform:"uppercase"}},$s=(0,g.useCallback)(Tn=>{var gr;return(gr=i.find(zr=>zr.title===Tn))===null||gr===void 0?void 0:gr.field},[i]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!zt){Yt(s);return}const Tn=Object.values(zt);if(s&&Tn.flat().length){const gr=s.filter(zr=>!!Object.entries(zt).filter(([,ar])=>!!ar.length).every(([ar,nn])=>{const Mn=Pi(zr,$s(ar));return Array.isArray(Mn)&&Array.isArray(nn)?Mn.some(Vr=>nn.includes(Vr)):Array.isArray(Mn)?Mn.includes(nn):Array.isArray(nn)?nn.includes(Mn):Mn===nn}));Yt(gr)}else Yt(s);qt(Tn.flat().length)},[s,zt,$s]);const Jt=(Tn,gr)=>{const zr=nn=>{const Mn=new Set,Vr=lr=>{lr!=null&&Mn.add(lr)};return gr&&gr.forEach(lr=>{const Bs=Pi(lr,$s(nn));Array.isArray(Bs)?Bs.forEach(Vr):Vr(Bs)}),Mn},ar=nn=>({placeholder:"All results",label:nn.column,multiple:nn.type==="multiple-select",items:[...zr(nn.column)].sort().map(Mn=>({label:Mn,value:Mn}))});return Tn.map(nn=>({type:nn.type,element:ar(nn)}))},Ur=!!(j!=null&&j.length),ai=(0,g.useCallback)(Tn=>(0,n.jsx)(Pa,{setSearch:Fr,hasFilters:Ur,selectedFiltersLength:Xt,toggleFilters:Mt,...Tn}),[Mt,Ur,Xt,Fr]),Mr=typeof s!="function"&&s.length===0,ho=i.length,li=(0,g.useCallback)(Tn=>W&&Mr?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:ho,children:W})})}):(0,n.jsx)(co.os,{...Tn}),[Mr,W,ho]);return(0,n.jsxs)("div",{className:fe.root,children:[et&&s&&typeof s!="function"&&(j==null?void 0:j.length)&&(0,n.jsx)(ja,{filters:Jt(j,s),selectedFilters:zt,onChangeFilters:Cr}),(0,n.jsx)(co.ZP,{components:{Header:Ea,Toolbar:ai,Body:li,...ye},options:{...Os,...u},columns:wr,icons:Ri,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(J.Z,{variant:"h5",component:"h2",children:p}),v&&(0,n.jsx)(J.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof s=="function"?s:Lt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...oe})]})}Oi.icons=Object.freeze(Ri);const Bl=e=>{const{children:s,value:i,index:u,...p}=e;return _jsx("div",{role:"tabpanel",hidden:i!==u,"aria-labelledby":`scrollable-auto-tab-${u}`,...p,children:i===u&&_jsx(Box,{p:3,children:s})})},La=(0,l.Z)(()=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:"1.5rem",textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:e=>e.isNext?"auto":"0",marginRight:e=>e.isNext?"0":"10px","&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Zl=e=>{const s=La(e),{ariaLabel:i,onClick:u}=e;return _jsx(IconButton,{onClick:u,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},ka=(e,s)=>s?e?"20px":"0":"40px",Oa=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>ka(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Dl=e=>{const s=Oa(e),{isFirstNav:i,isFirstIndex:u,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},$a=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Nl=e=>{const s=$a(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Ba=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function Fl(e){const{tabs:s}=e,i=Ba(),[u,p]=useState([0,0]),[v,j]=useState(0),[B,W]=useState(0),[N,ye]=useState([[]]),oe=useRef(),{width:fe}=useWindowSize(),Le=(Xt,qt)=>{p([v,qt])},Ye=()=>{j(v-1)},et=()=>{j(v+1)},Pt=()=>v+1<N.length;useEffect(()=>{const qt=v===0?1:2,Lt=oe.current.offsetWidth-20-qt*30,Yt=u[0]*B+u[1],zt=Math.floor(Lt/170);W(zt),ye(chunkArray(s,zt)),p([Math.floor(Yt/zt),Yt%zt])},[fe,s]);const Mt=v===u[0]?u[1]:!1;return _jsxs("div",{className:i.root,children:[_jsx(AppBar,{ref:oe,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:Mt,onChange:Le,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Ye,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),N[v].map((Xt,qt)=>_jsx(StyledTab,{value:qt,isFirstIndex:qt===0,isFirstNav:v===0,icon:Xt.icon||void 0,label:Xt.label||void 0},qt)),Pt()&&_jsx(StyledIcon,{isNext:!0,onClick:et,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Mt!==!1?N[v].map((Xt,qt)=>_jsx(TabPanel,{value:qt,index:Mt,children:Xt.content},qt)):_jsx(TabPanel,{value:u[1],index:u[1],children:N[u[0]][u[1]].content},"panel_outside_chunked_array")]})}var Ul=t(44311);function Za(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function Ml(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Za(e.data,s)})]})}const Da=e=>(0,l.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.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:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Na=({title:e="Unknown page",className:s})=>(0,n.jsx)(J.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Fa(e){const{description:s,title:i,titleComponent:u=void 0,children:p,textAlign:v="left"}=e,j=Da({textAlign:v})(),B=u||(0,n.jsx)(Na,{title:i,className:j.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Js.q,{title:i}),(0,n.jsxs)("div",{className:j.container,children:[(0,n.jsxs)("div",{className:j.leftItemsBox,children:[B,s&&(0,n.jsx)(J.Z,{className:j.description,variant:"body2",children:s})]}),(0,n.jsx)("div",{className:j.rightItemsBox,children:p})]})]})}var Ua=t.p+"static/mic-drop.fe3ef4d0..svg";const Ma=(0,l.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"}),za=()=>{const e=Ma();return(0,n.jsx)("img",{src:Ua,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Va=(0,l.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:32}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Wa(e){const{status:s,statusMessage:i,additionalInfo:u,supportUrl:p}=e,v=Va(),j=(0,A.s0)(),B=Gs();return(0,n.jsxs)(P.Z,{container:!0,spacing:0,className:v.container,children:[(0,n.jsxs)(P.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(J.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(J.Z,{variant:"body1",className:v.subtitle,children:u}),(0,n.jsx)(J.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(J.Z,{variant:"h6",children:[(0,n.jsx)(Me,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(Me,{to:p||B.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(za,{})]})}var Ha=t(16173);const Ga=(0,fn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(J.Z),ri=(0,fn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(It.Z);function Ka(e){const{children:s,...i}=e,[u,p]=g.useState(null),v=g.Children.toArray(s),[j,B,...W]=v,N=W.length?W.pop():v[v.length-1],ye=v.length>3,oe=Ye=>{p(Ye.currentTarget)},fe=()=>{p(null)},Le=Boolean(u);return(0,n.jsxs)(g.Fragment,{children:[(0,n.jsxs)(Ha.Z,{"aria-label":"breadcrumb",...i,children:[v.length>1&&(0,n.jsx)(ri,{clone:!0,children:j}),v.length>2&&(0,n.jsx)(ri,{clone:!0,children:B}),ye&&(0,n.jsx)(Ga,{onClick:oe,children:"..."}),(0,n.jsx)(It.Z,{style:{fontStyle:"italic"},children:N})]}),(0,n.jsx)(Vs.ZP,{open:Le,anchorEl:u,onClose:fe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(H.Z,{children:W.map((Ye,et)=>(0,n.jsx)(he.Z,{button:!0,children:(0,n.jsx)(ri,{clone:!0,children:Ye})},et))})})]})}const Ya=(0,l.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"}),Ja=({type:e,typeLink:s,classes:i,pageTitle:u})=>e?s?(0,n.jsxs)(Ka,{className:i.breadcrumb,children:[(0,n.jsx)(Me,{to:s,children:e}),(0,n.jsx)(J.Z,{children:u})]}):(0,n.jsx)(J.Z,{className:i.type,children:e}):null,Qa=({pageTitle:e,classes:s,tooltip:i})=>{const u=(0,n.jsx)(J.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(Ie.ZP,{title:i,placement:"top-start",children:u}):u},Xa=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(J.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function $i(e){const{children:s,pageTitleOverride:i,style:u,subtitle:p,title:v,tooltip:j,type:B,typeLink:W}=e,N=Ya(),oe=(0,L.h_)(L.Ds).getOptionalString("app.title")||"Backstage",fe=i||v,Le=v||i,Ye=`${fe} | %s | ${oe}`,et=`${fe} | ${oe}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Js.q,{titleTemplate:Ye,defaultTitle:et}),(0,n.jsxs)("header",{style:u,className:N.header,children:[(0,n.jsxs)(It.Z,{className:N.leftItemsBox,children:[(0,n.jsx)(Ja,{classes:N,type:B,typeLink:W,pageTitle:Le}),(0,n.jsx)(Qa,{classes:N,pageTitle:Le,tooltip:j}),(0,n.jsx)(Xa,{classes:N,subtitle:p})]}),(0,n.jsx)(P.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:s})]})]})}const qa=({label:e,secondaryLabel:s,icon:i,disabled:u=!1,onClick:p})=>_jsx(React.Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:v=>{p&&p(v)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function zl(e){const{actionItems:s}=e,[i,u]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>u(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:i,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>u(!1),children:_jsx(List,{children:s.map((v,j)=>_jsx(qa,{...v},`header-action-menu-${j}`))})})]})}const _a=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:"bold",letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),el=({value:e,className:s})=>(0,n.jsx)(J.Z,{className:s,children:e});function tl(e){const{label:s,value:i,url:u}=e,p=_a(),v=(0,n.jsx)(el,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(P.Z,{item:!0,children:(0,n.jsxs)("span",{className:p.root,children:[(0,n.jsx)(J.Z,{className:p.label,children:s}),u?(0,n.jsx)(Me,{to:u,children:v}):v]})})}const nl=e=>(0,k.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),rl=(0,l.Z)(nl,{name:"BackstageItemCardHeader"});function sl(e){const{title:s,subtitle:i,children:u}=e,p=rl(e);return(0,n.jsxs)("div",{className:p.root,children:[i&&(0,n.jsx)(J.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(J.Z,{variant:"h6",component:"h4",children:s}),u]})}function Vl(e){const{description:s,tags:i,title:u,type:p,subtitle:v,label:j,onClick:B,href:W}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:v||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((N,ye)=>_jsx(Chip,{size:"small",label:N},ye))}):null,s]}),_jsxs(CardActions,{children:[!W&&_jsx(Button,{to:"#",onClick:B,color:"primary",children:j}),W&&_jsx(Button,{to:W,color:"primary",children:j})]})]})}const ol=e=>(0,k.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),il=(0,l.Z)(ol,{name:"BackstageItemCardGrid"});function al(e){const{children:s,...i}=e,u=il(i);return(0,n.jsx)("div",{className:u.root,...i,children:s})}var ll=t(41547);const cl=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function Bi(e){const{themeId:s,children:i}=e,{isMobile:u}=Nr(),p=cl({isMobile:u});return(0,n.jsx)(ll.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function dl(e){const{themeId:s,children:i,...u}=e;return(0,n.jsxs)(Bi,{themeId:s,children:[(0,n.jsx)($i,{...u}),i]})}var Un=t(30195);const Wl=Un.z.object({providerInfo:Un.z.object({}).catchall(Un.z.unknown()).optional(),profile:Un.z.object({email:Un.z.string().optional(),displayName:Un.z.string().optional(),picture:Un.z.string().optional()}),backstageIdentity:Un.z.object({token:Un.z.string(),identity:Un.z.object({type:Un.z.literal("user"),userEntityRef:Un.z.string(),ownershipEntityRefs:Un.z.array(Un.z.string())})})}),Zi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function ul(e){const s=new Date(Date.now()+Zi.defaultTokenExpiryMillis);if(!e)return s;const[i,u,p]=e.split("."),v=JSON.parse(atob(u));return typeof v.exp!="number"?s:new Date(v.exp*1e3-Zi.tokenExpiryMarginMillis)}class Hl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!u)throw new TypeError(`Invalid user entity reference "${i}"`);return u[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 s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:ul(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const Gl=e=>{const s=useApi(discoveryApiRef),[{status:i,error:u},{execute:p}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await v.start(),e.onSignInSuccess(v)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},hl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),si=({children:e})=>{const s=hl();return(0,n.jsx)(P.Z,{component:"li",item:!0,classes:s,children:e})};class oi{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 s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function pl(e){const[s,i,u]=e.split(".");return JSON.parse(atob(i))}class ii{getUserId(){return this.result.userId}static fromResult(s){return new ii(s)}async getIdToken(){var s,i;return(i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:i,ent:u}=pl(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var s,i;return{token:await((i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s))}}async signOut(){var s,i;return(i=(s=this.result).signOut)===null||i===void 0?void 0:i.call(s)}constructor(s){this.result=s}}class ks{static createGuest(){return new oi}static fromLegacy(s){return ii.fromResult(s)}static create(s){return new ks(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!i)throw new TypeError(`Invalid user entity reference "${s}"`);return i[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(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,i,u){this.identity=s,this.authApi=i,this.profile=u}}const fl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:u,message:p}=e,v=(0,L.h_)(i),j=(0,L.h_)(L.VE),B=async()=>{try{const W=await v.getBackstageIdentity({instantPopup:!0});if(!W)throw new Error(`The ${u} provider is not configured to support sign-in`);const N=await v.getProfile();s(ks.create({identity:W.identity,profile:N,authApi:v}))}catch(W){j.post(new vr.SP("Login failed",W))}};return(0,n.jsx)(si,{children:(0,n.jsx)(Pr,{variant:"fullHeight",title:u,actions:(0,n.jsx)(ee.Z,{color:"primary",variant:"outlined",onClick:B,children:"Sign In"}),children:(0,n.jsx)(J.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),u=await i.getBackstageIdentity({optional:!0});if(!u)return;const p=await i.getProfile();return ks.create({identity:u.identity,profile:p,authApi:i})}},gl={Component:({onSignInSuccess:e})=>(0,n.jsx)(si,{children:(0,n.jsx)(Pr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(ee.Z,{color:"primary",variant:"outlined",onClick:()=>e(new oi),children:"Enter"}),children:(0,n.jsxs)(J.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new oi};var ml=t(63955),Di=t(86619),Ni=t(74828),vl=t(45455),yl=t.n(vl);const xl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,bl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Fi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Sl={Component:({onSignInSuccess:e})=>{const s=bl(),{register:i,handleSubmit:u,formState:p}=(0,ml.cI)({mode:"onChange"}),{errors:v}=p,j=({userId:B})=>{e(ks.fromLegacy({userId:B,profile:{email:`${B}@example.com`}}))};return(0,n.jsx)(si,{children:(0,n.jsxs)(Pr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(J.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:s.form,onSubmit:u(j),children:[(0,n.jsxs)(b.Z,{children:[(0,n.jsx)(Di.Z,{...Fi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,n.jsx)(Ni.Z,{error:!0,children:v.userId.message})]}),(0,n.jsxs)(b.Z,{children:[(0,n.jsx)(Di.Z,{...Fi(i("idToken",{required:!1,validate:B=>!B||xl.test(B)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(v.idToken)}),v.idToken&&(0,n.jsx)(Ni.Z,{error:!0,children:v.idToken.message})]}),(0,n.jsx)(ee.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!yl()(v),children:"Continue"})]})]})})},loader:async()=>{}},uo="@backstage/core:SignInPage:provider",Ui={guest:gl,custom:Sl,common:fl};function Mi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function _l(e){return e.reduce((i,u)=>{if(typeof u=="string")return Mi(u,i),i[u]={components:Ui[u],id:u},i;const{id:p}=u;return Mi(p,i),i[p]={components:Ui.common,id:p,config:u},i},{})}const ec=(e,s)=>{const i=useApi(errorApiRef),u=useApiHolder(),[p,v]=useState(!0),j=useCallback(W=>{s(IdentityApiSignOutProxy.from({identityApi:W,signOut:async()=>{var N;localStorage.removeItem(uo),await((N=W.signOut)===null||N===void 0?void 0:N.call(W))}}))},[s]);useLayoutEffect(()=>{var W;if(!p)return;const N=localStorage.getItem(uo);if(N===null){v(!1);return}const ye=e[N];if(!ye){v(!1);return}let oe=!1;return ye.components.loader(u,(W=ye.config)===null||W===void 0?void 0:W.apiRef).then(fe=>{oe||(fe?j(fe):v(!1))}).catch(fe=>{oe||(localStorage.removeItem(uo),i.post(fe),v(!1))}),()=>{oe=!0}},[p,i,s,u,e,j]);const B=useMemo(()=>Object.keys(e).map(W=>{const N=e[W],{Component:ye}=N.components,oe=fe=>{localStorage.setItem(uo,N.id),j(fe)};return _jsx(ye,{config:N.config,onSignInSuccess:oe},N.id)}),[e,j]);return[p,B]},Cl=({onSignInSuccess:e,providers:s=[],title:i,align:u="left"})=>{const p=useApi(configApiRef),v=useStyles(),j=getSignInProviders(s),[B,W]=useSignInProviders(j,e);return B?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:v,children:W})]})]})},wl=({provider:e,auto:s,onSignInSuccess:i})=>{const u=useStyles(),p=useApi(e.apiRef),v=useApi(configApiRef),[j,B]=useState(),[W,N]=useState(!1),ye=async({checkExisting:oe,showPopup:fe})=>{try{let Le;if(oe&&(Le=await p.getBackstageIdentity({optional:!0})),!Le&&(fe||s)&&(N(!0),Le=await p.getBackstageIdentity({instantPopup:!0}),!Le))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Le){N(!0);return}const Ye=await p.getProfile();i(UserIdentity.create({identity:Le.identity,authApi:p,profile:Ye}))}catch(Le){B(Le),N(!0)}};return useMountEffect(()=>ye({checkExisting:!0})),W?_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:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ye({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function tc(e){return"provider"in e?_jsx(wl,{...e}):_jsx(Cl,{...e})}const jl=(0,l.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"}),El=(0,fn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(_r.Z);function nc(e){const{slackChannel:s,errorBoundaryProps:i,children:u,title:p,deepLink:v,value:j,onChange:B}=e,W=jl(),[N,ye]=useState(0),oe=B||((Ye,et)=>ye(et));let fe;j?React.Children.map(u,Ye=>{React.isValidElement(Ye)&&(Ye==null?void 0:Ye.props.value)===j&&(fe=Ye==null?void 0:Ye.props.children)}):React.Children.map(u,(Ye,et)=>{React.isValidElement(Ye)&&et===N&&(fe=Ye==null?void 0:Ye.props.children)});const Le=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Le,children:[p&&_jsx(El,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:W,value:j||N,onChange:oe,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:fe}),v&&_jsx(BottomLink,{...v})]})})}const Al=(0,l.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:"bold"}}),{name:"BackstageCardTab"});function rc(e){const{children:s,...i}=e,u=Al();return _jsx(Tab,{disableRipple:!0,classes:u,...i})}},25248:function(wt,Ue,t){"use strict";t.d(Ue,{fC:function(){return x},CL:function(){return Ze},sM:function(){return _},$v:function(){return je},v_:function(){return Ke},hg:function(){return Me},uB:function(){return X},R5:function(){return At},bq:function(){return T},Ds:function(){return Ee},ni:function(){return Q},T0:function(){return F},CO:function(){return Ln},x8:function(){return cn},rx:function(){return vn},YO:function(){return Gt},P4:function(){return bn},NT:function(){return en},NW:function(){return qe},VE:function(){return gt},W0:function(){return Ie},gP:function(){return nt},IY:function(){return ht},F4:function(){return ue},ux:function(){return I},Kp:function(){return ve},$4:function(){return at},p_:function(){return $},ZM:function(){return rt},D:function(){return A},gW:function(){return E},E6:function(){return ct},z$:function(){return dt},h_:function(){return ne},I_:function(){return k},qD:function(){return ke},vJ:function(){return Sn},yx:function(){return Re},tg:function(){return hn},Oi:function(){return Jn}});var h=t(52322),n=t(51837),g=t(2784);const L=(0,n.CT)("analytics-context"),z=()=>{const ge=(0,g.useContext)(L);if(ge===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const te=ge.atVersion(1);if(te===void 0)throw new Error("No context found for version 1.");return te},x=ge=>{const{attributes:te,children:Ae}=ge,Xe={...z(),...te},yt=(0,n.EI)({1:Xe});return(0,h.jsx)(L.Provider,{value:yt,children:Ae})};function l(ge,te){const Ae=Ne=>_jsx(x,{attributes:te,children:_jsx(ge,{...Ne})});return Ae.displayName=`WithAnalyticsContext(${ge.displayName||ge.name||"Component"})`,Ae}function k(){const ge=(0,n.Vt)("api-context");if(!ge)throw new Error("API context is not available");const te=ge.atVersion(1);if(!te)throw new Error("ApiContext v1 not available");return te}function ne(ge){const Ae=k().get(ge);if(!Ae)throw new Error(`No implementation available for ${ge}`);return Ae}function q(ge){return function(Ae){const Ne=yt=>{const ie=k(),P={};for(const J in ge)if(ge.hasOwnProperty(J)){const He=ge[J],M=ie.get(He);if(!M)throw new Error(`No implementation available for ${He}`);P[J]=M}return _jsx(Ae,{...yt,...P})},Xe=Ae.displayName||Ae.name||"Component";return Ne.displayName=`withApis(${Xe})`,Ne}}class ee{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(te){if(this.config=te,!te.id.split(".").flatMap(Ne=>Ne.split("-")).every(Ne=>Ne.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${te.id}'`)}}function F(ge){return new ee(ge)}function Q(ge,te){return"id"in ge?{api:ge,deps:{},factory:()=>te}:ge}var _;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(_||(_={}));const ve=F({id:"core.auth.google"}),ue=F({id:"core.auth.github"}),A=F({id:"core.auth.okta"}),I=F({id:"core.auth.gitlab"}),$=F({id:"core.auth.microsoft"}),E=F({id:"core.auth.onelogin"}),T=F({id:"core.auth.bitbucket"}),X=F({id:"core.auth.atlassian"}),je=F({id:"core.alert"}),Ke=F({id:"core.analytics"}),Me=F({id:"core.apptheme"}),Ee=F({id:"core.config"}),qe=F({id:"core.discovery"}),gt=F({id:"core.error"});var Ze;(function(ge){ge[ge.None=0]="None",ge[ge.Active=1]="Active"})(Ze||(Ze={}));const Ie=F({id:"core.featureflags"}),nt=F({id:"core.fetch"}),at=F({id:"core.identity"}),rt=F({id:"core.oauthrequest"}),ct=F({id:"core.storage"});class lt{setContext(te){this.context=te}captureEvent(te,Ae,{value:Ne,attributes:Xe}={}){try{this.analyticsApi.captureEvent({action:te,subject:Ae,value:Ne,attributes:Xe,context:this.context})}catch(yt){console.warn("Error during analytics event capture. %o",yt)}}constructor(te,Ae={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=te,this.context=Ae}}function mt(){try{return ne(Ke)}catch{return{captureEvent:()=>{}}}}function dt(){const ge=(0,g.useRef)(null),te=z(),Ae=mt();function Ne(){return ge.current===null&&(ge.current=new lt(Ae)),ge.current}const Xe=Ne();return Xe.setContext(te),Xe}const We="plugin-context",le=ge=>{const{children:te,plugin:Ae}=ge,{Provider:Ne}=(0,n.CT)(We);return(0,h.jsx)(Ne,{value:(0,n.EI)({1:{plugin:Ae}}),children:te})};function Re(){const ge=(0,n.Vt)(We);if(!ge)throw new Error("Plugin Options context is not available");const te=ge.atVersion(1);if(!te)throw new Error("Plugin Options v1 is not available");return te.plugin.getPluginOptions()}const ke=()=>{const ge=(0,n.Vt)("app-context");if(!ge)throw new Error("App context is not available");const te=ge.atVersion(1);if(!te)throw new Error("AppContext v1 not available");return te},st=(0,n.uW)("component-data-store",()=>new WeakMap),vt="__backstage_data";function At(ge,te,Ae){const Ne=ge;var Xe;let yt=(Xe=Ne[vt])!==null&&Xe!==void 0?Xe:st.get(ge);if(yt||(yt={map:new Map},Object.defineProperty(Ne,vt,{enumerable:!1,configurable:!0,writable:!1,value:yt}),st.set(ge,yt)),yt.map.has(te)){const ie=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${te}" to component "${ie}"`)}yt.map.set(te,Ae)}function ht(ge,te){if(!ge)return;const Ae=ge.type;if(!Ae)return;var Ne;const Xe=(Ne=Ae[vt])!==null&&Ne!==void 0?Ne:st.get(Ae);if(!!Xe)return Xe.map.get(te)}const bt=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let kt=bt;class $t{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(te,Ae){this.id=te,this.params=Ae,this[kt]="absolute"}}function en(ge){var te;return new $t(ge.id,(te=ge.params)!==null&&te!==void 0?te:[])}const on=/^\w+$/;let Vt=null;class Wt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(te,Ae,Ne,Xe){this.id=te,this.path=Ae,this.parent=Ne,this.params=Xe,this[Vt]="sub"}}function un(ge){const{id:te,path:Ae,parent:Ne}=ge,Xe=Ae.split("/").filter(P=>P.startsWith(":")).map(P=>P.substring(1)),yt=[...Ne.params,...Xe];if(Ne.params.some(P=>Xe.includes(P)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ae.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ae}'`);if(Ae.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ae}'`);for(const P of Xe)if(!on.test(P))throw new Error(`SubRouteRef path has invalid param, got '${P}'`);return new Wt(te,Ae,Ne,yt)}let _t=bt;class Rn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(te,Ae,Ne){this.id=te,this.params=Ae,this.optional=Ne,this[_t]="external"}}function cn(ge){var te;return new Rn(ge.id,(te=ge.params)!==null&&te!==void 0?te:[],Boolean(ge.optional))}var Pn=t(10289);function hn(ge){const te=(0,Pn.TH)(),Ae=(0,n.Vt)("routing-context");if(!Ae)throw new Error("Routing context is not available");const Ne=Ae.atVersion(1),Xe=(0,g.useMemo)(()=>Ne&&Ne.resolve(ge,te),[Ne,ge,te]);if(!Ae)throw new Error("useRouteRef used outside of routing context");if(!Ne)throw new Error("RoutingContext v1 not available");const yt="optional"in ge&&ge.optional;if(!Xe&&!yt)throw new Error(`No path for ${ge}`);return Xe}function Jn(ge){return(0,Pn.UO)()}class Ht extends g.Component{static getDerivedStateFromError(te){return{error:te}}render(){const{error:te}=this.state,{app:Ae,plugin:Ne}=this.props,{ErrorBoundaryFallback:Xe}=Ae.getComponents();return te?(0,h.jsx)(Xe,{error:te,resetError:this.handleErrorReset,plugin:Ne}):this.props.children}constructor(...te){super(...te),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function bn(ge){const{component:te,mountPoint:Ae,name:Ne}=ge;return Gt({component:{lazy:()=>te().then(Xe=>{const yt=P=>{try{hn(Ae)}catch(J){if(typeof J=="object"&&J!==null){const{message:He}=J;if(typeof He=="string"&&He.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ae} 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 J}return(0,h.jsx)(Xe,{...P})},ie=Ne||Xe.displayName||Xe.name||"LazyComponent";return yt.displayName=`RoutableExtension(${ie})`,yt},Xe=>ie=>{const P=ke(),{BootErrorPage:J}=P.getComponents();return(0,h.jsx)(J,{step:"load-chunk",error:Xe})})},data:{"core.mountPoint":Ae},name:Ne})}function Ln(ge){const{component:te,name:Ae}=ge;return Gt({component:te,name:Ae})}function Gt(ge){const{data:te={},name:Ae}=ge;Ae||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ne;if("lazy"in ge.component){const yt=ge.component.lazy;Ne=(0,g.lazy)(()=>yt().then(ie=>({default:ie})))}else Ne=ge.component.sync;const Xe=Ae||Ne.displayName||Ne.name||"Component";return{expose(yt){const ie=P=>{const J=ke(),{Progress:He}=J.getComponents(),M=te==null?void 0:te["core.mountPoint"];return(0,h.jsx)(g.Suspense,{fallback:(0,h.jsx)(He,{}),children:(0,h.jsx)(Ht,{app:J,plugin:yt,children:(0,h.jsx)(x,{attributes:{pluginId:yt.getId(),...Ae&&{extension:Ae},...M&&{routeRef:M.id}},children:(0,h.jsx)(le,{plugin:yt,children:(0,h.jsx)(Ne,{...P})})})})})};At(ie,"core.plugin",yt);for(const[P,J]of Object.entries(te))At(ie,P,J);return ie.displayName=`Extension(${Xe})`,ie}}}function pn(ge,te,Ae,Ne){return g.Children.toArray(ge).flatMap(Xe=>{if(!(0,g.isValidElement)(Xe))return[];if(Xe.type===g.Fragment)return pn(Xe.props.children,te,Ae,Ne);if(ht(Xe,"core.featureFlagged")){const yt=Xe.props;return("with"in yt?te.isActive(yt.with):!te.isActive(yt.without))?pn(Xe.props.children,te,Ae,Ne):[]}if(Ae===void 0||Ae(Xe))return[Xe];if(Ne)throw new Error(Ne);return pn(Xe.props.children,te,Ae,Ne)})}class dn{selectByComponentData(te){const Ae=pn(this.node,this.featureFlagsApi,Ne=>ht(Ne,te.key)!==void 0,te.withStrictError);return new dn(Ae,this.featureFlagsApi)}findComponentData(te){return pn(this.node,this.featureFlagsApi,Ne=>ht(Ne,te.key)!==void 0).map(Ne=>ht(Ne,te.key)).filter(Ne=>Ne!==void 0)}getElements(){return pn(this.node,this.featureFlagsApi)}constructor(te,Ae){this.node=te,this.featureFlagsApi=Ae}}function Sn(ge,te,Ae=[]){const Ne=ne(Ie),Xe=new dn(ge,Ne);return(0,g.useMemo)(()=>te(Xe),[ge,...Ae])}class kn{getId(){return this.config.id}getApis(){var te;return(te=this.config.apis)!==null&&te!==void 0?te:[]}getFeatureFlags(){var te,Ae;return(Ae=(te=this.config.featureFlags)===null||te===void 0?void 0:te.slice())!==null&&Ae!==void 0?Ae:[]}get routes(){var te;return(te=this.config.routes)!==null&&te!==void 0?te:{}}get externalRoutes(){var te;return(te=this.config.externalRoutes)!==null&&te!==void 0?te:{}}provide(te){return te.expose(this)}__experimentalReconfigure(te){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(te))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var te;return(te=this.options)!==null&&te!==void 0?te:{}}toString(){return`plugin{${this.config.id}}`}constructor(te){this.config=te,this.options=void 0}}function vn(ge){return new kn(ge)}},23054:function(wt,Ue,t){"use strict";t.d(Ue,{SP:function(){return _},dR:function(){return ee},VL:function(){return ue},BD:function(){return n}});function h(A){if(typeof A!="object"||A===null||Array.isArray(A))return!1;const I=A;return!(typeof I.name!="string"||I.name===""||typeof I.message!="string")}function n(A){if(typeof A!="object"||A===null||Array.isArray(A))throw new Error(`Encountered invalid error, not an object, got '${A}'`);const I=A;if(typeof I.name!="string"||I.name==="")throw new Error(`Encountered error object without a name, got '${A}'`);if(typeof I.message!="string")throw new Error(`Encountered error object without a message, got '${A}'`)}var g=t(24852);function L(A,I){const $=serializeErrorInternal(A),E={name:"Unknown",message:"<no reason given>",...$};return I!=null&&I.includeStack||delete E.stack,E}function z(A){const I=(0,g.deserializeError)(A);return A.stack||(I.stack=void 0),I}function x(A){if(h(A)){const I=String(A);return I!=="[object Object]"?I:`${A.name}: ${A.message}`}return`unknown error '${A}'`}class l extends Error{constructor(I,$){var E;let T=I;if($!==void 0){const X=x($);T?T+=`; caused by ${X}`:T=`caused by ${X}`}super(T),(E=Error.captureStackTrace)===null||E===void 0||E.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h($)?$:void 0}}class k extends null{}class ne extends null{}class q extends null{}class ee extends l{}class F extends null{}class Q extends null{}class _ extends l{constructor(I,$){super(I,$),this.name=h($)?$.name:"Error"}}async function ve(A){try{const $=await A.text();if($){var I;if(!((I=A.headers.get("content-type"))===null||I===void 0)&&I.startsWith("application/json"))try{const E=JSON.parse($);if(E.error&&E.response)return E}catch{}return{error:{name:"Error",message:`Request failed with status ${A.status} ${A.statusText}, ${$}`},response:{statusCode:A.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${A.status} ${A.statusText}`},response:{statusCode:A.status}}}class ue extends Error{static async fromResponse(I){const $=await ve(I),E=$.response.statusCode||I.status,T=$.error.name||I.statusText,X=`Request failed with ${E} ${T}`,je=z($.error);return new ue({message:X,response:I,data:$,cause:je})}constructor(I){super(I.message),this.name="ResponseError",this.response=I.response,this.body=I.data,this.cause=I.cause}}},32838:function(wt,Ue,t){"use strict";t.d(Ue,{nW:function(){return ue},ae:function(){return ee},q3:function(){return F}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var g=new WeakMap;class L{async getCredentials(I){const $=new URL(I.url),E=_class_private_field_get(this,g).find(T=>T.isUrlSupported($));if(!E)throw new Error(`No auth provider available for '${I.url}', see https://backstage.io/link?scm-auth`);return E.getCredentials(I)}constructor(I){_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_set(this,g,I)}}var z=new WeakMap,x=new WeakMap,l=new WeakMap,k=new WeakMap;class ne{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:I,gitlab:$,azure:E,bitbucket:T})=>ne.merge(ne.forGithub(I),ne.forGitlab($),ne.forAzure(E),ne.forBitbucket(T))})}static forAuthApi(I,$){return new ne("generic",I,$.host,$.scopeMapping)}static forGithub(I,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"github.com";return new ne("github",I,T,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(I,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"gitlab.com";return new ne("gitlab",I,T,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(I,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"dev.azure.com";return new ne("azure",I,T,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(I,$){var E;const T=(E=$==null?void 0:$.host)!==null&&E!==void 0?E:"bitbucket.org";return new ne("bitbucket",I,T,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...I){return new L(I)}isUrlSupported(I){return I.host===_class_private_field_get(this,x)}getAdditionalScopesForProvider(I){var $;if(!(I!=null&&I.customScopes)||_class_private_field_get(this,k)==="generic")return[];var E;return(E=($=I.customScopes)===null||$===void 0?void 0:$[_class_private_field_get(this,k)])!==null&&E!==void 0?E:[]}async getCredentials(I){const{url:$,additionalScope:E,...T}=I,X=_class_private_field_get(this,l).default.slice();E!=null&&E.repoWrite&&X.push(..._class_private_field_get(this,l).repoWrite);const je=this.getAdditionalScopesForProvider(E);je.length&&X.push(...je);const Ke=[...new Set(X)],Me=await _class_private_field_get(this,z).getAccessToken(Ke,T);return{token:Me,headers:{Authorization:`Bearer ${Me}`}}}constructor(I,$,E,T){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_init(this,x,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,k,{writable:!0,value:void 0}),_class_private_field_set(this,z,$),_class_private_field_set(this,x,E),_class_private_field_set(this,l,T),_class_private_field_set(this,k,I)}}var q=t(79158);class ee{static fromConfig(I){return q.Lx.fromConfig(I)}}const F=(0,h.T0)({id:"integration.scmintegrations"});var Q=t(52322),_=t(73250),ve=t(2784);const ue=A=>{const{type:I}=A,$=(0,h.qD)(),E=_.Z;var T;const X=I&&(T=$.getSystemIcon(I))!==null&&T!==void 0?T:E;return(0,Q.jsx)(X,{})}},79158:function(wt,Ue,t){"use strict";t.d(Ue,{Lx:function(){return Xn},BT:function(){return St}});var h=t(82717),n=t.n(h),g=t(76635);function L(S){const d=new URL("http://example.com");return d.host=S,d.host===S}function z(S){try{return new URL(S),!0}catch{return!1}}function x(S,d){return{list(){return S},byUrl(m){try{const w=typeof m=="string"?new URL(m):m;return S.find(Y=>d(Y)===w.host)}catch{return}},byHost(m){return S.find(w=>d(w)===m)}}}function l(S){const{url:d,base:m,lineNumber:w}=S;try{return new URL(d),d}catch{}let Y;if(d.startsWith("/")){const{filepath:me}=n()(m);Y=new URL(m);const Ce=(0,g.trimEnd)(Y.pathname.substring(0,Y.pathname.length-me.length),"/");Y.pathname=`${Ce}${d}`}else Y=new URL(d,m);return Y.search=new URL(m).search,w&&(Y.hash=`L${w}`),Y.toString()}const k="amazonaws.com";function ne(S){const d=S.getOptionalString("endpoint");var m;const w=(m=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&m!==void 0?m:!1;let Y,me;if(d){try{const tn=new URL(d);Y=tn.host,me=tn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${d}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${d}'`)}else Y=k;const Ce=S.getOptionalString("accessKeyId"),Be=S.getOptionalString("secretAccessKey"),pt=S.getOptionalString("roleArn"),Bt=S.getOptionalString("externalId");return{host:Y,endpoint:d,s3ForcePathStyle:w,accessKeyId:Ce,secretAccessKey:Be,roleArn:pt,externalId:Bt}}function q(S){const d=S.map(ne);return d.some(m=>m.host===k)||d.push({host:k}),d}class ee{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}ee.factory=({config:S})=>{var d;const m=q((d=S.getOptionalConfigArray("integrations.awsS3"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new ee(w)),w=>w.config.host)};var F=t(90383),Q=t(22504),_=t(69866);const ve="GB";var ue=new WeakMap,A=new WeakMap,I=new WeakMap,$=new WeakMap,E=new WeakMap,T=new WeakMap,X=new WeakMap;class je{static fromRepoUrl(d){const m=new URL(d);let w,Y,me;const Ce=m.pathname.split("/").map(Dn=>decodeURIComponent(Dn));if(Ce[2]==="_git"?(w=Ce[1],Y=me=Ce[3]):Ce[3]==="_git"?(w=Ce[1],Y=Ce[2],me=Ce[4]):Ce[4]==="_git"&&(w=`${Ce[1]}/${Ce[2]}`,Y=Ce[3],me=Ce[5]),!w||!Y||!me)throw new Error("Azure URL must point to a git repository");var Be;const pt=(Be=m.searchParams.get("path"))!==null&&Be!==void 0?Be:void 0;let Bt;const tn=m.searchParams.get("version");if(tn){if(tn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Bt=tn.slice(2)}return new je(m.origin,w,Y,me,pt,Bt)}toRepoUrl(){let d;return(0,F.Z)(this,I)===(0,F.Z)(this,$)?d=(0,F.Z)(this,X).call(this,(0,F.Z)(this,A),"_git",(0,F.Z)(this,$)):d=(0,F.Z)(this,X).call(this,(0,F.Z)(this,A),(0,F.Z)(this,I),"_git",(0,F.Z)(this,$)),(0,F.Z)(this,E)&&d.searchParams.set("path",(0,F.Z)(this,E)),(0,F.Z)(this,T)&&d.searchParams.set("version",ve+(0,F.Z)(this,T)),d.toString()}toFileUrl(){if(!(0,F.Z)(this,E))throw new Error("Azure URL must point to a specific path to be able to download a file");const d=(0,F.Z)(this,X).call(this,(0,F.Z)(this,A),(0,F.Z)(this,I),"_apis","git","repositories",(0,F.Z)(this,$),"items");return d.searchParams.set("api-version","6.0"),d.searchParams.set("path",(0,F.Z)(this,E)),(0,F.Z)(this,T)&&d.searchParams.set("version",(0,F.Z)(this,T)),d.toString()}toArchiveUrl(){const d=(0,F.Z)(this,X).call(this,(0,F.Z)(this,A),(0,F.Z)(this,I),"_apis","git","repositories",(0,F.Z)(this,$),"items");return d.searchParams.set("recursionLevel","full"),d.searchParams.set("download","true"),d.searchParams.set("api-version","6.0"),(0,F.Z)(this,E)&&d.searchParams.set("scopePath",(0,F.Z)(this,E)),(0,F.Z)(this,T)&&d.searchParams.set("version",(0,F.Z)(this,T)),d.toString()}toCommitsUrl(){const d=(0,F.Z)(this,X).call(this,(0,F.Z)(this,A),(0,F.Z)(this,I),"_apis","git","repositories",(0,F.Z)(this,$),"commits");return d.searchParams.set("api-version","6.0"),(0,F.Z)(this,T)&&d.searchParams.set("searchCriteria.itemVersion.version",(0,F.Z)(this,T)),d.toString()}getOwner(){return(0,F.Z)(this,A)}getProject(){return(0,F.Z)(this,I)}getRepo(){return(0,F.Z)(this,$)}getPath(){return(0,F.Z)(this,E)}getRef(){return(0,F.Z)(this,T)}constructor(d,m,w,Y,me,Ce){(0,Q.Z)(this,ue,{writable:!0,value:void 0}),(0,Q.Z)(this,A,{writable:!0,value:void 0}),(0,Q.Z)(this,I,{writable:!0,value:void 0}),(0,Q.Z)(this,$,{writable:!0,value:void 0}),(0,Q.Z)(this,E,{writable:!0,value:void 0}),(0,Q.Z)(this,T,{writable:!0,value:void 0}),(0,Q.Z)(this,X,{writable:!0,value:(...Be)=>{const pt=new URL((0,F.Z)(this,ue));return pt.pathname=Be.map(Bt=>encodeURIComponent(Bt)).join("/"),pt}}),(0,_.Z)(this,ue,d),(0,_.Z)(this,A,m),(0,_.Z)(this,I,w),(0,_.Z)(this,$,Y),(0,_.Z)(this,E,me),(0,_.Z)(this,T,Ce)}}const Ke="dev.azure.com";function Me(S){var d;const m=(d=S.getOptionalString("host"))!==null&&d!==void 0?d:Ke,w=S.getOptionalString("token");if(!L(m))throw new Error(`Invalid Azure integration config, '${m}' is not a valid host`);return{host:m,token:w}}function Ee(S){const d=S.map(Me);return d.some(m=>m.host===Ke)||d.push({host:Ke}),d}class qe{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:m,base:w}=d;if(z(m))return m;try{const me=je.fromRepoUrl(w),Ce=new URL(w);var Y;const Be=new URL(`https://a.com${(Y=me.getPath())!==null&&Y!==void 0?Y:""}`),pt=new URL(m,Be).pathname;return Ce.searchParams.set("path",pt),d.lineNumber&&(Ce.searchParams.set("line",String(d.lineNumber)),Ce.searchParams.set("lineEnd",String(d.lineNumber+1)),Ce.searchParams.set("lineStartColumn","1"),Ce.searchParams.set("lineEndColumn","1")),Ce.toString()}catch{return new URL(m,w).toString()}}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}qe.factory=({config:S})=>{var d;const m=Ee((d=S.getOptionalConfigArray("integrations.azure"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new qe(w)),w=>w.config.host)};var gt=t(48834).lW;function Ze(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function Ie(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function nt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}function at(S,d){const m=d?{...d}:{};if(S.token){const w=gt.from(`:${S.token}`,"utf8");m.Authorization=`Basic ${w.toString("base64")}`}return{headers:m}}const rt="bitbucket.org",ct="https://api.bitbucket.org/2.0";function lt(S){var d;const m=(d=S.getOptionalString("host"))!==null&&d!==void 0?d:rt;let w=S.getOptionalString("apiBaseUrl");const Y=S.getOptionalString("token"),me=S.getOptionalString("username"),Ce=S.getOptionalString("appPassword");if(!L(m))throw new Error(`Invalid Bitbucket integration config, '${m}' is not a valid host`);return w?w=(0,g.trimEnd)(w,"/"):m===rt?w=ct:w=`https://${m}/rest/api/1.0`,{host:m,apiBaseUrl:w,token:Y,username:me,appPassword:Ce}}function mt(S){const d=S.map(lt);return d.some(m=>m.host===rt)||d.push({host:rt,apiBaseUrl:ct}),d}class dt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(!d.lineNumber)return m;const w=new URL(m);return this.integrationConfig.host==="bitbucket.org"?w.hash=`lines-${d.lineNumber}`:w.hash=`${d.lineNumber}`,w.toString()}resolveEditUrl(d){const m=n()(d),w=new URL(d);return w.searchParams.set("mode","edit"),w.searchParams.set("spa","0"),w.searchParams.set("at",m.ref),w.toString()}constructor(d){this.integrationConfig=d}}dt.factory=({config:S})=>{var d,m,w;const Y=mt((w=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&w!==void 0?w:[...(d=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[],...(m=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&m!==void 0?m:[]]);return x(Y.map(me=>new dt(me)),me=>me.config.host)};var We=t(96279),le=t(48834).lW;async function Re(S,d){const{name:m,owner:w,resource:Y}=parseGitUrl(S),me=Y==="bitbucket.org";let Ce=me?`${d.apiBaseUrl}/repositories/${w}/${m}`:`${d.apiBaseUrl}/projects/${w}/repos/${m}/default-branch`,Be=await fetch(Ce,vt(d));if(Be.status===404&&!me&&(Ce=`${d.apiBaseUrl}/projects/${w}/repos/${m}/branches/default`,Be=await fetch(Ce,vt(d))),!Be.ok){const Bt=`Failed to retrieve default branch from ${Ce}, ${Be.status} ${Be.statusText}`;throw new Error(Bt)}let pt;if(me)pt=(await Be.json()).mainbranch.name;else{const{displayId:Bt}=await Be.json();pt=Bt}if(!pt)throw new Error(`Failed to read default branch from ${Ce}. Response ${Be.status} ${Be.json()}`);return pt}async function ke(S,d){const{name:m,owner:w,ref:Y,protocol:me,resource:Ce,filepath:Be}=parseGitUrl(S),pt=Ce==="bitbucket.org";let Bt=Y;Bt||(Bt=await Re(S,d));const tn=Be?`&path=${encodeURIComponent(decodeURIComponent(Be))}`:"";return pt?`${me}://${Ce}/${w}/${m}/get/${Bt}.tar.gz`:`${d.apiBaseUrl}/projects/${w}/repos/${m}/archive?format=tgz&at=${Bt}&prefix=${w}-${m}${tn}`}function st(S,d){try{const{owner:m,name:w,ref:Y,filepathtype:me,filepath:Ce}=parseGitUrl(S);if(!m||!w||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const Be=Ce.replace(/^\//,"");if(d.host==="bitbucket.org"){if(!Y)throw new Error("Invalid Bitbucket URL or file path");return`${d.apiBaseUrl}/repositories/${m}/${w}/src/${Y}/${Be}`}return`${d.apiBaseUrl}/projects/${m}/repos/${w}/raw/${Be}?at=${Y}`}catch(m){throw new Error(`Incorrect URL: ${S}, ${m}`)}}function vt(S){const d={};if(S.token)d.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const m=le.from(`${S.username}:${S.appPassword}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}const At="bitbucket.org",ht="https://api.bitbucket.org/2.0";function bt(S){const d=At,m=ht,w=S.getString("username"),Y=S.getString("appPassword");return{host:d,apiBaseUrl:m,username:w,appPassword:Y}}function kt(S){const d=S.map(bt);return d.length===0&&d.push({host:At,apiBaseUrl:ht}),d}class $t{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(d.lineNumber){const w=new URL(m);return w.hash=`lines-${d.lineNumber}`,w.toString()}return m}resolveEditUrl(d){const m=n()(d),w=new URL(d);return w.searchParams.set("mode","edit"),w.searchParams.set("at",m.ref),w.toString()}constructor(d){this.integrationConfig=d}}$t.factory=({config:S})=>{var d;const m=kt((d=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new $t(w)),w=>w.config.host)};var en=t(48834).lW;async function on(S,d){const{name:m,owner:w}=parseGitUrl(S),Y=`${d.apiBaseUrl}/repositories/${w}/${m}`,me=await fetch(Y,un(d));if(!me.ok){const pt=`Failed to retrieve default branch from ${Y}, ${me.status} ${me.statusText}`;throw new Error(pt)}const Be=(await me.json()).mainbranch.name;if(!Be)throw new Error(`Failed to read default branch from ${Y}. Response ${me.status} ${me.json()}`);return Be}async function Vt(S,d){const{name:m,owner:w,ref:Y,protocol:me,resource:Ce}=parseGitUrl(S);let Be=Y;return Be||(Be=await on(S,d)),`${me}://${Ce}/${w}/${m}/get/${Be}.tar.gz`}function Wt(S,d){try{const{owner:m,name:w,ref:Y,filepathtype:me,filepath:Ce}=parseGitUrl(S);if(!m||!w||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Be=Ce.replace(/^\//,"");if(!Y)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${d.apiBaseUrl}/repositories/${m}/${w}/src/${Y}/${Be}`}catch(m){throw new Error(`Incorrect URL: ${S}, ${m}`)}}function un(S){const d={};if(S.username&&S.appPassword){const m=en.from(`${S.username}:${S.appPassword}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}function _t(S){const d=S.getString("host");let m=S.getOptionalString("apiBaseUrl");const w=S.getOptionalString("token"),Y=S.getOptionalString("username"),me=S.getOptionalString("password");if(!L(d))throw new Error(`Invalid Bitbucket Server integration config, '${d}' is not a valid host`);return m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}/rest/api/1.0`,{host:d,apiBaseUrl:m,token:w,username:Y,password:me}}function Rn(S){return S.map(_t)}class cn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const m=l(d);if(d.lineNumber){const w=new URL(m);return w.hash=d.lineNumber.toString(),w.toString()}return m}resolveEditUrl(d){return d.includes("?")?d.substring(0,d.indexOf("?")):d}constructor(d){this.integrationConfig=d}}cn.factory=({config:S})=>{var d;const m=Rn((d=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new cn(w)),w=>w.config.host)};var Pn=t(48834).lW;async function hn(S,d){const{name:m,owner:w}=parseGitUrl(S);let Y=`${d.apiBaseUrl}/projects/${w}/repos/${m}/default-branch`,me=await fetch(Y,bn(d));if(me.status===404&&(Y=`${d.apiBaseUrl}/projects/${w}/repos/${m}/branches/default`,me=await fetch(Y,bn(d))),!me.ok){const pt=`Failed to retrieve default branch from ${Y}, ${me.status} ${me.statusText}`;throw new Error(pt)}const{displayId:Ce}=await me.json(),Be=Ce;if(!Be)throw new Error(`Failed to read default branch from ${Y}. Response ${me.status} ${me.json()}`);return Be}async function Jn(S,d){const{name:m,owner:w,ref:Y,filepath:me}=parseGitUrl(S);let Ce=Y;Ce||(Ce=await hn(S,d));const Be=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${d.apiBaseUrl}/projects/${w}/repos/${m}/archive?format=tgz&at=${Ce}&prefix=${w}-${m}${Be}`}function Ht(S,d){try{const{owner:m,name:w,ref:Y,filepathtype:me,filepath:Ce}=parseGitUrl(S);if(!m||!w||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Be=Ce.replace(/^\//,"");return`${d.apiBaseUrl}/projects/${m}/repos/${w}/raw/${Be}?at=${Y}`}catch(m){throw new Error(`Incorrect URL: ${S}, ${m}`)}}function bn(S){const d={};if(S.token)d.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const m=Pn.from(`${S.username}:${S.password}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}function Ln(S){const d=S.getString("host");let m=S.getOptionalString("baseUrl"),w=S.getOptionalString("cloneUrl"),Y=S.getOptionalString("gitilesBaseUrl");const me=S.getOptionalString("username"),Ce=S.getOptionalString("password");if(L(d)){if(m&&!z(m))throw new Error(`Invalid Gerrit integration config, '${m}' is not a valid baseUrl`);if(w&&!z(w))throw new Error(`Invalid Gerrit integration config, '${w}' is not a valid cloneUrl`);if(Y&&!z(Y))throw new Error(`Invalid Gerrit integration config, '${Y}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${d}' is not a valid host`);return m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}`,Y?Y=(0,g.trimEnd)(Y,"/"):Y=`https://${d}`,w?w=(0,g.trimEnd)(w,"/"):w=m,{host:d,baseUrl:m,cloneUrl:w,gitilesBaseUrl:Y,username:me,password:Ce}}function Gt(S){return S.map(Ln)}var pn=t(48834).lW;const dn=")]}'";function Sn(S,d){const w=d.replace(S.gitilesBaseUrl,"").split("/").filter(Bt=>!!Bt),Y=w.indexOf("+");if(Y<=0)throw new Error(`Unable to parse project from url: ${d}`);const me=(0,g.trimStart)(w.slice(0,Y).join("/"),"/"),Ce=w.indexOf("heads");if(Ce<=0)throw new Error(`Unable to parse branch from url: ${d}`);const Be=w[Ce+1],pt=w.slice(Ce+2).join("/");return{branch:Be,filePath:pt===""?"/":pt,project:me}}function kn(S,d,m,w){return`${S.gitilesBaseUrl}/${d}/+/refs/heads/${m}/${(0,g.trimStart)(w,"/")}`}function vn(S){return S.password?"/a/":"/"}function ge(S,d){const{branch:m,project:w}=Sn(S,d);return`${S.baseUrl}${vn(S)}projects/${encodeURIComponent(w)}/branches/${m}`}function te(S,d){const{project:m}=Sn(S,d);return`${S.cloneUrl}${vn(S)}${m}`}function Ae(S,d){const{branch:m,filePath:w,project:Y}=Sn(S,d);return`${S.baseUrl}${vn(S)}projects/${encodeURIComponent(Y)}/branches/${m}/files/${encodeURIComponent(w)}/content`}function Ne(S){return`${S.baseUrl}${vn(S)}projects/`}function Xe(S){const d={};if(!S.password)return d;const m=pn.from(`${S.username}:${S.password}`,"utf8");return d.Authorization=`Basic ${m.toString("base64")}`,{headers:d}}async function yt(S){const d=await S.text();if(d.startsWith(dn))try{return JSON.parse(d.slice(dn.length))}catch(m){throw new Error(`Invalid response from Gerrit: ${d.slice(0,10)} - ${m}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${d.slice(0,10)}`)}class ie{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){const{url:m,base:w,lineNumber:Y}=d;let me;if(m.startsWith("/")){const{branch:Ce,project:Be}=Sn(this.config,w);return kn(this.config,Be,Ce,m)}return m?me=new URL(m,w):me=new URL(w),Y&&(me.hash=Y.toString()),me.toString()}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}ie.factory=({config:S})=>{var d;const m=Gt((d=S.getOptionalConfigArray("integrations.gerrit"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new ie(w)),w=>w.config.host)};function P(S){const d=S.getString("host");let m=S.getOptionalString("baseUrl");const w=S.getOptionalString("username"),Y=S.getOptionalString("password");if(!L(d))throw new Error(`Invalid Gitea integration config, '${d}' is not a valid host`);return m?m=(0,g.trimEnd)(m,"/"):m=`https://${d}`,{host:d,baseUrl:m,username:w,password:Y}}var J=t(48834).lW;function He(S,d){try{var m;const w=(m=S.baseUrl)!==null&&m!==void 0?m:`https://${S.host}`,[Y,me,Ce,Be,pt,Bt,...tn]=d.replace(w,"").split("/"),Dn=tn.join("/").replace(/^\//,"");return`${w}/${me}/${Ce}/_edit/${Bt}/${Dn}`}catch(w){throw new Error(`Incorrect URL: ${d}, ${w}`)}}function M(S,d){try{var m;const w=(m=S.baseUrl)!==null&&m!==void 0?m:`https://${S.host}`,[Y,me,Ce,Be,pt,Bt,...tn]=d.replace(w,"").split("/"),Dn=tn.join("/").replace(/^\//,"");return`${w}/api/v1/repos/${me}/${Ce}/contents/${Dn}?ref=${Bt}`}catch(w){throw new Error(`Incorrect URL: ${d}, ${w}`)}}function Z(S){const d={},{username:m,password:w}=S;return w?(m?d.Authorization=`basic ${J.from(`${m}:${w}`).toString("base64")}`:d.Authorization=`token ${w}`,{headers:d}):d}class ce{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(d){return l(d)}resolveEditUrl(d){return He(this.config,d)}constructor(d){this.config=d}}ce.factory=({config:S})=>{var d;const w=((d=S.getOptionalConfigArray("integrations.gitea"))!==null&&d!==void 0?d:[]).map(Y=>P(Y));return x(w.map(Y=>new ce(Y)),Y=>Y.config.host)};const pe="github.com",Se="https://api.github.com",De="https://raw.githubusercontent.com";function $e(S){var d,m;const w=(m=S.getOptionalString("host"))!==null&&m!==void 0?m:pe;let Y=S.getOptionalString("apiBaseUrl"),me=S.getOptionalString("rawBaseUrl");const Ce=S.getOptionalString("token"),Be=(d=S.getOptionalConfigArray("apps"))===null||d===void 0?void 0:d.map(pt=>({appId:pt.getNumber("appId"),clientId:pt.getString("clientId"),clientSecret:pt.getString("clientSecret"),webhookSecret:pt.getString("webhookSecret"),privateKey:pt.getString("privateKey"),allowedInstallationOwners:pt.getOptionalStringArray("allowedInstallationOwners")}));if(!L(w))throw new Error(`Invalid GitHub integration config, '${w}' is not a valid host`);return Y?Y=(0,g.trimEnd)(Y,"/"):w===pe&&(Y=Se),me?me=(0,g.trimEnd)(me,"/"):w===pe&&(me=De),{host:w,apiBaseUrl:Y,rawBaseUrl:me,token:Ce,apps:Be}}function Ge(S){const d=S.map($e);return d.some(m=>m.host===pe)||d.push({host:pe,apiBaseUrl:Se,rawBaseUrl:De}),d}function tt(S,d,m){try{const{owner:w,name:Y,ref:me,filepathtype:Ce,filepath:Be}=parseGitUrl(S);if(!w||!Y||!me||Ce!=="blob"&&Ce!=="raw"&&Ce!=="tree")throw new Error("Invalid GitHub URL or file path");const pt=Be.replace(/^\//,"");return H(d,m)==="api"?`${d.apiBaseUrl}/repos/${w}/${Y}/contents/${pt}?ref=${me}`:`${d.rawBaseUrl}/${w}/${Y}/${me}/${pt}`}catch(w){throw new Error(`Incorrect URL: ${S}, ${w}`)}}function C(S,d){const m={};return H(S,d)==="api"&&(m.Accept="application/vnd.github.v3.raw"),d.token&&(m.Authorization=`token ${d.token}`),{headers:m}}function H(S,d){return S.apiBaseUrl&&(d.token||!S.rawBaseUrl)?"api":"raw"}var he=t(42822),se=t(89393),xe=t(26228);class Oe{async getOrCreateToken(d,m,w){let Y=this.tokenCache.get(d);if((!Y||this.isExpired(Y.expiresAt))&&(Y=await w(),Y.expiresAt=Y.expiresAt.minus({minutes:10}),this.tokenCache.set(d,Y)),!this.appliesToRepo(Y,m))throw new Error(`The Backstage GitHub application used in the ${d} organization does not have access to a repository with the name ${m}`);return{accessToken:Y.token}}appliesToRepo(d,m){return m===void 0?!0:d.repositories!==void 0?d.repositories.includes(m):!0}constructor(){this.tokenCache=new Map,this.isExpired=d=>xe.ou.local()>d}}const Fe={Accept:"application/vnd.github.machine-man-preview+json"};class it{async getInstallationCredentials(d,m){if(this.allowedInstallationOwners){var w;if(!(!((w=this.allowedInstallationOwners)===null||w===void 0)&&w.includes(d)))return{accessToken:void 0}}return this.cache.getOrCreateToken(d,m,async()=>{const{installationId:Y,suspended:me}=await this.getInstallationData(d);if(me)throw new Error(`The GitHub application for ${d} is suspended`);const Ce=await this.appClient.apps.createInstallationAccessToken({installation_id:Y,headers:Fe});let Be;if(Ce.data.repository_selection==="selected"){const Bt=new se.v({baseUrl:this.baseUrl,auth:Ce.data.token}),tn=await Bt.paginate(Bt.apps.listReposAccessibleToInstallation);var pt;Be=((pt=tn.repositories)!==null&&pt!==void 0?pt:tn).map(mr=>mr.name)}return{token:Ce.data.token,expiresAt:xe.ou.fromISO(Ce.data.expires_at),repositories:Be}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(d){const w=(await this.getInstallations()).find(me=>{var Ce,Be;return((Ce=me.account)===null||Ce===void 0||(Be=Ce.login)===null||Be===void 0?void 0:Be.toLocaleLowerCase("en-US"))===d.toLocaleLowerCase("en-US")});if(w)return{installationId:w.id,suspended:Boolean(w.suspended_by)};const Y=new Error(`No app installation found for ${d} in ${this.baseAuthConfig.appId}`);throw Y.name="NotFoundError",Y}constructor(d,m){this.cache=new Oe,this.allowedInstallationOwners=d.allowedInstallationOwners,this.baseUrl=m,this.baseAuthConfig={appId:d.appId,privateKey:d.privateKey.replace(/\\n/gm,`
31
+ `)},this.appClient=new se.v({baseUrl:m,headers:Fe,authStrategy:he.i,auth:this.baseAuthConfig})}}class jt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(m=>m.getInstallations()))).flat():[]}async getAppToken(d,m){if(this.apps.length===0)return;const w=await Promise.all(this.apps.map(Be=>Be.getInstallationCredentials(d,m).then(pt=>({credentials:pt,error:void 0}),pt=>({credentials:void 0,error:pt})))),Y=w.find(Be=>Be.credentials);if(Y)return Y.credentials.accessToken;const Ce=w.map(Be=>Be.error).find(Be=>Be.name!=="NotFoundError");if(Ce)throw Ce}constructor(d){var m,w;this.apps=(w=(m=d.apps)===null||m===void 0?void 0:m.map(Y=>new it(Y,d.apiBaseUrl)))!==null&&w!==void 0?w:[]}}class ft{async getCredentials(d){const m=n()(d.url),w=m.owner||m.name,Y=m.owner?m.name:void 0;let me="app",Ce=await this.githubAppCredentialsMux.getAppToken(w,Y);return Ce||(me="token",Ce=this.token),{headers:Ce?{Authorization:`Bearer ${Ce}`}:void 0,token:Ce,type:me}}constructor(d,m){this.githubAppCredentialsMux=d,this.token=m}}ft.create=S=>new ft(new jt(S),S.token);class _e{static fromIntegrations(d){const m=new Map;return d.github.list().forEach(w=>{const Y=SingleInstanceGithubCredentialsProvider.create(w.config);m.set(w.config.host,Y)}),new _e(m)}async getCredentials(d){const m=new URL(d.url),w=this.providers.get(m.host);if(!w)throw new Error(`There is no GitHub integration that matches ${d.url}. Please add a configuration for an integration.`);return w.getCredentials(d)}constructor(d){this.providers=d}}class ot{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return St(l(d),"tree")}resolveEditUrl(d){return St(d,"edit")}constructor(d){this.integrationConfig=d}}ot.factory=({config:S})=>{var d;const m=Ge((d=S.getOptionalConfigArray("integrations.github"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new ot(w)),w=>w.config.host)};function St(S,d){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(m,w,Y,me)=>`//${w}/${Y}/${me}/${d}/`)}const Tt=null;class Rt extends ot{get config(){return super.config}constructor(d){super(d)}}Rt.factory=ot.factory;const Ut=null,Qn=null,zn=null,Nt="gitlab.com",Dt="https://gitlab.com/api/v4";function rn(S){const d=S.getString("host");let m=S.getOptionalString("apiBaseUrl");const w=S.getOptionalString("token");let Y=S.getOptionalString("baseUrl");if(m?m=(0,g.trimEnd)(m,"/"):d===Nt&&(m=Dt),Y?Y=(0,g.trimEnd)(Y,"/"):Y=`https://${d}`,L(d)){if(!m||!z(m))throw new Error(`Invalid GitLab integration config, '${m}' is not a valid apiBaseUrl`);if(!z(Y))throw new Error(`Invalid GitLab integration config, '${Y}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${d}' is not a valid host`);return{host:d,token:w,apiBaseUrl:m,baseUrl:Y}}function Cn(S){const d=S.map(rn);return d.some(m=>m.host===Nt)||d.push({host:Nt,apiBaseUrl:Dt,baseUrl:`https://${Nt}`}),d}function an(S){let d="";return S.host!==Nt&&(d=new URL(S.baseUrl).pathname),trimEnd(d,"/")}async function On(S,d){const m=await Wn(S,d);return er(S,m,d).toString()}function Vn(S){const{token:d=""}=S;return{headers:{"PRIVATE-TOKEN":d}}}function er(S,d,m){try{const w=new URL(S),Y=w.pathname.split("/blob/").slice(1).join("/blob/"),[me,...Ce]=Y.split("/"),Be=getGitLabIntegrationRelativePath(m);return w.pathname=[...Be?[Be]:[],"api/v4/projects",d,"repository/files",encodeURIComponent(decodeURIComponent(Ce.join("/"))),"raw"].join("/"),w.search=`?ref=${me}`,w}catch(w){throw new Error(`Incorrect url: ${S}, ${w}`)}}async function Wn(S,d){const m=new URL(S);if(!m.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let w=m.pathname.split("/-/blob/")[0].split("/blob/")[0];const Y=getGitLabIntegrationRelativePath(d);Y&&(w=w.replace(Y,""));const me=new URL(`${m.origin}${Y}/api/v4/projects/${encodeURIComponent(w.replace(/^\//,""))}`),Ce=await fetch(me.toString(),Vn(d)),Be=await Ce.json();if(!Ce.ok)throw new Error(`GitLab Error '${Be.error}', ${Be.error_description}`);return Number(Be.id)}catch(w){throw new Error(`Could not get GitLab project ID for: ${S}, ${w}`)}}class Zn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return ur(d,"edit")}constructor(d){this.integrationConfig=d}}Zn.factory=({config:S})=>{var d;const m=Cn((d=S.getOptionalConfigArray("integrations.gitlab"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new Zn(w)),w=>w.config.host)};function ur(S,d){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${d}/`)}class Xn{static fromConfig(d){return new Xn({awsS3:ee.factory({config:d}),azure:qe.factory({config:d}),bitbucket:dt.factory({config:d}),bitbucketCloud:$t.factory({config:d}),bitbucketServer:cn.factory({config:d}),gerrit:ie.factory({config:d}),github:ot.factory({config:d}),gitlab:Zn.factory({config:d}),gitea:ce.factory({config:d})})}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(d=>d.list())}byUrl(d){let m=Object.values(this.byType).map(w=>w.byUrl(d)).filter(Boolean);if(m.length>1){const w=m.filter(Y=>!(Y instanceof dt));w.length!==0&&(m=w)}return m[0]}byHost(d){return Object.values(this.byType).map(m=>m.byHost(d)).find(Boolean)}resolveUrl(d){const m=this.byUrl(d.base);return m?m.resolveUrl(d):l(d)}resolveEditUrl(d){const m=this.byUrl(d);return m?m.resolveEditUrl(d):d}constructor(d){this.byType=d}}},96215:function(wt,Ue,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return T.s4}});var n=t(52322),g=t(2784),L=t(28316),z=t(10289),x=t(25248);const l=(0,x.T0)({id:"plugin.techdocs.storageservice"}),k=(0,x.T0)({id:"plugin.techdocs.service"});var ne=t(92077),q=t(95481),ee=t(7476),F=t(93225),Q=t(67896),_=t(65124),ve=t(17339),ue=t(85478),A=t(68435),I=t(3482),$=t(42081),E=t(48431),T=t(89258),X=t(52943),je=t(61886),Ke=t(13980),Me=t.n(Ke);class Ee{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var qe=t(51837);const gt=(0,qe.CT)("api-context"),Ze=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,g.useContext)(gt))===null||r===void 0?void 0:r.atVersion(1),O=f?new Ee(o,f):o;return(0,n.jsx)(gt.Provider,{value:(0,qe.EI)({1:O}),children:c})};Ze.propTypes={apis:Me().shape({get:Me().func.isRequired}).isRequired,children:Me().node};class Ie{static validateFactories(r,o){for(const c of o){const f=[c],O=new Set;for(;f.length;){const U=f.shift(),V=r.get(U);if(!!V)for(const re of Object.values(V.deps)){if(re.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);O.has(re)||(O.add(re),f.push(re))}}}}get(r){return this.load(r)}load(r,o=[]){const c=this.apis.get(r.id);if(c)return c;const f=this.factories.get(r);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const O=this.loadDeps(r,f.deps,[...o,f.api]),U=f.factory(O);return this.apis.set(r.id,U),U}loadDeps(r,o,c){const f={};for(const O in o)if(o.hasOwnProperty(O)){const U=o[O],V=this.load(U,c);if(!V)throw new Error(`No API factory available for dependency ${U} of dependent ${r}`);f[O]=V}return f}constructor(r){this.factories=r,this.apis=new Map}}var nt;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(nt||(nt={}));class at{register(r,o){const c=nt[r],f=this.factories.get(o.api.id);return f&&f.priority>=c?!1:(this.factories.set(o.api.id,{priority:c,factory:o}),!0)}get(r){const o=this.factories.get(r.id);if(!!o)return o.factory}getAllApis(){const r=new Set;for(const{factory:o}of this.factories.values())r.add(o.api);return r}constructor(){this.factories=new Map}}function rt(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,O=window.screen.width/2-c/2,U=window.screen.height/2-f/2,V=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${U},left=${O}`);let re="";if(!V||typeof V.closed=="undefined"||V.closed){const ut=new Error("Failed to open auth popup.");ut.name="PopupRejectedError",o(ut);return}const Ve=ut=>{if(ut.source!==V||ut.origin!==a.origin)return;const{data:Zt}=ut;if(Zt.type==="config_info"){re=Zt.targetOrigin;return}if(Zt.type!=="authorization_response")return;const Ft=Zt;if("error"in Ft){const Qt=new Error(Ft.error.message);Qt.name=Ft.error.name,o(Qt)}else r(Ft.response);Ct()},ze=setInterval(()=>{if(V.closed){const ut=`Login failed, ${re&&re!==window.location.origin?`Incorrect app origin, expected ${re}`:"popup was closed"}`,Zt=new Error(ut);Zt.name="PopupClosedError",o(Zt),Ct()}},100);function Ct(){window.removeEventListener("message",Ve),clearInterval(ze)}window.addEventListener("message",Ve)})}function ct(a){return[...a].join(" ")}class lt{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const o=await r.json();if(o.error){const c=new Error(o.error.message);throw o.error.name&&(c.name=o.error.name),c}return await this.sessionTransform(o)}async removeSession(){const r=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!r.ok){const o=new Error(`Logout request failed, ${r.statusText}`);throw o.status=r.status,o}}async showPopup(r){const o=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:o,origin:location.origin}),f=await rt({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(r,o){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${c}/${this.provider.id}${r}${f}`}buildQueryString(r){if(!r)return"";const o=Object.entries(r).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(r){const{discoveryApi:o,environment:c,provider:f,joinScopes:O=ct,oauthRequestApi:U,sessionTransform:V=re=>re}=r;this.authRequester=U.createAuthRequester({provider:f,onAuthRequest:re=>this.showPopup(re)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=O,this.sessionTransform=V}}function mt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class dt{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return mt(c,o)}getExtendedScope(r,o){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(r);for(const O of f)c.add(O)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var We=t(82394),le=t.n(We);let Re=Symbol.observable;class ke{[Re](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(le())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let st=Symbol.observable;class vt{[st](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(le())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class At{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?x.sM.SignedIn:x.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new vt(x.sM.SignedOut),this.signedIn=!1}}class ht{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),O=this.sessionScopesFunc(c);return mt(O,f)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.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(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new At;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:O}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=O,this.helper=new dt({sessionScopes:f,defaultScopes:c})}}class bt{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:c=new Set,sessionScopes:f}=r;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const kt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class $t{static create(r){const{discoveryApi:o,environment:c="development",provider:f=kt,oauthRequestApi:O,defaultScopes:U=[],scopeTransform:V=ze=>ze}=r,re=new lt({discoveryApi:o,environment:c,provider:f,oauthRequestApi:O,sessionTransform(ze){return{...ze,providerInfo:{idToken:ze.providerInfo.idToken,accessToken:ze.providerInfo.accessToken,scopes:$t.normalizeScopes(V,ze.providerInfo.scope),expiresAt:new Date(Date.now()+ze.providerInfo.expiresInSeconds*1e3)}}}}),Ve=new ht({connector:re,defaultScopes:new Set(U),sessionScopes:ze=>ze.providerInfo.scopes,sessionShouldRefresh:ze=>(ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new $t({sessionManager:Ve,scopeTransform:V})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=$t.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var O;return(O=f==null?void 0:f.providerInfo.accessToken)!==null&&O!==void 0?O:""}async getIdToken(r={}){const o=await this.sessionManager.getSession(r);var c;return(c=o==null?void 0:o.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}static normalizeScopes(r,o){if(!o)return new Set;const c=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const en={id:"github",title:"GitHub",icon:()=>null};class on{static create(r){const{discoveryApi:o,environment:c="development",provider:f=en,oauthRequestApi:O,defaultScopes:U=["read:user"]}=r;return $t.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:U})}}const Vt={id:"gitlab",title:"GitLab",icon:()=>null};class Wt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Vt,oauthRequestApi:O,defaultScopes:U=["read_user"]}=r;return $t.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:U})}}const un={id:"google",title:"Google",icon:()=>null},_t="https://www.googleapis.com/auth/";class Rn{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:O=un,defaultScopes:U=["openid",`${_t}userinfo.email`,`${_t}userinfo.profile`]}=r;return $t.create({discoveryApi:o,oauthRequestApi:c,provider:O,environment:f,defaultScopes:U,scopeTransform(V){return V.map(re=>re==="openid"?re:re==="profile"||re==="email"?`${_t}userinfo.${re}`:re.startsWith(_t)?re:`${_t}${re}`)}})}}const cn={id:"okta",title:"Okta",icon:()=>null},Pn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),hn="okta.";class Jn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=cn,oauthRequestApi:O,defaultScopes:U=["openid","email","profile","offline_access"]}=r;return $t.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:U,scopeTransform(V){return V.map(re=>Pn.has(re)||re.startsWith(hn)?re:`${hn}${re}`)}})}}var Ht=t(30195);const bn=Ht.z.object({profile:Ht.z.object({email:Ht.z.string().optional(),displayName:Ht.z.string().optional(),picture:Ht.z.string().optional()}),backstageIdentity:Ht.z.object({token:Ht.z.string(),identity:Ht.z.object({type:Ht.z.literal("user"),userEntityRef:Ht.z.string(),ownershipEntityRefs:Ht.z.array(Ht.z.string())})})}),Ln={id:"saml",title:"SAML",icon:()=>null};class Gt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Ln}=r,O=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),U=new StaticAuthSessionManager({connector:O}),V=new AuthSessionStore({manager:U,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new Gt(V)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}constructor(r){this.sessionManager=r}}const pn={id:"microsoft",title:"Microsoft",icon:()=>null};class dn{static create(r){const{environment:o="development",provider:c=pn,oauthRequestApi:f,discoveryApi:O,defaultScopes:U=["openid","offline_access","profile","email","User.Read"]}=r;return $t.create({discoveryApi:O,oauthRequestApi:f,provider:c,environment:o,defaultScopes:U})}}const Sn={id:"onelogin",title:"onelogin",icon:()=>null},kn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),vn="onelogin.";class ge{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Sn,oauthRequestApi:O}=r;return $t.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(U){return U.map(V=>kn.has(V)||V.startsWith(vn)?V:`${vn}${V}`)}})}}const te={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Ae{static create(r){const{discoveryApi:o,environment:c="development",provider:f=te,oauthRequestApi:O,defaultScopes:U=["team"]}=r;return $t.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:U})}}const Ne={id:"atlassian",title:"Atlassian",icon:()=>null};class Xe{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Ne,oauthRequestApi:O}=r;return $t.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c})}}class yt{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new ke}}class ie{captureEvent(r){}}const P="theme";class J{static createWithStorage(r){const o=new J(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(P))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(O=>{O?window.localStorage.setItem(P,O):window.localStorage.removeItem(P)}),window.addEventListener("storage",O=>{if(O.key===P){var U;const V=(U=localStorage.getItem(P))!==null&&U!==void 0?U:void 0;o.setActiveThemeId(V)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new vt(void 0)}}var He=t(9850),M=t.n(He),Z=t(12782),ce=t.n(Z);const pe=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Se(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function De(a){if(a===null)return"null";if(Array.isArray(a))return"array";const r=typeof a;return r==="number"&&isNaN(a)?"nan":r==="string"&&a===""?"empty-string":r}const $e={type(a,r,o,c){return`Invalid type in config for key '${a}' in '${r}', got ${o}, wanted ${c}`},missing(a){return`Missing required config value at '${a}'`},convert(a,r,o){return`Unable to convert config value for key '${a}' in '${r}' to a ${o}`}};class Ge{static fromConfigs(r){return r.length===0?new Ge(void 0):r.reduce((o,{data:c,context:f,filteredKeys:O,deprecatedKeys:U})=>{const V=new Ge(c,f,o);if(V.filteredKeys=O,U)for(const{key:re,description:Ve}of U)console.warn(`The configuration key '${re}' of ${f} is deprecated and may be removed soon. ${Ve||""}`);return V},void 0)}has(r){var o;if(this.readValue(r)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(r))!==null&&f!==void 0?f:!1}keys(){var r;const o=this.data?Object.keys(this.data):[];var c;const f=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...o,...f])]}get(r){const o=this.getOptional(r);if(o===void 0)throw new Error($e.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=M()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var O;return f}else if(f===void 0)return c;return ce()({},{value:f},{value:c},(U,V)=>!Se(V)||!Se(U)?V:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error($e.missing(this.fullKey(r)));return o}getOptionalConfig(r){var o;const c=this.readValue(r),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(r);if(Se(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError($e.type(this.fullKey(r),this.context,De(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error($e.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[O,U]of f.entries())if(!Se(U))return{expected:"object-array",value:U,key:`${r}[${O}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,O)=>this.copy(f,`${r}[${O}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error($e.missing(this.fullKey(r)));return o}getOptionalNumber(r){const o=this.readConfigValue(r,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const c=Number(o);if(!Number.isFinite(c))throw new Error($e.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error($e.missing(this.fullKey(r)));return o}getOptionalBoolean(r){return this.readConfigValue(r,o=>typeof o=="boolean"||{expected:"boolean"})}getString(r){const o=this.getOptionalString(r);if(o===void 0)throw new Error($e.missing(this.fullKey(r)));return o}getOptionalString(r){return this.readConfigValue(r,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(r){const o=this.getOptionalStringArray(r);if(o===void 0)throw new Error($e.missing(this.fullKey(r)));return o}getOptionalStringArray(r){return this.readConfigValue(r,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[c,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,o,c){const f=new Ge(r,this.context,c,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(r,o){const c=this.readValue(r);if(c===void 0){var f;if(!1)var O;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const U=o(c);if(U!==!0){const{key:V=r,value:re=c,expected:Ve}=U;throw new TypeError($e.type(this.fullKey(V),this.context,De(re),Ve))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!pe.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,O]of o.entries())if(Se(c))c=c[O];else if(c!==void 0){const U=this.fullKey(o.slice(0,f).join("."));throw new TypeError($e.type(U,this.context,De(c),"object"))}return c}constructor(r,o="mock-config",c,f=""){this.data=r,this.context=o,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const tt="Invalid discovery URL pattern,";class C{static compile(r){const o=r.split(/\{\{\s*pluginId\s*\}\}/),c=o.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${tt} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${tt} URL must not have a hash`);if(f.search)throw new Error(`${tt} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${tt} URL must not end with a slash`);return new C(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class H{post(r,o){return o!=null&&o.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,o)}error$(){return this.errorApi.error$()}constructor(r,o){this.alertApi=r,this.errorApi=o}}class he{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new ke}}class se{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function xe(a){if(a.length<3)throw new Error(`The '${a}' feature flag must have a minimum length of three characters.`);if(a.length>150)throw new Error(`The '${a}' feature flag must not exceed 150 characters.`);if(!a.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${a}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Oe{registerFlag(r){xe(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===x.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,f]of Object.entries(r.states))this.flags.set(c,f);const o=Array.from(this.flags.entries()).filter(([,c])=>c===x.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const o=JSON.parse(r);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const c=Object.entries(o).filter(([f,O])=>(xe(f),O===x.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Fe(a){let r=a.baseImplementation||t.g.fetch;var o;const c=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of c)r=f.apply(r);return{fetch:r}}class it{static create(r){var o,c;const f=jt(r),O=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",U=((c=r.header)===null||c===void 0?void 0:c.value)||(V=>`Bearer ${V}`);return new it(r.identityApi,f,O,U)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:O}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof O!="string"||!O||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue(O)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function jt(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?ft(a.urlPrefixAllowlist):a.config?ft([a.config.getString("backend.baseUrl")]):()=>!1}function ft(a){const r=a.map(o=>o.replace(/\/$/,""));return o=>r.some(c=>o===c||o.startsWith(`${c}/`))}function _e(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class ot{apply(r){return async(o,c)=>{const f=new Request(o,c),O="plugin://";if(!f.url.startsWith(O))return r(o,c);const{hostname:U,pathname:V,search:re,hash:Ve,username:ze,password:Ct}=new URL(`http://${f.url.substring(O.length)}`);let ut=await this.discoveryApi.getBaseUrl(U);if(ze||Ct){const Ft=new URL(ut),Qt=`${ze}${Ct?`:${Ct}`:""}@`;ut=`${Ft.protocol}//${Qt}${Ft.host}${Ft.pathname}`}const Zt=`${_e(ut,V)}${re}${Ve}`;return r(Zt,typeof o=="string"||St(o)?c:o)}}constructor(r){this.discoveryApi=r}}function St(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Tt{static resolvePluginProtocol(r){return new ot(r.discoveryApi)}static injectIdentityAuth(r){return it.create(r)}constructor(){}}function Rt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function Ut(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class Qn{request(r){return new Promise((o,c)=>{this.requests.push({scopes:r,resolve:o,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,o){this.requests=this.requests.filter(c=>Rt(r,c.scopes)?(c.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(o=>o.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,c)=>Ut(o,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:o=>{r&&this.resolve(r,o)},reject:o=>{r&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new vt(this.getCurrentPending())}}class zn{createAuthRequester(r){const o=new Qn,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const O=this.currentRequests.slice(),U=this.makeAuthRequest(f,r);U?O[c]=U:delete O[c],this.currentRequests=O,this.subject.next(O.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(r,o){const{scopes:c}=r;if(!!c)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(c);r.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",r.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new vt([]),this.currentRequests=[],this.handlerCount=0}}const Nt=new Map;class Dt{static create(r){var o;return new Dt((o=r.namespace)!==null&&o!==void 0?o:"",r.errorApi)}get(r){return this.snapshot(r).value}snapshot(r){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(r));f&&(o=JSON.parse(f,(O,U)=>(typeof U=="object"&&U!==null&&Object.freeze(U),U)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:o,presence:c}}forBucket(r){const o=`${this.namespace}/${r}`;return Nt.has(o)||Nt.set(o,new Dt(o,this.errorApi)),Nt.get(o)}async set(r,o){localStorage.setItem(this.getKeyName(r),JSON.stringify(o)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return this.observable.filter(({key:o})=>o===r)}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const o=this.snapshot(r);for(const c of this.subscribers)c.next(o)}constructor(r,o){this.namespace=r,this.errorApi=o,this.subscribers=new Set,this.observable=new(le())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var rn=t(64279);function Cn(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:g.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:O}=o.shift();g.Children.forEach(c,U=>{if(!(0,g.isValidElement)(U))return;const V={};for(const re in r)if(r.hasOwnProperty(re)){const Ve=r[re];V[re]=Ve.visit(Ve.accumulator,U,f,O[re])}for(const re of a.discoverers){const Ve=re(U);Ve&&o.push({node:Ve,parent:U,contexts:V})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function an(a,r){return()=>({accumulator:a(),visit:r})}function On(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function Vn(a){var r,o;if(((r=a.props)===null||r===void 0?void 0:r.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var c;return(c=a.props)===null||c===void 0?void 0:c.element}}const er=an(()=>new Set,(a,r)=>{const o=(0,x.IY)(r,"core.plugin");o&&a.add(o)}),Wn=a=>{const{children:r}=a,o=(0,x.h_)(x.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,x.R5)(Wn,"core.featureFlagged",!0);const Zn={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function ur(a){const r=a;if(r!=null&&r.type){var o,c;return(c=(o=r.type.displayName)!==null&&o!==void 0?o:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function Xn(a,r=new Array){return g.Children.forEach(a,o=>{if(!(0,g.isValidElement)(o))return;const c=(0,x.IY)(o,"core.mountPoint");if(c){const f=(0,x.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}Xn(o.props.children,r)}),r}const S=an(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,O;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const U=(f=r.props)===null||f===void 0?void 0:f.path,V=(0,x.IY)(r,"core.mountPoint");if(V&&U)throw new Error(`Path property may not be set directly on a routable extension "${ur(r)}"`);var re;const Ve=(re=c==null||(O=c.obj)===null||O===void 0?void 0:O.children)!==null&&re!==void 0?re:a.objects;if(U!==void 0){if(typeof U!="string")throw new Error(`Element path must be a string at "${ur(r)}"`);const Zt=U.startsWith("/")?U.slice(1):U,Ft=r.props.element;if((0,x.IY)(r,"core.gatherMountPoints")){var ze;if(Ft)throw new Error(`Mount point gatherers may not have an element prop "${ur(r)}"`);const Qt={path:Zt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((ze=r.props)===null||ze===void 0?void 0:ze.caseSensitive),children:[Zn],plugin:void 0};return Ve.push(Qt),{obj:Qt,gatherPath:Zt,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(Ft){var Ct;const[Qt,...An]=Xn(Ft);if(An.length>0)throw new Error(`Route element with path "${U}" may not contain multiple routable extensions`);if(!Qt)return c;const{routeRef:Yn,plugin:Fn}=Qt,or={path:Zt,element:"mounted",routeRefs:new Set([Yn]),caseSensitive:Boolean((Ct=r.props)===null||Ct===void 0?void 0:Ct.caseSensitive),children:[Zn],plugin:Fn};return Ve.push(or),a.paths.set(Yn,Zt),a.parents.set(Yn,c==null?void 0:c.routeRef),{obj:or,routeRef:Yn!=null?Yn:c==null?void 0:c.routeRef,gatherPath:Zt,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(V){var ut;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${ur(r)}" with mount point "${V}" must be assigned a path`);return c==null||(ut=c.obj)===null||ut===void 0||ut.routeRefs.add(V),a.paths.set(V,c.gatherPath),a.parents.set(V,c==null?void 0:c.gatherRouteRef),{...c,routeRef:V}}return c}),d=an(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,O,U;if((o==null?void 0:o.props.element)===r)return c;let V=c==null?void 0:c.obj,re=c==null?void 0:c.routeRef,Ve=c==null?void 0:c.sticky;const ze=(f=r.props)===null||f===void 0?void 0:f.path;var Ct;const ut=(Ct=V==null?void 0:V.children)!==null&&Ct!==void 0?Ct:a.objects,Zt=Boolean((O=r.props)===null||O===void 0?void 0:O.caseSensitive);let Ft=c==null?void 0:c.path;if((0,x.IY)(r,"core.gatherMountPoints")){if(!ze)throw new Error("Mount point gatherer must have a path");Ft=ze}const Qt=(U=r.props)===null||U===void 0?void 0:U.element;let An=(0,x.IY)(r,"core.mountPoint");if(!An&&(0,g.isValidElement)(Qt)&&(An=(0,x.IY)(Qt,"core.mountPoint")),An){let or=ze;if(Ft&&(or?Ft=void 0:or=Ft),!or)throw new Error("Mounted routable extension must have a path");a.paths.set(An,or),re&&Ve?(a.parents.set(An,re),ze&&(re=An,Ve=!1)):(a.parents.set(An,re),re=An),ze?(V={caseSensitive:Zt,path:ze,element:"mounted",routeRefs:new Set([An]),children:[Zn],plugin:(0,x.IY)(r.props.element,"core.plugin")},ut.push(V)):V==null||V.routeRefs.add(An)}if((0,x.IY)(r,"core.gatherMountPoints")&&(Ve=!0),(0,x.IY)(r,"core.gatherMountPoints")){if(!ze)throw new Error("Mount point gatherer must have a path");if(!An){var Fn;V={caseSensitive:Zt,path:ze,element:"gathered",routeRefs:new Set,children:[Zn],plugin:c==null||(Fn=c.obj)===null||Fn===void 0?void 0:Fn.plugin},ut.push(V)}}return{obj:V,path:Ft,routeRef:re,sticky:Ve}}),m=an(()=>new Set,(a,r)=>{if(r.type===Wn){const o=r.props;a.add("with"in o?o.with:o.without)}}),w=(0,qe.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Y(a){return a[w]==="absolute"}function me(a){return a[w]==="sub"}function Ce(a){return a[w]==="external"}function Be(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function pt(a,r,o){let c,f="";if(Y(a))c=a;else if(me(a))c=a.parent,f=a.path;else if(Ce(a)){const V=o.get(a);if(!V)return[void 0,""];if(Y(V))c=V;else if(me(V))c=V.parent,f=V.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${V}`)}else throw a[w]?new Error(`Unknown or invalid route ref type, ${a[w]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const O=r.get(c);if(O===void 0)return[void 0,""];const U=Be(O,f);return[c,U]}function Bt(a,r,o,c,f){var O;const U=(O=(0,z.fp)(f,r))!==null&&O!==void 0?O:[],V=Array();let re=-1;for(let Ct=a;Ct&&(re=U.findIndex(ut=>ut.route.routeRefs.has(Ct)),re===-1);Ct=c.get(Ct))V.unshift(Ct);V.length===0&&(re-=1);const Ve=re===-1?"":U[re].pathname,ze=V.slice(0,-1).map(Ct=>{const ut=o.get(Ct);if(ut===void 0)throw new Error(`No path for ${Ct}`);if(ut.includes(":"))throw new Error(`Cannot route to ${a} with parent ${Ct} as it has parameters`);return ut});return`${Be(Ve,...ze)}/`}class tn{resolve(r,o){const[c,f]=pt(r,this.routePaths,this.routeBindings);if(!c)return;let O;typeof o=="string"?O=this.trimPath(o):o.pathname?O={...o,pathname:this.trimPath(o.pathname)}:O=o;const U=this.appBasePath+Bt(c,O,this.routePaths,this.routeParents,this.routeObjects);return(...[re])=>Be(U,(0,z.Gn)(f,re))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,O){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=O}}const Dn=(0,qe.CT)("routing-context"),mr=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:O})=>{const U=new tn(a,r,o,c,f),V=(0,qe.EI)({1:U});return(0,n.jsx)(Dn.Provider,{value:V,children:O})},rs=(a,r)=>{try{var o,c;const f=(0,z.fp)(r,{pathname:a}),O=(o=f==null?void 0:f.filter(V=>{var re;return((re=V==null?void 0:V.route.routeRefs)===null||re===void 0?void 0:re.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!O)return{};let U;return O.routeRefs.size===1&&(U=O.routeRefs.values().next().value),{extension:"App",pluginId:((c=O.plugin)===null||c===void 0?void 0:c.getId())||"root",...U?{routeRef:U.id}:{}}}catch{return{}}},tr=({pathname:a,search:r,hash:o})=>{const c=(0,x.z$)();return(0,g.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},wn=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,z.TH)();return(0,n.jsx)(x.fC,{attributes:rs(r,a),children:(0,n.jsx)(tr,{pathname:r,search:o,hash:c})})};function Er(a,r){const o=new Set(r.values());o.delete(void 0);for(const c of r.keys()){if(o.has(c))continue;let f=c,O="";for(;f;){const V=a.get(f);if(V===void 0)throw new Error(`No path for ${f}`);O=Be(V,O),f=r.get(f)}const U=O.match(/:(\w+)/g);if(U){for(let V=0;V<U.length;V++)for(let re=V+1;re<U.length;re++)if(U[re]===U[V])throw new Error(`Parameter ${U[re]} is duplicated in path ${O}`)}}}function Ar(a,r){for(const o of r)if(!!o.externalRoutes){for(const[c,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.has(f))throw new Error(`External route '${c}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const ss=(0,qe.CT)("app-context"),os=({appContext:a,children:r})=>{const o=(0,qe.EI)({1:a});return(0,n.jsx)(ss.Provider,{value:o,children:r})};function Tr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function kr(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class Wr{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw Tr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return kr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Tr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return kr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(o=>o.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return kr("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var qn=t(72164);function Hn(a,r,o){if(a!==void 0){const f=o.find(O=>O.id===a);if(f)return f}if(r){const f=o.find(O=>O.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const Or=()=>{const a=(0,g.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,g.useState)(a.matches);return(0,g.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function vr({children:a}){const r=(0,x.h_)(x.hg),o=(0,qn.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?Or():!1,f=Hn(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const Hr=async(a="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const o=r.slice();if(a!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(a);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const c=window.__APP_CONFIG__;return c&&o.push({context:"window",data:c}),o};class Gr{add(r,o){return this.apis.push([r.id,o]),o}build(){return new hr(new Map(this.apis))}constructor(){this.apis=[]}}class hr{static builder(){return new Gr}static from(r){return new hr(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new hr(new Map([[r.id,o]]))}with(r,o){return new hr(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function is(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[O,U]of Object.entries(f)){const V=c[O];if(!V)throw new Error(`Key ${O} is not an existing external route`);if(!U&&!V.optional)throw new Error(`External route ${O} is required but was undefined`);U&&r.set(V,U)}}}),r}function Ir(){const[a]=(0,z.is)((0,n.jsx)(z.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const Rr=(0,g.createContext)({routeObjects:[]});function Kr(a){return Ir()?Yr(a):""}function Yr(a){var r;let{pathname:o}=new URL((r=a.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://dummy.dev");return o=o.replace(/\/*$/,""),o}function Jr(a,r,o){const c=Boolean(a),f=(0,rn.default)(a||(()=>Promise.resolve([])));let O;if(c&&f.loading){const{Progress:Ve}=r;O=(0,n.jsx)(Ve,{})}else if(f.error){const{BootErrorPage:Ve}=r;O=(0,n.jsx)(Ve,{step:"load-config",error:f.error})}const{ThemeProvider:U=vr}=r;if(O)return{node:(0,n.jsx)(Ze,{apis:hr.with(x.hg,o),children:(0,n.jsx)(U,{children:O})})};var V;return{api:Ge.fromConfigs((V=f.value)!==null&&V!==void 0?V:[])}}class as{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}class ls{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new as(this);let o=!1;return({children:f})=>{const O=(0,g.useMemo)(()=>J.createWithStorage(this.themes),[]),{routing:U,featureFlags:V,routeBindings:re}=(0,g.useMemo)(()=>{const ut=Cn({root:f,discoverers:[On,Vn],collectors:{routing:Ir()?d:S,collectedPlugins:er,featureFlags:m}});return ut.collectedPlugins.forEach(Zt=>this.plugins.add(Zt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...ut,routeBindings:is(this.bindRoutes)}},[f]);o||(o=!0,Er(U.paths,U.parents),Ar(re,this.plugins));const Ve=Jr(this.configLoader,this.components,O),ze="api"in Ve;if(ze){const{api:ut}=Ve;this.configApi=ut}if((0,g.useEffect)(()=>{if(ze){const ut=this.getApiHolder().get(x.W0);for(const Zt of this.plugins.values())if("getFeatureFlags"in Zt)for(const Ft of Zt.getFeatureFlags())ut.registerFlag({name:Ft.name,pluginId:Zt.getId()});else for(const Ft of Zt.output())Ft.type==="feature-flag"&&ut.registerFlag({name:Ft.name,pluginId:Zt.getId()});for(const Zt of V)ut.registerFlag({name:Zt,pluginId:""})}},[ze,Ve,V]),"node"in Ve)return Ve.node;const{ThemeProvider:Ct=vr}=this.components;return(0,n.jsx)(Ze,{apis:this.getApiHolder(),children:(0,n.jsx)(os,{appContext:r,children:(0,n.jsx)(Ct,{children:(0,n.jsx)(mr,{routePaths:U.paths,routeParents:U.parents,routeObjects:U.objects,routeBindings:re,basePath:Kr(Ve.api),children:(0,n.jsx)(Rr.Provider,{value:{routeObjects:U.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:O,children:U})=>{const[V,re]=(0,g.useState)(),Ve=(0,x.h_)(x.Ds),ze=Kr(Ve);return V?(this.appIdentityProxy.setTarget(V,{signOutTargetUrl:ze||"/"}),U):(0,n.jsx)(O,{onSignInSuccess:re})};return({children:O})=>{const U=(0,x.h_)(x.Ds),V=Yr(U),re=`${V}/*`,{routeObjects:Ve}=(0,g.useContext)(Rr);return o?Ir()?(0,n.jsxs)(r,{children:[(0,n.jsx)(wn,{routeObjects:Ve}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(z.Z5,{children:(0,n.jsx)(z.AW,{path:re,element:(0,n.jsx)(n.Fragment,{children:O})})})})]}):(0,n.jsxs)(r,{basename:V,children:[(0,n.jsx)(wn,{routeObjects:Ve}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(n.Fragment,{children:O})})]}):(this.appIdentityProxy.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:V||"/"}),Ir()?(0,n.jsxs)(r,{children:[(0,n.jsx)(wn,{routeObjects:Ve}),(0,n.jsx)(z.Z5,{children:(0,n.jsx)(z.AW,{path:re,element:(0,n.jsx)(n.Fragment,{children:O})})})]}):(0,n.jsxs)(r,{basename:V,children:[(0,n.jsx)(wn,{routeObjects:Ve}),O]}))}}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const o of r.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Ie.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:x.hg,deps:{},factory:()=>J.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:x.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:x.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:x.W0,deps:{},factory:()=>new Oe});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const o of r.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return Ie.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Ie(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const o=new Set;for(const c of r){const f=c.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(r){this.appIdentityProxy=new Wr;var o;this.apis=(o=r.apis)!==null&&o!==void 0?o:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]),this.components=r.components,this.themes=r.themes;var f;this.configLoader=(f=r.configLoader)!==null&&f!==void 0?f:Hr;var O;this.defaultApis=(O=r.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new at}}function cs(a){return new ls(a)}let Qr=!1;const Xr=a=>{const r=(0,x.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,g.useMemo)(()=>Ir(),[]),O=[...(0,x.vJ)(a.children,U=>U.getElements().flatMap(V=>{let re=V.props.path;if(re==="")return[];var Ve;re=(Ve=re==null?void 0:re.replace(/\/\*$/,""))!==null&&Ve!==void 0?Ve:"/";let ze=c?V:V.props.element;return!c&&!ze&&(ze=V,Qr||(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] />} />."),Qr=!0)),[{path:re,element:ze,children:V.props.children?[{path:re==="/"?"/":"*",element:V.props.children}]:void 0}]}).sort((V,re)=>re.path.localeCompare(V.path)).map(V=>({...V,path:V.path==="/"?"/":`${V.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,z.V$)(O)};var qr=t(25488);const _r=[(0,x.ni)({api:x.NW,deps:{configApi:x.Ds},factory:({configApi:a})=>C.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,x.ni)({api:x.$v,deps:{},factory:()=>new yt}),(0,x.ni)({api:x.v_,deps:{},factory:()=>new ie}),(0,x.ni)({api:x.VE,deps:{alertApi:x.$v},factory:({alertApi:a})=>{const r=new H(a,new he);return se.forward(r,{hidden:!1}),r}}),(0,x.ni)({api:x.E6,deps:{errorApi:x.VE},factory:({errorApi:a})=>Dt.create({errorApi:a})}),(0,x.ni)({api:x.gP,deps:{configApi:x.Ds,identityApi:x.$4,discoveryApi:x.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>Fe({middleware:[Tt.resolvePluginProtocol({discoveryApi:o}),Tt.injectIdentityAuth({identityApi:r,config:a})]})}),(0,x.ni)({api:x.ZM,deps:{},factory:()=>new zn}),(0,x.ni)({api:x.Kp,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Rn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.p_,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>dn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.F4,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>on.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.D,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Jn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.ux,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Wt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.gW,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>ge.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.bq,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Ae.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:x.uB,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Xe.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:qr.RV,deps:{discovery:x.NW,identity:x.$4,config:x.Ds},factory:({config:a,discovery:r,identity:o})=>qr.iM.create({config:a,discovery:r,identity:o})})];var fn=t(77277),It=t(93414),yr=t(62833);function ds({children:a}){return(0,z.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(z.VA,{children:a})}const us=()=>(0,n.jsx)(It.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),hs=({step:a,error:r})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${r.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(ds,{children:(0,n.jsx)(It.mf,{status:"501",statusMessage:o})})},es=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(It.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(fn.Z,{variant:"outlined",onClick:r,children:"Retry"})}),ps={Progress:It.Ex,Router:yr.VK,NotFoundErrorPage:us,BootErrorPage:hs,ErrorBoundaryFallback:es};var fs=t(43642),ts=t(80079),Pr=t(90941),Zs=t(32915),gs=t(40562),ns=t(21853),ms=t(60744),Ds=t(66569),vs=t(30254),Ns=t(13384),Fs=t(15933),ys=t(58838),Us=t(86737),y=t(4989),b=t(44407),R=t(18628),D=t(84219),G=t(98685),K=t(39781);const ae={brokenImage:ts.Z,catalog:R.Z,scaffolder:Zs.Z,techdocs:gs.Z,search:ns.Z,chat:ms.Z,dashboard:Ds.Z,docs:vs.Z,email:Ns.Z,github:ys.Z,group:D.Z,help:Us.Z,"kind:api":Fs.Z,"kind:component":b.Z,"kind:domain":fs.Z,"kind:group":D.Z,"kind:location":y.Z,"kind:system":Pr.Z,"kind:user":G.Z,user:G.Z,warning:K.Z};var de=t(73689),be=t(48032);const we={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")`},Pe={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 Te(a){const{colors:r,shape:o,options:c}=a,O=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,U=`${o}, ${O}`;var V;const re=(V=c==null?void 0:c.fontColor)!==null&&V!==void 0?V:"#FFFFFF";return{colors:r,shape:o,backgroundImage:U,fontColor:re}}const Je={home:Te({colors:Pe.teal,shape:we.wave}),documentation:Te({colors:Pe.pinkSea,shape:we.wave2}),tool:Te({colors:Pe.purpleSky,shape:we.round}),service:Te({colors:Pe.marineBlue,shape:we.wave}),website:Te({colors:Pe.veryBlue,shape:we.wave}),library:Te({colors:Pe.rubyRed,shape:we.wave}),other:Te({colors:Pe.darkGrey,shape:we.wave}),app:Te({colors:Pe.toastyOrange,shape:we.wave}),apis:Te({colors:Pe.teal,shape:we.wave2}),card:Te({colors:Pe.greens,shape:we.wave})},xt=16,Et='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Qe(a){const{palette:r,htmlFontSize:o=xt,fontFamily:c=Et,defaultPageTheme:f,pageTheme:O=Je}=a;if(!O[f])throw new Error(`${f} is not defined in pageTheme.`);var U;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:c,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:O[f],getPageTheme:({themeId:V})=>(U=O[V])!==null&&U!==void 0?U:O[f]}}function Ot(a){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:a.typography.fontFamily},body:{height:"100%",fontFamily:a.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:a.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:a.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:a.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,be.darken)(a.palette.link,.3),background:(0,be.lighten)(a.palette.link,.95)},[a.breakpoints.up("md")]:{minWidth:120,fontSize:a.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:a.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:a.spacing(1),marginBottom:a.spacing(1),color:a.palette.grey[900]},outlined:{color:a.palette.text.primary},label:{lineHeight:`${a.spacing(2.5)}px`,fontWeight:a.typography.fontWeightMedium,fontSize:`${a.spacing(1.75)}px`},labelSmall:{fontSize:`${a.spacing(1.5)}px`},deleteIcon:{color:a.palette.grey[500],width:`${a.spacing(3)}px`,height:`${a.spacing(3)}px`,margin:`0 ${a.spacing(.75)}px 0 -${a.spacing(.75)}px`},deleteIconSmall:{width:`${a.spacing(2)}px`,height:`${a.spacing(2)}px`,margin:`0 ${a.spacing(.5)}px 0 -${a.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 Kt(a){const r=Qe(a),o=(0,de.Z)(r),c=Ot(o);return{...o,overrides:c}}var nr=t(34505);const Nn=Kt({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",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:nr.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:Je}),pr=Kt({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",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:nr.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:Je});var gn=t(98192),jn=t(15222),$n=t(41547),xr=t(87561);const $r=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(jn.Z,{}),Provider:({children:a})=>(0,n.jsx)($n.Z,{theme:Nn,children:(0,n.jsx)(xr.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(gn.Z,{}),Provider:({children:a})=>(0,n.jsx)($n.Z,{theme:pr,children:(0,n.jsx)(xr.ZP,{children:a})})}];function _n(a){var r,o,c;return cs({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...ps,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:_r,icons:{...ae,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(c=a==null?void 0:a.themes)!==null&&c!==void 0?c:$r})}var mn=t(25271),En=t(76635);async function Lr({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,En.isArray)(c))return;var f;const O=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(En.isString).map(U=>U.split(":")).filter(U=>U.length===4&&U[0]==="entity").map(([U,V,re,Ve])=>(0,mn.eE)({kind:V,namespace:re,name:Ve})).forEach(U=>O.add(U)),await o.set("entityRefs",Array.from(O)),await r.remove("starredEntities")}class ci{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(le())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),Lr(r).then(),this.settingsStore=r.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var zi=t(33414),Vi=t(79324),Br=t(79692),fo=t(65826);const go=(0,Br.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function di(a){var r,o;const c=a.result,f=go(),O=useAnalytics(),U=()=>{O.captureEvent("discover",c.title,{attributes:{to:c.location},value:a.rank})};return _jsxs(Link,{noTrack:!0,to:c.location,onClick:U,children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:f.flexContainer,children:[_jsx(ListItemText,{className:f.itemText,primaryTypographyProps:{variant:"h6"},primary:!((r=a.highlight)===null||r===void 0)&&r.fields.title?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.title,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.title,secondary:!((o=a.highlight)===null||o===void 0)&&o.fields.text?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.text,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.text}),_jsxs(Box,{children:[c.kind&&_jsx(Chip,{label:`Kind: ${c.kind}`,size:"small"}),c.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${c.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var ui=t(86359),yn=t(43297),xs=t(95544),mo=t(99688),bs=t(12231),Ss=t(86136),Zr=t(49378),hi=t(85256),Cs=t(61837),vo=t(79784),Ms=t(50758),zs=t(31654),yo=t(43054),xo=t(65759),rr=t(51666);const ws="catalog-entity",bo=(0,rr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:ws}),So=(0,rr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Co=(0,rr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:ws}),wo=(0,rr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:ws}),jo=(0,rr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Vs=(0,rr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Eo=(0,rr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),Ao=[bo,So,Co,wo,jo,Vs,Eo];var To=t(49166);function Ws(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,O=typeof(r==null?void 0:r.disableUnregister)=="boolean";var U;const V=(U=!o||(O?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&U!==void 0?U:!1;let re=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(re=(0,n.jsxs)(bs.Z,{onClick:()=>{f(),c()},disabled:V,children:[(0,n.jsx)(Ss.Z,{children:(0,n.jsx)(To.Z,{fontSize:"small"})}),(0,n.jsx)(Zr.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:re})}const Hs=(0,Br.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Io(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[O,U]=(0,g.useState)(),V=Hs(),Ve=(0,yn.N$)(Co).allowed,ze=Qt=>{U(Qt.currentTarget)},Ct=()=>{U(void 0)},ut=(0,x.h_)(x.$v),Zt=(0,g.useCallback)(()=>{navigator.clipboard.writeText(window.location.toString()).then(()=>ut.post({message:"Copied!",severity:"info"}))},[ut]),Ft=r&&[...r.map(Qt=>(0,n.jsxs)(bs.Z,{onClick:()=>{Ct(),Qt.onClick()},children:[(0,n.jsx)(Ss.Z,{children:(0,n.jsx)(Qt.Icon,{fontSize:"small"})}),(0,n.jsx)(Zr.Z,{primary:Qt.title})]},Qt.title)),(0,n.jsx)(hi.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Cs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!O,role:"button",onClick:ze,"data-testid":"menu-button",className:V.button,id:"long-menu",children:(0,n.jsx)(yo.Z,{})}),(0,n.jsx)(vo.ZP,{open:Boolean(O),onClose:Ct,anchorEl:O,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(Ms.Z,{children:[Ft,(0,n.jsx)(Ws,{unregisterEntityOptions:o,isUnregisterAllowed:Ve,onUnregisterEntity:c,onClose:Ct}),(0,n.jsxs)(bs.Z,{onClick:()=>{Ct(),f()},children:[(0,n.jsx)(Ss.Z,{children:(0,n.jsx)(zs.Z,{fontSize:"small"})}),(0,n.jsx)(Zr.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(bs.Z,{onClick:()=>{Ct(),Zt()},children:[(0,n.jsx)(Ss.Z,{children:(0,n.jsx)(xo.Z,{fontSize:"small"})}),(0,n.jsx)(Zr.Z,{primary:"Copy entity URL"})]})]})})]})}const Ro="plugin.catalog.entityLayoutRoute",js=()=>null;(0,x.R5)(js,Ro,!0),(0,x.R5)(js,"core.gatherMountPoints",!0);function Gs(a){const{entity:r,title:o}=a;return(0,n.jsxs)(xs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(xs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(yn.LH,{entity:r})]})}function Po(a,r,o,c){var f;const O=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var U;const V=(U=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&U!==void 0?U:"";var re,Ve,ze;return{headerTitle:`${(ze=(Ve=(re=c==null?void 0:c.metadata.title)!==null&&re!==void 0?re:o)!==null&&Ve!==void 0?Ve:c==null?void 0:c.metadata.name)!==null&&ze!==void 0?ze:""}${V&&V!==mn.zG?` in ${V}`:""}`,headerType:(()=>{let ut=O.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(ut+=" \u2014 ",ut+=c.spec.type.toLocaleLowerCase("en-US")),ut})()}}function Gn(a){var r;const{entity:o}=a,c=(0,yn.hF)(o,mn.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(It.i9,{label:"Owner",value:(0,n.jsx)(yn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(It.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const pi=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:O,NotFoundComponent:U}=a,{kind:V,namespace:re,name:Ve}=(0,x.Oi)(yn.wi),{entity:ze,loading:Ct,error:ut}=(0,yn.ce)(),Zt=(0,z.TH)(),Ft=(0,x.vJ)(O,ei=>ei.selectByComponentData({key:Ro,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Sr})=>{if(ze){if(Sr.if&&!Sr.if(ze))return[]}else return[];return[{path:Sr.path,title:Sr.title,children:Sr.children,tabProps:Sr.tabProps}]}),[ze]),{headerTitle:Qt,headerType:An}=Po(V,re,Ve,ze),[Yn,Fn]=(0,g.useState)(!1),[or,br]=(0,g.useState)(!1),_o=(0,z.s0)(),lo=async()=>{Fn(!1),br(!1),_o("/")};(0,g.useEffect)(()=>{Fn(!1),br(!1)},[Zt.pathname]);var Ls;return(0,n.jsxs)(It.T3,{themeId:(Ls=ze==null||(r=ze.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&Ls!==void 0?Ls:"home",children:[(0,n.jsx)(It.h4,{title:(0,n.jsx)(Gs,{title:Qt,entity:ze}),pageTitleOverride:Qt,type:An,children:ze&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Gn,{entity:ze}),(0,n.jsx)(Io,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Fn(!0),onInspectEntity:()=>br(!0)})]})}),Ct&&(0,n.jsx)(It.Ex,{}),ze&&(0,n.jsx)(It.tn,{routes:Ft}),ut&&(0,n.jsx)(It.VY,{children:(0,n.jsx)(mo.Z,{severity:"error",children:ut.toString()})}),!Ct&&!ut&&!ze&&(0,n.jsx)(It.VY,{children:U||(0,n.jsxs)(It.GB,{title:"Entity not found",children:["There is no ",V," with the requested"," ",(0,n.jsx)(It.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(yn.pp,{open:Yn,entity:ze,onConfirm:lo,onClose:()=>Fn(!1)}),(0,n.jsx)(yn.U_,{open:or,entity:ze,onClose:()=>br(!1)})]})};pi.Route=js;var Wi=t(23054);function Hi(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[O,U]=useState(!1),V=useApi(catalogApiRef),re=useApi(alertApiRef),Ve=async()=>{U(!0);try{const ze=f.metadata.uid;await V.removeEntityByUid(ze),c()}catch(ze){assertError(ze),re.post({message:ze.message})}finally{U(!1)}};return _jsxs(Dialog,{open:r,onClose:o,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:O,onClick:Ve,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Es=t(19625);function Gi(a){var r,o;return(a==null||(r=a.metadata)===null||r===void 0||(o=r.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function Ki(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),O=async()=>{c(!1),a(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:f,onConfirm:O,onClose:()=>c(!1)})]})}var fi=t(29644);const gi=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Dr(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var O,U;return{errors:((U=(O=f.entity.status)===null||O===void 0?void 0:O.items)!==null&&U!==void 0?U:[]).filter(gi).map(Ve=>Ve.error).filter(Ve=>Boolean(Ve)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Yi(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Dr(stringifyEntityRef(a),o)).items.length>0}function Ji(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:O}=useAsync(async()=>Dr(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!O?null:_jsx(_Fragment,{children:O.items.map((U,V)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(U.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:U.entity})]}),U.errors.map((re,Ve)=>_jsx(ResponseErrorPanel,{error:re},Ve))]},V))})}const Ks="core.backstage.entitySwitch",Ys=a=>null;(0,x.R5)(Ys,Ks,!0);const As=a=>{var r;const{entity:o,loading:c}=(0,yn.ce)(),f=(0,x.I_)(),O=(0,x.vJ)(a.children,re=>re.selectByComponentData({key:Ks,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ve=>{if(c)return[];const{if:ze,children:Ct}=Ve.props;if(!o)return[{if:ze===void 0,children:Ct}];var ut;return[{if:(ut=ze==null?void 0:ze(o,{apis:f}))!==null&&ut!==void 0?ut:!0,children:Ct}]}),[f,o,c]);if(O.some(re=>typeof re.if=="object"&&"then"in re.if))return(0,n.jsx)(Lo,{results:O});var V;return(V=(r=O.find(re=>re.if))===null||r===void 0?void 0:r.children)!==null&&V!==void 0?V:null};function Lo({results:a}){const{loading:r,value:o}=(0,rn.default)(async()=>{const c=a.map(async({if:O,children:U})=>{try{if(await O)return U}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return r||!o?null:o}As.Case=Ys;const mi=null,vi=yn._i.Filters,Js=yn._i.Content,xn=(0,x.rx)({id:"catalog",apis:[(0,x.ni)({api:yn.Ah,deps:{discoveryApi:x.NW,fetchApi:x.gP},factory:({discoveryApi:a,fetchApi:r})=>new fi.MS({discoveryApi:a,fetchApi:r})}),(0,x.ni)({api:yn.p3,deps:{storageApi:x.E6},factory:({storageApi:a})=>new ci({storageApi:a})})],routes:{catalogIndex:Es._Z,catalogEntity:yn.wi},externalRoutes:{createComponent:Es.yw,viewTechDoc:Es.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),ko=xn.provide((0,x.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Es._Z})),Qs=xn.provide((0,x.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:yn.wi})),fr=xn.provide((0,x.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),yi=xn.provide((0,x.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),Oo=xn.provide((0,x.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),xi=xn.provide((0,x.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),Qi=xn.provide((0,x.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),sr=xn.provide((0,x.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),$o=xn.provide((0,x.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),Ts=xn.provide((0,x.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),Bo=xn.provide((0,x.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),Is=xn.provide((0,x.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Rs=t(32838);class Xs{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(r,o){const f=`${await this.getApiOrigin()}/${o}`,O=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(O.status===404)throw new Error("Page not found");return O.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,o,c){const f=await this.getApiOrigin();return new URL(r,`${f}/${c}`).toString()}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}class _s{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}const Zo=[(0,x.ni)({api:je.Dl,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Xs({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:je.gT,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new _s({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:Rs.q3,deps:{configApi:x.Ds},factory:({configApi:a})=>Rs.ae.fromConfig(a)})],Nr={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Do={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function eo(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function No(){const a=await Hr(),r=await eo();return[...a,{context:"detected",data:r?Nr:Do}]}var to=t(58845);const no=(0,Br.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var ro=()=>{const a=no();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.jsx)("path",{className:a.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 so=(0,Br.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Uo=()=>{const a=so();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.jsx)("path",{className:a.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 Mo=(0,Br.Z)({root:{width:It.po.drawerWidthClosed,height:3*It.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:It.po.drawerWidthClosed,marginLeft:24}}),zo=()=>{const a=Mo(),{isOpen:r}=(0,It.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(It.rU,{to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(ro,{}):(0,n.jsx)(Uo,{})})})},Vo=({children:a})=>(0,n.jsxs)(It.tR,{children:[(0,n.jsxs)(It.YE,{children:[(0,n.jsx)(zo,{}),(0,n.jsx)(It.v7,{}),(0,n.jsx)(It.R6,{icon:to.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var Wo=t(80030),Ho=t(32388),Go=t(4142);const io=(0,Br.Z)(a=>({headerIcon:{color:a.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:a.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var Kn;(function(a){a.LIGHT="light",a.DARK="dark"})(Kn||(Kn={}));const Ko=()=>{const a=(0,x.h_)(x.hg),r=io(),[o,c]=(0,g.useState)(a.getActiveThemeId()===Kn.DARK?Kn.DARK:Kn.LIGHT),f={[Kn.LIGHT]:{icon:Go.Z,title:"Dark theme"},[Kn.DARK]:{icon:Ho.Z,title:"Light theme"}},{title:O,icon:U}=f[o],V=()=>{c(re=>{const Ve=re===Kn.LIGHT?Kn.DARK:Kn.LIGHT;return a.setActiveThemeId(Ve),Ve})};return(0,n.jsx)(xs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(Wo.ZP,{title:O,arrow:!0,children:(0,n.jsx)(Cs.Z,{size:"small",onClick:V,children:(0,n.jsx)(U,{className:r.headerIcon})})})})},Yo=()=>(0,n.jsxs)(T.I6,{children:[(0,n.jsx)(F.S,{}),(0,n.jsx)(Q.F,{withSearch:!1})]}),Jo=(0,n.jsx)(Yo,{}),Ps=_n({apis:Zo,configLoader:No,plugins:Object.values(h)}),Qo=Ps.getProvider(),ao=Ps.getRouter(),Bn=T.s4.provide((0,je.KY)({name:"ThemeToggleAddon",component:Ko,location:je.oZ.Header})),Xo=(0,n.jsxs)(Xr,{children:[(0,n.jsx)(z.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(z.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(Qs,{})}),(0,n.jsx)(z.AW,{path:"/docs",element:(0,n.jsx)(T.Jl,{}),children:(0,n.jsx)(I.u,{})}),(0,n.jsxs)(z.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(T.I6,{}),children:[Jo,(0,n.jsx)(je.DR,{children:(0,n.jsx)(Bn,{})})]})]});var qo=()=>(0,n.jsx)(Qo,{children:(0,n.jsx)(ao,{children:(0,n.jsx)(Vo,{children:Xo})})});L.render((0,n.jsx)(qo,{}),document.getElementById("root"))},51837:function(wt,Ue,t){"use strict";t.d(Ue,{CT:function(){return x},EI:function(){return ne},uW:function(){return L},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),g=q=>`__@backstage/${q}__`;function L(q,ee){const F=g(q);let Q=n[F];return Q||(Q=ee(),n[F]=Q,Q)}var z=t(2784);function x(q){return L(q,()=>(0,z.createContext)(void 0))}function l(q){return(0,z.useContext)(x(q))}function k(q){return{set(ee){globalThis[`__@backstage/${q}__`]=createContext(createVersionedValueMap(ee))},reset(){delete globalThis[`__@backstage/${q}__`]}}}function ne(q){return Object.freeze(q),{atVersion(ee){return q[ee]}}}},43297:function(wt,Ue,t){"use strict";t.d(Ue,{h$:function(){return on},n3:function(){return h.n3},_i:function(){return $},zo:function(){return Re},tW:function(){return M},df:function(){return se},UO:function(){return Ln},dq:function(){return it},nl:function(){return ys},dx:function(){return at},rI:function(){return ct},u3:function(){return Rt},xE:function(){return Nt},sL:function(){return Dt},LH:function(){return er},U_:function(){return ds},pp:function(){return ts},EW:function(){return Ds},Ah:function(){return g},wi:function(){return gt},hF:function(){return dt},CV:function(){return We},$3:function(){return Ie},p3:function(){return L},ce:function(){return un},X2:function(){return Wt},wp:function(){return Gt},ZW:function(){return yt},N$:function(){return P},eK:function(){return vn},CR:function(){return Ae}});var h=t(29644),n=t(25248);const g=(0,n.T0)({id:"plugin.catalog.service"}),L=(0,n.T0)({id:"catalog-react.starred-entities"});var z=t(82394);class x{async toggleStarred(b){this.starredEntities.delete(b)||this.starredEntities.add(b);for(const R of this.subscribers)R.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(b=>(b.next(new Set(this.starredEntities)),this.subscribers.add(b),()=>{this.subscribers.delete(b)}))}}var l=t(52322),k=t(2784),ne=t(41156),q=t(60364),ee=t(77277),F=t(4190),Q=t(95544),_=t(90436),ve=t(60905),ue=t(36444);const A=y=>{const b=(0,ne.Z)(K=>K.breakpoints.down("md")),R=(0,q.Z)(),[D,G]=(0,k.useState)(!1);return b?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ee.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>G(!0),startIcon:(0,l.jsx)(ue.Z,{}),children:"Filters"}),(0,l.jsx)(F.ZP,{open:D,onClose:()=>G(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(Q.Z,{m:2,children:[(0,l.jsx)(_.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),y.children]})})]}):(0,l.jsx)(ve.Z,{item:!0,lg:2,children:y.children})},I=y=>(0,l.jsx)(ve.Z,{item:!0,xs:12,lg:10,children:y.children}),$=y=>(0,l.jsx)(ve.Z,{container:!0,style:{position:"relative"},children:y.children});$.Filters=A,$.Content=I;var E=t(93414),T=t(82108),X=t.n(T),je=t(829),Ke=t.n(je),Me=t(64279),Ee=t(25271),qe=t(51837);const gt=(0,qe.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ze(y){var b,R;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(R=(b=y.metadata.namespace)===null||b===void 0?void 0:b.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:y.metadata.name}}function Ie(y,b){const R=b==null?void 0:b.defaultKind;let D,G,K;return"metadata"in y?(D=y.kind,G=y.metadata.namespace,K=y.metadata.name):(D=y.kind,G=y.namespace,K=y.name),(G===void 0||G==="")&&(G=Ee.zG),(b==null?void 0:b.defaultNamespace)!==void 0?(b==null?void 0:b.defaultNamespace)===G&&(G=void 0):G===Ee.zG&&(G=void 0),D=D.toLocaleLowerCase("en-US"),D=R&&R.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${G?`${G}/`:""}${K}`}var nt=t(80030);const at=(0,k.forwardRef)((y,b)=>{const{entityRef:R,defaultKind:D,title:G,children:K,...ae}=y,de=(0,n.tg)(gt);let be,we,Pe;if(typeof R=="string"){const Qe=(0,Ee.of)(R);be=Qe.kind,we=Qe.namespace,Pe=Qe.name}else"metadata"in R?(be=R.kind,we=R.metadata.namespace,Pe=R.metadata.name):(be=R.kind,we=R.namespace,Pe=R.name);be=be.toLocaleLowerCase("en-US");var Te;we=(Te=we==null?void 0:we.toLocaleLowerCase("en-US"))!==null&&Te!==void 0?Te:Ee.zG;const Je={kind:be,namespace:we,name:Pe},xt=Ie({kind:be,namespace:we,name:Pe},{defaultKind:D}),Et=(0,l.jsxs)(E.rU,{...ae,ref:b,to:de(Je),children:[K,!K&&(G!=null?G:xt)]});return G?(0,l.jsx)(nt.ZP,{title:xt,children:Et}):Et});function rt(y){const{entityRefs:b,defaultKind:R,getTitle:D,...G}=y,K=(0,n.h_)(g),{value:ae=new Array,loading:de,error:be}=(0,Me.default)(async()=>{const we=b.reduce((Te,Je)=>"metadata"in Je?Te:[...Te,(0,Ee.of)(Je)],new Array),Pe=b.filter(Te=>"metadata"in Te);return we.length>0?[...(await K.getEntities({filter:we.map(Te=>({kind:Te.kind,"metadata.namespace":Te.namespace,"metadata.name":Te.name}))})).items,...Pe]:Pe},[b]);return de?(0,l.jsx)(E.Ex,{}):be?(0,l.jsx)(E.yu,{error:be}):(0,l.jsx)(l.Fragment,{children:ae.map((we,Pe)=>(0,l.jsxs)(k.Fragment,{children:[Pe>0&&", ",(0,l.jsx)(at,{...G,defaultKind:R,entityRef:we,title:D(we)})]},Pe))})}function ct(y){const{entityRefs:b,defaultKind:R,fetchEntities:D,getTitle:G,...K}=y;return D?(0,l.jsx)(rt,{...K,defaultKind:R,entityRefs:b,getTitle:G}):(0,l.jsx)(l.Fragment,{children:b.map((ae,de)=>(0,l.jsxs)(k.Fragment,{children:[de>0&&", ",(0,l.jsx)(at,{...K,defaultKind:R,entityRef:ae,title:G?G(ae):void 0})]},de))})}function lt(y){return y.reduce((b,R)=>({...b,...R.getCatalogFilters?R.getCatalogFilters():{}}),{})}function mt(y){return b=>y.every(R=>!R.filterEntity||R.filterEntity(b))}function dt(y,b,R){var D;let G=(y==null||(D=y.relations)===null||D===void 0?void 0:D.filter(K=>K.type===b).map(K=>(0,Ee.of)(K.targetRef)))||[];return R!=null&&R.kind&&(G=G.filter(K=>K.kind.toLocaleLowerCase("en-US")===R.kind.toLocaleLowerCase("en-US"))),G}function We(y,b){var R;const D=(R=y.metadata.annotations)===null||R===void 0?void 0:R[Ee.M6];if(!!D)try{const G=(0,Ee.Ou)(D),K=b.byUrl(G.target);return{locationTargetUrl:G.target,integrationType:K==null?void 0:K.type}}catch{return}}function le(y,b){const R=new Set([...getEntityRelations(y,RELATION_MEMBER_OF,{kind:"group"}),...y?[getCompoundEntityRef(y)]:[]].map(stringifyEntityRef)),D=getEntityRelations(b,RELATION_OWNED_BY).map(stringifyEntityRef);for(const G of D)if(R.has(G))return!0;return!1}class Re{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(b){this.value=b}}class ke{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(b){this.value=b}}class st{filterEntity(b){var R;return this.values.every(D=>((R=b.metadata.tags)!==null&&R!==void 0?R:[]).includes(D))}toQueryValue(){return this.values}constructor(b){this.values=b}}class vt{filterEntity(b){const R=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([b.metadata.tags]),G=this.toUpperArray([b.metadata.name,b.metadata.title]);for(const K of R)if(D.every(ae=>ae!==K)&&G.every(ae=>!ae.includes(K)))return!1;return!0}toUpperArray(b){return b.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(b){this.value=b}}class At{filterEntity(b){return this.values.some(R=>dt(b,Ee.S4).some(D=>Ie(D,{defaultKind:"group"})===R))}toQueryValue(){return this.values}constructor(b){this.values=b}}class ht{filterEntity(b){return this.values.some(R=>{var D;return((D=b.spec)===null||D===void 0?void 0:D.lifecycle)===R})}toQueryValue(){return this.values}constructor(b){this.values=b}}class bt{filterEntity(b){switch(this.value){case"owned":return this.isOwnedEntity(b);case"starred":return this.isStarredEntity(b);default:return!0}}toQueryValue(){return this.value}constructor(b,R,D){this.value=b,this.isOwnedEntity=R,this.isStarredEntity=D}}class kt{filterEntity(b){var R;const D=(R=b.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(b){this.value=b}}class $t{filterEntity(b){var R,D;const G=(b==null||(R=b.status)===null||R===void 0||(D=R.items)===null||D===void 0?void 0:D.length)>0;return G!==void 0&&this.value===G}constructor(b){this.value=b}}const en=(0,qe.CT)("entity-context"),on=({children:y,entity:b,loading:R,error:D,refresh:G})=>{const K={entity:b,loading:R,error:D,refresh:G};return(0,l.jsx)(en.Provider,{value:(0,qe.EI)({1:K}),children:(0,l.jsx)(n.fC,{attributes:{...b?{entityRef:(0,Ee.eE)(b)}:void 0},children:y})})},Vt=y=>_jsx(on,{entity:y.entity,loading:!Boolean(y.entity),error:void 0,refresh:void 0,children:y.children});function Wt(){const y=(0,qe.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const b=y.atVersion(1);if(!b)throw new Error("EntityContext v1 not available");if(!b.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:b.entity}}function un(){const y=(0,qe.Vt)("entity-context");if(!y)throw new Error("Entity context is not available");const b=y.atVersion(1);if(!b)throw new Error("EntityContext v1 not available");const{entity:R,loading:D,error:G,refresh:K}=b;return{entity:R,loading:D,error:G,refresh:K}}var _t=t(76635),Rn=t(19126),cn=t.n(Rn),Pn=t(10289),hn=t(69294),Jn=t(48760),Ht=t(90736);const bn=(0,k.createContext)(void 0),Ln=({children:y})=>{const b=(0,Ht.default)(),R=(0,n.h_)(g),[D,G]=(0,k.useState)({}),K=(0,Pn.TH)();var ae;const de=(0,k.useMemo)(()=>(ae=cn().parse(K.search,{ignoreQueryPrefix:!0}).filters)!==null&&ae!==void 0?ae:{},[K]),[be,we]=(0,k.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Pe,error:Te},Je]=(0,hn.default)(async()=>{const Qe=(0,_t.compact)(Object.values(D)),Ot=mt(Qe),Kt=lt(Qe),nr=lt((0,_t.compact)(Object.values(be.appliedFilters))),Nn=Object.keys(D).reduce((gn,jn)=>{const $n=D[jn];return $n!=null&&$n.toQueryValue&&(gn[jn]=$n.toQueryValue()),gn},{});if((0,_t.isEqual)(nr,Kt))we({appliedFilters:D,backendEntities:be.backendEntities,entities:be.backendEntities.filter(Ot)});else{const gn=await R.getEntities({filter:Kt});we({appliedFilters:D,backendEntities:gn.items,entities:gn.items.filter(Ot)})}if(b()){var pr;const gn=cn().parse(K.search,{ignoreQueryPrefix:!0}),jn=cn().stringify({...gn,filters:Nn},{addQueryPrefix:!0,arrayFormat:"repeat"}),$n=`${window.location.pathname}${jn}`;(pr=window.history)===null||pr===void 0||pr.replaceState(null,document.title,$n)}},[R,de,D,be],{loading:!0});(0,Jn.Z)(Je,10,[D]);const xt=(0,k.useCallback)(Qe=>{G(Ot=>{const Kt=typeof Qe=="function"?Qe(Ot):Qe;return{...Ot,...Kt}})},[]),Et=(0,k.useMemo)(()=>({filters:be.appliedFilters,entities:be.entities,backendEntities:be.backendEntities,updateFilters:xt,queryParameters:de,loading:Pe,error:Te}),[be,xt,de,Pe,Te]);return(0,l.jsx)(bn.Provider,{value:Et,children:y})};function Gt(){const y=(0,k.useContext)(bn);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var pn=t(18149),dn=t.n(pn);function Sn(){const y=(0,n.h_)(g),{filters:{kind:b,type:R},queryParameters:{type:D},updateFilters:G}=Gt(),K=(0,k.useMemo)(()=>[D].flat().filter(Boolean),[D]);var ae;const[de,be]=(0,k.useState)(K.length?K:(ae=R==null?void 0:R.getTypes())!==null&&ae!==void 0?ae:[]);(0,k.useEffect)(()=>{K.length&&be(K)},[K]);const[we,Pe]=(0,k.useState)([]),Te=(0,k.useMemo)(()=>b==null?void 0:b.value,[b]),{error:Je,loading:xt,value:Et}=(0,Me.default)(async()=>Te?await y.getEntityFacets({filter:{kind:Te},facets:["spec.type"]}).then(Kt=>Kt.facets["spec.type"]||[]):[],[Te,y]),Qe=(0,k.useRef)(Et);return(0,k.useEffect)(()=>{const Ot=Qe.current;if(Qe.current=Et,xt||!Te||Ot===Et||!Et)return;const Kt=[...new Set(Ke()(Et,Nn=>-Nn.count).map(Nn=>Nn.value.toLocaleLowerCase("en-US")))];Pe(Kt);const nr=de.filter(Nn=>Kt.includes(Nn));dn()(de,nr)||be(nr)},[xt,Te,de,be,Et]),(0,k.useEffect)(()=>{G({type:de.length?new ke(de):void 0})},[de,G]),{loading:xt,error:Je,availableTypes:we,selectedTypes:de,setSelectedTypes:be}}const kn=20;function vn(y,b){var R,D;const G=b==null||(R=b.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),K=b==null||(D=b.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),ae=(0,n.h_)(g),{loading:de,value:be,error:we}=(0,Me.default)(async()=>{var Pe;const Te=(Pe=y.relations)===null||Pe===void 0?void 0:Pe.map(Qe=>({type:Qe.type,target:(0,Ee.of)(Qe.targetRef)})).filter(Qe=>(!G||Qe.type.toLocaleLowerCase("en-US")===G)&&(!K||Qe.target.kind===K));if(!Te)return[];const Je=Object.values((0,_t.groupBy)(Te,({target:Qe})=>`${Qe.kind}:${Qe.namespace}`.toLocaleLowerCase("en-US"))),xt=[];for(const Qe of Je)xt.push({kind:Qe[0].target.kind,namespace:Qe[0].target.namespace,nameBatches:(0,_t.chunk)(Qe.map(Ot=>Ot.target.name),kn)});return(await Promise.all(xt.flatMap(Qe=>Qe.nameBatches.map(Ot=>ae.getEntities({filter:{kind:Qe.kind,"metadata.namespace":Qe.namespace,"metadata.name":Ot}}))))).flatMap(Qe=>Qe.items)},[y,G,K]);return{entities:be,loading:de,error:we}}var ge=t(72164);function te(y){return typeof y=="string"?y:(0,Ee.eE)(y)}function Ae(){const y=(0,n.h_)(L),b=(0,ge.Z)(y.starredEntitie$(),new Set),R=(0,k.useCallback)(G=>b.has(te(G)),[b]),D=(0,k.useCallback)(G=>y.toggleStarred(te(G)).then(),[y]);return{starredEntities:b,toggleStarredEntity:D,isStarredEntity:R}}function Ne(y){return typeof y=="string"?y:(0,Ee.eE)(y)}function Xe(y){const b=(0,n.h_)(L),[R,D]=(0,k.useState)(!1);return(0,k.useEffect)(()=>{const K=b.starredEntitie$().subscribe({next(ae){D(ae.has(Ne(y)))}});return()=>{K.unsubscribe()}},[y,b]),{toggleStarredEntity:(0,k.useCallback)(()=>b.toggleStarred(Ne(y)).then(),[y,b]),isStarredEntity:R}}function yt(){const y=(0,n.h_)(n.$4),{loading:b,value:R}=(0,Me.default)(async()=>{const{ownershipEntityRefs:G}=await y.getBackstageIdentity();return G},[]),D=(0,k.useMemo)(()=>{const G=new Set(R!=null?R:[]);return K=>{const ae=dt(K,Ee.S4).map(Ee.eE);for(const de of ae)if(G.has(de))return!0;return!1}},[R]);return(0,k.useMemo)(()=>({loading:b,isOwnedEntity:D}),[b,D])}var ie=t(25488);function P(y){const{entity:b,loading:R,error:D}=un(),{allowed:G,loading:K,error:ae}=(0,ie.gI)({permission:y,resourceRef:b?(0,Ee.eE)(b):void 0});return R||K?{loading:!0,allowed:!1}:D?{loading:!1,allowed:!1,error:D}:{loading:!1,allowed:G,error:ae}}function J(){const y=(0,n.h_)(g),[b,R]=(0,k.useState)([]),{error:D,loading:G,value:K}=(0,Me.default)(async()=>{const de="kind";return await y.getEntityFacets({facets:[de]}).then(we=>we.facets[de]||[])},[y]),ae=(0,k.useRef)(K);return(0,k.useEffect)(()=>{const de=ae.current;if(ae.current=K,G||de===K||!K)return;const be=[...new Set(Ke()(K,we=>we.value).map(we=>we.value.toLocaleLowerCase("en-US")))];R(be)},[G,K,R]),{loading:G,error:D,availableKinds:b}}function He(y){var b;const{filters:R,queryParameters:{kind:D},updateFilters:G}=Gt(),K=(0,k.useMemo)(()=>[D].flat()[0],[D]);var ae;const[de,be]=(0,k.useState)((ae=K!=null?K:(b=R.kind)===null||b===void 0?void 0:b.value)!==null&&ae!==void 0?ae:y.initialFilter);(0,k.useEffect)(()=>{K&&be(K)},[K]),(0,k.useEffect)(()=>{var Je;if(!((Je=R.kind)===null||Je===void 0)&&Je.value){var xt;be((xt=R.kind)===null||xt===void 0?void 0:xt.value)}},[R.kind]);const{availableKinds:we,loading:Pe,error:Te}=J();return(0,k.useEffect)(()=>{G({kind:de?new Re(de):void 0})},[de,G]),{loading:Pe,error:Te,availableKinds:we,selectedKind:de,setSelectedKind:be}}const M=y=>{const{hidden:b,initialFilter:R="component"}=y,D=(0,n.h_)(n.$v),{error:G,availableKinds:K,selectedKind:ae,setSelectedKind:de}=He({initialFilter:R});if((0,k.useEffect)(()=>{G&&D.post({message:"Failed to load entity kinds",severity:"error"})},[G,D]),(K==null?void 0:K.length)===0||G)return null;const be=[...K.map(we=>({value:we,label:X()(we)}))];return b?null:(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsx)(E.Ph,{label:"Kind",items:be,selected:ae,onChange:we=>de(String(we))})})};var Z=t(79692),ce=t(5806),pe=t(21324),Se=t(86619),De=t(19996),$e=t(25505),Ge=t(38016),tt=t(88013);const C=(0,Z.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),H=(0,l.jsx)($e.Z,{fontSize:"small"}),he=(0,l.jsx)(De.Z,{fontSize:"small"}),se=()=>{var y;const b=C(),{updateFilters:R,backendEntities:D,filters:G,queryParameters:{lifecycles:K}}=Gt(),ae=(0,k.useMemo)(()=>[K].flat().filter(Boolean),[K]);var de;const[be,we]=(0,k.useState)(ae.length?ae:(de=(y=G.lifecycles)===null||y===void 0?void 0:y.values)!==null&&de!==void 0?de:[]);(0,k.useEffect)(()=>{ae.length&&we(ae)},[ae]),(0,k.useEffect)(()=>{R({lifecycles:be.length?new ht(be):void 0})},[be,R]);const Pe=(0,k.useMemo)(()=>[...new Set(D.map(Te=>{var Je;return(Je=Te.spec)===null||Je===void 0?void 0:Je.lifecycle}).filter(Boolean))].sort(),[D]);return Pe.length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(tt.ZP,{multiple:!0,options:Pe,value:be,onChange:(Te,Je)=>we(Je),renderOption:(Te,{selected:Je})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:H,checkedIcon:he,checked:Je}),label:Te}),size:"small",popupIcon:(0,l.jsx)(Ge.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Te=>(0,l.jsx)(Se.Z,{...Te,className:b.input,variant:"outlined"})})]})}):null},xe=(0,Z.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Oe=(0,l.jsx)($e.Z,{fontSize:"small"}),Fe=(0,l.jsx)(De.Z,{fontSize:"small"}),it=()=>{var y;const b=xe(),{updateFilters:R,backendEntities:D,filters:G,queryParameters:{owners:K}}=Gt(),ae=(0,k.useMemo)(()=>[K].flat().filter(Boolean),[K]);var de;const[be,we]=(0,k.useState)(ae.length?ae:(de=(y=G.owners)===null||y===void 0?void 0:y.values)!==null&&de!==void 0?de:[]);(0,k.useEffect)(()=>{ae.length&&we(ae)},[ae]),(0,k.useEffect)(()=>{R({owners:be.length?new At(be):void 0})},[be,R]);const Pe=(0,k.useMemo)(()=>[...new Set(D.flatMap(Te=>dt(Te,Ee.S4).map(Je=>Ie(Je,{defaultKind:"group"}))).filter(Boolean))].sort(),[D]);return Pe.length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(tt.ZP,{multiple:!0,options:Pe,value:be,onChange:(Te,Je)=>we(Je),renderOption:(Te,{selected:Je})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:Oe,checkedIcon:Fe,checked:Je}),label:Te}),size:"small",popupIcon:(0,l.jsx)(Ge.Z,{"data-testid":"owner-picker-expand"}),renderInput:Te=>(0,l.jsx)(Se.Z,{...Te,className:b.input,variant:"outlined"})})]})}):null},jt=(0,Z.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),ft=()=>{var y;const b=jt(),{filters:R,updateFilters:D}=useEntityList();var G;const[K,ae]=useState((G=(y=R.text)===null||y===void 0?void 0:y.value)!==null&&G!==void 0?G:"");return useDebounce(()=>{D({text:K.length?new EntityTextFilter(K):void 0})},250,[K,D]),_jsx(Toolbar,{className:b.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:b.input,placeholder:"Search",autoComplete:"off",onChange:de=>ae(de.target.value),value:K,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ae(""),edge:"end",disabled:K.length===0,children:_jsx(Clear,{})})})})})})},_e=Object.freeze({createEntityRefColumn(y){const{defaultKind:b}=y;function R(D){var G;return((G=D.metadata)===null||G===void 0?void 0:G.title)||Ie(D,{defaultKind:b})}return{title:"Name",highlight:!0,customFilterAndSearch(D,G){return R(G).includes(D)},customSort(D,G){return R(D).localeCompare(R(G))},render:D=>{var G;return(0,l.jsx)(at,{entityRef:D,defaultKind:b,title:(G=D.metadata)===null||G===void 0?void 0:G.title})}}},createEntityRelationColumn(y){const{title:b,relation:R,defaultKind:D,filter:G}=y;function K(de){return dt(de,R,G)}function ae(de){return K(de).map(be=>Ie(be,{defaultKind:D})).join(", ")}return{title:b,customFilterAndSearch(de,be){return ae(be).includes(de)},customSort(de,be){return ae(de).localeCompare(ae(be))},render:de=>(0,l.jsx)(ct,{entityRefs:K(de),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:Ee.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:Ee.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:Ee.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,l.jsx)(E.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ot=[_e.createEntityRefColumn({defaultKind:"system"}),_e.createDomainColumn(),_e.createOwnerColumn(),_e.createMetadataDescriptionColumn()],St=[_e.createEntityRefColumn({defaultKind:"component"}),_e.createSystemColumn(),_e.createOwnerColumn(),_e.createSpecTypeColumn(),_e.createSpecLifecycleColumn(),_e.createMetadataDescriptionColumn()],Tt=(0,Z.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),Rt=y=>{const{entities:b,title:R,emptyContent:D,variant:G="gridItem",columns:K}=y,ae=Tt(),de={minWidth:"0",width:"100%"};return G==="gridItem"&&(de.height="calc(100% - 10px)"),(0,l.jsx)(E.iA,{columns:K,title:R,style:de,emptyContent:D&&(0,l.jsx)("div",{className:ae.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:b})};Rt.columns=_e,Rt.systemEntityColumns=ot,Rt.componentEntityColumns=St;const Ut=(0,Z.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Qn=(0,l.jsx)($e.Z,{fontSize:"small"}),zn=(0,l.jsx)(De.Z,{fontSize:"small"}),Nt=y=>{var b;const R=Ut(),{updateFilters:D,filters:G,queryParameters:{tags:K}}=Gt(),ae=(0,n.h_)(g),{value:de}=(0,Me.default)(async()=>{var Je;const xt="metadata.tags",{facets:Et}=await ae.getEntityFacets({facets:[xt],filter:(Je=G.kind)===null||Je===void 0?void 0:Je.getCatalogFilters()});return Object.fromEntries(Et[xt].map(({value:Qe,count:Ot})=>[Qe,Ot]))},[G.kind]),be=(0,k.useMemo)(()=>[K].flat().filter(Boolean),[K]);var we;const[Pe,Te]=(0,k.useState)(be.length?be:(we=(b=G.tags)===null||b===void 0?void 0:b.values)!==null&&we!==void 0?we:[]);return(0,k.useEffect)(()=>{be.length&&Te(be)},[be]),(0,k.useEffect)(()=>{D({tags:Pe.length?new st(Pe):void 0})},[Pe,D]),Object.keys(de!=null?de:{}).length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(tt.ZP,{multiple:!0,options:Object.keys(de!=null?de:{}),value:Pe,onChange:(Je,xt)=>Te(xt),renderOption:(Je,{selected:xt})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:Qn,checkedIcon:zn,checked:xt}),label:y.showCounts?`${Je} (${de==null?void 0:de[Je]})`:Je}),size:"small",popupIcon:(0,l.jsx)(Ge.Z,{"data-testid":"tag-picker-expand"}),renderInput:Je=>(0,l.jsx)(Se.Z,{...Je,className:R.input,variant:"outlined"})})]})}):null},Dt=y=>{const{hidden:b,initialFilter:R}=y,D=(0,n.h_)(n.$v),{error:G,availableTypes:K,selectedTypes:ae,setSelectedTypes:de}=Sn();if((0,k.useEffect)(()=>{G&&D.post({message:"Failed to load entity types",severity:"error"}),R&&de([R])},[G,D,R,de]),K.length===0||G)return null;const be=[{value:"all",label:"all"},...K.map(Pe=>({value:Pe,label:Pe}))];var we;return b?null:(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsx)(E.Ph,{label:"Type",items:be,selected:(we=be.length>1?ae[0]:void 0)!==null&&we!==void 0?we:"all",onChange:Pe=>de(Pe==="all"?[]:[String(Pe)])})})};var rn=t(15459),Cn=t(61837),an=t(11640),On=t(28347);const Vn=(0,rn.Z)({root:{color:"#f3ba37"}})(an.Z),er=y=>{const{toggleStarredEntity:b,isStarredEntity:R}=Xe(y.entity);return(0,l.jsx)(Cn.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>b(),children:(0,l.jsx)(nt.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,l.jsx)(Vn,{}):(0,l.jsx)(On.Z,{})})})};var Wn=t(8629),Zn=t(79249),ur=t(38724),Xn=t(99152),S=t(6487),d=t(49429),m=t(55999),w=t(72779),Y=t.n(w),me=t(39412);const Ce=me.Z;function Be(y,b){if(y)return y.toLocaleLowerCase("en-US");if(b)try{return(0,Ee.of)(b).kind.toLocaleLowerCase("en-US")}catch{return}}function pt(y,b){const R=(0,n.qD)(),D=Be(y,b);return D&&R.getSystemIcon(`kind:${D}`)||Ce}function Bt(y){const{kind:b,entityRef:R,...D}=y,G=pt(b,R);return(0,l.jsx)(G,{...D})}const tn=(0,Z.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function Dn(y){const b=(0,n.h_)(g),R=(0,Ee.eE)(y),{loading:D,error:G,value:K}=(0,Me.default)(async()=>{const ae=await b.getEntityAncestors({entityRef:R}),de=new Array,be=new Array;for(const we of ae.items){const Pe=(0,Ee.eE)(we.entity),Te=Pe===ae.rootEntityRef;de.push({id:Pe,root:Te,...we.entity});for(const Je of we.parentEntityRefs)be.push({from:Pe,to:Je})}return{nodes:de,edges:be}},[R]);return{loading:D,error:G,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function mr({node:y}){const b=tn(),R=(0,Pn.s0)(),D=(0,n.tg)(gt),[G,K]=(0,k.useState)(0),[ae,de]=(0,k.useState)(0),be=(0,k.useRef)(null);(0,k.useLayoutEffect)(()=>{if(be.current){let{height:Ot,width:Kt}=be.current.getBBox();Ot=Math.round(Ot),Kt=Math.round(Kt),(Ot!==ae||Kt!==G)&&(K(Kt),de(Ot))}},[G,ae]);const we=10,Pe=ae,Te=Pe+we,Je=Te+G+we*2,xt=ae+we*2,Et=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?Ie({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),Qe=()=>{R(D({kind:y.kind,namespace:y.metadata.namespace||Ee.zG,name:y.metadata.name}))};return(0,l.jsxs)("g",{onClick:Qe,className:b.clickable,children:[(0,l.jsx)("rect",{className:Y()(b.node,y.root?"secondary":"primary"),width:Je,height:xt,rx:10}),(0,l.jsx)(Bt,{kind:y.kind,y:we,x:we,width:Pe,height:Pe,className:Y()(b.text,y.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:be,className:Y()(b.text,y.root?"secondary":"primary"),y:xt/2,x:Te+(G+we*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Et})]})}function rs(y){const{loading:b,error:R,nodes:D,edges:G}=Dn(y.entity);return b?(0,l.jsx)(E.Ex,{}):R?(0,l.jsx)(E.Gk,{error:R}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(m.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,l.jsx)(E.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,l.jsx)(Q.Z,{mt:4,children:(0,l.jsx)(E.mn,{nodes:D,edges:G,renderNode:mr,direction:E.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var tr=t(11776),wn=t(38402),Er=t(86136),Ar=t(99688),ss=t(49378),os=t(54506),Tr=t(94339),kr=t(24579),Wr=t(27685);const qn=(0,Z.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Hn(y){const b=qn();return(0,l.jsx)(ss.Z,{...y,primaryTypographyProps:{className:b.monospace},secondaryTypographyProps:{className:b.monospace}})}function Or(y){const b=qn();return(0,l.jsx)(os.Z,{className:b.monospace,children:y.children})}function vr(y){return(0,l.jsx)(Q.Z,{mt:2,children:(0,l.jsx)(Tr.Z,{variant:"outlined",children:(0,l.jsxs)(kr.Z,{children:[(0,l.jsxs)(_.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,l.jsx)(hr,{to:y.helpLink})]}),y.children]})})})}function Hr(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function Gr(y){const[b,R]=y.entry,D=Hr(R);return(0,l.jsxs)(wn.Z,{children:[y.indent&&(0,l.jsx)(Er.Z,{}),(0,l.jsx)(Hn,{primary:b,secondary:D?(0,l.jsx)(E.rU,{to:D,children:R}):R})]})}function hr(y){const b=qn();return(0,l.jsx)(E.rU,{to:y.to,className:b.helpIcon,children:(0,l.jsx)(Wr.Z,{fontSize:"inherit"})})}const is=(0,Z.Z)({root:{display:"flex",flexDirection:"column"}});function Ir(y){var b,R;const D=(0,n.h_)(g),G=(0,Ee.eE)(y),K=(b=y.metadata.annotations)===null||b===void 0?void 0:b[Ee.P1],ae=(R=y.metadata.annotations)===null||R===void 0?void 0:R[Ee.q1],{loading:de,error:be,value:we}=(0,Me.default)(async()=>!K&&!ae?[]:(await D.getEntities({filter:[...K?[{[`metadata.annotations.${Ee.P1}`]:K}]:[],...ae?[{[`metadata.annotations.${Ee.q1}`]:ae}]:[]]})).items,[K,ae]);return{loading:de,error:be,location:K,originLocation:ae,colocatedEntities:we==null?void 0:we.filter(Pe=>(0,Ee.eE)(Pe)!==G)}}function Rr(y){return(0,l.jsxs)(tr.Z,{dense:!0,children:[y.header&&(0,l.jsx)(Gr,{entry:y.header},"header"),y.entities.map(b=>(0,l.jsxs)(wn.Z,{children:[(0,l.jsx)(Er.Z,{children:(0,l.jsx)(Bt,{kind:b.kind})}),(0,l.jsx)(Hn,{primary:(0,l.jsx)(at,{entityRef:b})})]},(0,Ee.eE)(b)))]})}function Kr(y){const{entity:b}=y,{loading:R,error:D,location:G,originLocation:K,colocatedEntities:ae}=Ir(b);if(R)return(0,l.jsx)(E.Ex,{});if(D)return(0,l.jsx)(E.Gk,{error:D});if(!G&&!K)return(0,l.jsx)(Ar.Z,{severity:"warning",children:"Entity had no location information."});if(!(ae!=null&&ae.length))return(0,l.jsx)(Ar.Z,{severity:"info",children:"There were no other entities on this location."});if(G===K)return(0,l.jsx)(Rr,{entities:ae});const de=ae.filter(we=>{var Pe;return((Pe=we.metadata.annotations)===null||Pe===void 0?void 0:Pe[Ee.P1])===G}),be=ae.filter(we=>{var Pe;return((Pe=we.metadata.annotations)===null||Pe===void 0?void 0:Pe[Ee.q1])===K});return(0,l.jsxs)(l.Fragment,{children:[de.length>0&&(0,l.jsx)(Rr,{entities:de,header:["At the same location",G]}),be.length>0&&(0,l.jsx)(Rr,{entities:be,header:["At the same origin",K]})]})}function Yr(y){const b=is();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(m.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,l.jsx)("div",{className:b.root,children:(0,l.jsx)(Kr,{entity:y.entity})})]})}function Jr(y){return Object.fromEntries([...Object.entries(y)].sort((b,R)=>b[0]<R[0]?-1:1))}function as(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(m.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(m.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(E.Oi,{text:JSON.stringify(Jr(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var ls=t(3440),cs=t.n(ls);const Qr=(0,Z.Z)({root:{display:"flex",flexDirection:"column"}});function Xr(y){var b,R;const D=Qr(),{apiVersion:G,kind:K,metadata:ae,spec:de,relations:be=[],status:we={}}=y.entity,Pe=cs()(Ke()(be,Te=>Te.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:D.root,children:[(0,l.jsx)(vr,{title:"Identity",children:(0,l.jsxs)(tr.Z,{dense:!0,children:[(0,l.jsx)(wn.Z,{children:(0,l.jsx)(Hn,{primary:"apiVersion",secondary:G})}),(0,l.jsx)(wn.Z,{children:(0,l.jsx)(Hn,{primary:"kind",secondary:K})}),(de==null?void 0:de.type)&&(0,l.jsx)(wn.Z,{children:(0,l.jsx)(Hn,{primary:"spec.type",secondary:de.type})}),ae.uid&&(0,l.jsx)(wn.Z,{children:(0,l.jsx)(Hn,{primary:"uid",secondary:ae.uid})}),ae.etag&&(0,l.jsx)(wn.Z,{children:(0,l.jsx)(Hn,{primary:"etag",secondary:ae.etag})})]})}),(0,l.jsxs)(vr,{title:"Metadata",children:[!!Object.keys(ae.annotations||{}).length&&(0,l.jsx)(tr.Z,{dense:!0,subheader:(0,l.jsxs)(Or,{children:["Annotations",(0,l.jsx)(hr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ae.annotations).map(Te=>(0,l.jsx)(Gr,{indent:!0,entry:Te},Te[0]))}),!!Object.keys(ae.labels||{}).length&&(0,l.jsx)(tr.Z,{dense:!0,subheader:(0,l.jsx)(Or,{children:"Labels"}),children:Object.entries(ae.labels).map(Te=>(0,l.jsx)(Gr,{indent:!0,entry:Te},Te[0]))}),!!(!((b=ae.tags)===null||b===void 0)&&b.length)&&(0,l.jsx)(tr.Z,{dense:!0,subheader:(0,l.jsx)(Or,{children:"Tags"}),children:ae.tags.map((Te,Je)=>(0,l.jsxs)(wn.Z,{children:[(0,l.jsx)(Er.Z,{}),(0,l.jsx)(Hn,{primary:Te})]},`${Te}-${Je}`))})]}),!!be.length&&(0,l.jsx)(vr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Pe).map(([Te,Je],xt)=>(0,l.jsx)("div",{children:(0,l.jsx)(tr.Z,{dense:!0,subheader:(0,l.jsx)(Or,{children:Te}),children:Je.map(Et=>(0,l.jsxs)(wn.Z,{children:[(0,l.jsx)(Er.Z,{children:(0,l.jsx)(Bt,{entityRef:Et.targetRef})}),(0,l.jsx)(Hn,{primary:(0,l.jsx)(at,{entityRef:Et.targetRef})})]},Et.targetRef))})},xt))}),!!(!((R=we.items)===null||R===void 0)&&R.length)&&(0,l.jsx)(vr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:we.items.map((Te,Je)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(_.Z,{children:[Te.level,": ",Te.type]}),(0,l.jsx)(Q.Z,{ml:2,children:Te.message})]},Je))})]})]})}var qr=t(72847);function _r(y){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(m.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(m.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(E.Oi,{text:qr.ZP.stringify(Jr(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const fn=(0,Z.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function It(y){const{children:b,value:R,index:D,...G}=y,K=fn();return(0,l.jsx)("div",{role:"tabpanel",hidden:R!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:K.tabContents,...G,children:R===D&&(0,l.jsx)(Q.Z,{pl:3,pr:3,children:b})})}function yr(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function ds(y){const b=fn(),[R,D]=k.useState(0);return(0,k.useEffect)(()=>{D(0)},[y.open]),y.entity?(0,l.jsxs)(Wn.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:b.fullHeightDialog},children:[(0,l.jsx)(Zn.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(ur.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:b.root,children:[(0,l.jsxs)(Xn.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(G,K)=>D(K),"aria-label":"Inspector options",className:b.tabs,children:[(0,l.jsx)(S.Z,{label:"Overview",...yr(0)}),(0,l.jsx)(S.Z,{label:"Ancestry",...yr(1)}),(0,l.jsx)(S.Z,{label:"Colocated",...yr(2)}),(0,l.jsx)(S.Z,{label:"Raw JSON",...yr(3)}),(0,l.jsx)(S.Z,{label:"Raw YAML",...yr(4)})]}),(0,l.jsx)(It,{value:R,index:0,children:(0,l.jsx)(Xr,{entity:y.entity})}),(0,l.jsx)(It,{value:R,index:1,children:(0,l.jsx)(rs,{entity:y.entity})}),(0,l.jsx)(It,{value:R,index:2,children:(0,l.jsx)(Yr,{entity:y.entity})}),(0,l.jsx)(It,{value:R,index:3,children:(0,l.jsx)(as,{entity:y.entity})}),(0,l.jsx)(It,{value:R,index:4,children:(0,l.jsx)(_r,{entity:y.entity})})]})}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(ee.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var us=t(85256);function hs(y){var b;const R=(0,n.h_)(g),D=(b=y.metadata.annotations)===null||b===void 0?void 0:b[Ee.q1],G=y.metadata.uid,K=D==="bootstrap:bootstrap",ae=(0,Me.default)(async()=>{const Et=R.getLocationByRef(D);let Qe;if(!D)Qe=Promise.resolve([]);else{const Ot=`metadata.annotations.${Ee.q1}`;Qe=R.getEntities({filter:{[Ot]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Kt=>Kt.items)}return Promise.all([Et,Qe]).then(([Ot,Kt])=>({location:Ot,colocatedEntities:Kt}))},[R,y]),de=(0,k.useCallback)(async function(){const{location:Qe}=ae.value;await R.removeLocationById(Qe.id)},[R,ae]),be=(0,k.useCallback)(async function(){await R.removeEntityByUid(G)},[R,G]);if(K)return{type:"bootstrap",location:D,deleteEntity:be};const{loading:we,error:Pe,value:Te}=ae;if(we)return{type:"loading"};if(Pe)return{type:"error",error:Pe};const{location:Je,colocatedEntities:xt}=Te;return Je?{type:"unregister",location:D,colocatedEntities:xt.map(Ee.iB),unregisterLocation:de,deleteEntity:be}:{type:"only-delete",deleteEntity:be}}var es=t(23054);const ps=(0,Z.Z)({advancedButton:{fontSize:"0.7em"}}),fs=({entity:y,onConfirm:b})=>{const R=(0,n.h_)(n.$v),D=(0,n.h_)(n.Ds),G=ps(),K=hs(y),[ae,de]=(0,k.useState)(!1),[be,we]=(0,k.useState)(!1);var Pe;const Te=(Pe=D.getOptionalString("app.title"))!==null&&Pe!==void 0?Pe:"Backstage",Je=(0,k.useCallback)(async function(){if("unregisterLocation"in K){we(!0);try{await K.unregisterLocation(),b()}catch(Qe){(0,es.BD)(Qe),R.post({message:Qe.message})}finally{we(!1)}}},[R,b,K]),xt=(0,k.useCallback)(async function(){if("deleteEntity"in K){we(!0);try{await K.deleteEntity(),b()}catch(Qe){(0,es.BD)(Qe),R.post({message:Qe.message})}finally{we(!1)}}},[R,b,K]);return K.type==="loading"?(0,l.jsx)(E.Ex,{}):K.type==="error"?(0,l.jsx)(E.Gk,{error:K.error}):K.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Ar.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',K.location,'"). If you believe this is in error, please contact the ',Te," ","integrator."]}),(0,l.jsxs)(Q.Z,{marginTop:2,children:[!ae&&(0,l.jsx)(ee.Z,{variant:"text",size:"small",color:"primary",className:G.advancedButton,onClick:()=>de(!0),children:"Advanced Options"}),ae&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.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,l.jsx)(ee.Z,{variant:"contained",color:"secondary",disabled:be,onClick:xt,children:"Delete Entity"})]})]})]}):K.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.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,l.jsx)(ee.Z,{variant:"contained",color:"secondary",disabled:be,onClick:xt,children:"Delete Entity"})]}):K.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(m.Z,{component:"ul",children:K.colocatedEntities.map(Et=>(0,l.jsx)("li",{children:(0,l.jsx)(at,{entityRef:Et})},`${Et.kind}:${Et.namespace}/${Et.name}`))}),(0,l.jsx)(m.Z,{children:"Located at the following location:"}),(0,l.jsx)(m.Z,{component:"ul",children:(0,l.jsx)("li",{children:K.location})}),(0,l.jsxs)(m.Z,{children:["To undo, just re-register the entity in ",Te,"."]}),(0,l.jsxs)(Q.Z,{marginTop:2,children:[(0,l.jsx)(ee.Z,{variant:"contained",color:"secondary",disabled:be,onClick:Je,children:"Unregister Location"}),!ae&&(0,l.jsx)(Q.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(ee.Z,{variant:"text",size:"small",color:"primary",className:G.advancedButton,onClick:()=>de(!0),children:"Advanced Options"})})]}),ae&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(us.Z,{})}),(0,l.jsx)(m.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,l.jsx)(ee.Z,{variant:"contained",color:"secondary",disabled:be,onClick:xt,children:"Delete Entity"})]})]}):(0,l.jsx)(Ar.Z,{severity:"error",children:"Internal error: Unknown state"})},ts=y=>{const{open:b,onConfirm:R,onClose:D,entity:G}=y;return(0,l.jsxs)(Wn.Z,{open:b,onClose:D,children:[(0,l.jsx)(Zn.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(ur.Z,{children:(0,l.jsx)(fs,{entity:G,onConfirm:R})}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(ee.Z,{onClick:D,color:"primary",children:"Cancel"})})]})};var Pr=t(12231),Zs=t(9520),gs=t(47603);const ns=(0,Z.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function ms(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:gs.Z},{id:"starred",label:"Starred",icon:an.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const Ds=y=>{const{initialFilter:b,availableFilters:R}=y,D=ns(),G=(0,n.h_)(n.Ds);var K;const ae=(K=G.getOptionalString("organization.name"))!==null&&K!==void 0?K:"Company",{filters:de,updateFilters:be,backendEntities:we,queryParameters:{kind:Pe,user:Te},loading:Je}=Gt(),xt=["starred","all"],Et=ms(ae).map(mn=>({...mn,items:mn.items.filter(({id:En})=>["group","user"].some(Lr=>Lr===Pe)?xt.includes(En):!R||R.includes(En))})).filter(({items:mn})=>!!mn.length),{isStarredEntity:Qe}=Ae(),{isOwnedEntity:Ot,loading:Kt}=yt(),nr=Je||Kt,Nn=(0,k.useMemo)(()=>new bt("owned",Ot,Qe),[Ot,Qe]),pr=(0,k.useMemo)(()=>new bt("starred",Ot,Qe),[Ot,Qe]),gn=(0,k.useMemo)(()=>[Te].flat()[0],[Te]),[jn,$n]=(0,k.useState)(gn!=null?gn:b),xr=(0,k.useMemo)(()=>we.filter(mt((0,_t.compact)(Object.values({...de,user:void 0})))),[de,we]),$r=(0,k.useMemo)(()=>({all:xr.length,starred:xr.filter(mn=>pr.filterEntity(mn)).length,owned:xr.filter(mn=>Nn.filterEntity(mn)).length}),[xr,pr,Nn]);(0,k.useEffect)(()=>{gn&&$n(gn)},[gn]),(0,k.useEffect)(()=>{!nr&&!!jn&&jn!=="all"&&$r[jn]===0&&$n("all")},[nr,$r,jn,$n]),(0,k.useEffect)(()=>{be({user:jn?new bt(jn,Ot,Qe):void 0})},[jn,Ot,Qe,be]);var _n;return(0,l.jsx)(Tr.Z,{className:D.root,children:Et.map(mn=>(0,l.jsxs)(k.Fragment,{children:[(0,l.jsx)(_.Z,{variant:"subtitle2",component:"span",className:D.title,children:mn.name}),(0,l.jsx)(Tr.Z,{className:D.groupWrapper,children:(0,l.jsx)(tr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":mn.name,children:mn.items.map(En=>{var Lr;return(0,l.jsxs)(Pr.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>$n(En.id),selected:En.id===((Lr=de.user)===null||Lr===void 0?void 0:Lr.value),className:D.menuItem,disabled:$r[En.id]===0,"data-testid":`user-picker-${En.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[En.icon&&(0,l.jsx)(Er.Z,{className:D.listIcon,children:(0,l.jsx)(En.icon,{fontSize:"small"})}),(0,l.jsx)(ss.Z,{children:(0,l.jsxs)(_.Z,{variant:"body1",children:[En.label," "]})}),(0,l.jsx)(Zs.Z,{children:(_n=$r[En.id])!==null&&_n!==void 0?_n:"-"})]},En.id)})})})]},mn.name))})},vs=(0,Z.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ns=(0,l.jsx)($e.Z,{fontSize:"small"}),Fs=(0,l.jsx)(De.Z,{fontSize:"small"}),ys=()=>{const y=vs(),{updateFilters:b}=Gt(),[R,D]=(0,k.useState)([]);function G(de){b({orphan:de?new kt(de):void 0})}function K(de){b({error:de?new $t(de):void 0})}const ae=["Is Orphan","Has Error"];return(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(_.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(tt.ZP,{multiple:!0,options:ae,value:R,onChange:(de,be)=>{D(be),G(be.includes("Is Orphan")),K(be.includes("Has Error"))},renderOption:(de,{selected:be})=>(0,l.jsx)(ce.Z,{control:(0,l.jsx)(pe.Z,{icon:Ns,checkedIcon:Fs,checked:be}),label:de}),size:"small",popupIcon:(0,l.jsx)(Ge.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:de=>(0,l.jsx)(Se.Z,{...de,className:y.input,variant:"outlined"})})]})})},Us=({children:y,value:b})=>{var R;const[D,G]=useState((R=b==null?void 0:b.filters)!==null&&R!==void 0?R:{}),K=useCallback(xt=>{G(Et=>{const Qe=typeof xt=="function"?xt(Et):xt;return{...Et,...Qe}})},[]),ae=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var de,be,we,Pe,Te;const Je=useMemo(()=>({entities:(de=b==null?void 0:b.entities)!==null&&de!==void 0?de:ae.entities,backendEntities:(be=b==null?void 0:b.backendEntities)!==null&&be!==void 0?be:ae.backendEntities,updateFilters:(we=b==null?void 0:b.updateFilters)!==null&&we!==void 0?we:K,filters:D,loading:(Pe=b==null?void 0:b.loading)!==null&&Pe!==void 0?Pe:!1,queryParameters:(Te=b==null?void 0:b.queryParameters)!==null&&Te!==void 0?Te:ae.queryParameters,error:b==null?void 0:b.error}),[b,ae,D,K]);return _jsx(EntityListContext.Provider,{value:Je,children:y})}},33414:function(wt,Ue,t){"use strict";t.r(Ue),t.d(Ue,{AboutCard:function(){return gt},AboutContent:function(){return Ee},AboutField:function(){return X}});var h=t(52322),n=t(25271),g=t(93414),L=t(25248),z=t(32838),x=t(43297),l=t(79692),k=t(94339),ne=t(32552),q=t(61837),ee=t(85256),F=t(24579),Q=t(52866),_=t(30254),ve=t(27604),ue=t(2784),A=t(19625),I=t(60905),$=t(90436),E=t(7089);const T=(0,l.Z)(Ze=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ze.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function X(Ze){const{label:Ie,value:nt,gridSizes:at,children:rt}=Ze,ct=T(),lt=(0,L.vJ)(rt,dt=>dt.getElements()),mt=lt.length>0?lt:(0,h.jsx)($.Z,{variant:"body2",className:ct.value,children:nt||"unknown"});return(0,h.jsxs)(I.Z,{item:!0,...at,children:[(0,h.jsx)($.Z,{variant:"h2",className:ct.label,children:Ie}),mt]})}var je=t(24851);const Ke=(0,l.Z)({description:{wordBreak:"break-word"}});function Me(Ze,Ie,nt){if(Ie==="url"||Ze.includes("://"))return Ze;const at=nt.type==="file"?`file://${nt.target}`:nt.target;return Ie==="file"||nt.type==="file"?new URL(Ze,at).href:at}function Ee(Ze){var Ie,nt,at,rt,ct,lt,mt,dt;const{entity:We}=Ze,le=Ke(),Re=We.kind.toLocaleLowerCase("en-US")==="system",ke=We.kind.toLocaleLowerCase("en-US")==="resource",st=We.kind.toLocaleLowerCase("en-US")==="component",vt=We.kind.toLocaleLowerCase("en-US")==="api",At=We.kind.toLocaleLowerCase("en-US")==="template",ht=We.kind.toLocaleLowerCase("en-US")==="location",bt=We.kind.toLocaleLowerCase("en-US")==="group",kt=(0,x.hF)(We,n.cz,{kind:"system"}),$t=(0,x.hF)(We,n.cz,{kind:"component"}),en=(0,x.hF)(We,n.cz,{kind:"domain"}),on=(0,x.hF)(We,n.S4);let Vt;try{Vt=(0,n.CV)(We)}catch{Vt=void 0}return(0,h.jsxs)(I.Z,{container:!0,children:[(0,h.jsx)(X,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)($.Z,{variant:"body2",paragraph:!0,className:le.description,children:(We==null||(Ie=We.metadata)===null||Ie===void 0?void 0:Ie.description)||"No description"})}),(0,h.jsx)(X,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:on.length>0&&(0,h.jsx)(x.rI,{entityRefs:on,defaultKind:"group"})}),(Re||en.length>0)&&(0,h.jsx)(X,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:en.length>0&&(0,h.jsx)(x.rI,{entityRefs:en,defaultKind:"domain"})}),(vt||st||ke||kt.length>0)&&(0,h.jsx)(X,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:kt.length>0&&(0,h.jsx)(x.rI,{entityRefs:kt,defaultKind:"system"})}),st&&$t.length>0&&(0,h.jsx)(X,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(x.rI,{entityRefs:$t,defaultKind:"component"})}),(vt||st||ke||At||bt||ht||typeof(We==null||(nt=We.spec)===null||nt===void 0?void 0:nt.type)=="string")&&(0,h.jsx)(X,{label:"Type",value:We==null||(at=We.spec)===null||at===void 0?void 0:at.type,gridSizes:{xs:12,sm:6,lg:4}}),(vt||st||typeof(We==null||(rt=We.spec)===null||rt===void 0?void 0:rt.lifecycle)=="string")&&(0,h.jsx)(X,{label:"Lifecycle",value:We==null||(ct=We.spec)===null||ct===void 0?void 0:ct.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(X,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((We==null||(lt=We.metadata)===null||lt===void 0?void 0:lt.tags)||[]).map(Wt=>(0,h.jsx)(E.Z,{size:"small",label:Wt},Wt))}),ht&&((We==null||(mt=We.spec)===null||mt===void 0?void 0:mt.targets)||(We==null||(dt=We.spec)===null||dt===void 0?void 0:dt.target))&&(0,h.jsx)(X,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(je.s,{cols:1,items:(We.spec.targets||[We.spec.target]).map(Wt=>Wt).map(Wt=>{var un;return{text:Wt,href:Me(Wt,(We==null||(un=We.spec)===null||un===void 0?void 0:un.type)||"unknown",Vt)}})})})]})}const qe=(0,l.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 gt(Ze){var Ie,nt,at;const{variant:rt}=Ze,ct=qe(),{entity:lt}=(0,x.X2)(),mt=(0,L.h_)(z.q3),dt=(0,L.h_)(x.Ah),We=(0,L.h_)(L.$v),le=(0,L.tg)(A.jU),Re=(0,x.CV)(lt,mt),ke=(Ie=lt.metadata.annotations)===null||Ie===void 0?void 0:Ie[n.Tf],st={label:"View Source",disabled:!Re,icon:(0,h.jsx)(z.nW,{type:Re==null?void 0:Re.integrationType}),href:Re==null?void 0:Re.locationTargetUrl},vt={label:"View TechDocs",disabled:!(!((nt=lt.metadata.annotations)===null||nt===void 0)&&nt["backstage.io/techdocs-ref"])||!le,icon:(0,h.jsx)(_.Z,{}),href:le&&le({namespace:lt.metadata.namespace||n.zG,kind:lt.kind,name:lt.metadata.name})};let At="";rt==="gridItem"?At=ct.gridItemCard:rt==="fullHeight"&&(At=ct.fullHeightCard);let ht="";rt==="gridItem"?ht=ct.gridItemCardContent:rt==="fullHeight"&&(ht=ct.fullHeightCardContent);const bt=(at=lt.metadata.annotations)===null||at===void 0?void 0:at[n.P1],kt=(bt==null?void 0:bt.startsWith("url:"))||(bt==null?void 0:bt.startsWith("file:")),$t=(0,ue.useCallback)(async()=>{await dt.refreshEntity((0,n.eE)(lt)),We.post({message:"Refresh scheduled",severity:"info"})},[dt,We,lt]);return(0,h.jsxs)(k.Z,{className:At,children:[(0,h.jsx)(ne.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[kt&&(0,h.jsx)(q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:$t,children:(0,h.jsx)(Q.Z,{})}),(0,h.jsx)(q.Z,{component:g.rU,"aria-label":"Edit",disabled:!ke,title:"Edit Metadata",to:ke!=null?ke:"#",children:(0,h.jsx)(ve.Z,{})})]}),subheader:(0,h.jsx)(g.M6,{links:[st,vt]})}),(0,h.jsx)(ee.Z,{}),(0,h.jsx)(F.Z,{className:ht,children:(0,h.jsx)(Ee,{entity:lt})})]})}},79324:function(wt,Ue,t){"use strict";t.d(Ue,{K:function(){return Q}});var h=t(52322),n=t(2784),g=t(79692),L=t(12420),z=t(97580),x=t(73698),l=t(74603),k=t(12231),ne=t(43297),q=t(64279),ee=t(25248);const F=(0,g.Z)(_=>(0,L.Z)({root:{..._.typography.h4}}));function Q(_){const{initialFilter:ve="component",allowedKinds:ue}=_,A=F(),I=(0,ee.h_)(ne.Ah),{value:$}=(0,q.default)(async()=>await I.getEntityFacets({facets:["kind"]}).then(Ze=>{var Ie;return((Ie=Ze.facets.kind)===null||Ie===void 0?void 0:Ie.map(nt=>nt.value).sort())||[]})),{filters:E,updateFilters:T,queryParameters:{kind:X}}=(0,ne.wp)(),je=(0,n.useMemo)(()=>{var Ze;return(Ze=[X].flat()[0])===null||Ze===void 0?void 0:Ze.toLocaleLowerCase("en-US")},[X]),[Ke,Me]=(0,n.useState)(je!=null?je:ve);(0,n.useEffect)(()=>{var Ze;if(!((Ze=E.kind)===null||Ze===void 0)&&Ze.value){var Ie;Me((Ie=E.kind)===null||Ie===void 0?void 0:Ie.value)}},[E.kind]),(0,n.useEffect)(()=>{T({kind:Ke?new ne.zo(Ke):void 0})},[Ke,T]),(0,n.useEffect)(()=>{je&&Me(je)},[je]);var Ee;const gt=[(0,z.Z)(Ke)].concat((Ee=$==null?void 0:$.filter(Ze=>ue?ue.some(Ie=>Ie.toLocaleLowerCase("en-US")===Ze.toLocaleLowerCase("en-US")):!0))!==null&&Ee!==void 0?Ee:[]).sort().reduce((Ze,Ie)=>(Ze[Ie.toLocaleLowerCase("en-US")]=Ie,Ze),{});return(0,h.jsx)(x.Z,{input:(0,h.jsx)(l.Z,{value:Ke}),value:Ke,onChange:Ze=>Me(Ze.target.value),classes:A,children:Object.keys(gt).map(Ze=>(0,h.jsx)(k.Z,{value:Ze,children:`${gt[Ze]}s`},Ze))})}},86359:function(wt,Ue,t){"use strict";t.d(Ue,{E:function(){return ue}});var h=t(52322),n=t(25271),g=t(93414),L=t(43297),z=t(90436),x=t(15459),l=t(27604),k=t(2997),ne=t(11640),q=t(28347),ee=t(76635),F=t(2784),Q=t(7089);const _=Object.freeze({createNameColumn(A){function I($){var E;return((E=$.metadata)===null||E===void 0?void 0:E.title)||(0,L.$3)($,{defaultKind:A==null?void 0:A.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:$},{entity:E}){return I($).localeCompare(I(E))},render:({entity:$})=>{var E;return(0,h.jsx)(L.dx,{entityRef:$,defaultKind:(A==null?void 0:A.defaultKind)||"Component",title:(E=$.metadata)===null||E===void 0?void 0:E.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:A})=>(0,h.jsx)(L.rI,{entityRefs:A.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:A})=>(0,h.jsx)(L.rI,{entityRefs:A.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:A})=>{var I,$;return(0,h.jsx)(h.Fragment,{children:((A==null||(I=A.spec)===null||I===void 0?void 0:I.targets)||(A==null||($=A.spec)===null||$===void 0?void 0:$.target))&&(0,h.jsx)(g.Or,{text:(A.spec.targets||[A.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:A})=>(0,h.jsx)(g.Or,{text:A.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:A})=>(0,h.jsx)(h.Fragment,{children:A.metadata.tags&&A.metadata.tags.map(I=>(0,h.jsx)(Q.Z,{label:I,size:"small",variant:"outlined",style:{marginBottom:"0px"}},I))}),width:"auto"}},createTitleColumn(A){return{title:"Title",field:"entity.metadata.title",hidden:A==null?void 0:A.hidden,searchable:!0}},createLabelColumn(A,I){return{title:(I==null?void 0:I.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>{var E;const T=(E=$.metadata)===null||E===void 0?void 0:E.labels,X=T&&T[A]||(I==null?void 0:I.defaultValue);return(0,h.jsx)(h.Fragment,{children:X&&(0,h.jsx)(Q.Z,{label:X,size:"small",variant:"outlined"},X)})},width:"auto"}}}),ve=(0,x.Z)({root:{color:"#f3ba37"}})(ne.Z),ue=A=>{var I,$;const{columns:E,actions:T,tableOptions:X,subtitle:je,emptyContent:Ke}=A,{isStarredEntity:Me,toggleStarredEntity:Ee}=(0,L.CR)(),{loading:qe,error:gt,entities:Ze,filters:Ie}=(0,L.wp)(),nt=(0,F.useMemo)(()=>{var le;return[_.createTitleColumn({hidden:!0}),_.createNameColumn({defaultKind:(le=Ie.kind)===null||le===void 0?void 0:le.value}),...Re(),_.createMetadataDescriptionColumn(),_.createTagsColumn()];function Re(){var ke;switch((ke=Ie.kind)===null||ke===void 0?void 0:ke.value){case"user":return[];case"domain":case"system":return[_.createOwnerColumn()];case"group":case"template":return[_.createSpecTypeColumn()];case"location":return[_.createSpecTypeColumn(),_.createSpecTargetsColumn()];default:return[_.createSystemColumn(),_.createOwnerColumn(),_.createSpecTypeColumn(),_.createSpecLifecycleColumn()]}}},[(I=Ie.kind)===null||I===void 0?void 0:I.value]),at=Ie.type===void 0;var rt;const ct=(0,ee.capitalize)((rt=($=Ie.user)===null||$===void 0?void 0:$.value)!==null&&rt!==void 0?rt:"all");if(gt)return(0,h.jsx)("div",{children:(0,h.jsx)(g.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(g.Oi,{language:"text",text:gt.toString()})})});const lt=[({entity:le})=>{var Re;const ke=(Re=le.metadata.annotations)===null||Re===void 0?void 0:Re[n.l2],st="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:st}),(0,h.jsx)(k.Z,{fontSize:"small"})]}),tooltip:st,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:le})=>{var Re;const ke=(Re=le.metadata.annotations)===null||Re===void 0?void 0:Re[n.Tf],st="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:st}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:st,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:le})=>{const Re=Me(le),ke=Re?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:ke}),Re?(0,h.jsx)(ve,{}):(0,h.jsx)(q.Z,{})]}),tooltip:ke,onClick:()=>Ee(le)}}],mt=Ze.map(le=>{const Re=(0,L.hF)(le,n.cz,{kind:"system"}),ke=(0,L.hF)(le,n.S4);return{entity:le,resolved:{name:(0,L.$3)(le,{defaultKind:"Component"}),ownedByRelationsTitle:ke.map(st=>(0,L.$3)(st,{defaultKind:"group"})).join(", "),ownedByRelations:ke,partOfSystemRelationTitle:Re.map(st=>(0,L.$3)(st,{defaultKind:"system"})).join(", "),partOfSystemRelations:Re}}}),dt=(E||nt).find(le=>le.title==="Type");dt&&(dt.hidden=!at);const We=mt.length>20;return(0,h.jsx)(g.iA,{isLoading:qe,columns:E||nt,options:{paging:We,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!qe,padding:"dense",pageSizeOptions:[20,50,100],...X},title:`${ct} (${Ze.length})`,data:mt,actions:T||lt,subtitle:je,emptyContent:Ke})};ue.columns=_},24851:function(wt,Ue,t){"use strict";t.d(Ue,{s:function(){return ve}});var h=t(52322),n=t(90348),g=t(11861),L=t(2784),z=t(79692),x=t(95544),l=t(90436),k=t(52160),ne=t(93414);const q=(0,z.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function ee(ue){const{href:A,text:I,Icon:$}=ue,E=q();return(0,h.jsxs)(x.Z,{display:"flex",children:[(0,h.jsx)(x.Z,{mr:1,className:E.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:$?(0,h.jsx)($,{}):(0,h.jsx)(k.Z,{})})}),(0,h.jsx)(x.Z,{flexGrow:"1",children:(0,h.jsx)(ne.rU,{to:A,target:"_blank",rel:"noopener",children:I||A})})]})}var F=t(41156);const Q={xs:1,sm:1,md:1,lg:2,xl:3};function _(ue){const A=[(0,F.Z)(T=>T.breakpoints.up("xl"))?"xl":null,(0,F.Z)(T=>T.breakpoints.up("lg"))?"lg":null,(0,F.Z)(T=>T.breakpoints.up("md"))?"md":null,(0,F.Z)(T=>T.breakpoints.up("sm"))?"sm":null,(0,F.Z)(T=>T.breakpoints.up("xs"))?"xs":null];let I=1;if(typeof ue=="number")I=ue;else{var $;const T=($=A.find(X=>X!==null))!==null&&$!==void 0?$:"xs";var E;I=(E=ue==null?void 0:ue[T])!==null&&E!==void 0?E:Q[T]}return I}function ve(ue){const{items:A,cols:I=void 0}=ue,$=_(I);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:$,children:A.map(({text:E,href:T,Icon:X},je)=>(0,h.jsx)(g.Z,{children:(0,h.jsx)(ee,{href:T,text:E!=null?E:T,Icon:X})},je))})}},19625:function(wt,Ue,t){"use strict";t.d(Ue,{_Z:function(){return L},jU:function(){return g},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),g=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),L=(0,h.NT)({id:"catalog"})},51666:function(wt,Ue,t){"use strict";t.d(Ue,{rG:function(){return h},Y2:function(){return $},J$:function(){return ne},g2:function(){return g}});var h;(function(E){E.DENY="DENY",E.ALLOW="ALLOW",E.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(E,T){return E.name===T.name}function g(E,T){return"resourceType"in E?!T||E.resourceType===T:!1}function L(E){return E.attributes.action==="create"}function z(E){return E.attributes.action==="read"}function x(E){return E.attributes.action==="update"}function l(E){return E.attributes.action==="delete"}function k(E){return{authorize:async(T,X)=>await E.authorize(T,X),authorizeConditional(T,X){const je=T;return E.authorize(je,X)}}}function ne({name:E,attributes:T,resourceType:X}){return X?{type:"resource",name:E,attributes:T,resourceType:X}:{type:"basic",name:E,attributes:T}}var q=t(23054),ee=t(96279),F=t.n(ee),Q=t(9571),_=t(30195);const ve=_.z.lazy(()=>_.z.object({rule:_.z.string(),resourceType:_.z.string(),params:_.z.record(_.z.any()).optional()}).or(_.z.object({anyOf:_.z.array(ve).nonempty()})).or(_.z.object({allOf:_.z.array(ve).nonempty()})).or(_.z.object({not:ve}))),ue=_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),A=_.z.union([_.z.object({result:_.z.literal(h.ALLOW).or(_.z.literal(h.DENY))}),_.z.object({result:_.z.literal(h.CONDITIONAL),pluginId:_.z.string(),resourceType:_.z.string(),conditions:ve})]),I=(E,T)=>_.z.object({items:_.z.array(_.z.intersection(_.z.object({id:_.z.string()}),E)).refine(X=>X.length===T.size&&X.every(({id:je})=>T.has(je)),{message:"Items in response do not match request"})});class ${async authorize(T,X){return this.makeRequest(T,ue,X)}async authorizeConditional(T,X){return this.makeRequest(T,A,X)}async makeRequest(T,X,je){if(!this.enabled)return T.map(Ie=>({result:h.ALLOW}));const Ke={items:T.map(Ie=>({id:Q.Z(),...Ie}))},Me=await this.discovery.getBaseUrl("permission"),Ee=await F()(`${Me}/authorize`,{method:"POST",body:JSON.stringify(Ke),headers:{...this.getAuthorizationHeader(je==null?void 0:je.token),"content-type":"application/json"}});if(!Ee.ok)throw await q.VL.fromResponse(Ee);const qe=await Ee.json(),Ze=I(X,new Set(Ke.items.map(({id:Ie})=>Ie))).parse(qe).items.reduce((Ie,nt)=>(Ie[nt.id]=nt,Ie),{});return Ke.items.map(Ie=>Ze[Ie.id])}getAuthorizationHeader(T){return T?{Authorization:`Bearer ${T}`}:{}}constructor(T){this.discovery=T.discovery;var X;this.enabled=(X=T.config.getOptionalBoolean("permission.enabled"))!==null&&X!==void 0?X:!1}}},25488:function(wt,Ue,t){"use strict";t.d(Ue,{iM:function(){return x},RV:function(){return L},gI:function(){return k}});var h=t(52322),n=t(2784),g=t(25248);const L=(0,g.T0)({id:"plugin.permission.api"});var z=t(51666);class x{static create(F){const{config:Q,discovery:_,identity:ve}=F,ue=new z.Y2({discovery:_,config:Q});return new x(ue,ve)}async authorize(F){return(await this.permissionClient.authorize([F],await this.identityApi.getCredentials()))[0]}constructor(F,Q){this.permissionClient=F,this.identityApi=Q}}var l=t(49857);function k(ee){const F=(0,g.h_)(L),{data:Q,error:_}=(0,l.ZP)(ee,async ve=>{if((0,z.g2)(ve.permission)&&!ve.resourceRef)return z.rG.DENY;const{result:ue}=await F.authorize(ve);return ue});return _?{error:_,loading:!1,allowed:!1}:Q===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:Q===z.rG.ALLOW}}const ne=ee=>{const{permission:F,resourceRef:Q,errorComponent:_,...ve}=ee,ue=usePermission(isResourcePermission(F)?{permission:F,resourceRef:Q}:{permission:F}),A=useApp(),{NotFoundErrorPage:I}=A.getComponents();let $=_===void 0?_jsx(I,{}):_;return ue.loading?$=null:ue.allowed&&($=ee.element),_jsx(Route,{...ve,element:$})};function q(ee){const{permission:F,resourceRef:Q}=ee,_=usePermission(isResourcePermission(F)?{permission:F,resourceRef:Q}:{permission:F}),ve=useApp();if(_.loading)return null;if(_.allowed)return _jsx(_Fragment,{children:ee.children});if(ee.errorPage)return _jsx(_Fragment,{children:ee.errorPage});const{NotFoundErrorPage:ue}=ve.getComponents();return _jsx(ue,{})}},65826:function(wt,Ue,t){"use strict";t.d(Ue,{FA:function(){return k},qO:function(){return rt},Nd:function(){return Me},Rx:function(){return E}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class g{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Z){this.mockedResults=Z}}var L=t(52322),z=t(2784),x=t(79692);const l=(0,x.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),k=({text:M,preTag:Z,postTag:ce})=>{const pe=l(),Se=(0,z.useMemo)(()=>M.split(new RegExp(`(${Z}.+?${ce})`)),[ce,Z,M]);return(0,L.jsx)(L.Fragment,{children:Se.map((De,$e)=>De.includes(Z)?(0,L.jsx)("mark",{className:pe.highlight,children:De.replace(new RegExp(`${Z}|${ce}`,"g"),"")},$e):De)})};var ne=t(48760),q=t(50581),ee=t(61837),F=t(74603),Q=t(21853),_=t(33375),ve=t(76635),ue=t(64279),A=t(1849),I=t(51837);const $=(0,I.CT)("search-context"),E=()=>{const M=(0,z.useContext)($);if(!M)throw new Error("useSearch must be used within a SearchContextProvider");const Z=M.atVersion(1);if(!Z)throw new Error("No SearchContext v1 found");return Z},T=()=>(0,z.useContext)($)!==void 0,X={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},je=(M=X)=>{var Z,ce,pe,Se;const De=(0,h.h_)(n),[$e,Ge]=(0,z.useState)(M.term),[tt,C]=(0,z.useState)(M.types),[H,he]=(0,z.useState)(M.filters),[se,xe]=(0,z.useState)(M.pageLimit),[Oe,Fe]=(0,z.useState)(M.pageCursor),it=(0,A.Z)($e),jt=(0,A.Z)(H),ft=(0,ue.default)(()=>De.query({term:$e,types:tt,filters:H,pageLimit:se,pageCursor:Oe}),[$e,tt,H,se,Oe]),_e=!ft.loading&&!ft.error&&((Z=ft.value)===null||Z===void 0?void 0:Z.nextPageCursor),ot=!ft.loading&&!ft.error&&((ce=ft.value)===null||ce===void 0?void 0:ce.previousPageCursor),St=(0,z.useCallback)(()=>{var Ut;Fe((Ut=ft.value)===null||Ut===void 0?void 0:Ut.nextPageCursor)},[(pe=ft.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Tt=(0,z.useCallback)(()=>{var Ut;Fe((Ut=ft.value)===null||Ut===void 0?void 0:Ut.previousPageCursor)},[(Se=ft.value)===null||Se===void 0?void 0:Se.previousPageCursor]);return(0,z.useEffect)(()=>{it!==void 0&&$e!==it&&Fe(void 0)},[$e,it,Fe]),(0,z.useEffect)(()=>{jt!==void 0&&!(0,ve.isEqual)(H,jt)&&Fe(void 0)},[H,jt,Fe]),{result:ft,term:$e,setTerm:Ge,types:tt,setTypes:C,filters:H,setFilters:he,pageLimit:se,setPageLimit:xe,pageCursor:Oe,setPageCursor:Fe,fetchNextPage:_e?St:void 0,fetchPreviousPage:ot?Tt:void 0}},Ke=M=>{const{initialState:Z,children:ce}=M,pe=je(Z);return(0,L.jsx)(h.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,L.jsx)($.Provider,{value:(0,I.EI)({1:pe}),children:ce})})},Me=M=>{const{initialState:Z,inheritParentContextIfAvailable:ce,children:pe}=M;return T()&&ce?(0,L.jsx)(L.Fragment,{children:pe}):(0,L.jsx)(Ke,{initialState:Z,children:pe})},Ee=({children:M})=>{const Z=(0,h.z$)(),{term:ce}=E();return(0,z.useEffect)(()=>{ce&&Z.captureEvent("search",ce)},[Z,ce]),(0,L.jsx)(L.Fragment,{children:M})};function qe(M){return(0,z.forwardRef)((Z,ce)=>(0,L.jsx)(Me,{inheritParentContextIfAvailable:!0,children:(0,L.jsx)(M,{...Z,ref:ce})}))}const gt=qe((0,z.forwardRef)((M,Z)=>{const{onChange:ce,onKeyDown:pe=()=>{},onClear:Se=()=>{},onSubmit:De=()=>{},debounceTime:$e=200,clearButton:Ge=!0,fullWidth:tt=!0,value:C,placeholder:H,inputProps:he={},endAdornment:se,...xe}=M,Oe=(0,h.h_)(h.Ds),[Fe,it]=(0,z.useState)("");(0,z.useEffect)(()=>{it(Rt=>Rt!==C?String(C):Rt)},[C]),(0,ne.Z)(()=>ce(Fe),$e,[Fe]);const jt=(0,z.useCallback)(Rt=>{it(Rt.target.value)},[it]),ft=(0,z.useCallback)(Rt=>{pe&&pe(Rt),De&&Rt.key==="Enter"&&De()},[pe,De]),_e=(0,z.useCallback)(()=>{ce(""),Se&&Se()},[ce,Se]),ot=H!=null?H:`Search in ${Oe.getOptionalString("app.title")||"Backstage"}`,St=(0,L.jsx)(q.Z,{position:"start",children:(0,L.jsx)(ee.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,L.jsx)(Q.Z,{})})}),Tt=(0,L.jsx)(q.Z,{position:"end",children:(0,L.jsx)(ee.Z,{"aria-label":"Clear",size:"small",onClick:_e,children:(0,L.jsx)(_.Z,{})})});return(0,L.jsx)(Ee,{children:(0,L.jsx)(F.Z,{"data-testid":"search-bar-next",ref:Z,value:Fe,placeholder:ot,startAdornment:St,endAdornment:Ge?Tt:se,inputProps:{"aria-label":"Search",...he},fullWidth:tt,onChange:jt,onKeyDown:ft,...xe})})})),Ze=qe((0,z.forwardRef)((M,Z)=>{const{value:ce="",onChange:pe,...Se}=M,{term:De,setTerm:$e}=E();(0,z.useEffect)(()=>{ce&&$e(String(ce))},[ce,$e]);const Ge=(0,z.useCallback)(tt=>{pe?pe(tt):$e(tt)},[pe,$e]);return(0,L.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,L.jsx)(gt,{...Se,ref:Z,value:De,onChange:Ge})})}));var Ie=t(4614),nt=t(88013);const rt=(M=>Z=>(0,L.jsx)(Me,{inheritParentContextIfAvailable:!0,children:(0,L.jsx)(M,{...Z})}))(function(Z){const{loading:ce,value:pe,onChange:Se=()=>{},options:De=[],getOptionLabel:$e=_e=>String(_e),inputPlaceholder:Ge,inputDebounceTime:tt,freeSolo:C=!0,fullWidth:H=!0,clearOnBlur:he=!1,"data-testid":se="search-autocomplete",...xe}=Z,{setTerm:Oe}=E(),Fe=(0,z.useCallback)(_e=>_e?typeof _e=="string"?_e:$e(_e):"",[$e]),it=(0,z.useMemo)(()=>Fe(pe),[pe,Fe]),jt=(0,z.useCallback)((_e,ot,St,Tt)=>{Oe(Fe(ot)),Se(_e,ot,St,Tt)},[Fe,Oe,Se]),ft=(0,z.useCallback)(({InputProps:{ref:_e,endAdornment:ot},InputLabelProps:St,...Tt})=>(0,L.jsx)(Ze,{...Tt,ref:_e,clearButton:!1,value:it,placeholder:Ge,debounceTime:tt,endAdornment:ce?(0,L.jsx)(Ie.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):ot}),[ce,it,Ge,tt]);return(0,L.jsx)(nt.ZP,{...xe,"data-testid":se,value:pe,onChange:jt,options:De,getOptionLabel:$e,renderInput:ft,freeSolo:C,fullWidth:H,clearOnBlur:he})}),ct=({icon:M,primaryText:Z,primaryTextTypographyProps:ce,secondaryText:pe,secondaryTextTypographyProps:Se,disableTextTypography:De})=>_jsxs(_Fragment,{children:[M?_jsx(ListItemIcon,{children:M}):null,_jsx(ListItemText,{primary:Z,primaryTypographyProps:ce,secondary:pe,secondaryTypographyProps:Se,disableTypography:De})]});var lt=t(42494),mt=t(84899),dt=t(5806),We=t(21324),le=t(56939),Re=t(73698),ke=t(12231),st=t(86619),vt=t(7089),At=t(69294);const ht=(M,Z,ce=[],pe=250)=>{const Se=(0,z.useRef)({}),De=M||(()=>Promise.resolve([])),[$e,Ge]=(0,At.default)(De,[Z],{loading:!0});if((0,ne.Z)(()=>{Se.current[Z]===void 0&&(Se.current[Z]=Ge(Z).then(C=>(Se.current[Z]=C,C)))},pe,[Ge,Z]),ce.length)return{loading:!1,value:ce};const tt=Se.current[Z];return Array.isArray(tt)?{loading:!1,value:tt}:$e},bt=(M,Z)=>{const{setFilters:ce}=E();(0,z.useEffect)(()=>{Z&&[Z].flat().length>0&&ce(pe=>({...pe,[M]:Z}))},[])},kt=M=>{const{className:Z,defaultValue:ce,name:pe,values:Se,valuesDebounceMs:De,label:$e,filterSelectedOptions:Ge,limitTags:tt,multiple:C}=M,[H,he]=(0,z.useState)("");bt(pe,ce);const se=typeof Se=="function"?Se:void 0,xe=typeof Se=="function"?void 0:Se,{value:Oe,loading:Fe}=ht(se,H,xe,De),{filters:it,setFilters:jt}=E(),ft=it[pe]||(C?[]:null),_e=(Tt,Rt)=>{jt(Ut=>{const{[pe]:Qn,...zn}=Ut;return Rt?{...zn,[pe]:Rt}:{...zn}})},ot=Tt=>(0,L.jsx)(st.Z,{...Tt,name:"search",variant:"outlined",label:$e,fullWidth:!0}),St=(Tt,Rt)=>Tt.map((Ut,Qn)=>(0,L.jsx)(vt.Z,{label:Ut,color:"primary",...Rt({index:Qn})}));return(0,L.jsx)(nt.ZP,{filterSelectedOptions:Ge,limitTags:tt,multiple:C,className:Z,id:`${C?"multi-":""}select-filter-${pe}--select`,options:Oe||[],loading:Fe,value:ft,onChange:_e,onInputChange:(Tt,Rt)=>he(Rt),renderInput:ot,renderTags:St})},$t=(0,x.Z)({label:{textTransform:"capitalize"}}),en=M=>{const{className:Z,defaultValue:ce,label:pe,name:Se,values:De=[],valuesDebounceMs:$e}=M,Ge=$t(),{filters:tt,setFilters:C}=E();bt(Se,ce);const H=typeof De=="function"?De:void 0,he=typeof De=="function"?void 0:De,{value:se=[],loading:xe}=ht(H,"",he,$e),Oe=it=>{const{target:{value:jt,checked:ft}}=it;C(_e=>{const{[Se]:ot,...St}=_e,Tt=(ot||[]).filter(Ut=>Ut!==jt),Rt=ft?[...Tt,jt]:Tt;return Rt.length?{...St,[Se]:Rt}:St})};var Fe;return(0,L.jsxs)(lt.Z,{className:Z,disabled:xe,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,L.jsx)(mt.Z,{className:Ge.label,children:pe}):null,se.map(it=>(0,L.jsx)(dt.Z,{control:(0,L.jsx)(We.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":it},value:it,name:it,onChange:Oe,checked:((Fe=tt[Se])!==null&&Fe!==void 0?Fe:[]).includes(it)}),label:it},it))]})},on=M=>{const{className:Z,defaultValue:ce,label:pe,name:Se,values:De,valuesDebounceMs:$e}=M,Ge=$t();bt(Se,ce);const tt=typeof De=="function"?De:void 0,C=typeof De=="function"?void 0:De,{value:H=[],loading:he}=ht(tt,"",C,$e),{filters:se,setFilters:xe}=E(),Oe=Fe=>{const{target:{value:it}}=Fe;xe(jt=>{const{[Se]:ft,..._e}=jt;return it?{..._e,[Se]:it}:_e})};return(0,L.jsxs)(lt.Z,{disabled:he,className:Z,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,L.jsx)(le.Z,{className:Ge.label,margin:"dense",children:pe}):null,(0,L.jsxs)(Re.Z,{variant:"outlined",value:se[Se]||"",onChange:Oe,children:[(0,L.jsx)(ke.Z,{value:"",children:(0,L.jsx)("em",{children:"All"})}),H.map(Fe=>(0,L.jsx)(ke.Z,{value:Fe,children:Fe},Fe))]})]})},Vt=({component:M,...Z})=>(0,L.jsx)(M,{...Z});Vt.Checkbox=M=>(0,L.jsx)(Vt,{...M,component:en}),Vt.Select=M=>(0,L.jsx)(Vt,{...M,component:on}),Vt.Autocomplete=M=>(0,L.jsx)(Vt,{...M,component:kt});var Wt=t(93414);const un=M=>{const{children:Z}=M,pe=useSearch().result;return Z(pe)},_t=M=>{const{query:Z,children:ce}=M,pe=useApi(searchApiRef),Se=useAsync(()=>{const{term:De="",types:$e=[],filters:Ge={},...tt}=Z;return pe.query({...tt,term:De,types:$e,filters:Ge})},[Z]);return ce(Se)},Rn=M=>{const{query:Z,children:ce}=M;return Z?_jsx(_t,{query:Z,children:ce}):_jsx(un,{children:ce})},cn=M=>{const{query:Z,children:ce}=M;return _jsx(Rn,{query:Z,children:({loading:pe,error:Se,value:De})=>pe?_jsx(Progress,{}):Se?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Se}):De!=null&&De.results.length?ce(De):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},Pn=M=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(cn,{...M})}),hn=(0,x.Z)(M=>({root:{display:"flex",justifyContent:"space-between",gap:M.spacing(2),margin:M.spacing(2,0)}})),Jn=()=>{const{fetchNextPage:M,fetchPreviousPage:Z}=useSearch(),ce=hn();return!M&&!Z?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:ce.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Z,onClick:Z,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!M,onClick:M,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})};var Ht=t(48834).lW;const bn=M=>Ht.from(M.toString(),"utf-8").toString("base64"),Ln=M=>M?Number(Ht.from(M,"base64").toString("utf-8")):0,Gt=M=>{const{total:Z=-1,cursor:ce,onCursorChange:pe,limit:Se=25,limitLabel:De="Results per page:",limitText:$e=({from:xe,to:Oe})=>Z>0?`of ${Z}`:`${xe}-${Oe}`,limitOptions:Ge,onLimitChange:tt,...C}=M,H=useMemo(()=>Ln(ce),[ce]),he=useCallback((xe,Oe)=>{pe==null||pe(bn(Oe))},[pe]),se=useCallback(xe=>{const Oe=xe.target.value;tt==null||tt(parseInt(Oe,10))},[tt]);return _jsx(TablePagination,{...C,component:"div",count:Z,page:H,onPageChange:he,rowsPerPage:Se,labelRowsPerPage:De,labelDisplayedRows:$e,rowsPerPageOptions:Ge,onRowsPerPageChange:se})},pn=M=>{const{pageLimit:Z,setPageLimit:ce,pageCursor:pe,setPageCursor:Se}=useSearch();return _jsx(Gt,{...M,limit:Z,onLimitChange:ce,cursor:pe,onCursorChange:Se})},dn=({result:M,highlight:Z,rank:ce,icon:pe,secondaryAction:Se,lineClamp:De=5})=>{const $e=useAnalytics(),Ge=()=>{$e.captureEvent("discover",M.title,{attributes:{to:M.location},value:ce})};return _jsxs(Link,{noTrack:!0,to:M.location,onClick:Ge,children:[_jsxs(ListItem,{alignItems:"center",children:[pe&&_jsx(ListItemIcon,{children:pe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:Z!=null&&Z.fields.title?_jsx(HighlightedSearchResultText,{text:Z.fields.title,preTag:Z.preTag,postTag:Z.postTag}):M.title,secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:De,overflow:"hidden"},children:Z!=null&&Z.fields.text?_jsx(HighlightedSearchResultText,{text:Z.fields.text,preTag:Z.preTag,postTag:Z.postTag}):M.text})}),Se&&_jsx(Box,{alignItems:"flex-end",children:Se})]}),_jsx(Divider,{})]})},Sn=M=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(dn,{...M})}),kn=M=>{const{loading:Z,error:ce,resultItems:pe,renderResultItem:Se=Ge=>_jsx(DefaultResultListItem,{result:Ge.document},Ge.document.location),noResultsComponent:De=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...$e}=M;return _jsxs(List,{...$e,children:[Z?_jsx(Progress,{}):null,!Z&&ce?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ce}):null,!Z&&!ce&&(pe==null?void 0:pe.length)?pe.map(Se):null,!Z&&!ce&&!(pe!=null&&pe.length)?_jsx(ListItem,{children:De}):null]})},vn=M=>{const{query:Z,disableRenderingWithNoResults:ce,...pe}=M;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Z,children:({loading:Se,error:De,value:$e})=>{var Ge;return!(!($e==null||(Ge=$e.results)===null||Ge===void 0)&&Ge.length)&&ce?null:_jsx(kn,{...pe,loading:Se,error:De,resultItems:$e==null?void 0:$e.results})}})})};var ge=t(19126);const te=(0,x.Z)(M=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:M.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:M.palette.text.secondary,margin:M.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:M.palette.text.secondary,margin:M.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:M.spacing(.5)}})),Ae=M=>{const Z=te(),{label:ce,children:pe,...Se}=M;return _jsx(Chip,{...Se,className:Z.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[ce,": ",pe]})})},Ne=()=>null,Xe=(0,x.Z)(M=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:M.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:M.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),yt=M=>{const Z=Xe(),{label:ce,value:pe="None",onChange:Se,onDelete:De}=M,$e=useCallback(Ge=>{Se(Ge.target.value)},[Se]);return _jsx(Ae,{label:ce,onDelete:De,children:_jsx(Typography,{role:"textbox",component:"span",className:Z.root,onChange:$e,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},ie=(0,x.Z)(M=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:M.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),P=M=>{const Z=ie(),{label:ce,value:pe="none",onChange:Se,onDelete:De,children:$e}=M,Ge=useCallback(tt=>{Se(tt.target.value)},[Se]);return _jsx(Ae,{label:ce,onDelete:De,children:_jsxs(Select,{className:Z.root,value:pe,onChange:Ge,input:_jsx(InputBase,{}),IconComponent:Ne,children:[_jsx(MenuItem,{value:"none",children:"None"}),$e]})})};function J(M){const Z=te(),[ce,pe]=useState(null),{loading:Se,error:De,icon:$e,title:Ge,titleProps:tt={},link:C=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Z.listSubheaderLinkIcon})]}),linkProps:H={},filterOptions:he,renderFilterOption:se=Tt=>_jsx(MenuItem,{value:String(Tt),children:Tt},String(Tt)),filterFields:xe,renderFilterField:Oe,resultItems:Fe,renderResultItem:it=Tt=>_jsx(DefaultResultListItem,{result:Tt.document},Tt.document.location),noResultsComponent:jt=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ft}=M,_e=useCallback(Tt=>{pe(Tt.currentTarget)},[]),ot=useCallback(()=>{pe(null)},[]);var St;return _jsxs(List,{...ft,children:[_jsxs(ListSubheader,{className:Z.listSubheader,children:[$e,_jsx(Typography,{className:Z.listSubheaderName,component:"strong",...tt,children:Ge}),he?_jsx(Chip,{className:Z.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:_e}):null,he?_jsx(Menu,{id:"filters-menu",anchorEl:ce,open:Boolean(ce),onClose:ot,onClick:ot,keepMounted:!0,children:he.map(se)}):null,xe==null?void 0:xe.map(Tt=>(St=Oe==null?void 0:Oe(Tt))!==null&&St!==void 0?St:null),_jsx(Link,{className:Z.listSubheaderLink,to:"/search",...H,children:C})]}),Se?_jsx(Progress,{}):null,!Se&&De?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:De}):null,!Se&&!De&&(Fe==null?void 0:Fe.length)?Fe.map(it):null,!Se&&!De&&!(Fe!=null&&Fe.length)?_jsx(ListItem,{children:jt}):null]})}function He(M){const{query:Z,linkProps:ce={},disableRenderingWithNoResults:pe,...Se}=M,De=`/search?${qs.stringify({query:Z.term,types:Z.types,filters:Z.filters,pageCursor:Z.pageCursor},{arrayFormat:"brackets"})}`;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:Z,children:({loading:$e,error:Ge,value:tt})=>{var C;if(!(!(tt==null||(C=tt.results)===null||C===void 0)&&C.length)&&pe)return null;var H;return _jsx(J,{...Se,loading:$e,error:Ge,linkProps:{to:De,...ce},resultItems:tt==null?void 0:tt.results,filterFields:Object.keys((H=Z.filters)!==null&&H!==void 0?H:{})})}})})}},61886:function(wt,Ue,t){"use strict";t.d(Ue,{Ox:function(){return Ie},Zz:function(){return x},oZ:function(){return Me},DR:function(){return l},ZS:function(){return je},VA:function(){return rt},KY:function(){return ne},gT:function(){return _},Dl:function(){return ve},ux:function(){return at},$L:function(){return Q},x1:function(){return Ke}});var h=t(52322),n=t(2784),g=t(10289),L=t(25248);const z="techdocs.addons.addon.v1",x="techdocs.addons.wrapper.v1",l=()=>null;(0,L.R5)(l,x,!0);const k=le=>`${z}.${le.toLocaleLowerCase("en-US")}`;function ne(le){const{name:Re,component:ke}=le;return(0,L.YO)({name:Re,component:{sync:st=>(0,h.jsx)(ke,{...st})},data:{[z]:le,[k(Re)]:!0}})}const q=(le,Re)=>le.selectByComponentData({key:Re}).getElements()[0],ee=le=>le.selectByComponentData({key:x}).selectByComponentData({key:z}),F=le=>le.selectByComponentData({key:x}).findComponentData({key:z}),Q=()=>{const le=(0,g.pC)(),Re=(0,L.vJ)(le,ee),ke=(0,L.vJ)(le,F),st=(0,n.useCallback)(ht=>{if(!Re||!ht)return null;const bt=k(ht.name);var kt;return(kt=q(Re,bt))!==null&&kt!==void 0?kt:null},[Re]),vt=(0,n.useCallback)(ht=>{const bt=ke.find(kt=>kt.name===ht);return bt?st(bt):null},[ke,st]),At=(0,n.useCallback)(ht=>{const bt=ke.filter(kt=>kt.location===ht);return bt.length?bt.map(st):null},[ke,st]);return{renderComponentByName:vt,renderComponentsByLocation:At}},_=(0,L.T0)({id:"plugin.techdocs.service"}),ve=(0,L.T0)({id:"plugin.techdocs.storageservice"});var ue=t(64279),A=t(25271),I=t(51837);function $(le,Re){return Re.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(le.kind=le.kind.toLocaleLowerCase(),le.name=le.name.toLocaleLowerCase(),le.namespace=le.namespace.toLocaleLowerCase()),le}const E=(le,Re)=>(0,A.eE)(le)===(0,A.eE)(Re),T={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},X=(0,I.CT)("techdocs-reader-page-context"),je=(0,n.memo)(({entityRef:le,children:Re})=>{const ke=(0,L.h_)(_),st=(0,L.h_)(L.Ds),vt=(0,ue.default)(async()=>ke.getTechDocsMetadata(le),[le]),At=(0,ue.default)(async()=>ke.getEntityMetadata(le),[le]),[ht,bt]=(0,n.useState)(T.title),[kt,$t]=(0,n.useState)(T.subtitle),[en,on]=(0,n.useState)(T.shadowRoot),Vt={metadata:vt,entityRef:$(le,st),entityMetadata:At,shadowRoot:en,setShadowRoot:on,title:ht,setTitle:bt,subtitle:kt,setSubtitle:$t},Wt=(0,I.EI)({1:Vt});return(0,h.jsx)(X.Provider,{value:Wt,children:Re instanceof Function?Re(Vt):Re})},(le,Re)=>E(le.entityRef,Re.entityRef)),Ke=()=>{const le=(0,n.useContext)(X);if(le===void 0)return T;const Re=le.atVersion(1);if(Re===void 0)throw new Error("No context found for version 1.");return Re},Me=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Ee=t(70882),qe=t(50236),gt=t(19219),Ze=t(93414);const Ie="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",nt=le=>{(0,n.useEffect)(()=>{if(!le)return()=>{};const Re=le.querySelectorAll('head > link[rel="stylesheet"]');var ke;let st=(ke=Re==null?void 0:Re.length)!==null&&ke!==void 0?ke:0;const vt=new CustomEvent(Ie);if(!st)return le.dispatchEvent(vt),()=>{};const At=()=>{--st===0&&le.dispatchEvent(vt)};return Re==null||Re.forEach(ht=>{ht.addEventListener("load",At)}),()=>{Re==null||Re.forEach(ht=>{ht.removeEventListener("load",At)})}},[le])},at=le=>{const[Re,ke]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!le)return()=>{};ke(!0);const st=le.style;st.setProperty("opacity","0");const vt=()=>{ke(!1),st.setProperty("opacity","1")};return le.addEventListener(Ie,vt),()=>{le.removeEventListener(Ie,vt)}},[le]),Re},rt=({element:le,onAppend:Re,children:ke})=>{const[st,vt]=(0,n.useState)((0,Ee.Ue)({...(0,qe.Z)(),insertionPoint:void 0}));nt(le);const At=at(le),ht=(0,n.useCallback)(bt=>{if(!le||!bt)return;vt((0,Ee.Ue)({...(0,qe.Z)(),insertionPoint:le.querySelector("head")||void 0}));let kt=bt.shadowRoot;kt||(kt=bt.attachShadow({mode:"open"})),kt.replaceChildren(le),typeof Re=="function"&&Re(kt)},[le,Re]);return(0,h.jsxs)(h.Fragment,{children:[At&&(0,h.jsx)(Ze.Ex,{}),(0,h.jsxs)(gt.ZP,{jss:st,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:ht,"data-testid":"techdocs-native-shadowroot"}),ke]})]})};var ct=t(54073);const lt=()=>{const{shadowRoot:le}=useTechDocsReaderPage();return le},mt=le=>{const Re=lt();return Re?le.map(ke=>Re==null?void 0:Re.querySelectorAll(ke)).filter(ke=>ke.length).map(ke=>Array.from(ke)).flat():[]},dt=le=>le.toString()&&le.rangeCount&&le.getRangeAt(0).getBoundingClientRect().top,We=(le=0)=>{const Re=lt(),[ke,st]=useState(null),vt=useMemo(()=>debounce(()=>{const At=Re,ht=At.getSelection?At.getSelection():document.getSelection();ht&&dt(ht)?st(ht):st(null)},le),[Re,st,le]);return useEffect(()=>(window.document.addEventListener("selectionchange",vt),()=>window.document.removeEventListener("selectionchange",vt)),[vt]),ke}},52943:function(wt,Ue,t){"use strict";t.r(Ue),t.d(Ue,{EmbeddedDocsRouter:function(){return ue},Router:function(){return ve},isTechDocsAvailable:function(){return _}});var h=t(52322),n=t(2784),g=t(10289),L=t(43297),z=t(93414),x=t(25271),l=t(89258),k=t(65124),ne=t(67896);const q=({entity:A})=>{const I=(0,x.iB)(A);return(0,h.jsxs)(l.I6,{entityRef:I,children:[(0,h.jsx)(k.b,{}),(0,h.jsx)(ne.F,{withSearch:!1})]})};var ee=t(18662),F=t(7476);const Q="backstage.io/techdocs-ref",_=A=>{var I,$;return Boolean(A==null||(I=A.metadata)===null||I===void 0||($=I.annotations)===null||$===void 0?void 0:$[Q])},ve=()=>(0,h.jsxs)(g.Z5,{children:[(0,h.jsx)(g.AW,{path:"/",element:(0,h.jsx)(ee.TechDocsIndexPage,{})}),(0,h.jsx)(g.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(F.TechDocsReaderPage,{})})]}),ue=A=>{var I;const{children:$}=A,{entity:E}=(0,L.X2)(),T=(0,g.V$)([{path:"/*",element:(0,h.jsx)(q,{entity:E}),children:[{path:"*",element:$}]}]);return((I=E.metadata.annotations)===null||I===void 0?void 0:I[Q])?T:(0,h.jsx)(z.sk,{annotation:Q})}},92077:function(wt,Ue,t){"use strict";t.d(Ue,{k:function(){return z},p:function(){return L}});var h=t(23054),n=t(76372),g=t.n(n);class L{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:k,namespace:ne,name:q}=l,F=`${await this.getApiOrigin()}/metadata/techdocs/${ne}/${k}/${q}`,Q=await this.fetchApi.fetch(`${F}`);if(!Q.ok)throw await h.VL.fromResponse(Q);return await Q.json()}async getEntityMetadata(l){const{kind:k,namespace:ne,name:q}=l,F=`${await this.getApiOrigin()}/metadata/entity/${ne}/${k}/${q}`,Q=await this.fetchApi.fetch(`${F}`);if(!Q.ok)throw await h.VL.fromResponse(Q);return await Q.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class z{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,k){const{kind:ne,namespace:q,name:ee}=l,Q=`${await this.getStorageUrl()}/${q}/${ne}/${ee}/${k}`,_=await this.fetchApi.fetch(`${Q.endsWith("/")?Q:`${Q}/`}index.html`);let ve="";switch(_.status){case 404:throw ve="Page not found. ",k||(ve+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ve);case 500:throw ve="Could not generate documentation or an error in the TechDocs backend. ",new Error(ve);default:break}return _.text()}async syncEntityDocs(l,k=()=>{}){const{kind:ne,namespace:q,name:ee}=l,Q=`${await this.getApiOrigin()}/sync/${q}/${ne}/${ee}`,{token:_}=await this.identityApi.getCredentials();return new Promise((ve,ue)=>{const A=new n.EventSourcePolyfill(Q,{withCredentials:!0,headers:_?{Authorization:`Bearer ${_}`}:{}});A.addEventListener("log",I=>{I.data&&k(JSON.parse(I.data))}),A.addEventListener("finish",I=>{let $=!1;I.data&&({updated:$}=JSON.parse(I.data)),ve($?"updated":"cached")}),A.onerror=I=>{switch(A.close(),I.status){case 404:ue(new h.dR(I.message));return;default:ue(new Error(I.data));return}}})}async getBaseUrl(l,k,ne){const{kind:q,namespace:ee,name:F}=k,_=`${await this.getApiOrigin()}/static/docs/${ee}/${q}/${F}/${ne}`;return new URL(l,_.endsWith("/")?_:`${_}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(wt,Ue,t){"use strict";t.d(Ue,{D:function(){return h}});function h(n,g){return g.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(wt,Ue,t){"use strict";t.d(Ue,{u:function(){return k}});var h=t(52322),n=t(2784),g=t(93414),L=t(43297),z=t(42081),x=t(48431),l=t(68435);const k=ne=>{const{initialFilter:q="owned",columns:ee,actions:F}=ne;return(0,h.jsx)(z.j,{children:(0,h.jsxs)(g.VY,{children:[(0,h.jsx)(g.yW,{title:"",children:(0,h.jsx)(g.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(L.UO,{children:(0,h.jsxs)(L._i,{children:[(0,h.jsxs)(L._i.Filters,{children:[(0,h.jsx)(x.f,{}),(0,h.jsx)(L.EW,{initialFilter:q}),(0,h.jsx)(L.dq,{}),(0,h.jsx)(L.xE,{})]}),(0,h.jsx)(L._i.Content,{children:(0,h.jsx)(l.n,{actions:F,columns:ee})})]})})]})})}},85478:function(wt,Ue,t){"use strict";t.d(Ue,{f:function(){return ee}});var h=t(52322),n=t(95573),g=t(51953),L=t(25248),z=t(93414),x=t(94339),l=t(16111),k=t(24579),ne=t(14503),q=t(2784);const ee=ue=>{const{entities:A}=ue,I=(0,L.tg)(n.Fw),$=(0,L.h_)(L.Ds);if(!A)return null;var E,T;return(0,h.jsx)(z.Oh,{"data-testid":"docs-explore",children:A!=null&&A.length?A.map((X,je)=>(0,h.jsxs)(x.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(z.hu,{title:(E=X.metadata.title)!==null&&E!==void 0?E:X.metadata.name})}),(0,h.jsx)(k.Z,{children:X.metadata.description}),(0,h.jsx)(ne.Z,{children:(0,h.jsx)(z.zx,{to:I({namespace:(0,g.D)((T=X.metadata.namespace)!==null&&T!==void 0?T:"default",$),kind:(0,g.D)(X.kind,$),name:(0,g.D)(X.metadata.name,$)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},je)):null})};var F=t(43297);const Q={title:"All Documentation",filterPredicate:()=>!0},_=({entities:ue,group:A})=>{const{loading:I,isOwnedEntity:$}=useEntityOwnership(),E=ue.filter(X=>A.filterPredicate==="ownedByUser"?I?!1:$(X):typeof A.filterPredicate=="function"&&A.filterPredicate(X)),T=(()=>typeof A.title=="string"?_jsx(ContentHeader,{title:A.title}):A.title)();return E.length===0?null:_jsxs(Content,{children:[T,_jsx(DocsCardGrid,{entities:E})]})},ve=({groups:ue})=>{const{loading:A,error:I,entities:$}=useEntityList();if(I)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:I.toString()})});if(A)return _jsx(Progress,{});if($.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 E,T;return $.sort((X,je)=>((E=X.metadata.title)!==null&&E!==void 0?E:X.metadata.name).localeCompare((T=je.metadata.title)!==null&&T!==void 0?T:je.metadata.name)),_jsx(Content,{children:(ue||[Q]).map((X,je)=>_jsx(_,{entities:$,group:X},`${X.title}-${je}`))})}},68435:function(wt,Ue,t){"use strict";t.d(Ue,{H:function(){return $},n:function(){return E}});var h=t(52322),n=t(2784),g=t(95074),L=t(76635),z=t(93414),x=t(43297),l=t(25248),k=t(25271),ne=t(95573),q=t(39981),ee=t(2337),F=t(11640),Q=t(28347);const _=(0,ee.Z)({root:{color:"#f3ba37"}})(F.Z),ve={createCopyDocsUrlAction(T){return X=>({icon:()=>(0,h.jsx)(q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${X.resolved.docsUrl}`)})},createStarEntityAction(T,X){return({entity:je})=>{const Ke=T(je);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ke?(0,h.jsx)(_,{}):(0,h.jsx)(Q.Z,{}),tooltip:Ke?"Remove from favorites":"Add to favorites",onClick:()=>X(je)}}}};function ue(T){return T.metadata.title||T.metadata.name}const A={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:T=>(0,h.jsx)(z.uw,{value:(0,h.jsx)(z.rU,{to:T.resolved.docsUrl,children:ue(T.entity)}),subvalue:T.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(x.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var I=t(51953);const $=T=>{const{entities:X,title:je,loading:Ke,columns:Me,actions:Ee}=T,[,qe]=(0,g.Z)(),gt=(0,l.tg)(ne.Fw),Ze=(0,l.h_)(l.Ds);if(!X)return null;const Ie=X.map(rt=>{const ct=(0,x.hF)(rt,k.S4);var lt;return{entity:rt,resolved:{docsUrl:gt({namespace:(0,I.D)((lt=rt.metadata.namespace)!==null&&lt!==void 0?lt:"default",Ze),kind:(0,I.D)(rt.kind,Ze),name:(0,I.D)(rt.metadata.name,Ze)}),ownedByRelations:ct,ownedByRelationsTitle:ct.map(mt=>(0,x.$3)(mt,{defaultKind:"group"})).join(", ")}}}),nt=[A.createNameColumn(),A.createOwnerColumn(),A.createTypeColumn()],at=[ve.createCopyDocsUrlAction(qe)];return(0,h.jsx)(h.Fragment,{children:Ke||Ie&&Ie.length>0?(0,h.jsx)(z.iA,{isLoading:Ke,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Ie,columns:Me||nt,actions:Ee||at,title:je?`${je} (${Ie.length})`:`All (${Ie.length})`}):(0,h.jsx)(z.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(z.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};$.columns=A,$.actions=ve;const E=T=>{var X;const{columns:je,actions:Ke}=T,{loading:Me,error:Ee,entities:qe,filters:gt}=(0,x.wp)(),{isStarredEntity:Ze,toggleStarredEntity:Ie}=(0,x.CR)(),[,nt]=(0,g.Z)();var at;const rt=(0,L.capitalize)((at=(X=gt.user)===null||X===void 0?void 0:X.value)!==null&&at!==void 0?at:"all"),ct=[ve.createCopyDocsUrlAction(nt),ve.createStarEntityAction(Ze,Ie)];return Ee?(0,h.jsx)(z.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(z.Oi,{language:"text",text:Ee.toString()})}):(0,h.jsx)($,{title:rt,entities:qe,loading:Me,actions:Ke||ct,columns:je})};E.columns=A,E.actions=ve},18662:function(wt,Ue,t){"use strict";t.r(Ue),t.d(Ue,{TechDocsIndexPage:function(){return z}});var h=t(52322),n=t(2784),g=t(10289),L=t(3482);const z=x=>(0,g.pC)()||(0,h.jsx)(L.u,{...x})},42081:function(wt,Ue,t){"use strict";t.d(Ue,{j:function(){return z}});var h=t(52322),n=t(2784),g=t(93414),L=t(25248);const z=x=>{const{children:l}=x,k=(0,L.h_)(L.Ds);var ne;const q=`Documentation available in ${(ne=k.getOptionalString("organization.name"))!==null&&ne!==void 0?ne:"Backstage"}`;return(0,h.jsx)(g.g9,{title:"Documentation",subtitle:q,themeId:"documentation",children:l})}},48431:function(wt,Ue,t){"use strict";t.d(Ue,{f:function(){return L}});var h=t(2784),n=t(43297);class g{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const L=()=>{const{updateFilters:z}=(0,n.wp)();return(0,h.useEffect)(()=>{z({techdocs:new g})},[z]),null}},89258:function(wt,Ue,t){"use strict";t.d(Ue,{I6:function(){return q},Jl:function(){return ne},s4:function(){return z}});var h=t(61886),n=t(92077),g=t(95573),L=t(25248);const z=(0,L.rx)({id:"techdocs",apis:[(0,L.ni)({api:h.Dl,deps:{configApi:L.Ds,discoveryApi:L.NW,identityApi:L.$4,fetchApi:L.gP},factory:({configApi:ee,discoveryApi:F,identityApi:Q,fetchApi:_})=>new n.k({configApi:ee,discoveryApi:F,identityApi:Q,fetchApi:_})}),(0,L.ni)({api:h.gT,deps:{configApi:L.Ds,discoveryApi:L.NW,fetchApi:L.gP},factory:({configApi:ee,discoveryApi:F,fetchApi:Q})=>new n.p({configApi:ee,discoveryApi:F,fetchApi:Q})})],routes:{root:g._Z,docRoot:g.Fw,entityContent:g.pd}}),x=z.provide((0,L.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(ee=>ee.Router),mountPoint:g._Z})),l=z.provide((0,L.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(ee=>ee.EmbeddedDocsRouter),mountPoint:g.pd})),k=z.provide((0,L.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(ee=>ee.TechDocsCustomHome),mountPoint:g._Z})),ne=z.provide((0,L.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(ee=>ee.TechDocsIndexPage),mountPoint:g._Z})),q=z.provide((0,L.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(ee=>ee.TechDocsReaderPage),mountPoint:g.Fw}))},7476:function(wt,Ue,t){"use strict";t.r(Ue),t.d(Ue,{TechDocsReaderLayout:function(){return ee},TechDocsReaderPage:function(){return F}});var h=t(52322),n=t(2784),g=t(10289),L=t(93414),z=t(61886),x=t(67896),l=t(93225),k=t(65124),ne=t(95573),q=t(25248);const ee=({withSearch:Q,withHeader:_=!0})=>(0,h.jsxs)(L.T3,{themeId:"documentation",children:[_&&(0,h.jsx)(l.S,{}),(0,h.jsx)(k.b,{}),(0,h.jsx)(x.F,{withSearch:Q})]}),F=Q=>{const{kind:_,name:ve,namespace:ue}=(0,q.Oi)(ne.Fw),{children:A,entityRef:I={kind:_,name:ve,namespace:ue}}=Q,$=(0,g.pC)();if(!A){const T=($?n.Children.toArray($.props.children):[]).find(X=>{var je;if((0,q.IY)(X,z.Zz))return!1;const Ke=X==null||(je=X.props)===null||je===void 0?void 0:je.children;return Ke?!n.Children.toArray(Ke).some(Me=>(0,q.IY)(Me,z.Zz)):!0});return(0,h.jsx)(z.ZS,{entityRef:I,children:T||(0,h.jsx)(ee,{})})}return(0,h.jsx)(z.ZS,{entityRef:I,children:({metadata:E,entityMetadata:T,onReady:X})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(L.T3,{themeId:"documentation",children:A instanceof Function?A({entityRef:I,techdocsMetadataValue:E.value,entityMetadataValue:T.value,onReady:X}):A})})})}},67896:function(wt,Ue,t){"use strict";t.d(Ue,{F:function(){return Ge}});var h=t(52322),n=t(2784),g=t(79692),L=t(60905),z=t(61886),x=t(93414),l=t(17339),k=t(4614),ne=t(77277),q=t(99688),ee=t(12420),F=t(90436),Q=t(61837),_=t(4190),ve=t(87685);const ue=(0,g.Z)(C=>(0,ee.Z)({paper:{width:"100%",[C.breakpoints.up("sm")]:{width:"75%"},[C.breakpoints.up("md")]:{width:"50%"},padding:C.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:C.palette.background.default}})),A=({buildLog:C,onClose:H})=>{const he=ue(),se=C.length===0?"Waiting for logs...":C.join(`
32
+ `);return(0,h.jsxs)(L.Z,{container:!0,direction:"column",className:he.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(L.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(F.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(Q.Z,{title:"Close the drawer",onClick:H,color:"inherit",children:(0,h.jsx)(ve.Z,{})},"dismiss")]}),(0,h.jsx)(x.nU,{text:se,classes:{root:he.logs}})]})},I=({buildLog:C})=>{const H=ue(),[he,se]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>se(!0),children:"Show Build Logs"}),(0,h.jsx)(_.ZP,{classes:{paper:H.paper},anchor:"right",open:he,onClose:()=>se(!1),children:(0,h.jsx)(A,{buildLog:C,onClose:()=>se(!1)})})]})};var $=t(25248);const E=({errorMessage:C})=>{const H=(0,$.h_)($.Ds).getOptionalString("techdocs.builder");let he="";return H!=="local"&&(he="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,h.jsx)(x.mf,{status:"404",statusMessage:C||"Documentation not found",additionalInfo:he})};var T=t(95481);const X=(0,g.Z)(C=>({root:{marginBottom:C.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),je=()=>{let C=null;const H=X(),{state:he,contentReload:se,contentErrorMessage:xe,syncErrorMessage:Oe,buildLog:Fe}=(0,T.DK)();return he==="INITIAL_BUILD"&&(C=(0,h.jsx)(q.Z,{classes:{root:H.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(k.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:Fe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),he==="CONTENT_STALE_REFRESHING"&&(C=(0,h.jsx)(q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(k.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:Fe}),classes:{root:H.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),he==="CONTENT_STALE_READY"&&(C=(0,h.jsx)(q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>se(),children:"Refresh"}),classes:{root:H.root},children:"A newer version of this documentation is now available, please refresh to view."})),he==="CONTENT_STALE_ERROR"&&(C=(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:Fe}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",Oe]})),he==="CONTENT_NOT_FOUND"&&(C=(0,h.jsxs)(h.Fragment,{children:[Oe&&(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:Fe}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",Oe]}),(0,h.jsx)(E,{errorMessage:xe})]})),C};var Ke=t(10289),Me=t(60364),Ee=t(41156),qe=t(32838),gt=t(35368),Ze=t.n(gt);const Ie=/main\.[A-Fa-f0-9]{8}\.min\.css$/,nt=/^https:\/\/fonts\.googleapis\.com/,at=/^https:\/\/fonts\.gstatic\.com/,rt=C=>C.nodeName==="LINK",ct=C=>{const H=(C==null?void 0:C.getAttribute("href"))||"",he=H.match(Ie),se=H.match(nt),xe=H.match(at);return he||se||xe},lt=C=>(rt(C)&&!ct(C)&&C.remove(),C),mt=C=>C.nodeName==="IFRAME",dt=(C,H)=>{const he=C.getAttribute("src")||"";try{const{host:se}=new URL(he);return H.includes(se)}catch{return!1}},We=C=>H=>(mt(H)&&!dt(H,C)&&H.remove(),H),le=()=>{const C=(0,$.h_)($.Ds);return(0,n.useMemo)(()=>C.getOptionalConfig("techdocs.sanitizer"),[C])},Re=()=>{const C=le();return(0,n.useCallback)(async H=>{const he=C==null?void 0:C.getOptionalStringArray("allowedIframeHosts");Ze().addHook("beforeSanitizeElements",lt);const se=["link"];return he&&(se.push("iframe"),Ze().addHook("beforeSanitizeElements",We(he))),Ze().sanitize(H.innerHTML,{ADD_TAGS:se,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[C])};var ke=t(41128),st=({theme:C})=>`
33
+ /*================== Variables ==================*/
34
+ /*
35
+ 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.
36
+ 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.
37
+ */
38
+
39
+ :host {
40
+ /* FONT */
41
+ --md-default-fg-color: ${C.palette.text.primary};
42
+ --md-default-fg-color--light: ${C.palette.text.secondary};
43
+ --md-default-fg-color--lighter: ${(0,ke.$n)(C.palette.text.secondary,.7)};
44
+ --md-default-fg-color--lightest: ${(0,ke.$n)(C.palette.text.secondary,.3)};
45
+
46
+ /* BACKGROUND */
47
+ --md-default-bg-color:${C.palette.background.default};
48
+ --md-default-bg-color--light: ${C.palette.background.paper};
49
+ --md-default-bg-color--lighter: ${(0,ke.$n)(C.palette.background.paper,.7)};
50
+ --md-default-bg-color--lightest: ${(0,ke.$n)(C.palette.background.paper,.3)};
51
+
52
+ /* PRIMARY */
53
+ --md-primary-fg-color: ${C.palette.primary.main};
54
+ --md-primary-fg-color--light: ${C.palette.primary.light};
55
+ --md-primary-fg-color--dark: ${C.palette.primary.dark};
56
+ --md-primary-bg-color: ${C.palette.primary.contrastText};
57
+ --md-primary-bg-color--light: ${(0,ke.$n)(C.palette.primary.contrastText,.7)};
58
+
59
+ /* ACCENT */
60
+ --md-accent-fg-color: var(--md-primary-fg-color);
61
+
62
+ /* SHADOW */
63
+ --md-shadow-z1: ${C.shadows[1]};
64
+ --md-shadow-z2: ${C.shadows[2]};
65
+ --md-shadow-z3: ${C.shadows[3]};
66
+
67
+ /* EXTENSIONS */
68
+ --md-admonition-fg-color: var(--md-default-fg-color);
69
+ --md-admonition-bg-color: var(--md-default-bg-color);
70
+ /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
71
+ --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>');
72
+ --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>');
73
+ --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>');
74
+ --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>');
75
+ --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>');
76
+ --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>');
77
+ --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>');
78
+ --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>');
79
+ --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>');
80
+ --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>');
81
+ --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>');
82
+ --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>');
83
+ --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>');
84
+ --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>');
85
+ --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>');
86
+ --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>');
87
+ --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>');
88
+ --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>');
89
+ --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>');
90
+ --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>');
91
+ --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>');
92
+ --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>');
93
+ --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>');
94
+ --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>');
95
+ --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>');
96
+ --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>');
97
+ }
98
+
99
+ :host > * {
100
+ /* CODE */
101
+ --md-code-fg-color: ${C.palette.text.primary};
102
+ --md-code-bg-color: ${C.palette.background.paper};
103
+ --md-code-hl-color: ${(0,ke.Fq)(C.palette.warning.main,.5)};
104
+ --md-code-hl-keyword-color: ${C.palette.type==="dark"?C.palette.primary.light:C.palette.primary.dark};
105
+ --md-code-hl-function-color: ${C.palette.type==="dark"?C.palette.secondary.light:C.palette.secondary.dark};
106
+ --md-code-hl-string-color: ${C.palette.type==="dark"?C.palette.success.light:C.palette.success.dark};
107
+ --md-code-hl-number-color: ${C.palette.type==="dark"?C.palette.error.light:C.palette.error.dark};
108
+ --md-code-hl-constant-color: var(--md-code-hl-function-color);
109
+ --md-code-hl-special-color: var(--md-code-hl-function-color);
110
+ --md-code-hl-name-color: var(--md-code-fg-color);
111
+ --md-code-hl-comment-color: var(--md-default-fg-color--light);
112
+ --md-code-hl-generic-color: var(--md-default-fg-color--light);
113
+ --md-code-hl-variable-color: var(--md-default-fg-color--light);
114
+ --md-code-hl-operator-color: var(--md-default-fg-color--light);
115
+ --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
116
+
117
+ /* TYPESET */
118
+ --md-typeset-font-size: 1rem;
119
+ --md-typeset-color: var(--md-default-fg-color);
120
+ --md-typeset-a-color: var(--md-accent-fg-color);
121
+ --md-typeset-table-color: ${C.palette.text.primary};
122
+ --md-typeset-del-color: ${C.palette.type==="dark"?(0,ke.Fq)(C.palette.error.dark,.5):(0,ke.Fq)(C.palette.error.light,.5)};
123
+ --md-typeset-ins-color: ${C.palette.type==="dark"?(0,ke.Fq)(C.palette.success.dark,.5):(0,ke.Fq)(C.palette.success.light,.5)};
124
+ --md-typeset-mark-color: ${C.palette.type==="dark"?(0,ke.Fq)(C.palette.warning.dark,.5):(0,ke.Fq)(C.palette.warning.light,.5)};
125
+ }
126
+
127
+ @media screen and (max-width: 76.1875em) {
128
+ :host > * {
129
+ /* TYPESET */
130
+ --md-typeset-font-size: .9rem;
131
+ }
132
+ }
133
+
134
+ @media screen and (max-width: 600px) {
135
+ :host > * {
136
+ /* TYPESET */
137
+ --md-typeset-font-size: .7rem;
138
+ }
139
+ }
140
+ `,vt=({theme:C})=>`
141
+ /*================== Reset ==================*/
142
+
143
+ body {
144
+ --md-text-color: var(--md-default-fg-color);
145
+ --md-text-link-color: var(--md-accent-fg-color);
146
+ --md-text-font-family: ${C.typography.fontFamily};
147
+ font-family: var(--md-text-font-family);
148
+ background-color: unset;
149
+ }
150
+ `;const At="224px";var ht=({theme:C,sidebar:H})=>`
151
+ /*================== Layout ==================*/
152
+
153
+ .md-grid {
154
+ max-width: 100%;
155
+ margin: 0;
156
+ }
157
+
158
+ .md-nav {
159
+ font-size: calc(var(--md-typeset-font-size) * 0.9);
160
+ }
161
+ .md-nav__link {
162
+ display: flex;
163
+ align-items: center;
164
+ justify-content: space-between;
165
+ }
166
+ .md-nav__icon {
167
+ height: 20px !important;
168
+ width: 20px !important;
169
+ margin-left:${C.spacing(1)}px;
170
+ }
171
+ .md-nav__icon svg {
172
+ margin: 0;
173
+ width: 20px !important;
174
+ height: 20px !important;
175
+ }
176
+ .md-nav__icon:after {
177
+ width: 20px !important;
178
+ height: 20px !important;
179
+ }
180
+
181
+ .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
182
+ text-decoration: underline;
183
+ color: var(--md-typeset-a-color);
184
+ }
185
+
186
+ .md-main__inner {
187
+ margin-top: 0;
188
+ }
189
+
190
+ .md-sidebar {
191
+ bottom: 75px;
192
+ position: fixed;
193
+ width: 16rem;
194
+ overflow-y: auto;
195
+ overflow-x: hidden;
196
+ scrollbar-color: rgb(193, 193, 193) #eee;
197
+ scrollbar-width: thin;
198
+ }
199
+ .md-sidebar .md-sidebar__scrollwrap {
200
+ width: calc(12.1rem);
201
+ }
202
+ .md-sidebar--secondary {
203
+ right: ${C.spacing(3)}px;
204
+ }
205
+ .md-sidebar::-webkit-scrollbar {
206
+ width: 5px;
207
+ }
208
+ .md-sidebar::-webkit-scrollbar-button {
209
+ width: 5px;
210
+ height: 5px;
211
+ }
212
+ .md-sidebar::-webkit-scrollbar-track {
213
+ background: #eee;
214
+ border: 1 px solid rgb(250, 250, 250);
215
+ box-shadow: 0px 0px 3px #dfdfdf inset;
216
+ border-radius: 3px;
217
+ }
218
+ .md-sidebar::-webkit-scrollbar-thumb {
219
+ width: 5px;
220
+ background: rgb(193, 193, 193);
221
+ border: transparent;
222
+ border-radius: 3px;
223
+ }
224
+ .md-sidebar::-webkit-scrollbar-thumb:hover {
225
+ background: rgb(125, 125, 125);
226
+ }
227
+
228
+ .md-content {
229
+ max-width: calc(100% - 16rem * 2);
230
+ margin-left: 16rem;
231
+ margin-bottom: 50px;
232
+ }
233
+
234
+ .md-footer {
235
+ position: fixed;
236
+ bottom: 0px;
237
+ }
238
+ .md-footer__title {
239
+ background-color: unset;
240
+ }
241
+ .md-footer-nav__link {
242
+ width: 16rem;
243
+ }
244
+
245
+ .md-dialog {
246
+ background-color: unset;
247
+ }
248
+
249
+ @media screen and (min-width: 76.25em) {
250
+ .md-sidebar {
251
+ height: auto;
252
+ }
253
+ }
254
+
255
+ @media screen and (max-width: 76.1875em) {
256
+ .md-nav {
257
+ transition: none !important;
258
+ background-color: var(--md-default-bg-color)
259
+ }
260
+ .md-nav--primary .md-nav__title {
261
+ cursor: auto;
262
+ color: var(--md-default-fg-color);
263
+ font-weight: 700;
264
+ white-space: normal;
265
+ line-height: 1rem;
266
+ height: auto;
267
+ display: flex;
268
+ flex-flow: column;
269
+ row-gap: 1.6rem;
270
+ padding: 1.2rem .8rem .8rem;
271
+ background-color: var(--md-default-bg-color);
272
+ }
273
+ .md-nav--primary .md-nav__title~.md-nav__list {
274
+ box-shadow: none;
275
+ }
276
+ .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
277
+ border-top: none;
278
+ }
279
+ .md-nav--primary .md-nav__title .md-nav__button {
280
+ display: none;
281
+ }
282
+ .md-nav--primary .md-nav__title .md-nav__icon {
283
+ color: var(--md-default-fg-color);
284
+ position: static;
285
+ height: auto;
286
+ margin: 0 0 0 -0.2rem;
287
+ }
288
+ .md-nav--primary > .md-nav__title [for="none"] {
289
+ padding-top: 0;
290
+ }
291
+ .md-nav--primary .md-nav__item {
292
+ border-top: none;
293
+ }
294
+ .md-nav--primary :is(.md-nav__title,.md-nav__item) {
295
+ font-size : var(--md-typeset-font-size);
296
+ }
297
+ .md-nav .md-source {
298
+ display: none;
299
+ }
300
+
301
+ .md-sidebar {
302
+ height: 100%;
303
+ }
304
+ .md-sidebar--primary {
305
+ width: 12.1rem !important;
306
+ z-index: 200;
307
+ left: ${H.isPinned?`calc(-12.1rem + ${At})`:"calc(-12.1rem + 72px)"} !important;
308
+ }
309
+ .md-sidebar--secondary:not([hidden]) {
310
+ display: none;
311
+ }
312
+
313
+ .md-content {
314
+ max-width: 100%;
315
+ margin-left: 0;
316
+ }
317
+
318
+ .md-header__button {
319
+ margin: 0.4rem 0;
320
+ margin-left: 0.4rem;
321
+ padding: 0;
322
+ }
323
+
324
+ .md-overlay {
325
+ left: 0;
326
+ }
327
+
328
+ .md-footer {
329
+ position: static;
330
+ padding-left: 0;
331
+ }
332
+ .md-footer-nav__link {
333
+ /* footer links begin to overlap at small sizes without setting width */
334
+ width: 50%;
335
+ }
336
+ }
337
+
338
+ @media screen and (max-width: 600px) {
339
+ .md-sidebar--primary {
340
+ left: -12.1rem !important;
341
+ width: 12.1rem;
342
+ }
343
+ }
344
+ `;const bt=["h1","h2","h3","h4","h5","h6"];var kt=({theme:C})=>`
345
+ /*================== Typeset ==================*/
346
+
347
+ .md-typeset {
348
+ font-size: var(--md-typeset-font-size);
349
+ }
350
+
351
+ ${bt.reduce((H,he)=>{var se;const xe=(se=C.typography.htmlFontSize)!==null&&se!==void 0?se:16,Oe=C.typography[he],{lineHeight:Fe,fontFamily:it,fontWeight:jt,fontSize:ft}=Oe,_e=ot=>{let St=1;return typeof ot=="number"&&(St=ot/xe*.6),typeof ot=="string"&&(St=ot.replace("rem","")),`calc(${St} * var(--md-typeset-font-size))`};return H.concat(`
352
+ .md-typeset ${he} {
353
+ color: var(--md-default-fg-color);
354
+ line-height: ${Fe};
355
+ font-family: ${it};
356
+ font-weight: ${jt};
357
+ font-size: ${_e(ft)};
358
+ }
359
+ `)},"")}
360
+
361
+ .md-typeset .md-content__button {
362
+ color: var(--md-default-fg-color);
363
+ }
364
+
365
+ .md-typeset hr {
366
+ border-bottom: 0.05rem dotted ${C.palette.divider};
367
+ }
368
+
369
+ .md-typeset details {
370
+ font-size: var(--md-typeset-font-size) !important;
371
+ }
372
+ .md-typeset details summary {
373
+ padding-left: 2.5rem !important;
374
+ }
375
+ .md-typeset details summary:before,
376
+ .md-typeset details summary:after {
377
+ top: 50% !important;
378
+ width: 20px !important;
379
+ height: 20px !important;
380
+ transform: rotate(0deg) translateY(-50%) !important;
381
+ }
382
+ .md-typeset details[open] > summary:after {
383
+ transform: rotate(90deg) translateX(-50%) !important;
384
+ }
385
+
386
+ .md-typeset blockquote {
387
+ color: var(--md-default-fg-color--light);
388
+ border-left: 0.2rem solid var(--md-default-fg-color--light);
389
+ }
390
+
391
+ .md-typeset table:not([class]) {
392
+ font-size: var(--md-typeset-font-size);
393
+ border: 1px solid var(--md-default-fg-color);
394
+ border-bottom: none;
395
+ border-collapse: collapse;
396
+ }
397
+ .md-typeset table:not([class]) th {
398
+ font-weight: bold;
399
+ }
400
+ .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
401
+ border-bottom: 1px solid var(--md-default-fg-color);
402
+ }
403
+
404
+ .md-typeset pre > code::-webkit-scrollbar-thumb {
405
+ background-color: hsla(0, 0%, 0%, 0.32);
406
+ }
407
+ .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
408
+ background-color: hsla(0, 0%, 0%, 0.87);
409
+ }
410
+ `,$t=()=>`
411
+ /*================== Animations ==================*/
412
+ /*
413
+ Disable CSS animations on link colors as they lead to issues in dark mode.
414
+ The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
415
+ */
416
+ .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
417
+ transition: none;
418
+ }
419
+ `,en=({theme:C})=>`
420
+ /*================== Extensions ==================*/
421
+
422
+ /* HIGHLIGHT */
423
+ .highlight .md-clipboard:after {
424
+ content: unset;
425
+ }
426
+
427
+ .highlight .nx {
428
+ color: ${C.palette.type==="dark"?"#ff53a3":"#ec407a"};
429
+ }
430
+
431
+ /* CODE HILITE */
432
+ .codehilite .gd {
433
+ background-color: ${C.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
434
+ }
435
+
436
+ .codehilite .gi {
437
+ background-color: ${C.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
438
+ }
439
+
440
+ /* TABBED */
441
+ .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
442
+ .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
443
+ .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
444
+ .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
445
+ .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
446
+ .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
447
+ .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
448
+ .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
449
+ .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
450
+ .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
451
+ .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
452
+ .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
453
+ .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
454
+ .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
455
+ .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
456
+ .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
457
+ .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
458
+ .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
459
+ .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
460
+ .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
461
+ color: var(--md-accent-fg-color);
462
+ border-color: var(--md-accent-fg-color);
463
+ }
464
+
465
+ /* TASK-LIST */
466
+ .task-list-control .task-list-indicator::before {
467
+ background-color: ${C.palette.action.disabledBackground};
468
+ }
469
+ .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
470
+ background-color: ${C.palette.success.main};
471
+ }
472
+
473
+ /* ADMONITION */
474
+ .admonition {
475
+ font-size: var(--md-typeset-font-size) !important;
476
+ }
477
+ .admonition .admonition-title {
478
+ padding-left: 2.5rem !important;
479
+ }
480
+
481
+ .admonition .admonition-title:before {
482
+ top: 50% !important;
483
+ width: 20px !important;
484
+ height: 20px !important;
485
+ transform: translateY(-50%) !important;
486
+ }
487
+ `;const on=[st,vt,ht,kt,$t,en],Vt=()=>(0,x.Pf)(),Wt=()=>{const C=Vt(),H=(0,Me.Z)();return(0,n.useMemo)(()=>{const he={theme:H,sidebar:C};return on.reduce((se,xe)=>se+xe(he),"")},[H,C])},un=()=>{const C=Wt();return(0,n.useCallback)(H=>(H.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${C}</style>`),H),[C])},_t=(C,H,he)=>{const se=C==="src"&&H.endsWith(".svg"),xe=!H.match(/^([a-z]*:)?\/\//i),Oe=H.startsWith(he);return se&&(xe||Oe)},Rn=({techdocsStorageApi:C,entityId:H,path:he})=>async se=>{const xe=await C.getApiOrigin(),Oe=async(Fe,it)=>{for(const jt of Fe)if(jt.hasAttribute(it)){const ft=jt.getAttribute(it);if(!ft)return;const _e=await C.getBaseUrl(ft,H,he);if(_t(it,ft,xe))try{const St=await(await fetch(_e,{credentials:"include"})).text();jt.setAttribute(it,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(St)))}`)}catch{jt.setAttribute("alt",`Error: ${ft}`)}else jt.setAttribute(it,_e)}};return await Promise.all([Oe(se.querySelectorAll("img"),"src"),Oe(se.querySelectorAll("script"),"src"),Oe(se.querySelectorAll("source"),"src"),Oe(se.querySelectorAll("link"),"href"),Oe(se.querySelectorAll("a[download]"),"href")]),se};var cn=t(79158),Pn=t(67097),hn=t(28316),Jn=t(82717),Ht=t.n(Jn);const bn=C=>H=>{var he;const se=H.querySelector('[title="Edit this page"]');if(!se||!se.href)return H;const xe=new URL(se.href),Oe=C.byUrl(xe);if((Oe==null?void 0:Oe.type)!=="github"&&(Oe==null?void 0:Oe.type)!=="gitlab")return H;const Fe=((he=H.querySelector("article>h1"))===null||he===void 0?void 0:he.childNodes[0].textContent)||"",it=encodeURIComponent(`Documentation Feedback: ${Fe}`),jt=encodeURIComponent(`Page source:
488
+ ${se.href}
489
+
490
+ Feedback:`),ft=(Oe==null?void 0:Oe.type)==="github"?(0,cn.BT)(xe.href,"blob"):xe.href,_e=Ht()(ft),ot=`/${_e.organization}/${_e.name}`,St=se.cloneNode();switch(Oe==null?void 0:Oe.type){case"gitlab":St.href=`${xe.origin}${ot}/issues/new?issue[title]=${it}&issue[description]=${jt}`;break;case"github":St.href=`${xe.origin}${ot}/issues/new?title=${it}&body=${jt}`;break;default:return H}return hn.render(n.createElement(Pn.Z),St),St.style.paddingLeft="5px",St.title="Leave feedback for this page",St.id="git-feedback-link",se==null||se.insertAdjacentElement("beforebegin",St),H};var Ln=t(44882);const Gt=()=>C=>{const H=C.querySelector('.md-header label[for="__drawer"]'),he=C.querySelector("article");if(!H||!he)return C;const se=H.cloneNode();return hn.render(n.createElement(Ln.Z),se),se.id="toggle-sidebar",se.title="Toggle Sidebar",se.classList.add("md-content__button"),se.style.setProperty("padding","0 0 0 5px"),se.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),he==null||he.prepend(se),C},pn=()=>C=>(((he,se)=>{Array.from(he).filter(xe=>xe.hasAttribute(se)).forEach(xe=>{const Oe=xe.getAttribute(se);if(Oe){Oe.match(/^https?:\/\//i)&&xe.setAttribute("target","_blank");try{const Fe=dn(window.location.href);xe.setAttribute(se,new URL(Oe,Fe).toString())}catch{xe.replaceWith(xe.textContent||Oe)}}})})(Array.from(C.getElementsByTagName("a")),"href"),C);function dn(C){const H=new URL(C);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Sn=({baseUrl:C,onClick:H})=>he=>(Array.from(he.getElementsByTagName("a")).forEach(se=>{se.addEventListener("click",xe=>{const Fe=se.getAttribute("href");!Fe||Fe.startsWith(C)&&!se.hasAttribute("download")&&(xe.preventDefault(),H(xe,Fe))})}),he);var kn=t(15459),vn=t(80030),ge=t(72379),te=t(41547);const Ae=(0,kn.Z)(C=>({tooltip:{fontSize:"inherit",color:C.palette.text.primary,margin:0,padding:C.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(vn.ZP),Ne=()=>(0,h.jsx)(ge.Z,{children:(0,h.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"})}),Xe=({text:C})=>{const[H,he]=(0,n.useState)(!1),se=(0,n.useCallback)(()=>{navigator.clipboard.writeText(C),he(!0)},[C]),xe=(0,n.useCallback)(()=>{he(!1)},[he]);return(0,h.jsx)(Ae,{title:"Copied to clipboard",placement:"left",open:H,onClose:xe,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:se,children:(0,h.jsx)(Ne,{})})})},yt=C=>H=>{const he=H.querySelectorAll("pre > code");for(const xe of he){var se;const Oe=xe.textContent||"",Fe=document.createElement("div");xe==null||(se=xe.parentElement)===null||se===void 0||se.prepend(Fe),hn.render((0,h.jsx)(te.Z,{theme:C,children:(0,h.jsx)(Xe,{text:Oe})}),Fe)}return H},ie=()=>C=>{var H;return(H=C.querySelector(".md-header"))===null||H===void 0||H.remove(),C},P=()=>C=>{var H,he;return(H=C.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(he=C.querySelector(".md-footer-copyright"))===null||he===void 0||he.remove(),C},J=({onLoading:C,onLoaded:H})=>he=>(C(),he.addEventListener(z.Ox,function se(){H(),he.removeEventListener(z.Ox,se)}),he),He=()=>C=>(setTimeout(()=>{if(window.location.hash){var H;const he=window.location.hash.slice(1);(H=C==null?void 0:C.querySelector(`[id="${he}"]`))===null||H===void 0||H.scrollIntoView()}},200),C),M=()=>C=>(setTimeout(()=>{const H=C==null?void 0:C.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(se=>{const xe=se==null?void 0:se.querySelector("input");xe!=null&&xe.checked||xe==null||xe.click()}),H[H.length-1].scrollIntoView())},200),C),Z=async(C,H)=>{let he;if(typeof C=="string")he=new DOMParser().parseFromString(C,"text/html").documentElement;else if(C instanceof Element)he=C;else throw new Error("dom is not a recognized type");for(const se of H)he=await se(he);return he},ce="screen and (max-width: 76.1875em)",pe=C=>{const H=(0,Ke.s0)(),he=(0,Me.Z)(),se=(0,Ee.Z)(ce),xe=Re(),Oe=un(),Fe=(0,$.h_)(z.Dl),it=(0,$.h_)(qe.q3),{state:jt,path:ft,content:_e}=(0,T.DK)(),[ot,St]=(0,n.useState)(null),Tt=(0,z.ux)(ot),Rt=(0,n.useCallback)(()=>{if(!ot)return;ot.querySelectorAll(".md-sidebar").forEach(Dt=>{if(se)Dt.style.top="0px";else{const On=document==null?void 0:document.querySelector(".techdocs-reader-page");var rn;const Vn=(rn=On==null?void 0:On.getBoundingClientRect().top)!==null&&rn!==void 0?rn:0;var Cn;let er=(Cn=ot.getBoundingClientRect().top)!==null&&Cn!==void 0?Cn:0;const Wn=ot.querySelector(".md-container > .md-tabs");var an;const Zn=(an=Wn==null?void 0:Wn.getBoundingClientRect().height)!==null&&an!==void 0?an:0;er<Vn&&(er=Vn),Dt.style.top=`${Math.max(er,0)+Zn}px`}Dt.style.setProperty("opacity","1")})},[ot,se]);(0,n.useEffect)(()=>(window.addEventListener("resize",Rt),window.addEventListener("scroll",Rt,!0),()=>{window.removeEventListener("resize",Rt),window.removeEventListener("scroll",Rt,!0)}),[ot,Rt]);const Ut=(0,n.useCallback)(()=>{if(!ot)return;const Nt=ot.querySelector(".md-footer");Nt&&(Nt.style.width=`${ot.getBoundingClientRect().width}px`)},[ot]);(0,n.useEffect)(()=>(window.addEventListener("resize",Ut),()=>{window.removeEventListener("resize",Ut)}),[ot,Ut]),(0,n.useEffect)(()=>{Tt||(Ut(),Rt())},[jt,Tt,Ut,Rt]);const Qn=(0,n.useCallback)((Nt,Dt)=>Z(Nt,[xe,Rn({techdocsStorageApi:Fe,entityId:C,path:Dt}),pn(),Gt(),ie(),P(),bn(it),Oe]),[C,it,Fe,xe,Oe]),zn=(0,n.useCallback)(async Nt=>Z(Nt,[He(),M(),yt(he),Sn({baseUrl:window.location.origin,onClick:(Dt,rn)=>{const Cn=Dt.ctrlKey||Dt.metaKey,an=new URL(rn),On=`${an.pathname}${an.search}${an.hash}`;if(an.hash)if(Cn)window.open(On,"_blank");else{var Vn;H(On),(Vn=Nt==null?void 0:Nt.querySelector(`[id="${an.hash.slice(1)}"]`))===null||Vn===void 0||Vn.scrollIntoView()}else Cn?window.open(On,"_blank"):H(On)}}),J({onLoading:()=>{},onLoaded:()=>{var Dt;(Dt=Nt.querySelector(".md-nav__title"))===null||Dt===void 0||Dt.removeAttribute("for")}}),J({onLoading:()=>{Array.from(Nt.querySelectorAll(".md-sidebar")).forEach(rn=>{rn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[he,H]);return(0,n.useEffect)(()=>{if(!_e)return()=>{};let Nt=!0;return Qn(_e,ft).then(async Dt=>{if(!(Dt!=null&&Dt.innerHTML)||!Nt)return;window.scroll({top:0});const rn=await zn(Dt);St(rn)}),()=>{Nt=!1}},[_e,ft,Qn,zn]),ot};var Se=t(8560);const De=()=>{const C=(0,z.$L)(),{shadowRoot:H}=(0,z.x1)(),he=H==null?void 0:H.querySelector('[data-md-component="content"]'),se=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let xe=se==null?void 0:se.querySelector('[data-techdocs-addons-location="primary sidebar"]');xe||(xe=document.createElement("div"),xe.setAttribute("data-techdocs-addons-location","primary sidebar"),se==null||se.prepend(xe));const Oe=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Fe=Oe==null?void 0:Oe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Fe||(Fe=document.createElement("div"),Fe.setAttribute("data-techdocs-addons-location","secondary sidebar"),Oe==null||Oe.prepend(Fe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Se.Z,{container:xe,children:C.renderComponentsByLocation(z.oZ.PrimarySidebar)}),(0,h.jsx)(Se.Z,{container:he,children:C.renderComponentsByLocation(z.oZ.Content)}),(0,h.jsx)(Se.Z,{container:Fe,children:C.renderComponentsByLocation(z.oZ.SecondarySidebar)})]})},$e=(0,g.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Ge=(0,T.m1)(C=>{var H;const{withSearch:he=!0,onReady:se}=C,xe=$e(),{entityMetadata:{value:Oe,loading:Fe},entityRef:it,setShadowRoot:jt}=(0,z.x1)(),ft=pe(it),_e=(0,n.useCallback)(ot=>{jt(ot),se instanceof Function&&se()},[jt,se]);return Fe===!1&&!Oe?(0,h.jsx)(x.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):ft?(0,h.jsx)(x.VY,{children:(0,h.jsxs)(L.Z,{container:!0,children:[(0,h.jsx)(L.Z,{xs:12,item:!0,children:(0,h.jsx)(je,{})}),he&&(0,h.jsx)(L.Z,{className:xe.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:it,entityTitle:Oe==null||(H=Oe.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)(L.Z,{xs:12,item:!0,children:(0,h.jsx)(z.VA,{element:ft,onAppend:_e,children:(0,h.jsx)(De,{})})})]})}):(0,h.jsx)(x.VY,{children:(0,h.jsx)(L.Z,{container:!0,children:(0,h.jsx)(L.Z,{xs:12,item:!0,children:(0,h.jsx)(je,{})})})})}),tt=null},93225:function(wt,Ue,t){"use strict";t.d(Ue,{S:function(){return Q}});var h=t(52322),n=t(2784),g=t(18671),L=t(98069),z=t(73250),x=t(61886),l=t(43297),k=t(25271),ne=t(93414),q=t(25248),ee=t(95573);const F=(0,h.jsx)(L.Z,{animation:"wave",variant:"text",height:40}),Q=_=>{const{children:ve}=_,ue=(0,x.$L)(),A=(0,q.h_)(q.Ds),{title:I,setTitle:$,subtitle:E,setSubtitle:T,entityRef:X,metadata:{value:je,loading:Ke},entityMetadata:{value:Me,loading:Ee}}=(0,x.x1)();(0,n.useEffect)(()=>{!je||($(je.site_name),T(()=>{let{site_description:dt}=je;return(!dt||dt==="None")&&(dt="Home"),dt}))},[je,$,T]);const qe=A.getOptional("app.title")||"Backstage",gt=[I,E,qe].filter(Boolean).join(" | "),{locationMetadata:Ze,spec:Ie}=Me||{},nt=Ie==null?void 0:Ie.lifecycle,at=Me?(0,l.hF)(Me,k.S4):[],rt=(0,q.tg)(ee._Z)(),ct=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:X,title:Me==null?void 0:Me.metadata.title,defaultKind:"Component"})}),at.length>0&&(0,h.jsx)(ne.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:at,defaultKind:"group"})}),nt?(0,h.jsx)(ne.i9,{label:"Lifecycle",value:nt}):null,Ze&&Ze.type!=="dir"&&Ze.type!=="file"?(0,h.jsx)(ne.i9,{label:"",value:(0,h.jsx)("a",{href:Ze.target,target:"_blank",rel:"noopener noreferrer",children:(0,h.jsx)(z.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!Ee&&Me===void 0||!Ke&&je===void 0?null:(0,h.jsxs)(ne.h4,{type:"Documentation",typeLink:rt,title:I||F,subtitle:E||F,children:[(0,h.jsx)(g.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:gt})}),ct,ve,ue.renderComponentsByLocation(x.oZ.Header)]})}},65124:function(wt,Ue,t){"use strict";t.d(Ue,{b:function(){return F}});var h=t(52322),n=t(2784),g=t(79692),L=t(15223),z=t(95544),x=t(80030),l=t(61837),k=t(48348),ne=t(47603),q=t(61886);const ee=(0,g.Z)(Q=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:Q.spacing(3,3,0)}})),F=Q=>{const _=ee(),[ve,ue]=(0,n.useState)(null),A=(0,n.useCallback)(Ke=>{ue(Ke.currentTarget)},[]),I=(0,n.useCallback)(()=>{ue(null)},[]),{entityMetadata:{value:$,loading:E}}=(0,q.x1)(),T=(0,q.$L)(),X=T.renderComponentsByLocation(q.oZ.Subheader),je=T.renderComponentsByLocation(q.oZ.Settings);return!X&&!je||E===!1&&!$?null:(0,h.jsx)(L.Z,{classes:_,...Q.toolbarProps,children:(0,h.jsxs)(z.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[X,je?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:A,children:(0,h.jsx)(ne.Z,{})})}),(0,h.jsx)(k.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ve,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ve),onClose:I,keepMounted:!0,children:je})]}):null]})})}},95481:function(wt,Ue,t){"use strict";t.d(Ue,{DK:function(){return F},m1:function(){return _}});var h=t(52322),n=t(2784),g=t(10289),L=t(61886),z=t(25248),x=t(64279),l=t(77446);function k({contentLoading:ve,content:ue,activeSyncState:A}){return ve||A==="BUILD_READY_RELOAD"||!ue&&A==="CHECKING"?"CHECKING":!ue&&A==="BUILDING"?"INITIAL_BUILD":ue?A==="BUILDING"?"CONTENT_STALE_REFRESHING":A==="BUILD_READY"?"CONTENT_STALE_READY":A==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ne(ve,ue){const A={...ve};switch(ue.type){case"sync":ue.state==="CHECKING"&&(A.buildLog=[]),A.activeSyncState=ue.state,A.syncError=ue.syncError;break;case"contentLoading":A.contentLoading=!0,A.contentError=void 0;break;case"content":typeof ue.path=="string"&&(A.path=ue.path),A.contentLoading=!1,A.content=ue.content,A.contentError=ue.contentError;break;case"buildLog":A.buildLog=A.buildLog.concat(ue.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(A.activeSyncState)&&["contentLoading","content"].includes(ue.type)&&(A.activeSyncState="UP_TO_DATE",A.buildLog=[]),A}function q(ve,ue,A,I){var $,E;const[T,X]=(0,n.useReducer)(ne,{activeSyncState:"CHECKING",path:I,contentLoading:!0,buildLog:[]}),je=(0,z.h_)(L.Dl),{retry:Ke}=(0,l.Z)(async()=>{X({type:"contentLoading"});try{const qe=await je.getEntityDocs({kind:ve,namespace:ue,name:A},I);return X({type:"content",content:qe,path:I}),qe}catch(qe){X({type:"content",contentError:qe,path:I})}},[je,ve,ue,A,I]),Me=(0,n.useRef)({content:void 0,reload:()=>{}});return Me.current={content:T.content,reload:Ke},(0,x.default)(async()=>{X({type:"sync",state:"CHECKING"});const qe=setTimeout(()=>{X({type:"sync",state:"BUILDING"})},1e3);try{switch(await je.syncEntityDocs({kind:ve,namespace:ue,name:A},Ze=>{X({type:"buildLog",log:Ze})})){case"updated":Me.current.content?X({type:"sync",state:"BUILD_READY"}):(Me.current.reload(),X({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":X({type:"sync",state:"UP_TO_DATE"});break;default:X({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(gt){X({type:"sync",state:"ERROR",syncError:gt})}finally{clearTimeout(qe)}},[ve,A,ue,je,X,Me]),{state:(0,n.useMemo)(()=>k({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Ke,path:T.path,content:T.content,contentErrorMessage:($=T.contentError)===null||$===void 0?void 0:$.toString(),syncErrorMessage:(E=T.syncError)===null||E===void 0?void 0:E.toString(),buildLog:T.buildLog}}const ee=(0,n.createContext)({}),F=()=>(0,n.useContext)(ee),Q=({children:ve})=>{const{"*":ue=""}=(0,g.UO)(),{entityRef:A}=(0,L.x1)(),{kind:I,namespace:$,name:E}=A,T=q(I,$,E,ue);return(0,h.jsx)(ee.Provider,{value:T,children:ve instanceof Function?ve(T):ve})},_=ve=>ue=>(0,h.jsx)(Q,{children:(0,h.jsx)(ve,{...ue})})},95573:function(wt,Ue,t){"use strict";t.d(Ue,{Fw:function(){return g},_Z:function(){return n},pd:function(){return L}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),g=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),L=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(wt,Ue,t){"use strict";t.d(Ue,{S:function(){return I}});var h=t(52322),n=t(2784),g=t(79692),L=t(49378),z=t(38402),x=t(86136),l=t(85256),k=t(93414),ne=t(25248),q=t(65826);const ee=(0,g.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),F=$=>{const{result:E,highlight:T,rank:X,lineClamp:je=5,asListItem:Ke=!0,asLink:Me=!0,title:Ee,icon:qe}=$,gt=ee(),Ze=(0,ne.z$)(),Ie=()=>{Ze.captureEvent("discover",E.title,{attributes:{to:E.location},value:X})},nt=()=>{const ct=T!=null&&T.fields.title?(0,h.jsx)(q.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):E.title,lt=T!=null&&T.fields.entityTitle?(0,h.jsx)(q.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):E.entityTitle,mt=T!=null&&T.fields.name?(0,h.jsx)(q.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):E.name;return(0,h.jsx)(L.Z,{className:gt.itemText,primaryTypographyProps:{variant:"h6"},primary:Ee||(0,h.jsxs)(h.Fragment,{children:[ct," | ",lt!=null?lt:mt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:je,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(q.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):E.text})})},at=({children:ct})=>Me?(0,h.jsx)(k.rU,{noTrack:!0,to:E.location,onClick:Ie,children:ct}):(0,h.jsx)(h.Fragment,{children:ct}),rt=({children:ct})=>Ke?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(z.Z,{alignItems:"flex-start",children:[qe&&(0,h.jsx)(x.Z,{children:qe}),(0,h.jsx)("div",{className:gt.flexContainer,children:ct})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ct});return(0,h.jsx)(at,{children:(0,h.jsx)(rt,{children:(0,h.jsx)(nt,{})})})};var Q=t(27556),_=t(10289);const ve=(0,g.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),ue=$=>$==null?void 0:$.document,A=$=>{const{entityId:E,entityTitle:T,debounceTime:X=150}=$,[je,Ke]=(0,n.useState)(!1),Me=(0,_.s0)(),{setFilters:Ee,result:{loading:qe,value:gt}}=(0,q.Rx)(),Ze=ve(),[Ie,nt]=(0,n.useState)([]);(0,n.useEffect)(()=>{let mt=!0;if(mt&&gt){const dt=gt.results.slice(0,10);nt(dt)}return()=>{mt=!1}},[qe,gt]);const{kind:at,name:rt,namespace:ct}=E;(0,n.useEffect)(()=>{Ee(mt=>({...mt,kind:at,namespace:ct,name:rt}))},[at,ct,rt,Ee]);const lt=(mt,dt)=>{if(ue(dt)){const{location:We}=dt.document;Me(We)}};return(0,h.jsx)(Q.Z,{className:Ze.bar,variant:"outlined",children:(0,h.jsx)(q.qO,{classes:{root:Ze.root},"data-testid":"techdocs-search-bar",size:"small",open:je,getOptionLabel:()=>"",filterOptions:mt=>mt,onClose:()=>{Ke(!1)},onFocus:()=>{Ke(!0)},onChange:lt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ie,renderOption:({document:mt,highlight:dt})=>(0,h.jsx)(F,{result:mt,lineClamp:3,asListItem:!1,asLink:!1,title:mt.title,highlight:dt}),loading:qe,inputDebounceTime:X,inputPlaceholder:`Search ${T||E.name} docs`,freeSolo:!1})})},I=$=>{const E={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,h.jsx)(q.Nd,{initialState:E,children:(0,h.jsx)(A,{...$})})}},53260:function(){}},function(wt){var Ue=function(h){return wt(wt.s=h)};wt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Ue(96215)});var t=wt.O()}]);})();
491
+
492
+ //# sourceMappingURL=main.ee853139.js.map