@techdocs/cli 1.2.3-next.1 → 1.2.4-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 (61) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/embedded-app/.config-schema.json +7 -8
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/static/{5837.ebb0f422.chunk.js → 5837.45e6ec1d.chunk.js} +2 -2
  5. package/dist/embedded-app/static/{5837.ebb0f422.chunk.js.map → 5837.45e6ec1d.chunk.js.map} +1 -1
  6. package/dist/embedded-app/static/{6051.f45bae28.chunk.js → 6051.3f1d6d7c.chunk.js} +3 -3
  7. package/dist/embedded-app/static/{6051.f45bae28.chunk.js.map → 6051.3f1d6d7c.chunk.js.map} +1 -1
  8. package/dist/embedded-app/static/{7560.b3ed3a97.chunk.js → 7560.a50a4f27.chunk.js} +2 -2
  9. package/dist/embedded-app/static/{7560.b3ed3a97.chunk.js.map → 7560.a50a4f27.chunk.js.map} +1 -1
  10. package/dist/embedded-app/static/7750.36f3b714.chunk.js +8 -0
  11. package/dist/embedded-app/static/{7750.0f3395fe.chunk.js.map → 7750.36f3b714.chunk.js.map} +1 -1
  12. package/dist/embedded-app/static/main.4fdcff32.js +494 -0
  13. package/dist/embedded-app/static/main.4fdcff32.js.map +1 -0
  14. package/dist/embedded-app/static/{module-ajv.fca02de5.js → module-ajv.2efe45a5.js} +5 -5
  15. package/dist/embedded-app/static/module-ajv.2efe45a5.js.map +1 -0
  16. package/dist/embedded-app/static/module-date-fns.7dd2cc1f.js +4 -0
  17. package/dist/embedded-app/static/module-date-fns.7dd2cc1f.js.map +1 -0
  18. package/dist/embedded-app/static/module-luxon.1ec72e86.js +3 -0
  19. package/dist/embedded-app/static/module-luxon.1ec72e86.js.map +1 -0
  20. package/dist/embedded-app/static/{module-material-table.5d56e1cb.js → module-material-table.ac270938.js} +2 -2
  21. package/dist/embedded-app/static/{module-material-table.5d56e1cb.js.map → module-material-table.ac270938.js.map} +1 -1
  22. package/dist/embedded-app/static/module-material-ui.8008c157.js +51 -0
  23. package/dist/embedded-app/static/module-material-ui.8008c157.js.map +1 -0
  24. package/dist/embedded-app/static/module-octokit.ea8cd5cc.js +2 -2
  25. package/dist/embedded-app/static/module-octokit.ea8cd5cc.js.map +1 -1
  26. package/dist/embedded-app/static/module-yaml.b5c4d531.js +1 -1
  27. package/dist/embedded-app/static/module-yaml.b5c4d531.js.map +1 -1
  28. package/dist/embedded-app/static/module-zod.49ffd80f.js +1 -1
  29. package/dist/embedded-app/static/module-zod.49ffd80f.js.map +1 -1
  30. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_ada.88274170.chunk.js +1 -1
  31. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_ada.88274170.chunk.js.map +1 -1
  32. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_dart.d81ae419.chunk.js +1 -1
  33. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_dart.d81ae419.chunk.js.map +1 -1
  34. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_dts.497871f1.chunk.js +1 -1
  35. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_dts.497871f1.chunk.js.map +1 -1
  36. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_javascript.b660af43.chunk.js +1 -1
  37. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_javascript.b660af43.chunk.js.map +1 -1
  38. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_mathematica.19225e2a.chunk.js +1 -1
  39. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_mathematica.19225e2a.chunk.js.map +1 -1
  40. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_typescript.90772612.chunk.js +1 -1
  41. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_typescript.90772612.chunk.js.map +1 -1
  42. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_vhdl.c15a8f55.chunk.js +1 -1
  43. package/dist/embedded-app/static/react-syntax-highlighter_languages_highlight_vhdl.c15a8f55.chunk.js.map +1 -1
  44. package/dist/embedded-app/static/{runtime.3308728f.js → runtime.4fdcff32.js} +2 -2
  45. package/dist/embedded-app/static/{runtime.3308728f.js.map → runtime.4fdcff32.js.map} +1 -1
  46. package/dist/embedded-app/static/vendor.4fdcff32.js +236 -0
  47. package/dist/embedded-app/static/vendor.4fdcff32.js.map +1 -0
  48. package/dist/index.cjs.js +1 -1
  49. package/package.json +6 -6
  50. package/dist/embedded-app/static/7750.0f3395fe.chunk.js +0 -8
  51. package/dist/embedded-app/static/main.3308728f.js +0 -494
  52. package/dist/embedded-app/static/main.3308728f.js.map +0 -1
  53. package/dist/embedded-app/static/module-ajv.fca02de5.js.map +0 -1
  54. package/dist/embedded-app/static/module-date-fns.d70f4cc3.js +0 -3
  55. package/dist/embedded-app/static/module-date-fns.d70f4cc3.js.map +0 -1
  56. package/dist/embedded-app/static/module-luxon.f67513b2.js +0 -3
  57. package/dist/embedded-app/static/module-luxon.f67513b2.js.map +0 -1
  58. package/dist/embedded-app/static/module-material-ui.e3edf608.js +0 -74
  59. package/dist/embedded-app/static/module-material-ui.e3edf608.js.map +0 -1
  60. package/dist/embedded-app/static/vendor.3308728f.js +0 -236
  61. package/dist/embedded-app/static/vendor.3308728f.js.map +0 -1
@@ -1,494 +0,0 @@
1
- (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(jt,Me,t){"use strict";t.d(Me,{n3:function(){return V},MS:function(){return x}});var h=t(25271),n=t(23054),g=t(96279),L=t.n(g);const V=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class x{async getEntityAncestors(k,ne){const{kind:q,namespace:_,name:F}=(0,h.of)(k.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${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:_=[],offset:F,limit:Q,after:X}=k!=null?k:{},ve=[];for(const $ of[q].flat()){const E=[];for(const[T,ee]of Object.entries($))for(const je of[ee].flat())je===V?E.push(encodeURIComponent(T)):typeof je=="string"&&E.push(`${encodeURIComponent(T)}=${encodeURIComponent(je)}`);E.length&&ve.push(`filter=${E.join(",")}`)}_.length&&ve.push(`fields=${_.map(encodeURIComponent).join(",")}`),F!==void 0&&ve.push(`offset=${F}`),Q!==void 0&&ve.push(`limit=${Q}`),X!==void 0&&ve.push(`after=${encodeURIComponent(X)}`);const de=ve.length?`?${ve.join("&")}`:"",A=await this.requestRequired("GET",`/entities${de}`,ne),I=($,E)=>{var T,ee;if(((T=$.metadata)===null||T===void 0?void 0:T.name)===void 0||$.kind===void 0||((ee=E.metadata)===null||ee===void 0?void 0:ee.name)===void 0||E.kind===void 0)return 0;const je=(0,h.eE)($),He=(0,h.eE)(E);return je<He?-1:je>He?1:0};return{items:A.sort(I)}}async getEntityByRef(k,ne){const{kind:q,namespace:_,name:F}=(0,h.of)(k);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${encodeURIComponent(F)}`,ne)}async getEntityByName(k,ne){const{kind:q,namespace:_="default",name:F}=k;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(_)}/${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:_}=k,F=[];for(const X of[q].flat()){const ve=[];for(const[de,A]of Object.entries(X))for(const I of[A].flat())I===V?ve.push(encodeURIComponent(de)):typeof I=="string"&&ve.push(`${encodeURIComponent(de)}=${encodeURIComponent(I)}`);ve.length&&F.push(`filter=${ve.join(",")}`)}for(const X of _)F.push(`facet=${encodeURIComponent(X)}`);const Q=F.length?`?${F.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${Q}`,ne)}async addLocation(k,ne){const{type:q="url",target:_,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:_})});if(Q.status!==201)throw new Error(await Q.text());const{location:X,entities:ve,exists:de}=await Q.json();if(!X)throw new Error(`Location wasn't added: ${_}`);return{location:X,entities:ve,exists:de}}async getLocationByRef(k,ne){return(await this.requestRequired("GET","/locations",ne)).map(_=>_.data).find(_=>k===(0,h.NZ)(_))}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 _=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(_.ok)return{valid:!0};if(_.status!==400)throw await n.VL.fromResponse(_);const{errors:F=[]}=await _.json();return{valid:!1,errors:F}}async requestIgnored(k,ne,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},Q=await this.fetchApi.fetch(_,{method:k,headers:F});if(!Q.ok)throw await n.VL.fromResponse(Q)}async requestRequired(k,ne,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},Q=await this.fetchApi.fetch(_,{method:k,headers:F});if(!Q.ok)throw await n.VL.fromResponse(Q);return await Q.json()}async requestOptional(k,ne,q){const _=`${await this.discoveryApi.getBaseUrl("catalog")}${ne}`,F=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},Q=await this.fetchApi.fetch(_,{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(jt,Me,t){"use strict";t.d(Me,{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 ln},nP:function(){return kn},aS:function(){return $n},S4:function(){return en},cz:function(){return Cn},iB:function(){return lt},CV:function(){return xt},of:function(){return st},Ou:function(){return Fe},eE:function(){return ut},NZ:function(){return Qe}});const h="default",n="backstage.io/view-url",g="backstage.io/edit-url",L="kubernetes.io/api-server",V="kubernetes.io/api-server-certificate-authority",x="kubernetes.io/auth-provider";var l=t(76635),k=t.n(l);class ne{async enforce(R){return R.metadata.namespace?R:lodash.merge({metadata:{namespace:this.namespace}},R)}constructor(R=DEFAULT_NAMESPACE){this.namespace=R}}class q{static isValidPrefixAndOrSuffix(R,J,Ke,M){if(typeof R!="string")return!1;const Z=R.split(J);return Z.length===1?M(Z[0]):Z.length===2?Ke(Z[0])&&M(Z[1]):!1}static isJsonSafe(R){try{return k().isEqual(R,JSON.parse(JSON.stringify(R)))}catch{return!1}}static isValidDnsSubdomain(R){return typeof R=="string"&&R.length>=1&&R.length<=253&&R.split(".").every(q.isValidDnsLabel)}static isValidDnsLabel(R){return typeof R=="string"&&R.length>=1&&R.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(R)}static isValidTag(R){return typeof R=="string"&&R.length>=1&&R.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(R)}static isValidUrl(R){if(typeof R!="string")return!1;try{return new URL(R),!0}catch{return!1}}static isValidString(R){var J;return typeof R=="string"&&((J=R==null?void 0:R.trim())===null||J===void 0?void 0:J.length)>=1}static isNonEmptyString(R){var J;return typeof R=="string"&&((J=R==null?void 0:R.trim())===null||J===void 0?void 0:J.length)>=1}}var _=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),X=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}}}}}}'),de=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=[_,X,ve,de];function $(oe){if(!(oe!=null&&oe.length))throw new TypeError("Unknown error");const R=oe[0];throw new TypeError(`${R.instancePath||"<root>"} ${R.message}${R.params?` - ${Object.entries(R.params).map(([J,Ke])=>`${J}: ${Ke}`).join(", ")}`:""}`)}function E(oe,R={}){var J;const Ke=(J=R==null?void 0:R.disableCache)!==null&&J!==void 0?J:!1,M=Ke?"":JSON.stringify(oe);if(!Ke){const be=A.get(M);if(be)return be}const Z=T(oe),le=new(Q())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Z.length&&le.addSchema(Z,void 0,void 0,!0);const he=le.compile(oe);return Ke||A.set(M,he),he}function T(oe){if(typeof oe!="object")return[];const R=new Set;oe.$id&&R.add(oe.$id);const J=new Array,Ke=[oe];for(;Ke.length;){const M=Ke.pop();for(const Z of ee(M))if(!R.has(Z)){R.add(Z);const le=I.find(he=>he.$id===Z);le&&(J.push(le),Ke.push(le))}}return J}function*ee(oe){const R=[oe];for(;R.length;){const J=R.pop();if(typeof J=="object"&&J)for(const[Ke,M]of Object.entries(J))Ke==="$ref"&&typeof M=="string"?yield M.split("#")[0]:R.push(M)}}function je(oe){const R=compileAjvSchema(oe||entityEnvelopeSchema);return J=>{if(R(J)===!0)return J;throw throwAjvError(R.errors)}}function He(oe){const R=E(oe);return J=>{var Ke;if(R(J)===!0)return J;const Z=(Ke=R.errors)===null||Ke===void 0?void 0:Ke.filter(le=>["/kind","/apiVersion"].includes(le.instancePath));if((Z==null?void 0:Z.length)&&Z.every(le=>le.keyword==="enum"))return!1;throw $(R.errors)}}function Ne(oe){const R=compileAjvSchema(oe||entitySchema);return J=>{if(R(J)===!0)return J;throw throwAjvError(R.errors)}}class Ee{static isValidApiVersion(R){return q.isValidPrefixAndOrSuffix(R,"/",q.isValidDnsSubdomain,J=>J.length>=1&&J.length<=63&&/^[a-z0-9A-Z]+$/.test(J))}static isValidKind(R){return typeof R=="string"&&R.length>=1&&R.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(R)}static isValidObjectName(R){return typeof R=="string"&&R.length>=1&&R.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(R)}static isValidNamespace(R){return q.isValidDnsLabel(R)}static isValidLabelKey(R){return q.isValidPrefixAndOrSuffix(R,"/",q.isValidDnsSubdomain,Ee.isValidObjectName)}static isValidLabelValue(R){return R===""||Ee.isValidObjectName(R)}static isValidAnnotationKey(R){return q.isValidPrefixAndOrSuffix(R,"/",q.isValidDnsSubdomain,Ee.isValidObjectName)}static isValidAnnotationValue(R){return typeof R=="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:oe=>typeof oe=="string"&&oe.length>=1&&oe.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(oe)};function mt(oe={}){return{...qe,...oe}}class Ze{async enforce(R){function J(S,H,me){if(H==null)throw new Error(`${S} must have a value`);let ue;try{ue=me(H)}catch(Ce){throw new Error(`${S} could not be validated, ${Ce}`)}if(!ue){let Ce;switch(me.name){case"isValidLabelValue":case"isValidObjectName":Ce="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":Ce="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Ce="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Ce="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Ce="a string";break;case"isValidKind":Ce="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Ce="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Ce="a non empty string";break;default:Ce=void 0;break}const Oe=Ce?` expected ${Ce} but found "${H}".`:"";throw new Error(`"${S}" 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 Ke(S,H,me){return H===void 0||J(S,H,me)}J("apiVersion",R.apiVersion,this.validators.isValidApiVersion),J("kind",R.kind,this.validators.isValidKind),J("metadata.name",R.metadata.name,this.validators.isValidEntityName),Ke("metadata.namespace",R.metadata.namespace,this.validators.isValidNamespace);var M;for(const[S,H]of Object.entries((M=R.metadata.labels)!==null&&M!==void 0?M:[]))J(`labels.${S}`,S,this.validators.isValidLabelKey),J(`labels.${S}`,H,this.validators.isValidLabelValue);var Z;for(const[S,H]of Object.entries((Z=R.metadata.annotations)!==null&&Z!==void 0?Z:[]))J(`annotations.${S}`,S,this.validators.isValidAnnotationKey),J(`annotations.${S}`,H,this.validators.isValidAnnotationValue);var le;const he=(le=R.metadata.tags)!==null&&le!==void 0?le:[];for(let S=0;S<he.length;++S)J(`tags.${S}`,he[S],this.validators.isValidTag);var be;const De=(be=R.metadata.links)!==null&&be!==void 0?be:[];for(let S=0;S<De.length;++S){var $e,We,tt;J(`links.${S}.url`,($e=De[S])===null||$e===void 0?void 0:$e.url,CommonValidatorFunctions.isValidUrl),Ke(`links.${S}.title`,(We=De[S])===null||We===void 0?void 0:We.title,CommonValidatorFunctions.isNonEmptyString),Ke(`links.${S}.icon`,(tt=De[S])===null||tt===void 0?void 0:tt.icon,KubernetesValidatorFunctions.isValidObjectName)}return R}constructor(R=makeValidator()){this.validators=R}}class Ie{async enforce(R){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(R)===!0)return R;const[Ke]=this.validate.errors||[];throw Ke?new Error(`Malformed envelope, ${Ke.instancePath||"<root>"} ${Ke.message}`):new Error("Malformed envelope, Unknown error")}}function rt(oe){let R=oe.indexOf(":");const J=oe.indexOf("/");J!==-1&&J<R&&(R=-1);const Ke=R===-1?void 0:oe.slice(0,R),M=J===-1?void 0:oe.slice(R+1,J),Z=oe.slice(Math.max(R+1,J+1));if(Ke===""||M===""||Z==="")throw new TypeError(`Entity reference "${oe}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ke,namespace:M,name:Z}}function lt(oe){return{kind:oe.kind,namespace:oe.metadata.namespace||h,name:oe.metadata.name}}function st(oe,R){if(!oe)throw new Error("Entity reference must not be empty");const J=R==null?void 0:R.defaultKind,Ke=(R==null?void 0:R.defaultNamespace)||h;let M,Z,le;if(typeof oe=="string"){const We=rt(oe);var he;M=(he=We.kind)!==null&&he!==void 0?he:J;var be;Z=(be=We.namespace)!==null&&be!==void 0?be:Ke,le=We.name}else{var De;M=(De=oe.kind)!==null&&De!==void 0?De:J;var $e;Z=($e=oe.namespace)!==null&&$e!==void 0?$e:Ke,le=oe.name}if(M)if(Z){if(!le){const We=JSON.stringify(oe);throw new Error(`Entity reference ${We} had missing or empty name`)}}else{const We=JSON.stringify(oe);throw new Error(`Entity reference ${We} had missing or empty namespace`)}else{const We=JSON.stringify(oe);throw new Error(`Entity reference ${We} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:M,namespace:Z,name:le}}function ut(oe){let R,J,Ke;if("metadata"in oe){R=oe.kind;var M;J=(M=oe.metadata.namespace)!==null&&M!==void 0?M:h,Ke=oe.metadata.name}else{R=oe.kind;var Z;J=(Z=oe.namespace)!==null&&Z!==void 0?Z:h,Ke=oe.name}return`${R.toLocaleLowerCase("en-US")}:${J.toLocaleLowerCase("en-US")}/${Ke.toLocaleLowerCase("en-US")}`}class ct{async enforce(R){let J=R;for(const Ke of this.policies){const M=await Ke.enforce(J);if(!M)throw new Error(`Policy ${Ke.constructor.name} did not return a result`);J=M}return J}constructor(R){this.policies=R}}class vt{async enforce(R){for(const J of this.policies){const Ke=await J.enforce(R);if(Ke)return Ke}throw new Error("The entity did not match any known policy")}constructor(R){this.policies=R}}const ht={allOf(oe){return new ct(oe)},oneOf(oe){return new vt(oe)}};var Ge=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 ae(oe){let R;return{async check(J){return R||(R=He(oe)),R(J)===J}}}const Re=ae(Ge);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 ot=ae(ke);var yt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const At=ae(yt);var pt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const St=ae(pt);var Lt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const kt=ae(Lt),en="ownedBy",rn="ownerOf",Vt="consumesApi",Wt="apiConsumedBy",hn="providesApi",_t="apiProvidedBy",kn="dependsOn",ln="dependencyOf",On="parentOf",pn="childOf",Hn="memberOf",Ht="hasMember",Cn="partOf",$n="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 fn=ae(Gt);var cn=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 wn=ae(cn);var Bn=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 yn=ae(Bn),ge="backstage.io/managed-by-location",te="backstage.io/managed-by-origin-location",Ae="backstage.io/source-location";function Fe(oe){if(typeof oe!="string")throw new TypeError(`Unable to parse location ref '${oe}', unexpected argument ${typeof oe}`);const R=oe.indexOf(":");if(R<0)throw new TypeError(`Unable to parse location ref '${oe}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const J=oe.substring(0,R).trim(),Ke=oe.substring(R+1).trim();if(!J||!Ke)throw new TypeError(`Unable to parse location ref '${oe}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(J==="http"||J==="https")throw new TypeError(`Invalid location ref '${oe}', please prefix it with 'url:', e.g. 'url:${oe}'`);return{type:J,target:Ke}}function Qe(oe){const{type:R,target:J}=oe;if(R){if(!J)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${R}:${J}`}function xt(oe){var R,J,Ke,M,Z;const le=(Z=(R=oe.metadata)===null||R===void 0||(J=R.annotations)===null||J===void 0?void 0:J[Ae])!==null&&Z!==void 0?Z:(Ke=oe.metadata)===null||Ke===void 0||(M=Ke.annotations)===null||M===void 0?void 0:M[ge];if(!le)throw new Error(`Entity '${ut(oe)}' is missing location`);return Fe(le)}},93414:function(jt,Me,t){"use strict";t.d(Me,{zx:function(){return qe},Oi:function(){return ht},VY:function(){return Ai},yW:function(){return Ha},XF:function(){return Re},mn:function(){return Fe},NX:function(){return h},ub:function(){return $e},mf:function(){return Qa},yu:function(){return En},h4:function(){return Di},M6:function(){return An},i9:function(){return al},aR:function(){return Ti},rJ:function(){return Tr},Oh:function(){return pl},hu:function(){return dl},rU:function(){return Ne},nU:function(){return gr},sk:function(){return Ue},Or:function(){return vs},T3:function(){return Ni},g9:function(){return ml},Ex:function(){return Zt},Gk:function(){return lr},tn:function(){return Ii},Ph:function(){return dn},YE:function(){return f},v7:function(){return sa},R6:function(){return ji},tR:function(){return yi},uw:function(){return va},qt:function(){return gi},iA:function(){return Zi},GB:function(){return jn},po:function(){return hr},mZ:function(){return Ps},Pf:function(){return as}});var h={};t.r(h),t.d(h,{Nm:function(){return ke},ht:function(){return At},LJ:function(){return yt}});var n=t(52322),g=t(2784),L=t(25248),V=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 _=t(77277),F=t(72779),Q=t.n(F),X=t(86689),ve=t(62833),de=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}},ee=()=>{const e="http://dummy.dev";var s;const i=(s=T())!==null&&s!==void 0?s:"/",{pathname:u}=new URL(i,e);return(0,de.trimEnd)(u,"/")},je=e=>{let s=String(e);const i=ee(),u=E(s),p=s.startsWith(i);return!u&&!p&&(s=i.concat(s)),s},He=e=>{if(e instanceof Array)return e.map(He).join(" ").trim();if(typeof e=="object"&&e){var s;return He(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},Ne=g.forwardRef(({onClick:e,noTrack:s,...i},u)=>{const p=$(),v=(0,L.z$)(),j=I()?je(i.to):i.to,B=He(i.children)||j,W=E(j),N=W&&!!/^https?:/.exec(j),ye=se=>{e==null||e(se),s||v.captureEvent("click",B,{attributes:{to:j}})};return W?(0,n.jsxs)(X.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)(X.Z,{...i,ref:u,component:ve.rU,to:j,onClick:ye})}),Ee=g.forwardRef((e,s)=>(0,n.jsx)(Ne,{ref:s,...e,color:"initial"})),qe=g.forwardRef((e,s)=>(0,n.jsx)(_.Z,{ref:s,component:Ee,...e}));var mt=t(60364),Ze=t(61837),Ie=t(80030),rt=t(19353),lt=t(95074);function st(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,lt.Z)();(0,g.useEffect)(()=>{W&&v.post(W)},[W,v]);const ye=se=>{se.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)(rt.Z,{})})})})}var ut=t(83229),ct=t(26639),vt=t(39595);function ht(e){const{text:s,language:i,showLineNumbers:u=!1,highlightedNumbers:p,customStyle:v,showCopyCodeButton:j=!1}=e,B=(0,mt.Z)(),W=B.palette.type==="dark"?ct.Z:vt.Z,N=B.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(ut.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)(st,{text:s})})]})}var Ge=t(41156),ae=t(88188);function Re(e){const{title:s,to:i}=e,u=(0,Ge.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)(ae.Z,{})}):(0,n.jsx)(_.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 ot;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(ot||(ot={}));var yt;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(yt||(yt={}));var At;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(At||(At={}));var pt=t(84945),St=t(11105),Lt=t(97963),kt=t(46506),en=t.n(kt),rn=t(54073),Vt=t.n(rn),Wt=t(10368);const hn=(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=hn(),[i,u]=g.useState(0),[p,v]=g.useState(0),j=g.useRef(null);g.useLayoutEffect(()=>{if(j.current){let{height:ye,width:se}=j.current.getBBox();ye=Math.round(ye),se=Math.round(se),(ye!==p||se!==i)&&(u(se),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 kn="arrow-marker",ln="node",On="edge",pn="label",Hn=(0,Wt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Ht=e=>(0,n.jsx)(_t,{...e});function Cn({render:e=Ht,setNode:s,node:i}){const{width:u,height:p,x:v=0,y:j=0}=i,B=i,W=Hn(),N=g.useRef(null);return g.useLayoutEffect(()=>{if(N.current){let{height:ye,width:se}=N.current.getBBox();ye=Math.round(ye),se=Math.round(se),(ye!==p||se!==u)&&s(i.id,{...i,height:ye,width:se})}},[i,u,p,s]),(0,n.jsx)("g",{ref:N,"data-testid":ln,className:W.node,transform:`translate(${v-u/2},${j-p/2})`,children:e({node:B})})}var $n=t(76985),Gt=t(27916),fn=t(19574),cn=t.n(fn);const wn=(0,Wt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Bn({edge:{label:e}}){const s=wn();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const yn=(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)(Bn,{...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,se=yn(),fe=g.useRef(null);g.useLayoutEffect(()=>{if(fe.current){let{height:et,width:Rt}=fe.current.getBBox();et=Math.round(et),Rt=Math.round(Rt),(et!==W||Rt!==B)&&s(i,{...u,height:et,width:Rt})}},[u,W,B,s,i]);let Le="";const Je=g.useMemo(()=>$n.Z().x(et=>et.x).y(et=>et.y).curve(Gt[p]),[p]);if(N){const et=N.filter(Rt=>cn()(Rt.x)&&cn()(Rt.y));Le=Je(et)||""}return(0,n.jsxs)(n.Fragment,{children:[Le&&(0,n.jsx)("path",{"data-testid":On,className:se.path,d:Le}),ye.label?(0,n.jsx)("g",{ref:fe,"data-testid":pn,className:se.label,transform:`translate(${v},${j})`,children:e({edge:ye})}):null]})}const Ae="workspace";function Fe(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:se=0,paddingY:fe=0,acyclicer:Le,ranker:Je=yt.NETWORK_SIMPLEX,labelPosition:et=At.RIGHT,labelOffset:Rt=10,edgeRanks:Mt=1,edgeWeight:Xt=1,renderLabel:qt,defs:Pt,zoom:Yt="enabled",curve:zt="curveMonotoneX",...vr}=e,yr=(0,Lt.Z)(),[rr,Ur]=g.useState(100),[Os,$s]=g.useState(100),Jt=g.useRef(new(en()).graphlib.Graph),[Mr,ei]=g.useState(((s=Jt.current.graph())===null||s===void 0?void 0:s.width)||0),[zr,xo]=g.useState(((i=Jt.current.graph())===null||i===void 0?void 0:i.height)||0),[ti,Pn]=g.useState([]),[fr,Vr]=g.useState([]),sr=Math.max(Mr,rr),tn=Math.max(zr,Os),Vn=g.useMemo(()=>Vt()(an=>{if(!an)return;const Ln=St.Z(an),nn=St.Z(an.getElementById(Ae));function ir(){Ln.call(pt.sP().scaleExtent([1,10]).on("zoom",xr=>{xr.transform.x=Math.min(0,Math.max(xr.transform.x,sr-sr*xr.transform.k)),xr.transform.y=Math.min(0,Math.max(xr.transform.y,tn-tn*xr.transform.k)),nn.attr("transform",xr.transform)}))}Yt==="enabled"?ir():Yt==="enable-on-click"&&Ln.on("click",()=>ir());const{width:ar,height:bo}=an.getBoundingClientRect();rr!==ar&&Ur(ar),Os!==bo&&$s(bo)},100),[Os,rr,sr,tn,Yt]),Wr=g.useCallback(()=>{const an=Jt.current.nodes(),Ln=Jt.current.edges();an.forEach(nn=>{p.some(ar=>ar.id===nn)||Jt.current.removeNode(nn)}),Ln.forEach(nn=>{u.some(ar=>ar.from===nn.v&&ar.to===nn.w)||Jt.current.removeEdge(nn.v,nn.w)}),p.forEach(nn=>{const ir=Jt.current.nodes().find(ar=>nn.id===ar);if(ir&&Jt.current.node(ir)){const{width:ar,height:bo,x:xr,y:$l}=Jt.current.node(ir);Jt.current.setNode(ir,{...nn,width:ar,height:bo,x:xr,y:$l})}else Jt.current.setNode(nn.id,{...nn,width:0,height:0})}),u.forEach(nn=>{Jt.current.setEdge(nn.from,nn.to,{...nn,label:nn.label,width:0,height:0,labelpos:et,labeloffset:Rt,weight:Xt,minlen:Mt})})},[u,p,et,Rt,Xt,Mt]),or=g.useMemo(()=>Vt()(()=>{en().layout(Jt.current);const{height:an,width:Ln}=Jt.current.graph(),nn=Math.max(0,an||0),ir=Math.max(0,Ln||0);ei(ir),xo(nn),Pn(Jt.current.nodes()),Vr(Jt.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(Jt.current.setGraph({rankdir:j,align:B,nodesep:W,edgesep:N,ranksep:ye,marginx:se,marginy:fe,acyclicer:Le,ranker:Je}),Wr(),or(),or.cancel),[Le,B,j,N,se,fe,W,ye,Je,Wr,or]);function Bs(an,Ln){return Jt.current.setNode(an,Ln),or(),Jt.current}function Ol(an,Ln){return Jt.current.setEdge(an,Ln),or(),Jt.current}return(0,n.jsxs)("svg",{ref:Vn,...vr,width:"100%",height:tn,viewBox:`0 0 ${sr} ${tn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:kn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:yr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Pt]}),(0,n.jsx)("g",{id:Ae,children:(0,n.jsxs)("svg",{width:Mr,height:zr,y:tn/2-zr/2,x:sr/2-Mr/2,viewBox:`0 0 ${Mr} ${zr}`,children:[fr.map(an=>{const Ln=Jt.current.edge(an);return Ln?(0,n.jsx)(te,{id:an,setEdge:Ol,render:qt,edge:Ln,curve:zt},`${an.v}-${an.w}`):null}),ti.map(an=>{const Ln=Jt.current.node(an);return Ln?(0,n.jsx)(Cn,{setNode:Bs,render:v,node:Ln},an):null})]})})]})}var Qe;const xt=(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:(Qe=e.palette.banner.warning)!==null&&Qe!==void 0?Qe:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),oe=e=>{const{variant:s,message:i,id:u,fixed:p=!1}=e,v=xt(),B=useApi(storageApiRef).forBucket("notifications");var W;const N=(W=B.snapshot("dismissedBanners").value)!==null&&W!==void 0?W:[],[ye,se]=useState(new Set(N)),fe=useObservable(B.observe$("dismissedBanners"));useEffect(()=>{if(fe!=null&&fe.value){var Je;const et=(Je=fe==null?void 0:fe.value)!==null&&Je!==void 0?Je:[];se(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 R=t(60905),J=t(90436),Ke=t.p+"static/missingAnnotation.67f79e98..svg",M=t.p+"static/noInformation.4b426325..svg",Z=t.p+"static/createComponent.975d1e1e..svg",le=t.p+"static/noBuild.1715fa71..svg";const he=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),be=({missing:e})=>{const s=he();switch(e){case"field":return(0,n.jsx)("img",{src:Ke,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:le,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)(R.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,n.jsx)(R.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(R.Z,{container:!0,direction:"column",children:[(0,n.jsx)(R.Z,{item:!0,xs:!0,children:(0,n.jsx)(J.Z,{variant:"h5",children:s})}),(0,n.jsx)(R.Z,{item:!0,xs:!0,children:(0,n.jsx)(J.Z,{variant:"body1",children:i})}),(0,n.jsx)(R.Z,{item:!0,xs:!0,className:v.action,children:p})]})}),(0,n.jsx)(R.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof u=="string"?(0,n.jsx)(be,{missing:u}):u.customImage})]})}const We=`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=/^.*ANNOTATION.*$/m,S=We.match(tt)[0],H=We.split(`
12
- `).findIndex(e=>tt.test(e)),me=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function ue(e){return Array.from(Array(e+1).keys(),s=>s+H)}function Ce(e){const s=e.map(i=>S.replace("ANNOTATION",i)).join(`
13
- `);return We.replace(S,s)}function Oe(e){const s=e.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(i=>(0,n.jsx)("code",{children:i})).reduce((i,u)=>(0,n.jsxs)(n.Fragment,{children:[i,", ",u]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function Ue(e){const{annotation:s,readMoreUrl:i}=e,u=Array.isArray(s)?s:[s],p=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=me();return(0,n.jsx)($e,{missing:"field",title:"Missing Annotation",description:Oe(u),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:v.code,children:(0,n.jsx)(ht,{text:Ce(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:ue(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(_.Z,{color:"primary",component:Ne,to:p,children:"Read more"})]})})}var nt=t(11776),ft=t(38402),dt=t(49378),_e=t(41128),at=t(27616),wt=t(8284),Tt=t(70660),It=t(91750),Ut=t(38016);const Zn=(e,s)=>(s.palette.type==="light"?_e._j:_e.$n)(s.palette[e].light,.6),Wn=(e,s)=>(s.palette.type==="light"?_e.$n:_e._j)(s.palette[e].light,.9),Dt=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>Zn(s,e)}})),Nt=({severity:e})=>{const s=Dt({severity:e});return(0,n.jsx)(It.Z,{classes:s})},gn=({severity:e})=>{const s=Dt({severity:e});return(0,n.jsx)(Ut.Z,{classes:s})},Dn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>Wn(s,e),color:({severity:s})=>Zn(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>Zn(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>Zn(s,e),backgroundColor:({severity:s})=>Wn(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"}),sn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function jn(e){const{severity:s="warning",title:i,message:u,children:p,defaultExpanded:v}=e,j=Dn({severity:s}),B=sn(s)+(i?`: ${i}`:"");return(0,n.jsxs)(at.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,n.jsxs)(wt.Z,{expandIcon:(0,n.jsx)(gn,{severity:s}),className:j.summary,children:[(0,n.jsx)(Nt,{severity:s}),(0,n.jsx)(J.Z,{className:j.summaryText,variant:"subtitle1",children:B})]}),(u||p)&&(0,n.jsx)(Tt.Z,{children:(0,n.jsxs)(R.Z,{container:!0,children:[u&&(0,n.jsx)(R.Z,{item:!0,xs:12,children:(0,n.jsx)(J.Z,{className:j.message,variant:"body1",children:u})}),p&&(0,n.jsx)(R.Z,{item:!0,xs:12,className:j.details,children:p})]})})]})}const Nn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),qn=({error:e,message:s,stack:i,children:u})=>{const p=Nn();return(0,n.jsxs)(nt.Z,{dense:!0,children:[(0,n.jsxs)(ft.Z,{alignItems:"flex-start",children:[(0,n.jsx)(dt.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(st,{text:e})]}),(0,n.jsxs)(ft.Z,{alignItems:"flex-start",children:[(0,n.jsx)(dt.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(st,{text:s})]}),i&&(0,n.jsxs)(ft.Z,{alignItems:"flex-start",children:[(0,n.jsx)(dt.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(st,{text:i})]}),u]})};function En(e){const{title:s,error:i,defaultExpanded:u,children:p}=e;return(0,n.jsx)(jn,{severity:"error",title:s!=null?s:i.message,defaultExpanded:u,children:(0,n.jsx)(qn,{error:i.name,message:i.message,stack:i.stack,children:p})})}var xn=t(85256);const _n=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function lr(e){var s;const{title:i,error:u,defaultExpanded:p}=e,v=_n();if(u.name!=="ResponseError")return(0,n.jsx)(En,{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}`,se=W&&`${W.method} ${W.url}`,fe=B.message.replace(/\\n/g,`
14
- `),Le=(s=B.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
15
- `),Je=JSON.stringify(j,void 0,2);return(0,n.jsxs)(En,{title:i!=null?i:u.message,defaultExpanded:p,error:{name:ye,message:fe,stack:Le},children:[se&&(0,n.jsxs)(ft.Z,{alignItems:"flex-start",children:[(0,n.jsx)(dt.Z,{classes:{secondary:v.text},primary:"Request",secondary:W?`${se}`:void 0}),(0,n.jsx)(st,{text:se})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(xn.Z,{component:"li",className:v.divider}),(0,n.jsx)(ft.Z,{alignItems:"flex-start",children:(0,n.jsx)(dt.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,n.jsx)(ht,{language:"json",text:Je,showCopyCodeButton:!0})]})]})}var C=t(28316);function d(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function m(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function w(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),v=p||d(e);return p||m(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 Y=null;const pe="core.calloutSeen";function Se(){const[e,s]=useState(()=>{const u=localStorage.getItem(pe);return u?JSON.parse(u):{}}),i=useCallback((u,p)=>{const v=localStorage.getItem(pe),B={...v?JSON.parse(v):{},[u]:p};s(B),localStorage.setItem(pe,JSON.stringify(B))},[]);return{states:e,setState:i}}function Be(e){const{states:s,setState:i}=Se(),u=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:u}}function gt(e){const{seen:s,markSeen:i}=Be(e);return{show:s===!1,hide:i}}const Bt=(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 on(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(),se=Bt(),fe=useCallback(()=>{if(W.current){const Le=W.current.getBoundingClientRect(),Je=Math.max(Le.width,Le.height),et=800,Rt=Le.x-(Je-Le.width)/2-et,Mt=Le.y-(Je-Le.height)/2-et,Xt=Je+2*et,qt=450,Pt=Le.x+Le.width/2-qt,Yt=Le.y-(Je-Le.height)/2+Je+20;ye({dotLeft:Rt,dotTop:Mt,dotSize:Xt,borderWidth:et,textTop:Yt,textLeft:Pt,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:se.featureWrapper,ref:W,children:p}),createPortal(_jsx("div",{className:se.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx("div",{className:se.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:se.pulseCircle})}),_jsxs("div",{className:se.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 Fn=t(35292);const kr=(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 cs({color:e="primary",disabled:s=!1,href:i="#",icon:u=(0,n.jsx)(Fn.Z,{}),label:p,onClick:v,title:j}){const B=kr();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)(Ne,{title:j,className:Q()(B.link,B[e]),to:i,onClick:v,children:[u,(0,n.jsx)("span",{className:B.label,children:p})]})}const er=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function An(e){const{links:s}=e,i=er();return(0,n.jsx)("nav",{className:i.links,children:s.map((u,p)=>(0,n.jsx)(cs,{...u},p+1))})}const cr=e=>{const s=e==="dark"?"16%":"97%";return`
16
- hsl(0, 0%, ${s}) 0%,
17
- hsla(0, 0%, ${s}, 0.987) 8.1%,
18
- hsla(0, 0%, ${s}, 0.951) 15.5%,
19
- hsla(0, 0%, ${s}, 0.896) 22.5%,
20
- hsla(0, 0%, ${s}, 0.825) 29%,
21
- hsla(0, 0%, ${s}, 0.741) 35.3%,
22
- hsla(0, 0%, ${s}, 0.648) 41.2%,
23
- hsla(0, 0%, ${s}, 0.55) 47.1%,
24
- hsla(0, 0%, ${s}, 0.45) 52.9%,
25
- hsla(0, 0%, ${s}, 0.352) 58.8%,
26
- hsla(0, 0%, ${s}, 0.259) 64.7%,
27
- hsla(0, 0%, ${s}, 0.175) 71%,
28
- hsla(0, 0%, ${s}, 0.104) 77.5%,
29
- hsla(0, 0%, ${s}, 0.049) 84.5%,
30
- hsla(0, 0%, ${s}, 0.013) 91.9%,
31
- hsla(0, 0%, ${s}, 0) 100%
32
- `},br=100,Sr=10,ds=(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:br,height:`calc(100% + ${Sr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Sr,background:`linear-gradient(90deg, ${cr(e.palette.type)})`},fadeRight:{right:-Sr,background:`linear-gradient(270deg, ${cr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Cr(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 Or(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,se=Math.max(i,N)*Math.sign(u);e.current.scrollBy({left:se});const fe=u-se;Math.sign(u)!==Math.sign(fe)?p(0):p(fe)});return()=>cancelAnimationFrame(j)},[e,u,s,i]),p}function Zs(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:u=5,children:p,...v}=e,j=ds(e),B=React.useRef(),[W,N]=Cr(B),ye=Or(B,i,u),se=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:()=>se(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>se(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const $r=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Gn(e){const s=$r(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 wr=(0,g.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function gr(e){const{Progress:s}=(0,L.qD)().getComponents();return(0,n.jsx)(g.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(wr,{...e})})}const Hr=(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"}),jr=(e,s)=>s?typeof s=="string"?e+s:g.Children.toArray(s.props.children).reduce(jr,e):e,Tn=({level:e,children:s})=>{const p=g.Children.toArray(s).reduce(jr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:p},s)},us={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)(ht,{language:v[1],text:p}):(0,n.jsx)("code",{className:s,...u,children:i})},h1:Tn,h2:Tn,h3:Tn,h4:Tn,h5:Tn,h6:Tn};function Er(e){const{content:s,dialect:i="gfm",linkTarget:u,transformLinkUri:p,transformImageUri:v,className:j}=e,B=Hr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${B.markdown} ${j}`,children:s,components:us,linkTarget:u,transformLinkUri:p,transformImageUri:v})}var Ar=t(23054);const Gr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),hs=({request:e,busy:s,setBusy:i})=>{const u=Gr(),[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 ps=null;const fs=(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 Ds(e){const s=fs(),[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 gs=t(15277),Kr=t.n(gs),ms=t(29862);const Yr=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function vs(e){const[s,i]=(0,g.useState)(!1),u=(0,ms.t)(),p=Yr(),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 Jr=t(67358);function Zt(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)(Jr.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var mr=t(94339),Qr=t(14503),ys=t(24579),Xr=t(32552),mn=t(15459),Kn=t(95544),xs=t(27597);const bs=(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 Ss(e){const{link:s,title:i,onClick:u}=e,p=bs();return(0,n.jsxs)("div",{children:[(0,n.jsx)(xn.Z,{}),(0,n.jsx)(Ne,{to:s,onClick:u,underline:"none",children:(0,n.jsxs)(Kn.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(Kn.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(J.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(xs.Z,{className:p.arrow})]})})]})}const Cs=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})},ws=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)(En,{title:"Something Went Wrong",error:u,children:(0,n.jsx)(Cs,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},js=(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"}),Es=(0,mn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Qr.Z),qr={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 Tr(e){const{title:s,subheader:i,divider:u=!0,deepLink:p,slackChannel:v,errorBoundaryProps:j,variant:B,children:W,headerStyle:N,headerProps:ye,icon:se,action:fe,actionsClassName:Le,actions:Je,cardClassName:et,actionsTopRight:Rt,className:Mt,noPadding:Xt,titleTypographyProps:qt}=e,Pt=js();let Yt={},zt={};B&&B.split(/[\s]+/g).forEach(Ur=>{Yt={...Yt,...qr.card[Ur]},zt={...zt,...qr.cardContent[Ur]}});const vr=()=>(0,n.jsxs)("div",{className:Pt.headerSubheader,children:[i&&(0,n.jsx)("div",{className:Pt.subheader,children:i}),se]}),yr=j||(v?{slackChannel:v}:{});return(0,n.jsx)(mr.Z,{style:Yt,className:Mt,children:(0,n.jsxs)(ws,{...yr,children:[s&&(0,n.jsx)(Xr.Z,{classes:{root:Pt.header,title:Pt.headerTitle,subheader:Pt.headerSubheader,avatar:Pt.headerAvatar,action:Pt.headerAction,content:Pt.headerContent},title:s,subheader:vr(),action:fe,style:{...N},titleTypographyProps:qt,...ye}),Rt&&(0,n.jsx)(Es,{children:Rt}),u&&(0,n.jsx)(xn.Z,{}),(0,n.jsx)(ys.Z,{className:Q()(et,{[Pt.noPadding]:Xt}),style:zt,children:W}),Je&&(0,n.jsx)(Qr.Z,{className:Le,children:Je}),p&&(0,n.jsx)(Ss,{...p})]})})}var Ns=t(39307);const As=(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"}),_r={fractional:!0,inverse:!1,unit:"%",max:100},Fs=({palette:e,value:s,inverse:i,max:u})=>{if(isNaN(s))return"#ddd";const p=u||_r.max,v=i?p-s:s;return v<p/3?e.status.error:v<p*(2/3)?e.status.warning:e.status.ok};function y(e){const[s,i]=useState(null),{getColor:u=Fs}=e,p=As(e),{palette:v}=useTheme(),{value:j,fractional:B,inverse:W,unit:N,max:ye,description:se}={..._r,...e},fe=B?Math.round(j*ye):j,Le=ye!==100?Math.round(j):fe,[Je,et]=useState(!1);return useEffect(()=>{const Rt=s,Mt=()=>et(!0),Xt=()=>et(!1);return Rt&&se?(Rt.addEventListener("mouseenter",Mt),Rt.addEventListener("mouseleave",Xt),()=>{Rt.removeEventListener("mouseenter",Mt),Rt.removeEventListener("mouseleave",Xt)}):()=>{et(!1)}},[se,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}),se&&Je?_jsx("div",{className:p.description,children:se}):_jsx("div",{className:p.overlay,children:isNaN(j)?"N/A":`${Le}${N}`})]})}const b=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function P(e){const s=b(e),{title:i,subheader:u,progress:p,inverse:v,deepLink:j,description:B,icon:W,variant:N,getColor:ye}=e,se={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,{...se})})})}function D(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 G=t(21324),K=t(7089),ce=t(1292),ie=t(42494),xe=t(74603),we=t(56939),Pe=t(12231),Te=t(73698),Ye=t(72379);const bt=(0,l.Z)(()=>(0,k.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Xe=()=>{const e=bt();return(0,n.jsx)(Ye.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 Ot=(0,l.Z)(()=>(0,k.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Yn=()=>{const e=Ot();return(0,n.jsx)(Ye.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 Un=(0,mn.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"})(xe.Z),dr=(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 dn(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,se=dr(),[fe,Le]=(0,g.useState)(v||(s?[]:"")),[Je,et]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Le(s?[]:"")},[B,s]),(0,g.useEffect)(()=>{v!==void 0&&Le(v)},[v]);const Rt=Pt=>{Le(Pt.target.value),j(Pt.target.value)},Mt=Pt=>{if(N){Pt.preventDefault();return}et(Yt=>s&&!(Pt.target instanceof HTMLElement)?!0:!Yt)},Xt=()=>{et(!1)},qt=Pt=>()=>{const Yt=fe.filter(zt=>zt!==Pt);Le(Yt),j(Yt)};return(0,n.jsx)("div",{className:se.root,children:(0,n.jsx)(ce.Z,{onClickAway:Xt,children:(0,n.jsxs)(ie.Z,{className:se.formControl,children:[(0,n.jsx)(we.Z,{className:se.formLabel,children:u}),(0,n.jsxs)(Te.Z,{"aria-label":u,value:fe,native:W,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ye,onChange:Rt,onClick:Mt,open:Je,input:(0,n.jsx)(Un,{}),label:u,tabIndex:0,renderValue:Pt=>{var Yt;return s&&fe.length!==0?(0,n.jsx)("div",{className:se.chips,children:Pt.map(zt=>{var vr,yr;return(0,n.jsx)(K.Z,{label:(vr=i.find(rr=>rr.value===zt))===null||vr===void 0?void 0:vr.label,clickable:!0,onDelete:qt(zt),className:se.chip},(yr=i.find(rr=>rr.value===zt))===null||yr===void 0?void 0:yr.value)})}):(0,n.jsx)(J.Z,{children:fe.length===0?p||"":(Yt=i.find(zt=>zt.value===Pt))===null||Yt===void 0?void 0:Yt.label})},IconComponent:()=>Je?(0,n.jsx)(Yn,{}):(0,n.jsx)(Xe,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(Pe.Z,{value:[],children:p}),W?i&&i.map(Pt=>(0,n.jsx)("option",{value:Pt.value,children:Pt.label},Pt.value)):i&&i.map(Pt=>(0,n.jsxs)(Pe.Z,{value:Pt.value,children:[s&&(0,n.jsx)(G.Z,{color:"primary",checked:fe.includes(Pt.value)||!1,className:se.checkbox}),Pt.label]},Pt.value))]})]})})})}const vn=()=>{},In=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:vn,stepHistory:[],setStepHistory:vn,onStepChange:vn});function Ir(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,se=>{isValidElement(se)&&(se.props.end?ye=se:N.push(se))}),_jsxs(_Fragment,{children:[_jsx(In.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 Rr=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),Br=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),un=({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")}),bn=({text:e,handleClick:s,disabled:i,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:i,children:e||"Back"}),Pr=({actions:e={},children:s})=>{const i=Rr(),{stepperLength:u,stepIndex:p,setStepIndex:v,stepHistory:j,setStepHistory:B,onStepChange:W}=useContext(VerticalStepperContext),N=(Le,Je)=>{Je&&Je(),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])},se=()=>{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(bn,{text:e.backText,handleClick:se,disabled:p===0,stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(un,{text:e.nextText,handleClick:ye,disabled:!!u&&p>=u||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(Br,{text:e.restartText,handleClick:fe,stepIndex:p}),s]})},So=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Hi(e){const{title:s,children:i,end:u,actions:p,...v}=e,j=So();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 Zr=(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 Dr(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Gi(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ni(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ki(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Yi(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Rn(e){const s=Zr(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Us=t(74600),Ms=t(15584);const es=e=>(0,k.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),ts={root:{border:"0",verticalAlign:"top"}},ns=e=>(0,k.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),Co=e=>(0,k.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),zs=(0,mn.Z)(es,{name:"BackstageMetadataTableTitleCell"})(Ms.Z),wo=(0,mn.Z)(ts,{name:"BackstageMetadataTableCell"})(Ms.Z),ri=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),si=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(zs,{children:e}),_jsx(wo,{colSpan:e?1:2,...i,children:s})]}),Vs=(0,mn.Z)(ns,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),oi=(0,mn.Z)(Co,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),ur=(0,k.Z)({root:{margin:"0 0",listStyleType:"none"}}),Ts=e=>(0,k.Z)({root:{...ur.root,paddingLeft:e.spacing(1)}}),Ws=(0,mn.Z)(ur,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Vs,{classes:e,children:s})),Hs=(0,mn.Z)(Ts,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Vs,{classes:e,children:s}));function Gs(e,s){const i=e.map((u,p)=>_jsx(MetadataListItem,{children:Is(u)},p));return s?_jsx(Hs,{children:i}):_jsx(Ws,{children:i})}function jo(e,s,i){const u=Object.keys(e).map(p=>{const v=Is(e[p],!0),j=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${j}: `,v]},p)});return s?_jsx(Hs,{children:u}):_jsx(Ws,{children:u})}function Is(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?jo(e,s,i):Array.isArray(e)?Gs(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const Eo=({value:e,options:s})=>_jsx(Fragment,{children:Is(e,s)}),Ao=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(Eo,{value:s,options:i})});function ii(e,s){return Object.keys(e).map(i=>_jsx(Ao,{title:i,value:e[i],options:s},i))}function ai(e){const{metadata:s,dense:i=!0,options:u}=e,p=ii(s,u||{});return _jsx(MetadataTable,{dense:i,children:p})}var To=t(49429),Io=t(86136),Ks=t(79784),Ys=t(19126),rs=t.n(Ys);function Ro(e){return qs.stringify(e,{strictNullHandling:!0})}function Js(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Qs(e,s){return Js(e)[s]}function Po(e,s,i){const u={...Js(e),[s]:i};return Ro(u)}function Ji(e,s=250){const[i,u]=useSearchParams(),p=i.toString(),[v,j]=useState(Qs(p,e));return useEffect(()=>{const B=Qs(p,e);j(W=>isEqual(B,W)?W:B)},[p,j,e]),useDebouncedEffect(()=>{const B=Po(p,e,v);p!==B&&u(B,{replace:!0})},[u,v,p,e],s),[v,j]}const li={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 Nr(){const s=(0,L.I_)().get(L.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return li;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 ci=t(80079);function Jn(e,s){const u=(0,L.qD)().getSystemIcon(e);return u?(0,n.jsx)(u,{...s}):(0,n.jsx)(ci.Z,{...s})}function di(e){return Jn("brokenImage",e)}function ui(e){return Jn("catalog",e)}function Lo(e){return Jn("chat",e)}function Qi(e){return Jn("dashboard",e)}function Xi(e){return Jn("docs",e)}function ko(e){return Jn("email",e)}function Oo(e){return Jn("github",e)}function hi(e){return Jn("group",e)}function ss(e){return Jn("help",e)}function qi(e){return Jn("user",e)}function _i(e){return Jn("warning",e)}const pi=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Mn=({icon:e})=>{const s=(0,L.qD)();var i;const u=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:ss;return(0,n.jsx)(u,{})};var Xs;const $o=({link:e})=>(0,n.jsx)(Ne,{to:e.url,children:(Xs=e.title)!==null&&Xs!==void 0?Xs:e.url}),fi=({item:e})=>{var s;return(0,n.jsxs)(ft.Z,{children:[(0,n.jsx)(Io.Z,{children:(0,n.jsx)(Mn,{icon:e.icon})}),(0,n.jsx)(dt.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)($o,{link:u},u.url)],[])})]})};function gi(e){const{title:s,children:i}=e,{items:u}=Nr(),[p,v]=(0,g.useState)(!1),[j,B]=(0,g.useState)(null),W=pi(),N=(0,Ge.Z)(fe=>fe.breakpoints.down("sm")),ye=fe=>{B(fe.currentTarget),v(!0)},se=()=>{v(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Kn.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)(ss,{})}):(0,n.jsx)(_.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ye,startIcon:(0,n.jsx)(ss,{}),children:"Support"})}),(0,n.jsxs)(Ks.ZP,{"data-testid":"support-button-popover",open:p,anchorEl:j,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:se,children:[(0,n.jsxs)(nt.Z,{className:W.popoverList,children:[s&&(0,n.jsx)(ft.Z,{alignItems:"flex-start",children:(0,n.jsx)(J.Z,{variant:"subtitle1",children:s})}),g.Children.map(i,(fe,Le)=>(0,n.jsx)(ft.Z,{alignItems:"flex-start",children:fe},`child-${Le}`)),u&&u.map((fe,Le)=>(0,n.jsx)(fi,{item:fe},`item-${Le}`))]}),(0,n.jsx)(To.Z,{children:(0,n.jsx)(_.Z,{color:"primary",onClick:se,children:"Close"})})]})]})}var _s=t(18671);const Rs=72,Bo=24,Zo=18,hr={drawerWidthClosed:Rs,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Rs,iconSize:Rs-Bo*2,iconPadding:Bo,selectedIndicatorWidth:3,userBadgePadding:Zo,userBadgeDiameter:Rs-Zo*2,mobileSidebarHeight:56},mi=e=>({...hr,...e,iconContainerWidth:hr.drawerWidthClosed,iconSize:hr.drawerWidthClosed-hr.iconPadding*2,userBadgeDiameter:hr.drawerWidthClosed-hr.userBadgePadding*2}),Do={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:hr.defaultOpenDelayMs+200},vi=e=>({...Do,...e}),No="@backstage/core/sidebar-intro-dismissed",Qn=(0,g.createContext)({sidebarConfig:hr,submenuConfig:Do}),eo=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var os;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(os||(os={}));const to={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(os.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(os.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var is=t(51837);const no={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ro=(0,g.createContext)(no),so=(0,is.CT)("sidebar-pin-state-context");function Fo(e){const{children:s,value:i}=e;return(0,n.jsx)(ro.Provider,{value:i,children:(0,n.jsx)(so.Provider,{value:(0,is.EI)({1:i}),children:s})})}const as=()=>{const e=(0,g.useContext)(so),s=(0,g.useContext)(ro);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},Uo=(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"}),oo=(0,g.createContext)({content:{contentRef:void 0}});function yi(e){const[s,i]=(0,g.useState)(()=>to.getSidebarPinState()),{sidebarConfig:u}=(0,g.useContext)(Qn),p=(0,g.useRef)(null),v=(0,g.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,g.useEffect)(()=>{to.setSidebarPinState(s)},[s]);const j=(0,Ge.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),B=()=>i(!s),W=Uo({isPinned:s,sidebarConfig:u});return(0,n.jsx)(Fo,{value:{isPinned:s,toggleSidebarPinState:B,isMobile:j},children:(0,n.jsx)(oo.Provider,{value:v,children:(0,n.jsx)("div",{className:W.root,children:e.children})})})}function io(){const{content:e}=(0,g.useContext)(oo);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 ao={isOpen:!1,setOpen:()=>{}},lo=(0,g.createContext)(ao),co=(0,is.CT)("sidebar-open-state-context");function uo(e){const{children:s,value:i}=e;return(0,n.jsx)(lo.Provider,{value:i,children:(0,n.jsx)(co.Provider,{value:(0,is.EI)({1:i}),children:s})})}const Ps=()=>{const e=(0,g.useContext)(co),s=(0,g.useContext)(lo);if(e===void 0)return s||ao;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Mo=t(50023),zo=t(4190),Xn=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"}})),ho=e=>{const{to:s,label:i,icon:u,value:p}=e,{sidebarConfig:v}=(0,g.useContext)(Qn),j=Ho({sidebarConfig:v}),B=(0,A.TH)(),{selectedMenuItemIndex:W,setSelectedMenuItemIndex:N}=(0,g.useContext)(go),ye=(fe,Le)=>{N(Le===W?-1:Le)},se=p===W&&W>=0||p!==W&&!(W>=0)&&s===B.pathname;return(0,n.jsx)(Wo.Z,{label:i,icon:u,component:Ne,to:s||B.pathname,onChange:ye,value:p,selected:se,classes:j})},po=e=>{const{children:s,to:i,label:u,icon:p,value:v}=e,{isMobile:j}=as();return j?(0,n.jsx)(ho,{to:i,label:u,icon:p,value:v}):(0,n.jsx)(n.Fragment,{children:s})},fo=(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`})})),Go=e=>(0,de.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ko=g.createElement(po).type,xi=({children:e,label:s="Menu",open:i,onClose:u})=>{const{sidebarConfig:p}=(0,g.useContext)(Qn),v=fo({sidebarConfig:p});return(0,n.jsxs)(zo.ZP,{anchor:"bottom",open:i,onClose:u,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,n.jsxs)(Kn.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)(Xn.Z,{})})]}),(0,n.jsx)(Kn.Z,{component:"nav",children:e})]})},go=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),a=e=>{const{sidebarConfig:s}=(0,g.useContext)(Qn),{children:i}=e,u=fo({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===Ko));if(i)B.length?B=Go(B):B.push((0,n.jsx)(po,{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)(uo,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(go.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,n.jsx)(xi,{label:B[v]&&B[v].props.label,open:W,onClose:()=>j(-1),children:B[v]&&B[v].props.children}),(0,n.jsx)(Mo.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:B})]})})},r=(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 o;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(o||(o={}));const c=e=>{const{sidebarConfig:s}=(0,g.useContext)(Qn),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:p,children:v}=e,j=r({sidebarConfig:s}),B=(0,Ge.Z)(Mt=>Mt.breakpoints.down("md"),{noSsr:!0}),[W,N]=(0,g.useState)(o.Closed),ye=(0,g.useRef)(),{isPinned:se,toggleSidebarPinState:fe}=as(),Le=()=>{se||p||(ye.current&&(clearTimeout(ye.current),ye.current=void 0),W!==o.Open&&!B&&(ye.current=window.setTimeout(()=>{ye.current=void 0,N(o.Open)},i),N(o.Idle)))},Je=()=>{se||p||(ye.current&&(clearTimeout(ye.current),ye.current=void 0),W===o.Idle?N(o.Closed):W===o.Open&&(ye.current=window.setTimeout(()=>{ye.current=void 0,N(o.Closed)},u)))},et=W===o.Open&&!B||se,Rt=Mt=>{Mt?(N(o.Open),fe()):(N(o.Closed),fe())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(O,{}),(0,n.jsx)(uo,{value:{isOpen:et,setOpen:Rt},children:(0,n.jsx)("div",{className:j.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Le,onFocus:p?()=>{}:Le,onMouseLeave:p?()=>{}:Je,onBlur:p?()=>{}:Je,children:(0,n.jsx)("div",{className:Q()(j.drawer,{[j.drawerOpen]:et}),children:v})})})]})},f=e=>{var s;const i=mi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const p=vi((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:v,disableExpandOnHover:j,openDelayMs:B,closeDelayMs:W}=e,{isMobile:N}=as();return N?(0,n.jsx)(a,{children:v}):(0,n.jsx)(Qn.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(c,{openDelayMs:B,closeDelayMs:W,disableExpandOnHover:j,children:v})})};function O(){const{sidebarConfig:e}=(0,g.useContext)(Qn),{focusContent:s,contentRef:i}=io(),u=r({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(_.Z,{onClick:s,variant:"contained",className:Q()(u.visuallyHidden),children:"Skip to content"}):null}function U(e,s){const i=new URLSearchParams(s.search).toString(),u=rs().parse(i),p=new URLSearchParams(e.search).toString(),v=rs().parse(p);return(0,de.isEqual)(s.pathname,e.pathname)&&(0,de.isMatch)(v,u)}const z=(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"}),re=e=>{const{title:s,subtitle:i,to:u,icon:p,dropdownItems:v}=e,j=z(),{setIsHoveredOn:B}=useContext(SidebarItemWithSubmenuContext),W=()=>{B(!1)},N=useResolvedPath(u!=null?u:""),ye=useLocation();let se=isLocationMatch(ye,N);const[fe,Le]=useState(!1),Je=()=>{Le(!fe)};return v!==void 0?(v.some(et=>{const Rt=resolvePath(et.to);return se=isLocationMatch(ye,Rt),se}),_jsxs("div",{className:j.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Je,onTouchStart:et=>et.stopPropagation(),className:classnames(j.item,se?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,Rt)=>_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})})},Rt))})]})):_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,se?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 ze;const Ve=(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:(ze=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&ze!==void 0?ze:"#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"}),Ct=e=>{const{isOpen:s}=Ps(),{sidebarConfig:i,submenuConfig:u}=(0,g.useContext)(Qn),p=s?i.drawerWidthOpen:i.drawerWidthClosed,v=Ve({left:p,submenuConfig:u}),{isHoveredOn:j}=(0,g.useContext)(eo),[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 it=t(76600),$t=t(26739),Ft=t(98989),Kt=t(59797),Sn=t(83543);const tr=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),nr=()=>{const e=tr();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 pr=null;const ls=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),bi=()=>{const e=ls();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 Si=null,Fr,Ls;const Lr=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:(Fr=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&Fr!==void 0?Fr:"#404040"}},highlighted:{background:(Ls=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&Ls!==void 0?Ls:"#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 mo(e){return(0,g.useMemo)(()=>Lr(e),[e])()}const ea=(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||U(s,(0,A.i3)(j)));return}p&&(u=U(s,(0,A.i3)(p)))}}),u},[s.pathname]);function Ci(e){return e.to===void 0}const ta=g.createElement(Ct).type,na=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:se}=(0,A.TH)(),{pathname:fe}=(0,A.WU)(s);j||(se=se.toLocaleLowerCase("en-US"),fe=fe.toLocaleLowerCase("en-US"));let Le=se===fe;!Le&&!i&&(Le=se.startsWith(`${fe}/`));const Je=Le?W:void 0;return(0,n.jsx)(ve.rU,{...N,to:s,ref:ye,"aria-current":Je,style:{...u,...Le?v:void 0},className:Q()([p,Le?B:void 0])})}),wi=(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:se}=(0,g.useContext)(Qn),fe=mo(se),{isOpen:Le}=Ps(),Je=!Le&&v?{display:"flex",marginLeft:"24px"}:{},et=(0,n.jsxs)("div",{style:Je,children:[(0,n.jsx)(i,{fontSize:"small"}),!Le&&v?(0,n.jsx)(Ft.Z,{}):(0,n.jsx)(n.Fragment,{})]}),Rt=(0,n.jsx)($t.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:Rt}),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:Rt,qt={onClick:B,className:Q()(N,fe.root,Le?fe.open:fe.closed,Ci(e)&&fe.buttonItem,{[fe.highlightable]:!j})};return Ci(e)?(0,n.jsx)("button",{"aria-label":u,...qt,ref:s,children:Xt}):(0,n.jsx)(na,{...qt,activeClassName:fe.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ye,children:Xt})}),ra=({children:e,...s})=>{const{sidebarConfig:i}=(0,g.useContext)(Qn),u=mo(i),[p,v]=(0,g.useState)(!1),j=(0,A.TH)(),B=ea(e,j),W=(0,Ge.Z)(fe=>fe.breakpoints.down("sm")),N=()=>{v(!0)},ye=()=>{v(!1)},se=()=>W?p?(0,n.jsx)(Kt.Z,{fontSize:"small",className:u.submenuArrow}):(0,n.jsx)(Sn.Z,{fontSize:"small",className:u.submenuArrow}):!p&&(0,n.jsx)(Ft.Z,{fontSize:"small",className:u.submenuArrow});return(0,n.jsx)(eo.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)(wi,{hasSubmenu:!0,className:B?u.selected:"",...s,children:se()}),p&&e]})})},ji=(0,g.forwardRef)((e,s)=>{const[i]=(0,L.vJ)(e.children,u=>u.getElements().filter(p=>p.type===ta));return i?(0,n.jsx)(ra,{...e,children:i}):(0,n.jsx)(wi,{...e,ref:s})});function Bl(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,u]=useState(""),p=mo(s),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(i),u("")},B=se=>{se.key==="Enter"&&(se.preventDefault(),j())},W=se=>{u(se.target.value)},N=se=>{se.preventDefault(),se.stopPropagation()},ye=se=>{j(),se.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(ji,{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 Zl=(0,it.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Dl=(0,it.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),sa=(0,it.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),oa=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Nl=(0,it.Z)("div")(({theme:e})=>{const s=oa(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Fl=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=mo(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,{})})})},ia=(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 aa(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=ia({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 Ei=e=>{const{text:s,onDismiss:i}=e,[u,p]=useState(!1),v=()=>{p(!0)};return _jsx(Collapse,{in:!u,onExited:i,children:_jsx(aa,{text:s,onClose:v})})},la=null,ca="And your recently viewed plugins will pop up here!";function Ul(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(Ei,{text:la,onDismiss:B}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ei,{text:ca,onDismiss:W})]}):null}const da=(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 Ai(e){const{className:s,stretch:i,noPadding:u,children:p,...v}=e,{contentRef:j}=io(),B=da();return(0,n.jsx)("article",{ref:j,tabIndex:-1,...v,className:Q()(B.root,s,{[B.stretch]:i,[B.noPadding]:u}),children:p})}var ua=t(6487),ha=t(99152);const pa=(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 Ti(e){const{tabs:s,onChange:i,selectedIndex:u}=e,[p,v]=(0,g.useState)(u!=null?u:0),j=pa(),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)(ha.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)(ua.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 fa(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 se;return{index:ye===-1?0:ye,element:v,route:(se=e[ye])!==null&&se!==void 0?se:e[0]}}function Ii(e){const{routes:s}=e,i=(0,A.s0)(),{index:u,route:p,element:v}=fa(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)(Ti,{tabs:j,selectedIndex:u,onChange:B}),(0,n.jsxs)(Ai,{children:[(0,n.jsx)(_s.q,{title:p.title}),v]})]})}const Yo=()=>null;(0,L.R5)(Yo,"core.gatherMountPoints",!0);function Ri(e){const s=(0,n.jsx)(Yo,{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 Ri(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 ga(e){const s=Ri(e.children);return(0,n.jsx)(Ii,{routes:s})}ga.Route=Yo;const ma=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function va(e){const{value:s,subvalue:i}=e,u=ma();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 ya=t(21070),xa=t(90324),ba=t(98281),Sa=t(48049),Pi=t(51209),Li=t(33375),Ca=t(44233),wa=t(27604),Jo=t(36444),ja=t(37971),Ea=t(59709),Aa=t(17373),Ta=t(3702),Ia=t(93111),vo=t(67222);const Ra=(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"}),Pa=e=>{var s;const i=Ra(),{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)(_.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)(dn,{triggerReset:j,...N.element,selected:p[N.element.label],onChange:ye=>v({...p,[N.element.label]:ye})},N.element.label))})]})},ki={Add:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ya.Z,{...e,ref:s})),Check:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ba.Z,{...e,ref:s})),Clear:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Li.Z,{...e,ref:s})),Delete:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ca.Z,{...e,ref:s})),DetailPanel:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Pi.Z,{...e,ref:s})),Edit:(0,g.forwardRef)((e,s)=>(0,n.jsx)(wa.Z,{...e,ref:s})),Export:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ta.Z,{...e,ref:s})),Filter:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Jo.Z,{...e,ref:s})),FirstPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(ja.Z,{...e,ref:s})),LastPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ea.Z,{...e,ref:s})),NextPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Pi.Z,{...e,ref:s})),PreviousPage:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Sa.Z,{...e,ref:s})),ResetSearch:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Li.Z,{...e,ref:s})),Search:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Jo.Z,{...e,ref:s})),SortArrow:(0,g.forwardRef)((e,s)=>(0,n.jsx)(xa.Z,{...e,ref:s})),ThirdStateCheck:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Aa.Z,{...e,ref:s})),ViewColumn:(0,g.forwardRef)((e,s)=>(0,n.jsx)(Ia.Z,{...e,ref:s}))};function Oi(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 La=(0,mn.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"})(vo.W$),$i=(0,mn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(vo.UW),ka=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Oa=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function $a(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 Ba(e,s){return(0,de.transform)(e,(i,u,p)=>{(0,de.isEqual)(u,s[p])||(i[p]=u)})}const Bi={search:"",filtersOpen:!1,filters:{}};function Za(e){const{toolbarRef:s,setSearch:i,hasFilters:u,selectedFiltersLength:p,toggleFilters:v}=e,j=ka(),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)(Jo.Z,{})}),(0,n.jsxs)(J.Z,{className:j.title,children:["Filters (",p,")"]})]}),(0,n.jsx)($i,{...e,ref:s,onSearchChanged:B})]}):(0,n.jsx)($i,{...e,ref:s,onSearchChanged:B})}function Zi(e){const{data:s,columns:i,options:u,title:p,subtitle:v,filters:j,initialState:B,emptyContent:W,onStateChange:N,components:ye,...se}=e,fe=Oa(),Le=(0,mt.Z)(),Je={...Bi,...B},[et,Rt]=(0,g.useState)(Je.filtersOpen),Mt=(0,g.useCallback)(()=>Rt(Pn=>!Pn),[Rt]),[Xt,qt]=(0,g.useState)(0),[Pt,Yt]=(0,g.useState)(s),[zt,vr]=(0,g.useState)(Je.filters),yr=$a(i,Le),[rr,Ur]=(0,g.useState)(Je.search);(0,g.useEffect)(()=>{if(N){const Pn=Ba({search:rr,filtersOpen:et,filters:zt},Bi);N(Pn)}},[rr,et,zt,N]);const Os={headerStyle:{textTransform:"uppercase"}},$s=(0,g.useCallback)(Pn=>{var fr;return(fr=i.find(Vr=>Vr.title===Pn))===null||fr===void 0?void 0:fr.field},[i]);(0,g.useEffect)(()=>{if(typeof s=="function")return;if(!zt){Yt(s);return}const Pn=Object.values(zt);if(s&&Pn.flat().length){const fr=s.filter(Vr=>!!Object.entries(zt).filter(([,sr])=>!!sr.length).every(([sr,tn])=>{const Vn=Oi(Vr,$s(sr));return Array.isArray(Vn)&&Array.isArray(tn)?Vn.some(Wr=>tn.includes(Wr)):Array.isArray(Vn)?Vn.includes(tn):Array.isArray(tn)?tn.includes(Vn):Vn===tn}));Yt(fr)}else Yt(s);qt(Pn.flat().length)},[s,zt,$s]);const Jt=(Pn,fr)=>{const Vr=tn=>{const Vn=new Set,Wr=or=>{or!=null&&Vn.add(or)};return fr&&fr.forEach(or=>{const Bs=Oi(or,$s(tn));Array.isArray(Bs)?Bs.forEach(Wr):Wr(Bs)}),Vn},sr=tn=>({placeholder:"All results",label:tn.column,multiple:tn.type==="multiple-select",items:[...Vr(tn.column)].sort().map(Vn=>({label:Vn,value:Vn}))});return Pn.map(tn=>({type:tn.type,element:sr(tn)}))},Mr=!!(j!=null&&j.length),ei=(0,g.useCallback)(Pn=>(0,n.jsx)(Za,{setSearch:Ur,hasFilters:Mr,selectedFiltersLength:Xt,toggleFilters:Mt,...Pn}),[Mt,Mr,Xt,Ur]),zr=typeof s!="function"&&s.length===0,xo=i.length,ti=(0,g.useCallback)(Pn=>W&&zr?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:xo,children:W})})}):(0,n.jsx)(vo.os,{...Pn}),[zr,W,xo]);return(0,n.jsxs)("div",{className:fe.root,children:[et&&s&&typeof s!="function"&&(j==null?void 0:j.length)&&(0,n.jsx)(Pa,{filters:Jt(j,s),selectedFilters:zt,onChangeFilters:vr}),(0,n.jsx)(vo.ZP,{components:{Header:La,Toolbar:ei,Body:ti,...ye},options:{...Os,...u},columns:yr,icons:ki,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:Pt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...se})]})}Zi.icons=Object.freeze(ki);const Ml=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})})},Da=(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=Da(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})},Na=(e,s)=>s?e?"20px":"0":"40px",Fa=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Na(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Vl=e=>{const s=Fa(e),{isFirstNav:i,isFirstIndex:u,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ua=(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"}),Wl=e=>{const s=Ua(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Ma=(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 Hl(e){const{tabs:s}=e,i=Ma(),[u,p]=useState([0,0]),[v,j]=useState(0),[B,W]=useState(0),[N,ye]=useState([[]]),se=useRef(),{width:fe}=useWindowSize(),Le=(Xt,qt)=>{p([v,qt])},Je=()=>{j(v-1)},et=()=>{j(v+1)},Rt=()=>v+1<N.length;useEffect(()=>{const qt=v===0?1:2,Pt=se.current.offsetWidth-20-qt*30,Yt=u[0]*B+u[1],zt=Math.floor(Pt/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:se,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:Mt,onChange:Le,selectionFollowsFocus:!0,children:[v!==0&&_jsx(StyledIcon,{onClick:Je,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)),Rt()&&_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 Gl=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 Kl(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 Va=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"}),Wa=({title:e="Unknown page",className:s})=>(0,n.jsx)(J.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ha(e){const{description:s,title:i,titleComponent:u=void 0,children:p,textAlign:v="left"}=e,j=Va({textAlign:v})(),B=u||(0,n.jsx)(Wa,{title:i,className:j.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_s.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 Ga=t.p+"static/mic-drop.fe3ef4d0..svg";const Ka=(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"}),Ya=()=>{const e=Ka();return(0,n.jsx)("img",{src:Ga,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ja=(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 Qa(e){const{status:s,statusMessage:i,additionalInfo:u,supportUrl:p}=e,v=Ja(),j=(0,A.s0)(),B=Nr();return(0,n.jsxs)(R.Z,{container:!0,spacing:0,className:v.container,children:[(0,n.jsxs)(R.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)(Ne,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(Ne,{to:p||B.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(Ya,{})]})}var Xa=t(16173);const qa=(0,mn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(J.Z),Qo=(0,mn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Kn.Z);function _a(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,se=Je=>{p(Je.currentTarget)},fe=()=>{p(null)},Le=Boolean(u);return(0,n.jsxs)(g.Fragment,{children:[(0,n.jsxs)(Xa.Z,{"aria-label":"breadcrumb",...i,children:[v.length>1&&(0,n.jsx)(Qo,{clone:!0,children:j}),v.length>2&&(0,n.jsx)(Qo,{clone:!0,children:B}),ye&&(0,n.jsx)(qa,{onClick:se,children:"..."}),(0,n.jsx)(Kn.Z,{style:{fontStyle:"italic"},children:N})]}),(0,n.jsx)(Ks.ZP,{open:Le,anchorEl:u,onClose:fe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(nt.Z,{children:W.map((Je,et)=>(0,n.jsx)(ft.Z,{button:!0,children:(0,n.jsx)(Qo,{clone:!0,children:Je})},et))})})]})}const el=(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"}),tl=({type:e,typeLink:s,classes:i,pageTitle:u})=>e?s?(0,n.jsxs)(_a,{className:i.breadcrumb,children:[(0,n.jsx)(Ne,{to:s,children:e}),(0,n.jsx)(J.Z,{children:u})]}):(0,n.jsx)(J.Z,{className:i.type,children:e}):null,nl=({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},rl=({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 Di(e){const{children:s,pageTitleOverride:i,style:u,subtitle:p,title:v,tooltip:j,type:B,typeLink:W}=e,N=el(),se=(0,L.h_)(L.Ds).getOptionalString("app.title")||"Backstage",fe=i||v,Le=v||i,Je=`${fe} | %s | ${se}`,et=`${fe} | ${se}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_s.q,{titleTemplate:Je,defaultTitle:et}),(0,n.jsxs)("header",{style:u,className:N.header,children:[(0,n.jsxs)(Kn.Z,{className:N.leftItemsBox,children:[(0,n.jsx)(tl,{classes:N,type:B,typeLink:W,pageTitle:Le}),(0,n.jsx)(nl,{classes:N,pageTitle:Le,tooltip:j}),(0,n.jsx)(rl,{classes:N,subtitle:p})]}),(0,n.jsx)(R.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:s})]})]})}const sl=({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 Yl(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(sl,{...v},`header-action-menu-${j}`))})})]})}const ol=(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"}),il=({value:e,className:s})=>(0,n.jsx)(J.Z,{className:s,children:e});function al(e){const{label:s,value:i,url:u}=e,p=ol(),v=(0,n.jsx)(il,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(R.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)(Ne,{to:u,children:v}):v]})})}const ll=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"}}),cl=(0,l.Z)(ll,{name:"BackstageItemCardHeader"});function dl(e){const{title:s,subtitle:i,children:u}=e,p=cl(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 Jl(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 ul=e=>(0,k.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),hl=(0,l.Z)(ul,{name:"BackstageItemCardGrid"});function pl(e){const{children:s,...i}=e,u=hl(i);return(0,n.jsx)("div",{className:u.root,...i,children:s})}var fl=t(41547);const gl=(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 Ni(e){const{themeId:s,children:i}=e,{isMobile:u}=as(),p=gl({isMobile:u});return(0,n.jsx)(fl.Z,{theme:v=>({...v,page:v.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function ml(e){const{themeId:s,children:i,...u}=e;return(0,n.jsxs)(Ni,{themeId:s,children:[(0,n.jsx)(Di,{...u}),i]})}var zn=t(30195);const Ql=zn.z.object({providerInfo:zn.z.object({}).catchall(zn.z.unknown()).optional(),profile:zn.z.object({email:zn.z.string().optional(),displayName:zn.z.string().optional(),picture:zn.z.string().optional()}),backstageIdentity:zn.z.object({token:zn.z.string(),identity:zn.z.object({type:zn.z.literal("user"),userEntityRef:zn.z.string(),ownershipEntityRefs:zn.z.array(zn.z.string())})})}),Fi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function vl(e){const s=new Date(Date.now()+Fi.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-Fi.tokenExpiryMarginMillis)}class Xl{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:vl(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 ql=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},yl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Xo=({children:e})=>{const s=yl();return(0,n.jsx)(R.Z,{component:"li",item:!0,classes:s,children:e})};class qo{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 xl(e){const[s,i,u]=e.split(".");return JSON.parse(atob(i))}class _o{getUserId(){return this.result.userId}static fromResult(s){return new _o(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}=xl(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 qo}static fromLegacy(s){return _o.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 bl={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 Ar.SP("Login failed",W))}};return(0,n.jsx)(Xo,{children:(0,n.jsx)(Tr,{variant:"fullHeight",title:u,actions:(0,n.jsx)(_.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})}},Sl={Component:({onSignInSuccess:e})=>(0,n.jsx)(Xo,{children:(0,n.jsx)(Tr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(_.Z,{color:"primary",variant:"outlined",onClick:()=>e(new qo),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 qo};var Cl=t(63955),Ui=t(86619),Mi=t(74828),wl=t(45455),jl=t.n(wl);const El=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Al=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),zi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Tl={Component:({onSignInSuccess:e})=>{const s=Al(),{register:i,handleSubmit:u,formState:p}=(0,Cl.cI)({mode:"onChange"}),{errors:v}=p,j=({userId:B})=>{e(ks.fromLegacy({userId:B,profile:{email:`${B}@example.com`}}))};return(0,n.jsx)(Xo,{children:(0,n.jsxs)(Tr,{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)(ie.Z,{children:[(0,n.jsx)(Ui.Z,{...zi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(v.userId)}),v.userId&&(0,n.jsx)(Mi.Z,{error:!0,children:v.userId.message})]}),(0,n.jsxs)(ie.Z,{children:[(0,n.jsx)(Ui.Z,{...zi(i("idToken",{required:!1,validate:B=>!B||El.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)(Mi.Z,{error:!0,children:v.idToken.message})]}),(0,n.jsx)(_.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!jl()(v),children:"Continue"})]})]})})},loader:async()=>{}},yo="@backstage/core:SignInPage:provider",Vi={guest:Sl,custom:Tl,common:bl};function Wi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function oc(e){return e.reduce((i,u)=>{if(typeof u=="string")return Wi(u,i),i[u]={components:Vi[u],id:u},i;const{id:p}=u;return Wi(p,i),i[p]={components:Vi.common,id:p,config:u},i},{})}const ic=(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(yo),await((N=W.signOut)===null||N===void 0?void 0:N.call(W))}}))},[s]);useLayoutEffect(()=>{var W;if(!p)return;const N=localStorage.getItem(yo);if(N===null){v(!1);return}const ye=e[N];if(!ye){v(!1);return}let se=!1;return ye.components.loader(u,(W=ye.config)===null||W===void 0?void 0:W.apiRef).then(fe=>{se||(fe?j(fe):v(!1))}).catch(fe=>{se||(localStorage.removeItem(yo),i.post(fe),v(!1))}),()=>{se=!0}},[p,i,s,u,e,j]);const B=useMemo(()=>Object.keys(e).map(W=>{const N=e[W],{Component:ye}=N.components,se=fe=>{localStorage.setItem(yo,N.id),j(fe)};return _jsx(ye,{config:N.config,onSignInSuccess:se},N.id)}),[e,j]);return[p,B]},Il=({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})]})]})},Rl=({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:se,showPopup:fe})=>{try{let Le;if(se&&(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 Je=await p.getProfile();i(UserIdentity.create({identity:Le.identity,authApi:p,profile:Je}))}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 ac(e){return"provider"in e?_jsx(Rl,{...e}):_jsx(Il,{...e})}const Pl=(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"}),Ll=(0,mn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Xr.Z);function lc(e){const{slackChannel:s,errorBoundaryProps:i,children:u,title:p,deepLink:v,value:j,onChange:B}=e,W=Pl(),[N,ye]=useState(0),se=B||((Je,et)=>ye(et));let fe;j?React.Children.map(u,Je=>{React.isValidElement(Je)&&(Je==null?void 0:Je.props.value)===j&&(fe=Je==null?void 0:Je.props.children)}):React.Children.map(u,(Je,et)=>{React.isValidElement(Je)&&et===N&&(fe=Je==null?void 0:Je.props.children)});const Le=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Le,children:[p&&_jsx(Ll,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:W,value:j||N,onChange:se,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:fe}),v&&_jsx(BottomLink,{...v})]})})}const kl=(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 cc(e){const{children:s,...i}=e,u=kl();return _jsx(Tab,{disableRipple:!0,classes:u,...i})}},25248:function(jt,Me,t){"use strict";t.d(Me,{fC:function(){return x},CL:function(){return Ze},sM:function(){return X},$v:function(){return je},v_:function(){return He},hg:function(){return Ne},uB:function(){return ee},R5:function(){return At},bq:function(){return T},Ds:function(){return Ee},ni:function(){return Q},T0:function(){return F},CO:function(){return $n},x8:function(){return ln},rx:function(){return yn},YO:function(){return Gt},P4:function(){return Cn},NT:function(){return en},NW:function(){return qe},VE:function(){return mt},W0:function(){return Ie},gP:function(){return rt},IY:function(){return pt},F4:function(){return de},ux:function(){return I},Kp:function(){return ve},$4:function(){return lt},p_:function(){return $},ZM:function(){return st},D:function(){return A},gW:function(){return E},E6:function(){return ut},z$:function(){return ht},h_:function(){return ne},I_:function(){return k},qD:function(){return ke},vJ:function(){return wn},yx:function(){return Re},tg:function(){return pn},Oi:function(){return Hn}});var h=t(52322),n=t(51837),g=t(2784);const L=(0,n.CT)("analytics-context"),V=()=>{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,Qe={...V(),...te},xt=(0,n.EI)({1:Qe});return(0,h.jsx)(L.Provider,{value:xt,children:Ae})};function l(ge,te){const Ae=Fe=>_jsx(x,{attributes:te,children:_jsx(ge,{...Fe})});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 Fe=xt=>{const oe=k(),R={};for(const J in ge)if(ge.hasOwnProperty(J)){const Ke=ge[J],M=oe.get(Ke);if(!M)throw new Error(`No implementation available for ${Ke}`);R[J]=M}return _jsx(Ae,{...xt,...R})},Qe=Ae.displayName||Ae.name||"Component";return Fe.displayName=`withApis(${Qe})`,Fe}}class _{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(Fe=>Fe.split("-")).every(Fe=>Fe.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 _(ge)}function Q(ge,te){return"id"in ge?{api:ge,deps:{},factory:()=>te}:ge}var X;(function(ge){ge.SignedIn="SignedIn",ge.SignedOut="SignedOut"})(X||(X={}));const ve=F({id:"core.auth.google"}),de=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"}),ee=F({id:"core.auth.atlassian"}),je=F({id:"core.alert"}),He=F({id:"core.analytics"}),Ne=F({id:"core.apptheme"}),Ee=F({id:"core.config"}),qe=F({id:"core.discovery"}),mt=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"}),rt=F({id:"core.fetch"}),lt=F({id:"core.identity"}),st=F({id:"core.oauthrequest"}),ut=F({id:"core.storage"});class ct{setContext(te){this.context=te}captureEvent(te,Ae,{value:Fe,attributes:Qe}={}){try{this.analyticsApi.captureEvent({action:te,subject:Ae,value:Fe,attributes:Qe,context:this.context})}catch(xt){console.warn("Error during analytics event capture. %o",xt)}}constructor(te,Ae={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=te,this.context=Ae}}function vt(){try{return ne(He)}catch{return{captureEvent:()=>{}}}}function ht(){const ge=(0,g.useRef)(null),te=V(),Ae=vt();function Fe(){return ge.current===null&&(ge.current=new ct(Ae)),ge.current}const Qe=Fe();return Qe.setContext(te),Qe}const Ge="plugin-context",ae=ge=>{const{children:te,plugin:Ae}=ge,{Provider:Fe}=(0,n.CT)(Ge);return(0,h.jsx)(Fe,{value:(0,n.EI)({1:{plugin:Ae}}),children:te})};function Re(){const ge=(0,n.Vt)(Ge);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},ot=(0,n.uW)("component-data-store",()=>new WeakMap),yt="__backstage_data";function At(ge,te,Ae){const Fe=ge;var Qe;let xt=(Qe=Fe[yt])!==null&&Qe!==void 0?Qe:ot.get(ge);if(xt||(xt={map:new Map},Object.defineProperty(Fe,yt,{enumerable:!1,configurable:!0,writable:!1,value:xt}),ot.set(ge,xt)),xt.map.has(te)){const oe=ge.displayName||ge.name;throw new Error(`Attempted to attach duplicate data "${te}" to component "${oe}"`)}xt.map.set(te,Ae)}function pt(ge,te){if(!ge)return;const Ae=ge.type;if(!Ae)return;var Fe;const Qe=(Fe=Ae[yt])!==null&&Fe!==void 0?Fe:ot.get(Ae);if(!!Qe)return Qe.map.get(te)}const St=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Lt=St;class kt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(te,Ae){this.id=te,this.params=Ae,this[Lt]="absolute"}}function en(ge){var te;return new kt(ge.id,(te=ge.params)!==null&&te!==void 0?te:[])}const rn=/^\w+$/;let Vt=null;class Wt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(te,Ae,Fe,Qe){this.id=te,this.path=Ae,this.parent=Fe,this.params=Qe,this[Vt]="sub"}}function hn(ge){const{id:te,path:Ae,parent:Fe}=ge,Qe=Ae.split("/").filter(R=>R.startsWith(":")).map(R=>R.substring(1)),xt=[...Fe.params,...Qe];if(Fe.params.some(R=>Qe.includes(R)))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 R of Qe)if(!rn.test(R))throw new Error(`SubRouteRef path has invalid param, got '${R}'`);return new Wt(te,Ae,Fe,xt)}let _t=St;class kn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(te,Ae,Fe){this.id=te,this.params=Ae,this.optional=Fe,this[_t]="external"}}function ln(ge){var te;return new kn(ge.id,(te=ge.params)!==null&&te!==void 0?te:[],Boolean(ge.optional))}var On=t(10289);function pn(ge){const te=(0,On.TH)(),Ae=(0,n.Vt)("routing-context");if(!Ae)throw new Error("Routing context is not available");const Fe=Ae.atVersion(1),Qe=(0,g.useMemo)(()=>Fe&&Fe.resolve(ge,te),[Fe,ge,te]);if(!Ae)throw new Error("useRouteRef used outside of routing context");if(!Fe)throw new Error("RoutingContext v1 not available");const xt="optional"in ge&&ge.optional;if(!Qe&&!xt)throw new Error(`No path for ${ge}`);return Qe}function Hn(ge){return(0,On.UO)()}class Ht extends g.Component{static getDerivedStateFromError(te){return{error:te}}render(){const{error:te}=this.state,{app:Ae,plugin:Fe}=this.props,{ErrorBoundaryFallback:Qe}=Ae.getComponents();return te?(0,h.jsx)(Qe,{error:te,resetError:this.handleErrorReset,plugin:Fe}):this.props.children}constructor(...te){super(...te),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function Cn(ge){const{component:te,mountPoint:Ae,name:Fe}=ge;return Gt({component:{lazy:()=>te().then(Qe=>{const xt=R=>{try{pn(Ae)}catch(J){if(typeof J=="object"&&J!==null){const{message:Ke}=J;if(typeof Ke=="string"&&Ke.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)(Qe,{...R})},oe=Fe||Qe.displayName||Qe.name||"LazyComponent";return xt.displayName=`RoutableExtension(${oe})`,xt},Qe=>oe=>{const R=ke(),{BootErrorPage:J}=R.getComponents();return(0,h.jsx)(J,{step:"load-chunk",error:Qe})})},data:{"core.mountPoint":Ae},name:Fe})}function $n(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 Fe;if("lazy"in ge.component){const xt=ge.component.lazy;Fe=(0,g.lazy)(()=>xt().then(oe=>({default:oe})))}else Fe=ge.component.sync;const Qe=Ae||Fe.displayName||Fe.name||"Component";return{expose(xt){const oe=R=>{const J=ke(),{Progress:Ke}=J.getComponents(),M=te==null?void 0:te["core.mountPoint"];return(0,h.jsx)(g.Suspense,{fallback:(0,h.jsx)(Ke,{}),children:(0,h.jsx)(Ht,{app:J,plugin:xt,children:(0,h.jsx)(x,{attributes:{pluginId:xt.getId(),...Ae&&{extension:Ae},...M&&{routeRef:M.id}},children:(0,h.jsx)(ae,{plugin:xt,children:(0,h.jsx)(Fe,{...R})})})})})};At(oe,"core.plugin",xt);for(const[R,J]of Object.entries(te))At(oe,R,J);return oe.displayName=`Extension(${Qe})`,oe}}}function fn(ge,te,Ae,Fe){return g.Children.toArray(ge).flatMap(Qe=>{if(!(0,g.isValidElement)(Qe))return[];if(Qe.type===g.Fragment)return fn(Qe.props.children,te,Ae,Fe);if(pt(Qe,"core.featureFlagged")){const xt=Qe.props;return("with"in xt?te.isActive(xt.with):!te.isActive(xt.without))?fn(Qe.props.children,te,Ae,Fe):[]}if(Ae===void 0||Ae(Qe))return[Qe];if(Fe)throw new Error(Fe);return fn(Qe.props.children,te,Ae,Fe)})}class cn{selectByComponentData(te){const Ae=fn(this.node,this.featureFlagsApi,Fe=>pt(Fe,te.key)!==void 0,te.withStrictError);return new cn(Ae,this.featureFlagsApi)}findComponentData(te){return fn(this.node,this.featureFlagsApi,Fe=>pt(Fe,te.key)!==void 0).map(Fe=>pt(Fe,te.key)).filter(Fe=>Fe!==void 0)}getElements(){return fn(this.node,this.featureFlagsApi)}constructor(te,Ae){this.node=te,this.featureFlagsApi=Ae}}function wn(ge,te,Ae=[]){const Fe=ne(Ie),Qe=new cn(ge,Fe);return(0,g.useMemo)(()=>te(Qe),[ge,...Ae])}class Bn{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 yn(ge){return new Bn(ge)}},23054:function(jt,Me,t){"use strict";t.d(Me,{SP:function(){return X},dR:function(){return _},VL:function(){return de},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 V(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 ee=x($);T?T+=`; caused by ${ee}`:T=`caused by ${ee}`}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 _ extends l{}class F extends null{}class Q extends null{}class X 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 de extends Error{static async fromResponse(I){const $=await ve(I),E=$.response.statusCode||I.status,T=$.error.name||I.statusText,ee=`Request failed with ${E} ${T}`,je=V($.error);return new de({message:ee,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(jt,Me,t){"use strict";t.d(Me,{nW:function(){return de},ae:function(){return _},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 V=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,ee=_class_private_field_get(this,l).default.slice();E!=null&&E.repoWrite&&ee.push(..._class_private_field_get(this,l).repoWrite);const je=this.getAdditionalScopesForProvider(E);je.length&&ee.push(...je);const He=[...new Set(ee)],Ne=await _class_private_field_get(this,V).getAccessToken(He,T);return{token:Ne,headers:{Authorization:`Bearer ${Ne}`}}}constructor(I,$,E,T){_class_private_field_init(this,V,{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,V,$),_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 _{static fromConfig(I){return q.Lx.fromConfig(I)}}const F=(0,h.T0)({id:"integration.scmintegrations"});var Q=t(52322),X=t(73250),ve=t(2784);const de=A=>{const{type:I}=A,$=(0,h.qD)(),E=X.Z;var T;const ee=I&&(T=$.getSystemIcon(I))!==null&&T!==void 0?T:E;return(0,Q.jsx)(ee,{})}},79158:function(jt,Me,t){"use strict";t.d(Me,{Lx:function(){return lr},BT:function(){return wt}});var h=t(82717),n=t.n(h),g=t(76635);function L(C){const d=new URL("http://example.com");return d.host=C,d.host===C}function V(C){try{return new URL(C),!0}catch{return!1}}function x(C,d){return{list(){return C},byUrl(m){try{const w=typeof m=="string"?new URL(m):m;return C.find(Y=>d(Y)===w.host)}catch{return}},byHost(m){return C.find(w=>d(w)===m)}}}function l(C){const{url:d,base:m,lineNumber:w}=C;try{return new URL(d),d}catch{}let Y;if(d.startsWith("/")){const{filepath:pe}=n()(m);Y=new URL(m);const Se=(0,g.trimEnd)(Y.pathname.substring(0,Y.pathname.length-pe.length),"/");Y.pathname=`${Se}${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(C){const d=C.getOptionalString("endpoint");var m;const w=(m=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&m!==void 0?m:!1;let Y,pe;if(d){try{const on=new URL(d);Y=on.host,pe=on.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${d}' is not a valid URL`)}if(pe!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${d}'`)}else Y=k;const Se=C.getOptionalString("accessKeyId"),Be=C.getOptionalString("secretAccessKey"),gt=C.getOptionalString("roleArn"),Bt=C.getOptionalString("externalId");return{host:Y,endpoint:d,s3ForcePathStyle:w,accessKeyId:Se,secretAccessKey:Be,roleArn:gt,externalId:Bt}}function q(C){const d=C.map(ne);return d.some(m=>m.host===k)||d.push({host:k}),d}class _{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}}_.factory=({config:C})=>{var d;const m=q((d=C.getOptionalConfigArray("integrations.awsS3"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new _(w)),w=>w.config.host)};var F=t(90383),Q=t(22504),X=t(69866);const ve="GB";var de=new WeakMap,A=new WeakMap,I=new WeakMap,$=new WeakMap,E=new WeakMap,T=new WeakMap,ee=new WeakMap;class je{static fromRepoUrl(d){const m=new URL(d);let w,Y,pe;const Se=m.pathname.split("/").map(Fn=>decodeURIComponent(Fn));if(Se[2]==="_git"?(w=Se[1],Y=pe=Se[3]):Se[3]==="_git"?(w=Se[1],Y=Se[2],pe=Se[4]):Se[4]==="_git"&&(w=`${Se[1]}/${Se[2]}`,Y=Se[3],pe=Se[5]),!w||!Y||!pe)throw new Error("Azure URL must point to a git repository");var Be;const gt=(Be=m.searchParams.get("path"))!==null&&Be!==void 0?Be:void 0;let Bt;const on=m.searchParams.get("version");if(on){if(on.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Bt=on.slice(2)}return new je(m.origin,w,Y,pe,gt,Bt)}toRepoUrl(){let d;return(0,F.Z)(this,I)===(0,F.Z)(this,$)?d=(0,F.Z)(this,ee).call(this,(0,F.Z)(this,A),"_git",(0,F.Z)(this,$)):d=(0,F.Z)(this,ee).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,ee).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,ee).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,ee).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,pe,Se){(0,Q.Z)(this,de,{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,ee,{writable:!0,value:(...Be)=>{const gt=new URL((0,F.Z)(this,de));return gt.pathname=Be.map(Bt=>encodeURIComponent(Bt)).join("/"),gt}}),(0,X.Z)(this,de,d),(0,X.Z)(this,A,m),(0,X.Z)(this,I,w),(0,X.Z)(this,$,Y),(0,X.Z)(this,E,pe),(0,X.Z)(this,T,Se)}}const He="dev.azure.com";function Ne(C){var d;const m=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:He,w=C.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(C){const d=C.map(Ne);return d.some(m=>m.host===He)||d.push({host:He}),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(V(m))return m;try{const pe=je.fromRepoUrl(w),Se=new URL(w);var Y;const Be=new URL(`https://a.com${(Y=pe.getPath())!==null&&Y!==void 0?Y:""}`),gt=new URL(m,Be).pathname;return Se.searchParams.set("path",gt),d.lineNumber&&(Se.searchParams.set("line",String(d.lineNumber)),Se.searchParams.set("lineEnd",String(d.lineNumber+1)),Se.searchParams.set("lineStartColumn","1"),Se.searchParams.set("lineEndColumn","1")),Se.toString()}catch{return new URL(m,w).toString()}}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}qe.factory=({config:C})=>{var d;const m=Ee((d=C.getOptionalConfigArray("integrations.azure"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new qe(w)),w=>w.config.host)};var mt=t(48834).lW;function Ze(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function Ie(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function rt(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}function lt(C,d){const m=d?{...d}:{};if(C.token){const w=mt.from(`:${C.token}`,"utf8");m.Authorization=`Basic ${w.toString("base64")}`}return{headers:m}}const st="bitbucket.org",ut="https://api.bitbucket.org/2.0";function ct(C){var d;const m=(d=C.getOptionalString("host"))!==null&&d!==void 0?d:st;let w=C.getOptionalString("apiBaseUrl");const Y=C.getOptionalString("token"),pe=C.getOptionalString("username"),Se=C.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===st?w=ut:w=`https://${m}/rest/api/1.0`,{host:m,apiBaseUrl:w,token:Y,username:pe,appPassword:Se}}function vt(C){const d=C.map(ct);return d.some(m=>m.host===st)||d.push({host:st,apiBaseUrl:ut}),d}class ht{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}}ht.factory=({config:C})=>{var d,m,w;const Y=vt((w=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&w!==void 0?w:[...(d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[],...(m=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&m!==void 0?m:[]]);return x(Y.map(pe=>new ht(pe)),pe=>pe.config.host)};var Ge=t(96279),ae=t(48834).lW;async function Re(C,d){const{name:m,owner:w,resource:Y}=parseGitUrl(C),pe=Y==="bitbucket.org";let Se=pe?`${d.apiBaseUrl}/repositories/${w}/${m}`:`${d.apiBaseUrl}/projects/${w}/repos/${m}/default-branch`,Be=await fetch(Se,yt(d));if(Be.status===404&&!pe&&(Se=`${d.apiBaseUrl}/projects/${w}/repos/${m}/branches/default`,Be=await fetch(Se,yt(d))),!Be.ok){const Bt=`Failed to retrieve default branch from ${Se}, ${Be.status} ${Be.statusText}`;throw new Error(Bt)}let gt;if(pe)gt=(await Be.json()).mainbranch.name;else{const{displayId:Bt}=await Be.json();gt=Bt}if(!gt)throw new Error(`Failed to read default branch from ${Se}. Response ${Be.status} ${Be.json()}`);return gt}async function ke(C,d){const{name:m,owner:w,ref:Y,protocol:pe,resource:Se,filepath:Be}=parseGitUrl(C),gt=Se==="bitbucket.org";let Bt=Y;Bt||(Bt=await Re(C,d));const on=Be?`&path=${encodeURIComponent(decodeURIComponent(Be))}`:"";return gt?`${pe}://${Se}/${w}/${m}/get/${Bt}.tar.gz`:`${d.apiBaseUrl}/projects/${w}/repos/${m}/archive?format=tgz&at=${Bt}&prefix=${w}-${m}${on}`}function ot(C,d){try{const{owner:m,name:w,ref:Y,filepathtype:pe,filepath:Se}=parseGitUrl(C);if(!m||!w||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket URL or file path");const Be=Se.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: ${C}, ${m}`)}}function yt(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const m=ae.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}const At="bitbucket.org",pt="https://api.bitbucket.org/2.0";function St(C){const d=At,m=pt,w=C.getString("username"),Y=C.getString("appPassword");return{host:d,apiBaseUrl:m,username:w,appPassword:Y}}function Lt(C){const d=C.map(St);return d.length===0&&d.push({host:At,apiBaseUrl:pt}),d}class kt{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}}kt.factory=({config:C})=>{var d;const m=Lt((d=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new kt(w)),w=>w.config.host)};var en=t(48834).lW;async function rn(C,d){const{name:m,owner:w}=parseGitUrl(C),Y=`${d.apiBaseUrl}/repositories/${w}/${m}`,pe=await fetch(Y,hn(d));if(!pe.ok){const gt=`Failed to retrieve default branch from ${Y}, ${pe.status} ${pe.statusText}`;throw new Error(gt)}const Be=(await pe.json()).mainbranch.name;if(!Be)throw new Error(`Failed to read default branch from ${Y}. Response ${pe.status} ${pe.json()}`);return Be}async function Vt(C,d){const{name:m,owner:w,ref:Y,protocol:pe,resource:Se}=parseGitUrl(C);let Be=Y;return Be||(Be=await rn(C,d)),`${pe}://${Se}/${w}/${m}/get/${Be}.tar.gz`}function Wt(C,d){try{const{owner:m,name:w,ref:Y,filepathtype:pe,filepath:Se}=parseGitUrl(C);if(!m||!w||pe!=="src"&&pe!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Be=Se.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: ${C}, ${m}`)}}function hn(C){const d={};if(C.username&&C.appPassword){const m=en.from(`${C.username}:${C.appPassword}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}function _t(C){const d=C.getString("host");let m=C.getOptionalString("apiBaseUrl");const w=C.getOptionalString("token"),Y=C.getOptionalString("username"),pe=C.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:pe}}function kn(C){return C.map(_t)}class ln{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}}ln.factory=({config:C})=>{var d;const m=kn((d=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new ln(w)),w=>w.config.host)};var On=t(48834).lW;async function pn(C,d){const{name:m,owner:w}=parseGitUrl(C);let Y=`${d.apiBaseUrl}/projects/${w}/repos/${m}/default-branch`,pe=await fetch(Y,Cn(d));if(pe.status===404&&(Y=`${d.apiBaseUrl}/projects/${w}/repos/${m}/branches/default`,pe=await fetch(Y,Cn(d))),!pe.ok){const gt=`Failed to retrieve default branch from ${Y}, ${pe.status} ${pe.statusText}`;throw new Error(gt)}const{displayId:Se}=await pe.json(),Be=Se;if(!Be)throw new Error(`Failed to read default branch from ${Y}. Response ${pe.status} ${pe.json()}`);return Be}async function Hn(C,d){const{name:m,owner:w,ref:Y,filepath:pe}=parseGitUrl(C);let Se=Y;Se||(Se=await pn(C,d));const Be=pe?`&path=${encodeURIComponent(decodeURIComponent(pe))}`:"";return`${d.apiBaseUrl}/projects/${w}/repos/${m}/archive?format=tgz&at=${Se}&prefix=${w}-${m}${Be}`}function Ht(C,d){try{const{owner:m,name:w,ref:Y,filepathtype:pe,filepath:Se}=parseGitUrl(C);if(!m||!w||pe!=="browse"&&pe!=="raw"&&pe!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Be=Se.replace(/^\//,"");return`${d.apiBaseUrl}/projects/${m}/repos/${w}/raw/${Be}?at=${Y}`}catch(m){throw new Error(`Incorrect URL: ${C}, ${m}`)}}function Cn(C){const d={};if(C.token)d.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const m=On.from(`${C.username}:${C.password}`,"utf8");d.Authorization=`Basic ${m.toString("base64")}`}return{headers:d}}function $n(C){const d=C.getString("host");let m=C.getOptionalString("baseUrl"),w=C.getOptionalString("cloneUrl"),Y=C.getOptionalString("gitilesBaseUrl");const pe=C.getOptionalString("username"),Se=C.getOptionalString("password");if(L(d)){if(m&&!V(m))throw new Error(`Invalid Gerrit integration config, '${m}' is not a valid baseUrl`);if(w&&!V(w))throw new Error(`Invalid Gerrit integration config, '${w}' is not a valid cloneUrl`);if(Y&&!V(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:pe,password:Se}}function Gt(C){return C.map($n)}var fn=t(48834).lW;const cn=")]}'";function wn(C,d){const w=d.replace(C.gitilesBaseUrl,"").split("/").filter(Bt=>!!Bt),Y=w.indexOf("+");if(Y<=0)throw new Error(`Unable to parse project from url: ${d}`);const pe=(0,g.trimStart)(w.slice(0,Y).join("/"),"/"),Se=w.indexOf("heads");if(Se<=0)throw new Error(`Unable to parse branch from url: ${d}`);const Be=w[Se+1],gt=w.slice(Se+2).join("/");return{branch:Be,filePath:gt===""?"/":gt,project:pe}}function Bn(C,d,m,w){return`${C.gitilesBaseUrl}/${d}/+/refs/heads/${m}/${(0,g.trimStart)(w,"/")}`}function yn(C){return C.password?"/a/":"/"}function ge(C,d){const{branch:m,project:w}=wn(C,d);return`${C.baseUrl}${yn(C)}projects/${encodeURIComponent(w)}/branches/${m}`}function te(C,d){const{project:m}=wn(C,d);return`${C.cloneUrl}${yn(C)}${m}`}function Ae(C,d){const{branch:m,filePath:w,project:Y}=wn(C,d);return`${C.baseUrl}${yn(C)}projects/${encodeURIComponent(Y)}/branches/${m}/files/${encodeURIComponent(w)}/content`}function Fe(C){return`${C.baseUrl}${yn(C)}projects/`}function Qe(C){const d={};if(!C.password)return d;const m=fn.from(`${C.username}:${C.password}`,"utf8");return d.Authorization=`Basic ${m.toString("base64")}`,{headers:d}}async function xt(C){const d=await C.text();if(d.startsWith(cn))try{return JSON.parse(d.slice(cn.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 oe{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 pe;if(m.startsWith("/")){const{branch:Se,project:Be}=wn(this.config,w);return Bn(this.config,Be,Se,m)}return m?pe=new URL(m,w):pe=new URL(w),Y&&(pe.hash=Y.toString()),pe.toString()}resolveEditUrl(d){return d}constructor(d){this.integrationConfig=d}}oe.factory=({config:C})=>{var d;const m=Gt((d=C.getOptionalConfigArray("integrations.gerrit"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new oe(w)),w=>w.config.host)};function R(C){const d=C.getString("host");let m=C.getOptionalString("baseUrl");const w=C.getOptionalString("username"),Y=C.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 Ke(C,d){try{var m;const w=(m=C.baseUrl)!==null&&m!==void 0?m:`https://${C.host}`,[Y,pe,Se,Be,gt,Bt,...on]=d.replace(w,"").split("/"),Fn=on.join("/").replace(/^\//,"");return`${w}/${pe}/${Se}/_edit/${Bt}/${Fn}`}catch(w){throw new Error(`Incorrect URL: ${d}, ${w}`)}}function M(C,d){try{var m;const w=(m=C.baseUrl)!==null&&m!==void 0?m:`https://${C.host}`,[Y,pe,Se,Be,gt,Bt,...on]=d.replace(w,"").split("/"),Fn=on.join("/").replace(/^\//,"");return`${w}/api/v1/repos/${pe}/${Se}/contents/${Fn}?ref=${Bt}`}catch(w){throw new Error(`Incorrect URL: ${d}, ${w}`)}}function Z(C){const d={},{username:m,password:w}=C;return w?(m?d.Authorization=`basic ${J.from(`${m}:${w}`).toString("base64")}`:d.Authorization=`token ${w}`,{headers:d}):d}class le{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(d){return l(d)}resolveEditUrl(d){return Ke(this.config,d)}constructor(d){this.config=d}}le.factory=({config:C})=>{var d;const w=((d=C.getOptionalConfigArray("integrations.gitea"))!==null&&d!==void 0?d:[]).map(Y=>R(Y));return x(w.map(Y=>new le(Y)),Y=>Y.config.host)};const he="github.com",be="https://api.github.com",De="https://raw.githubusercontent.com";function $e(C){var d,m;const w=(m=C.getOptionalString("host"))!==null&&m!==void 0?m:he;let Y=C.getOptionalString("apiBaseUrl"),pe=C.getOptionalString("rawBaseUrl");const Se=C.getOptionalString("token"),Be=(d=C.getOptionalConfigArray("apps"))===null||d===void 0?void 0:d.map(gt=>({appId:gt.getNumber("appId"),clientId:gt.getString("clientId"),clientSecret:gt.getString("clientSecret"),webhookSecret:gt.getString("webhookSecret"),privateKey:gt.getString("privateKey"),allowedInstallationOwners:gt.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===he&&(Y=be),pe?pe=(0,g.trimEnd)(pe,"/"):w===he&&(pe=De),{host:w,apiBaseUrl:Y,rawBaseUrl:pe,token:Se,apps:Be}}function We(C){const d=C.map($e);return d.some(m=>m.host===he)||d.push({host:he,apiBaseUrl:be,rawBaseUrl:De}),d}function tt(C,d,m){try{const{owner:w,name:Y,ref:pe,filepathtype:Se,filepath:Be}=parseGitUrl(C);if(!w||!Y||!pe||Se!=="blob"&&Se!=="raw"&&Se!=="tree")throw new Error("Invalid GitHub URL or file path");const gt=Be.replace(/^\//,"");return H(d,m)==="api"?`${d.apiBaseUrl}/repos/${w}/${Y}/contents/${gt}?ref=${pe}`:`${d.rawBaseUrl}/${w}/${Y}/${pe}/${gt}`}catch(w){throw new Error(`Incorrect URL: ${C}, ${w}`)}}function S(C,d){const m={};return H(C,d)==="api"&&(m.Accept="application/vnd.github.v3.raw"),d.token&&(m.Authorization=`token ${d.token}`),{headers:m}}function H(C,d){return C.apiBaseUrl&&(d.token||!C.rawBaseUrl)?"api":"raw"}var me=t(42822),ue=t(89393),Ce=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=>Ce.ou.local()>d}}const Ue={Accept:"application/vnd.github.machine-man-preview+json"};class nt{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:pe}=await this.getInstallationData(d);if(pe)throw new Error(`The GitHub application for ${d} is suspended`);const Se=await this.appClient.apps.createInstallationAccessToken({installation_id:Y,headers:Ue});let Be;if(Se.data.repository_selection==="selected"){const Bt=new ue.v({baseUrl:this.baseUrl,auth:Se.data.token}),on=await Bt.paginate(Bt.apps.listReposAccessibleToInstallation);var gt;Be=((gt=on.repositories)!==null&&gt!==void 0?gt:on).map(kr=>kr.name)}return{token:Se.data.token,expiresAt:Ce.ou.fromISO(Se.data.expires_at),repositories:Be}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(d){const w=(await this.getInstallations()).find(pe=>{var Se,Be;return((Se=pe.account)===null||Se===void 0||(Be=Se.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,`
33
- `)},this.appClient=new ue.v({baseUrl:m,headers:Ue,authStrategy:me.i,auth:this.baseAuthConfig})}}class ft{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(gt=>({credentials:gt,error:void 0}),gt=>({credentials:void 0,error:gt})))),Y=w.find(Be=>Be.credentials);if(Y)return Y.credentials.accessToken;const Se=w.map(Be=>Be.error).find(Be=>Be.name!=="NotFoundError");if(Se)throw Se}constructor(d){var m,w;this.apps=(w=(m=d.apps)===null||m===void 0?void 0:m.map(Y=>new nt(Y,d.apiBaseUrl)))!==null&&w!==void 0?w:[]}}class dt{async getCredentials(d){const m=n()(d.url),w=m.owner||m.name,Y=m.owner?m.name:void 0;let pe="app",Se=await this.githubAppCredentialsMux.getAppToken(w,Y);return Se||(pe="token",Se=this.token),{headers:Se?{Authorization:`Bearer ${Se}`}:void 0,token:Se,type:pe}}constructor(d,m){this.githubAppCredentialsMux=d,this.token=m}}dt.create=C=>new dt(new ft(C),C.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 at{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return wt(l(d),"tree")}resolveEditUrl(d){return wt(d,"edit")}constructor(d){this.integrationConfig=d}}at.factory=({config:C})=>{var d;const m=We((d=C.getOptionalConfigArray("integrations.github"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new at(w)),w=>w.config.host)};function wt(C,d){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(m,w,Y,pe)=>`//${w}/${Y}/${pe}/${d}/`)}const Tt=null;class It extends at{get config(){return super.config}constructor(d){super(d)}}It.factory=at.factory;const Ut=null,Zn=null,Wn=null,Dt="gitlab.com",Nt="https://gitlab.com/api/v4";function gn(C){const d=C.getString("host");let m=C.getOptionalString("apiBaseUrl");const w=C.getOptionalString("token");let Y=C.getOptionalString("baseUrl");if(m?m=(0,g.trimEnd)(m,"/"):d===Dt&&(m=Nt),Y?Y=(0,g.trimEnd)(Y,"/"):Y=`https://${d}`,L(d)){if(!m||!V(m))throw new Error(`Invalid GitLab integration config, '${m}' is not a valid apiBaseUrl`);if(!V(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 Dn(C){const d=C.map(gn);return d.some(m=>m.host===Dt)||d.push({host:Dt,apiBaseUrl:Nt,baseUrl:`https://${Dt}`}),d}function sn(C){let d="";return C.host!==Dt&&(d=new URL(C.baseUrl).pathname),trimEnd(d,"/")}async function jn(C,d){const m=await En(C,d);return qn(C,m,d).toString()}function Nn(C){const{token:d=""}=C;return{headers:{"PRIVATE-TOKEN":d}}}function qn(C,d,m){try{const w=new URL(C),Y=w.pathname.split("/blob/").slice(1).join("/blob/"),[pe,...Se]=Y.split("/"),Be=getGitLabIntegrationRelativePath(m);return w.pathname=[...Be?[Be]:[],"api/v4/projects",d,"repository/files",encodeURIComponent(decodeURIComponent(Se.join("/"))),"raw"].join("/"),w.search=`?ref=${pe}`,w}catch(w){throw new Error(`Incorrect url: ${C}, ${w}`)}}async function En(C,d){const m=new URL(C);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 pe=new URL(`${m.origin}${Y}/api/v4/projects/${encodeURIComponent(w.replace(/^\//,""))}`),Se=await fetch(pe.toString(),Nn(d)),Be=await Se.json();if(!Se.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: ${C}, ${w}`)}}class xn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(d){return l(d)}resolveEditUrl(d){return _n(d,"edit")}constructor(d){this.integrationConfig=d}}xn.factory=({config:C})=>{var d;const m=Dn((d=C.getOptionalConfigArray("integrations.gitlab"))!==null&&d!==void 0?d:[]);return x(m.map(w=>new xn(w)),w=>w.config.host)};function _n(C,d){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${d}/`)}class lr{static fromConfig(d){return new lr({awsS3:_.factory({config:d}),azure:qe.factory({config:d}),bitbucket:ht.factory({config:d}),bitbucketCloud:kt.factory({config:d}),bitbucketServer:ln.factory({config:d}),gerrit:oe.factory({config:d}),github:at.factory({config:d}),gitlab:xn.factory({config:d}),gitea:le.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 ht));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(jt,Me,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),V=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),_=t(7476),F=t(93225),Q=t(67896),X=t(65124),ve=t(17339),de=t(85478),A=t(68435),I=t(3482),$=t(42081),E=t(48431),T=t(89258),ee=t(52943),je=t(61886),He=t(13980),Ne=t.n(He);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 mt=(0,qe.CT)("api-context"),Ze=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,g.useContext)(mt))===null||r===void 0?void 0:r.atVersion(1),O=f?new Ee(o,f):o;return(0,n.jsx)(mt.Provider,{value:(0,qe.EI)({1:O}),children:c})};Ze.propTypes={apis:Ne().shape({get:Ne().func.isRequired}).isRequired,children:Ne().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(),z=r.get(U);if(!!z)for(const re of Object.values(z.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],z=this.load(U,c);if(!z)throw new Error(`No API factory available for dependency ${U} of dependent ${r}`);f[O]=z}return f}constructor(r){this.factories=r,this.apis=new Map}}var rt;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(rt||(rt={}));class lt{register(r,o){const c=rt[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 st(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,z=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(!z||typeof z.closed=="undefined"||z.closed){const it=new Error("Failed to open auth popup.");it.name="PopupRejectedError",o(it);return}const ze=it=>{if(it.source!==z||it.origin!==a.origin)return;const{data:$t}=it;if($t.type==="config_info"){re=$t.targetOrigin;return}if($t.type!=="authorization_response")return;const Ft=$t;if("error"in Ft){const Kt=new Error(Ft.error.message);Kt.name=Ft.error.name,o(Kt)}else r(Ft.response);Ct()},Ve=setInterval(()=>{if(z.closed){const it=`Login failed, ${re&&re!==window.location.origin?`Incorrect app origin, expected ${re}`:"popup was closed"}`,$t=new Error(it);$t.name="PopupClosedError",o($t),Ct()}},100);function Ct(){window.removeEventListener("message",ze),clearInterval(Ve)}window.addEventListener("message",ze)})}function ut(a){return[...a].join(" ")}class ct{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 st({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=ut,oauthRequestApi:U,sessionTransform:z=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=z}}function vt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class ht{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return vt(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 Ge=t(82394),ae=t.n(Ge);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(ae())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let ot=Symbol.observable;class yt{[ot](){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(ae())(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 yt(x.sM.SignedOut),this.signedIn=!1}}class pt{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 vt(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 ht({sessionScopes:f,defaultScopes:c})}}class St{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 Lt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class kt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Lt,oauthRequestApi:O,defaultScopes:U=[],scopeTransform:z=Ve=>Ve}=r,re=new ct({discoveryApi:o,environment:c,provider:f,oauthRequestApi:O,sessionTransform(Ve){return{...Ve,providerInfo:{idToken:Ve.providerInfo.idToken,accessToken:Ve.providerInfo.accessToken,scopes:kt.normalizeScopes(z,Ve.providerInfo.scope),expiresAt:new Date(Date.now()+Ve.providerInfo.expiresInSeconds*1e3)}}}}),ze=new pt({connector:re,defaultScopes:new Set(U),sessionScopes:Ve=>Ve.providerInfo.scopes,sessionShouldRefresh:Ve=>(Ve.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new kt({sessionManager:ze,scopeTransform:z})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=kt.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 rn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=en,oauthRequestApi:O,defaultScopes:U=["read:user"]}=r;return kt.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 kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:U})}}const hn={id:"google",title:"Google",icon:()=>null},_t="https://www.googleapis.com/auth/";class kn{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:O=hn,defaultScopes:U=["openid",`${_t}userinfo.email`,`${_t}userinfo.profile`]}=r;return kt.create({discoveryApi:o,oauthRequestApi:c,provider:O,environment:f,defaultScopes:U,scopeTransform(z){return z.map(re=>re==="openid"?re:re==="profile"||re==="email"?`${_t}userinfo.${re}`:re.startsWith(_t)?re:`${_t}${re}`)}})}}const ln={id:"okta",title:"Okta",icon:()=>null},On=new Set(["openid","profile","email","phone","address","groups","offline_access"]),pn="okta.";class Hn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ln,oauthRequestApi:O,defaultScopes:U=["openid","email","profile","offline_access"]}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:U,scopeTransform(z){return z.map(re=>On.has(re)||re.startsWith(pn)?re:`${pn}${re}`)}})}}var Ht=t(30195);const Cn=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())})})}),$n={id:"saml",title:"SAML",icon:()=>null};class Gt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=$n}=r,O=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),U=new StaticAuthSessionManager({connector:O}),z=new AuthSessionStore({manager:U,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new Gt(z)}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 fn={id:"microsoft",title:"Microsoft",icon:()=>null};class cn{static create(r){const{environment:o="development",provider:c=fn,oauthRequestApi:f,discoveryApi:O,defaultScopes:U=["openid","offline_access","profile","email","User.Read"]}=r;return kt.create({discoveryApi:O,oauthRequestApi:f,provider:c,environment:o,defaultScopes:U})}}const wn={id:"onelogin",title:"onelogin",icon:()=>null},Bn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),yn="onelogin.";class ge{static create(r){const{discoveryApi:o,environment:c="development",provider:f=wn,oauthRequestApi:O}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(U){return U.map(z=>Bn.has(z)||z.startsWith(yn)?z:`${yn}${z}`)}})}}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 kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c,defaultScopes:U})}}const Fe={id:"atlassian",title:"Atlassian",icon:()=>null};class Qe{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Fe,oauthRequestApi:O}=r;return kt.create({discoveryApi:o,oauthRequestApi:O,provider:f,environment:c})}}class xt{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new ke}}class oe{captureEvent(r){}}const R="theme";class J{static createWithStorage(r){const o=new J(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(R))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(O=>{O?window.localStorage.setItem(R,O):window.localStorage.removeItem(R)}),window.addEventListener("storage",O=>{if(O.key===R){var U;const z=(U=localStorage.getItem(R))!==null&&U!==void 0?U:void 0;o.setActiveThemeId(z)}}),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 yt(void 0)}}var Ke=t(9850),M=t.n(Ke),Z=t(12782),le=t.n(Z);const he=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function be(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 We{static fromConfigs(r){return r.length===0?new We(void 0):r.reduce((o,{data:c,context:f,filteredKeys:O,deprecatedKeys:U})=>{const z=new We(c,f,o);if(z.filteredKeys=O,U)for(const{key:re,description:ze}of U)console.warn(`The configuration key '${re}' of ${f} is deprecated and may be removed soon. ${ze||""}`);return z},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 le()({},{value:f},{value:c},(U,z)=>!be(z)||!be(U)?z: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(be(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(!be(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 We(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:z=r,value:re=c,expected:ze}=U;throw new TypeError($e.type(this.fullKey(z),this.context,De(re),ze))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!he.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(be(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 S{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 S(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 me{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new ke}}class ue{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function Ce(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){Ce(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])=>(Ce(f),O===x.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Ue(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 nt{static create(r){var o,c;const f=ft(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)||(z=>`Bearer ${z}`);return new nt(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 ft(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?dt(a.urlPrefixAllowlist):a.config?dt([a.config.getString("backend.baseUrl")]):()=>!1}function dt(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 at{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:z,search:re,hash:ze,username:Ve,password:Ct}=new URL(`http://${f.url.substring(O.length)}`);let it=await this.discoveryApi.getBaseUrl(U);if(Ve||Ct){const Ft=new URL(it),Kt=`${Ve}${Ct?`:${Ct}`:""}@`;it=`${Ft.protocol}//${Kt}${Ft.host}${Ft.pathname}`}const $t=`${_e(it,z)}${re}${ze}`;return r($t,typeof o=="string"||wt(o)?c:o)}}constructor(r){this.discoveryApi=r}}function wt(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Tt{static resolvePluginProtocol(r){return new at(r.discoveryApi)}static injectIdentityAuth(r){return nt.create(r)}constructor(){}}function It(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 Zn{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=>It(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 yt(this.getCurrentPending())}}class Wn{createAuthRequester(r){const o=new Zn,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 yt([]),this.currentRequests=[],this.handlerCount=0}}const Dt=new Map;class Nt{static create(r){var o;return new Nt((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 Dt.has(o)||Dt.set(o,new Nt(o,this.errorApi)),Dt.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(ae())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var gn=t(64279);function Dn(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 z={};for(const re in r)if(r.hasOwnProperty(re)){const ze=r[re];z[re]=ze.visit(ze.accumulator,U,f,O[re])}for(const re of a.discoverers){const ze=re(U);ze&&o.push({node:ze,parent:U,contexts:z})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function sn(a,r){return()=>({accumulator:a(),visit:r})}function jn(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function Nn(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 qn=sn(()=>new Set,(a,r)=>{const o=(0,x.IY)(r,"core.plugin");o&&a.add(o)}),En=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)(En,"core.featureFlagged",!0);const xn={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function _n(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 lr(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})}lr(o.props.children,r)}),r}const C=sn(()=>({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,z=(0,x.IY)(r,"core.mountPoint");if(z&&U)throw new Error(`Path property may not be set directly on a routable extension "${_n(r)}"`);var re;const ze=(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 "${_n(r)}"`);const $t=U.startsWith("/")?U.slice(1):U,Ft=r.props.element;if((0,x.IY)(r,"core.gatherMountPoints")){var Ve;if(Ft)throw new Error(`Mount point gatherers may not have an element prop "${_n(r)}"`);const Kt={path:$t,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ve=r.props)===null||Ve===void 0?void 0:Ve.caseSensitive),children:[xn],plugin:void 0};return ze.push(Kt),{obj:Kt,gatherPath:$t,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(Ft){var Ct;const[Kt,...Sn]=lr(Ft);if(Sn.length>0)throw new Error(`Route element with path "${U}" may not contain multiple routable extensions`);if(!Kt)return c;const{routeRef:tr,plugin:nr}=Kt,pr={path:$t,element:"mounted",routeRefs:new Set([tr]),caseSensitive:Boolean((Ct=r.props)===null||Ct===void 0?void 0:Ct.caseSensitive),children:[xn],plugin:nr};return ze.push(pr),a.paths.set(tr,$t),a.parents.set(tr,c==null?void 0:c.routeRef),{obj:pr,routeRef:tr!=null?tr:c==null?void 0:c.routeRef,gatherPath:$t,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(z){var it;if((c==null?void 0:c.gatherPath)===void 0)throw new Error(`Routable extension "${_n(r)}" with mount point "${z}" must be assigned a path`);return c==null||(it=c.obj)===null||it===void 0||it.routeRefs.add(z),a.paths.set(z,c.gatherPath),a.parents.set(z,c==null?void 0:c.gatherRouteRef),{...c,routeRef:z}}return c}),d=sn(()=>({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 z=c==null?void 0:c.obj,re=c==null?void 0:c.routeRef,ze=c==null?void 0:c.sticky;const Ve=(f=r.props)===null||f===void 0?void 0:f.path;var Ct;const it=(Ct=z==null?void 0:z.children)!==null&&Ct!==void 0?Ct:a.objects,$t=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(!Ve)throw new Error("Mount point gatherer must have a path");Ft=Ve}const Kt=(U=r.props)===null||U===void 0?void 0:U.element;let Sn=(0,x.IY)(r,"core.mountPoint");if(!Sn&&(0,g.isValidElement)(Kt)&&(Sn=(0,x.IY)(Kt,"core.mountPoint")),Sn){let pr=Ve;if(Ft&&(pr?Ft=void 0:pr=Ft),!pr)throw new Error("Mounted routable extension must have a path");a.paths.set(Sn,pr),re&&ze?(a.parents.set(Sn,re),Ve&&(re=Sn,ze=!1)):(a.parents.set(Sn,re),re=Sn),Ve?(z={caseSensitive:$t,path:Ve,element:"mounted",routeRefs:new Set([Sn]),children:[xn],plugin:(0,x.IY)(r.props.element,"core.plugin")},it.push(z)):z==null||z.routeRefs.add(Sn)}if((0,x.IY)(r,"core.gatherMountPoints")&&(ze=!0),(0,x.IY)(r,"core.gatherMountPoints")){if(!Ve)throw new Error("Mount point gatherer must have a path");if(!Sn){var nr;z={caseSensitive:$t,path:Ve,element:"gathered",routeRefs:new Set,children:[xn],plugin:c==null||(nr=c.obj)===null||nr===void 0?void 0:nr.plugin},it.push(z)}}return{obj:z,path:Ft,routeRef:re,sticky:ze}}),m=sn(()=>new Set,(a,r)=>{if(r.type===En){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 pe(a){return a[w]==="sub"}function Se(a){return a[w]==="external"}function Be(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function gt(a,r,o){let c,f="";if(Y(a))c=a;else if(pe(a))c=a.parent,f=a.path;else if(Se(a)){const z=o.get(a);if(!z)return[void 0,""];if(Y(z))c=z;else if(pe(z))c=z.parent,f=z.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${z}`)}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,V.fp)(f,r))!==null&&O!==void 0?O:[],z=Array();let re=-1;for(let Ct=a;Ct&&(re=U.findIndex(it=>it.route.routeRefs.has(Ct)),re===-1);Ct=c.get(Ct))z.unshift(Ct);z.length===0&&(re-=1);const ze=re===-1?"":U[re].pathname,Ve=z.slice(0,-1).map(Ct=>{const it=o.get(Ct);if(it===void 0)throw new Error(`No path for ${Ct}`);if(it.includes(":"))throw new Error(`Cannot route to ${a} with parent ${Ct} as it has parameters`);return it});return`${Be(ze,...Ve)}/`}class on{resolve(r,o){const[c,f]=gt(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,V.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 Fn=(0,qe.CT)("routing-context"),kr=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:O})=>{const U=new on(a,r,o,c,f),z=(0,qe.EI)({1:U});return(0,n.jsx)(Fn.Provider,{value:z,children:O})},cs=(a,r)=>{try{var o,c;const f=(0,V.fp)(r,{pathname:a}),O=(o=f==null?void 0:f.filter(z=>{var re;return((re=z==null?void 0:z.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{}}},er=({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},An=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,V.TH)();return(0,n.jsx)(x.fC,{attributes:cs(r,a),children:(0,n.jsx)(er,{pathname:r,search:o,hash:c})})};function cr(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 z=a.get(f);if(z===void 0)throw new Error(`No path for ${f}`);O=Be(z,O),f=r.get(f)}const U=O.match(/:(\w+)/g);if(U){for(let z=0;z<U.length;z++)for(let re=z+1;re<U.length;re++)if(U[re]===U[z])throw new Error(`Parameter ${U[re]} is duplicated in path ${O}`)}}}function br(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 Sr=(0,qe.CT)("app-context"),ds=({appContext:a,children:r})=>{const o=(0,qe.EI)({1:a});return(0,n.jsx)(Sr.Provider,{value:o,children:r})};function Cr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function Or(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class Zs{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw Cr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Or("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Cr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Or("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 Or("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 $r=t(72164);function Gn(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 wr=()=>{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 gr({children:a}){const r=(0,x.h_)(x.hg),o=(0,$r.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?wr():!1,f=Gn(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 jr{add(r,o){return this.apis.push([r.id,o]),o}build(){return new Tn(new Map(this.apis))}constructor(){this.apis=[]}}class Tn{static builder(){return new jr}static from(r){return new Tn(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new Tn(new Map([[r.id,o]]))}with(r,o){return new Tn(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function us(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[O,U]of Object.entries(f)){const z=c[O];if(!z)throw new Error(`Key ${O} is not an existing external route`);if(!U&&!z.optional)throw new Error(`External route ${O} is required but was undefined`);U&&r.set(z,U)}}}),r}function Er(){const[a]=(0,V.is)((0,n.jsx)(V.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const Ar=(0,g.createContext)({routeObjects:[]});function Gr(a){return Er()?hs(a):""}function hs(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 ps(a,r,o){const c=Boolean(a),f=(0,gn.default)(a||(()=>Promise.resolve([])));let O;if(c&&f.loading){const{Progress:ze}=r;O=(0,n.jsx)(ze,{})}else if(f.error){const{BootErrorPage:ze}=r;O=(0,n.jsx)(ze,{step:"load-config",error:f.error})}const{ThemeProvider:U=gr}=r;if(O)return{node:(0,n.jsx)(Ze,{apis:Tn.with(x.hg,o),children:(0,n.jsx)(U,{children:O})})};var z;return{api:We.fromConfigs((z=f.value)!==null&&z!==void 0?z:[])}}class fs{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 Ds{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new fs(this);let o=!1;return({children:f})=>{const O=(0,g.useMemo)(()=>J.createWithStorage(this.themes),[]),{routing:U,featureFlags:z,routeBindings:re}=(0,g.useMemo)(()=>{const it=Dn({root:f,discoverers:[jn,Nn],collectors:{routing:Er()?d:C,collectedPlugins:qn,featureFlags:m}});return it.collectedPlugins.forEach($t=>this.plugins.add($t)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...it,routeBindings:us(this.bindRoutes)}},[f]);o||(o=!0,cr(U.paths,U.parents),br(re,this.plugins));const ze=ps(this.configLoader,this.components,O),Ve="api"in ze;if(Ve){const{api:it}=ze;this.configApi=it}if((0,g.useEffect)(()=>{if(Ve){const it=this.getApiHolder().get(x.W0);for(const $t of this.plugins.values())if("getFeatureFlags"in $t)for(const Ft of $t.getFeatureFlags())it.registerFlag({name:Ft.name,pluginId:$t.getId()});else for(const Ft of $t.output())Ft.type==="feature-flag"&&it.registerFlag({name:Ft.name,pluginId:$t.getId()});for(const $t of z)it.registerFlag({name:$t,pluginId:""})}},[Ve,ze,z]),"node"in ze)return ze.node;const{ThemeProvider:Ct=gr}=this.components;return(0,n.jsx)(Ze,{apis:this.getApiHolder(),children:(0,n.jsx)(ds,{appContext:r,children:(0,n.jsx)(Ct,{children:(0,n.jsx)(kr,{routePaths:U.paths,routeParents:U.parents,routeObjects:U.objects,routeBindings:re,basePath:Gr(ze.api),children:(0,n.jsx)(Ar.Provider,{value:{routeObjects:U.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:O,children:U})=>{const[z,re]=(0,g.useState)(),ze=(0,x.h_)(x.Ds),Ve=Gr(ze);return z?(this.appIdentityProxy.setTarget(z,{signOutTargetUrl:Ve||"/"}),U):(0,n.jsx)(O,{onSignInSuccess:re})};return({children:O})=>{const U=(0,x.h_)(x.Ds),z=hs(U),re=`${z}/*`,{routeObjects:ze}=(0,g.useContext)(Ar);return o?Er()?(0,n.jsxs)(r,{children:[(0,n.jsx)(An,{routeObjects:ze}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(V.Z5,{children:(0,n.jsx)(V.AW,{path:re,element:(0,n.jsx)(n.Fragment,{children:O})})})})]}):(0,n.jsxs)(r,{basename:z,children:[(0,n.jsx)(An,{routeObjects:ze}),(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:z||"/"}),Er()?(0,n.jsxs)(r,{children:[(0,n.jsx)(An,{routeObjects:ze}),(0,n.jsx)(V.Z5,{children:(0,n.jsx)(V.AW,{path:re,element:(0,n.jsx)(n.Fragment,{children:O})})})]}):(0,n.jsxs)(r,{basename:z,children:[(0,n.jsx)(An,{routeObjects:ze}),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 Zs;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 lt}}function gs(a){return new Ds(a)}let Kr=!1;const ms=a=>{const r=(0,x.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,g.useMemo)(()=>Er(),[]),O=[...(0,x.vJ)(a.children,U=>U.getElements().flatMap(z=>{let re=z.props.path;if(re==="")return[];var ze;re=(ze=re==null?void 0:re.replace(/\/\*$/,""))!==null&&ze!==void 0?ze:"/";let Ve=c?z:z.props.element;return!c&&!Ve&&(Ve=z,Kr||(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] />} />."),Kr=!0)),[{path:re,element:Ve,children:z.props.children?[{path:re==="/"?"/":"*",element:z.props.children}]:void 0}]}).sort((z,re)=>re.path.localeCompare(z.path)).map(z=>({...z,path:z.path==="/"?"/":`${z.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,V.V$)(O)};var Yr=t(25488);const vs=[(0,x.ni)({api:x.NW,deps:{configApi:x.Ds},factory:({configApi:a})=>S.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,x.ni)({api:x.$v,deps:{},factory:()=>new xt}),(0,x.ni)({api:x.v_,deps:{},factory:()=>new oe}),(0,x.ni)({api:x.VE,deps:{alertApi:x.$v},factory:({alertApi:a})=>{const r=new H(a,new me);return ue.forward(r,{hidden:!1}),r}}),(0,x.ni)({api:x.E6,deps:{errorApi:x.VE},factory:({errorApi:a})=>Nt.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})=>Ue({middleware:[Tt.resolvePluginProtocol({discoveryApi:o}),Tt.injectIdentityAuth({identityApi:r,config:a})]})}),(0,x.ni)({api:x.ZM,deps:{},factory:()=>new Wn}),(0,x.ni)({api:x.Kp,deps:{discoveryApi:x.NW,oauthRequestApi:x.ZM,configApi:x.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>kn.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})=>cn.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})=>rn.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})=>Hn.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})=>Qe.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,x.ni)({api:Yr.RV,deps:{discovery:x.NW,identity:x.$4,config:x.Ds},factory:({config:a,discovery:r,identity:o})=>Yr.iM.create({config:a,discovery:r,identity:o})})];var Jr=t(77277),Zt=t(93414),mr=t(62833);function Qr({children:a}){return(0,V.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(V.VA,{children:a})}const ys=()=>(0,n.jsx)(Zt.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Xr=({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)(Qr,{children:(0,n.jsx)(Zt.mf,{status:"501",statusMessage:o})})},mn=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(Zt.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(Jr.Z,{variant:"outlined",onClick:r,children:"Retry"})}),Kn={Progress:Zt.Ex,Router:mr.VK,NotFoundErrorPage:ys,BootErrorPage:Xr,ErrorBoundaryFallback:mn};var xs=t(43642),bs=t(80079),Ss=t(90941),Cs=t(32915),ws=t(40562),js=t(21853),Es=t(60744),qr=t(66569),Tr=t(30254),Ns=t(13384),As=t(15933),_r=t(58838),Fs=t(86737),y=t(4989),b=t(44407),P=t(18628),D=t(84219),G=t(98685),K=t(39781);const ce={brokenImage:bs.Z,catalog:P.Z,scaffolder:Cs.Z,techdocs:ws.Z,search:js.Z,chat:Es.Z,dashboard:qr.Z,docs:Tr.Z,email:Ns.Z,github:_r.Z,group:D.Z,help:Fs.Z,"kind:api":As.Z,"kind:component":b.Z,"kind:domain":xs.Z,"kind:group":D.Z,"kind:location":y.Z,"kind:system":Ss.Z,"kind:user":G.Z,user:G.Z,warning:K.Z};var ie=t(73689),xe=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 z;const re=(z=c==null?void 0:c.fontColor)!==null&&z!==void 0?z:"#FFFFFF";return{colors:r,shape:o,backgroundImage:U,fontColor:re}}const Ye={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})},bt=16,Et='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Xe(a){const{palette:r,htmlFontSize:o=bt,fontFamily:c=Et,defaultPageTheme:f,pageTheme:O=Ye}=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:z})=>(U=O[z])!==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,xe.darken)(a.palette.link,.3),background:(0,xe.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 Qt(a){const r=Xe(a),o=(0,ie.Z)(r),c=Ot(o);return{...o,overrides:c}}var Yn=t(34505);const Un=Qt({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:Yn.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:Ye}),dr=Qt({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:Yn.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:Ye});var dn=t(98192),vn=t(15222),In=t(41547),Ir=t(87561);const Rr=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(vn.Z,{}),Provider:({children:a})=>(0,n.jsx)(In.Z,{theme:Un,children:(0,n.jsx)(Ir.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(dn.Z,{}),Provider:({children:a})=>(0,n.jsx)(In.Z,{theme:dr,children:(0,n.jsx)(Ir.ZP,{children:a})})}];function Br(a){var r,o,c;return gs({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...Kn,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:vs,icons:{...ce,...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:Rr})}var un=t(25271),bn=t(76635);async function Pr({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,bn.isArray)(c))return;var f;const O=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(bn.isString).map(U=>U.split(":")).filter(U=>U.length===4&&U[0]==="entity").map(([U,z,re,ze])=>(0,un.eE)({kind:z,namespace:re,name:ze})).forEach(U=>O.add(U)),await o.set("entityRefs",Array.from(O)),await r.remove("starredEntities")}class So{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(ae())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),Pr(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 Hi=t(33414),Zr=t(79324),Dr=t(79692),Gi=t(65826);const ni=(0,Dr.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function Ki(a){var r,o;const c=a.result,f=ni(),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 Yi=t(86359),Rn=t(43297),Us=t(95544),Ms=t(99688),es=t(12231),ts=t(86136),ns=t(49378),Co=t(85256),zs=t(61837),wo=t(79784),ri=t(50758),si=t(31654),Vs=t(43054),oi=t(65759),ur=t(51666);const Ts="catalog-entity",Ws=(0,ur.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Ts}),Hs=(0,ur.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Gs=(0,ur.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Ts}),jo=(0,ur.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Ts}),Is=(0,ur.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Eo=(0,ur.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Ao=(0,ur.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),ii=[Ws,Hs,Gs,jo,Is,Eo,Ao];var ai=t(49166);function To(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,O=typeof(r==null?void 0:r.disableUnregister)=="boolean";var U;const z=(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)(es.Z,{onClick:()=>{f(),c()},disabled:z,children:[(0,n.jsx)(ts.Z,{children:(0,n.jsx)(ai.Z,{fontSize:"small"})}),(0,n.jsx)(ns.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:re})}const Io=(0,Dr.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ks(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[O,U]=(0,g.useState)(),z=Io(),ze=(0,Rn.N$)(Gs).allowed,Ve=Kt=>{U(Kt.currentTarget)},Ct=()=>{U(void 0)},it=(0,x.h_)(x.$v),$t=(0,g.useCallback)(()=>{navigator.clipboard.writeText(window.location.toString()).then(()=>it.post({message:"Copied!",severity:"info"}))},[it]),Ft=r&&[...r.map(Kt=>(0,n.jsxs)(es.Z,{onClick:()=>{Ct(),Kt.onClick()},children:[(0,n.jsx)(ts.Z,{children:(0,n.jsx)(Kt.Icon,{fontSize:"small"})}),(0,n.jsx)(ns.Z,{primary:Kt.title})]},Kt.title)),(0,n.jsx)(Co.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(zs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!O,role:"button",onClick:Ve,"data-testid":"menu-button",className:z.button,id:"long-menu",children:(0,n.jsx)(Vs.Z,{})}),(0,n.jsx)(wo.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)(ri.Z,{children:[Ft,(0,n.jsx)(To,{unregisterEntityOptions:o,isUnregisterAllowed:ze,onUnregisterEntity:c,onClose:Ct}),(0,n.jsxs)(es.Z,{onClick:()=>{Ct(),f()},children:[(0,n.jsx)(ts.Z,{children:(0,n.jsx)(si.Z,{fontSize:"small"})}),(0,n.jsx)(ns.Z,{primary:"Inspect entity"})]}),(0,n.jsxs)(es.Z,{onClick:()=>{Ct(),$t()},children:[(0,n.jsx)(ts.Z,{children:(0,n.jsx)(oi.Z,{fontSize:"small"})}),(0,n.jsx)(ns.Z,{primary:"Copy entity URL"})]})]})})]})}const Ys="plugin.catalog.entityLayoutRoute",rs=()=>null;(0,x.R5)(rs,Ys,!0),(0,x.R5)(rs,"core.gatherMountPoints",!0);function Ro(a){const{entity:r,title:o}=a;return(0,n.jsxs)(Us.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(Us.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(Rn.LH,{entity:r})]})}function Js(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 z=(U=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&U!==void 0?U:"";var re,ze,Ve;return{headerTitle:`${(Ve=(ze=(re=c==null?void 0:c.metadata.title)!==null&&re!==void 0?re:o)!==null&&ze!==void 0?ze:c==null?void 0:c.metadata.name)!==null&&Ve!==void 0?Ve:""}${z&&z!==un.zG?` in ${z}`:""}`,headerType:(()=>{let it=O.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(it+=" \u2014 ",it+=c.spec.type.toLocaleLowerCase("en-US")),it})()}}function Qs(a){var r;const{entity:o}=a,c=(0,Rn.hF)(o,un.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Zt.i9,{label:"Owner",value:(0,n.jsx)(Rn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Zt.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Po=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:O,NotFoundComponent:U}=a,{kind:z,namespace:re,name:ze}=(0,x.Oi)(Rn.wi),{entity:Ve,loading:Ct,error:it}=(0,Rn.ce)(),$t=(0,V.TH)(),Ft=(0,x.vJ)(O,Ls=>Ls.selectByComponentData({key:Ys,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Lr})=>{if(Ve){if(Lr.if&&!Lr.if(Ve))return[]}else return[];return[{path:Lr.path,title:Lr.title,children:Lr.children,tabProps:Lr.tabProps}]}),[Ve]),{headerTitle:Kt,headerType:Sn}=Js(z,re,ze,Ve),[tr,nr]=(0,g.useState)(!1),[pr,ls]=(0,g.useState)(!1),bi=(0,V.s0)(),Si=async()=>{nr(!1),ls(!1),bi("/")};(0,g.useEffect)(()=>{nr(!1),ls(!1)},[$t.pathname]);var Fr;return(0,n.jsxs)(Zt.T3,{themeId:(Fr=Ve==null||(r=Ve.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&Fr!==void 0?Fr:"home",children:[(0,n.jsx)(Zt.h4,{title:(0,n.jsx)(Ro,{title:Kt,entity:Ve}),pageTitleOverride:Kt,type:Sn,children:Ve&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Qs,{entity:Ve}),(0,n.jsx)(Ks,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>nr(!0),onInspectEntity:()=>ls(!0)})]})}),Ct&&(0,n.jsx)(Zt.Ex,{}),Ve&&(0,n.jsx)(Zt.tn,{routes:Ft}),it&&(0,n.jsx)(Zt.VY,{children:(0,n.jsx)(Ms.Z,{severity:"error",children:it.toString()})}),!Ct&&!it&&!Ve&&(0,n.jsx)(Zt.VY,{children:U||(0,n.jsxs)(Zt.GB,{title:"Entity not found",children:["There is no ",z," with the requested"," ",(0,n.jsx)(Zt.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(Rn.pp,{open:tr,entity:Ve,onConfirm:Si,onClose:()=>nr(!1)}),(0,n.jsx)(Rn.U_,{open:pr,entity:Ve,onClose:()=>ls(!1)})]})};Po.Route=rs;var Ji=t(23054);function li(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[O,U]=useState(!1),z=useApi(catalogApiRef),re=useApi(alertApiRef),ze=async()=>{U(!0);try{const Ve=f.metadata.uid;await z.removeEntityByUid(Ve),c()}catch(Ve){assertError(Ve),re.post({message:Ve.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:ze,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Nr=t(19625);function ci(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 Jn(){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 di=t(29644);const ui=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Lo(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(ui).map(ze=>ze.error).filter(ze=>Boolean(ze)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function Qi(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Lo(stringifyEntityRef(a),o)).items.length>0}function Xi(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:O}=useAsync(async()=>Lo(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,z)=>_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,ze)=>_jsx(ResponseErrorPanel,{error:re},ze))]},z))})}const ko="core.backstage.entitySwitch",Oo=a=>null;(0,x.R5)(Oo,ko,!0);const hi=a=>{var r;const{entity:o,loading:c}=(0,Rn.ce)(),f=(0,x.I_)(),O=(0,x.vJ)(a.children,re=>re.selectByComponentData({key:ko,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(ze=>{if(c)return[];const{if:Ve,children:Ct}=ze.props;if(!o)return[{if:Ve===void 0,children:Ct}];var it;return[{if:(it=Ve==null?void 0:Ve(o,{apis:f}))!==null&&it!==void 0?it:!0,children:Ct}]}),[f,o,c]);if(O.some(re=>typeof re.if=="object"&&"then"in re.if))return(0,n.jsx)(ss,{results:O});var z;return(z=(r=O.find(re=>re.if))===null||r===void 0?void 0:r.children)!==null&&z!==void 0?z:null};function ss({results:a}){const{loading:r,value:o}=(0,gn.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}hi.Case=Oo;const qi=null,_i=Rn._i.Filters,pi=Rn._i.Content,Mn=(0,x.rx)({id:"catalog",apis:[(0,x.ni)({api:Rn.Ah,deps:{discoveryApi:x.NW,fetchApi:x.gP},factory:({discoveryApi:a,fetchApi:r})=>new di.MS({discoveryApi:a,fetchApi:r})}),(0,x.ni)({api:Rn.p3,deps:{storageApi:x.E6},factory:({storageApi:a})=>new So({storageApi:a})})],routes:{catalogIndex:Nr._Z,catalogEntity:Rn.wi},externalRoutes:{createComponent:Nr.yw,viewTechDoc:Nr.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Xs=Mn.provide((0,x.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Nr._Z})),$o=Mn.provide((0,x.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:Rn.wi})),fi=Mn.provide((0,x.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),gi=Mn.provide((0,x.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),_s=Mn.provide((0,x.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),Rs=Mn.provide((0,x.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),Bo=Mn.provide((0,x.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),Zo=Mn.provide((0,x.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),hr=Mn.provide((0,x.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),mi=Mn.provide((0,x.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),Do=Mn.provide((0,x.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),vi=Mn.provide((0,x.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var No=t(32838);class Qn{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 eo{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 os=[(0,x.ni)({api:je.Dl,deps:{configApi:x.Ds,discoveryApi:x.NW,identityApi:x.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Qn({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 eo({configApi:a,discoveryApi:r,identityApi:o})}),(0,x.ni)({api:No.q3,deps:{configApi:x.Ds},factory:({configApi:a})=>No.ae.fromConfig(a)})],to={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},is={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function no(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function ro(){const a=await Hr(),r=await no();return[...a,{context:"detected",data:r?to:is}]}var so=t(58845);const Fo=(0,Dr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Uo=()=>{const a=Fo();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 oo=(0,Dr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var io=()=>{const a=oo();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 ao=(0,Dr.Z)({root:{width:Zt.po.drawerWidthClosed,height:3*Zt.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Zt.po.drawerWidthClosed,marginLeft:24}}),lo=()=>{const a=ao(),{isOpen:r}=(0,Zt.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(Zt.rU,{to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(Uo,{}):(0,n.jsx)(io,{})})})},co=({children:a})=>(0,n.jsxs)(Zt.tR,{children:[(0,n.jsxs)(Zt.YE,{children:[(0,n.jsx)(lo,{}),(0,n.jsx)(Zt.v7,{}),(0,n.jsx)(Zt.R6,{icon:so.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var uo=t(80030),Ps=t(32388),Mo=t(4142);const zo=(0,Dr.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 Xn;(function(a){a.LIGHT="light",a.DARK="dark"})(Xn||(Xn={}));const Vo=()=>{const a=(0,x.h_)(x.hg),r=zo(),[o,c]=(0,g.useState)(a.getActiveThemeId()===Xn.DARK?Xn.DARK:Xn.LIGHT),f={[Xn.LIGHT]:{icon:Mo.Z,title:"Dark theme"},[Xn.DARK]:{icon:Ps.Z,title:"Light theme"}},{title:O,icon:U}=f[o],z=()=>{c(re=>{const ze=re===Xn.LIGHT?Xn.DARK:Xn.LIGHT;return a.setActiveThemeId(ze),ze})};return(0,n.jsx)(Us.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(uo.ZP,{title:O,arrow:!0,children:(0,n.jsx)(zs.Z,{size:"small",onClick:z,children:(0,n.jsx)(U,{className:r.headerIcon})})})})},Wo=()=>(0,n.jsxs)(T.I6,{children:[(0,n.jsx)(F.S,{}),(0,n.jsx)(Q.F,{withSearch:!1})]}),Ho=(0,n.jsx)(Wo,{}),ho=Br({apis:os,configLoader:ro,plugins:Object.values(h)}),po=ho.getProvider(),fo=ho.getRouter(),Go=T.s4.provide((0,je.KY)({name:"ThemeToggleAddon",component:Vo,location:je.oZ.Header})),Ko=(0,n.jsxs)(ms,{children:[(0,n.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)($o,{})}),(0,n.jsx)(V.AW,{path:"/docs",element:(0,n.jsx)(T.Jl,{}),children:(0,n.jsx)(I.u,{})}),(0,n.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(T.I6,{}),children:[Ho,(0,n.jsx)(je.DR,{children:(0,n.jsx)(Go,{})})]})]});var go=()=>(0,n.jsx)(po,{children:(0,n.jsx)(fo,{children:(0,n.jsx)(co,{children:Ko})})});L.render((0,n.jsx)(go,{}),document.getElementById("root"))},51837:function(jt,Me,t){"use strict";t.d(Me,{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,_){const F=g(q);let Q=n[F];return Q||(Q=_(),n[F]=Q,Q)}var V=t(2784);function x(q){return L(q,()=>(0,V.createContext)(void 0))}function l(q){return(0,V.useContext)(x(q))}function k(q){return{set(_){globalThis[`__@backstage/${q}__`]=createContext(createVersionedValueMap(_))},reset(){delete globalThis[`__@backstage/${q}__`]}}}function ne(q){return Object.freeze(q),{atVersion(_){return q[_]}}}},43297:function(jt,Me,t){"use strict";t.d(Me,{h$:function(){return rn},n3:function(){return h.n3},_i:function(){return $},zo:function(){return Re},tW:function(){return M},df:function(){return ue},UO:function(){return $n},dq:function(){return nt},nl:function(){return _r},dx:function(){return lt},rI:function(){return ut},u3:function(){return It},xE:function(){return Dt},sL:function(){return Nt},LH:function(){return qn},U_:function(){return Qr},pp:function(){return bs},EW:function(){return qr},Ah:function(){return g},wi:function(){return mt},hF:function(){return ht},CV:function(){return Ge},$3:function(){return Ie},p3:function(){return L},ce:function(){return hn},X2:function(){return Wt},wp:function(){return Gt},ZW:function(){return xt},N$:function(){return R},eK:function(){return yn},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 V=t(82394);class x{async toggleStarred(b){this.starredEntities.delete(b)||this.starredEntities.add(b);for(const P of this.subscribers)P.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),_=t(77277),F=t(4190),Q=t(95544),X=t(90436),ve=t(60905),de=t(36444);const A=y=>{const b=(0,ne.Z)(K=>K.breakpoints.down("md")),P=(0,q.Z)(),[D,G]=(0,k.useState)(!1);return b?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(_.Z,{style:{marginTop:P.spacing(1),marginLeft:P.spacing(1)},onClick:()=>G(!0),startIcon:(0,l.jsx)(de.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)(X.Z,{variant:"h6",component:"h2",style:{marginBottom:P.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),ee=t.n(T),je=t(829),He=t.n(je),Ne=t(64279),Ee=t(25271),qe=t(51837);const mt=(0,qe.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ze(y){var b,P;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(P=(b=y.metadata.namespace)===null||b===void 0?void 0:b.toLocaleLowerCase("en-US"))!==null&&P!==void 0?P:DEFAULT_NAMESPACE,name:y.metadata.name}}function Ie(y,b){const P=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=P&&P.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${G?`${G}/`:""}${K}`}var rt=t(80030);const lt=(0,k.forwardRef)((y,b)=>{const{entityRef:P,defaultKind:D,title:G,children:K,...ce}=y,ie=(0,n.tg)(mt);let xe,we,Pe;if(typeof P=="string"){const Xe=(0,Ee.of)(P);xe=Xe.kind,we=Xe.namespace,Pe=Xe.name}else"metadata"in P?(xe=P.kind,we=P.metadata.namespace,Pe=P.metadata.name):(xe=P.kind,we=P.namespace,Pe=P.name);xe=xe.toLocaleLowerCase("en-US");var Te;we=(Te=we==null?void 0:we.toLocaleLowerCase("en-US"))!==null&&Te!==void 0?Te:Ee.zG;const Ye={kind:xe,namespace:we,name:Pe},bt=Ie({kind:xe,namespace:we,name:Pe},{defaultKind:D}),Et=(0,l.jsxs)(E.rU,{...ce,ref:b,to:ie(Ye),children:[K,!K&&(G!=null?G:bt)]});return G?(0,l.jsx)(rt.ZP,{title:bt,children:Et}):Et});function st(y){const{entityRefs:b,defaultKind:P,getTitle:D,...G}=y,K=(0,n.h_)(g),{value:ce=new Array,loading:ie,error:xe}=(0,Ne.default)(async()=>{const we=b.reduce((Te,Ye)=>"metadata"in Ye?Te:[...Te,(0,Ee.of)(Ye)],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 ie?(0,l.jsx)(E.Ex,{}):xe?(0,l.jsx)(E.yu,{error:xe}):(0,l.jsx)(l.Fragment,{children:ce.map((we,Pe)=>(0,l.jsxs)(k.Fragment,{children:[Pe>0&&", ",(0,l.jsx)(lt,{...G,defaultKind:P,entityRef:we,title:D(we)})]},Pe))})}function ut(y){const{entityRefs:b,defaultKind:P,fetchEntities:D,getTitle:G,...K}=y;return D?(0,l.jsx)(st,{...K,defaultKind:P,entityRefs:b,getTitle:G}):(0,l.jsx)(l.Fragment,{children:b.map((ce,ie)=>(0,l.jsxs)(k.Fragment,{children:[ie>0&&", ",(0,l.jsx)(lt,{...K,defaultKind:P,entityRef:ce,title:G?G(ce):void 0})]},ie))})}function ct(y){return y.reduce((b,P)=>({...b,...P.getCatalogFilters?P.getCatalogFilters():{}}),{})}function vt(y){return b=>y.every(P=>!P.filterEntity||P.filterEntity(b))}function ht(y,b,P){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 P!=null&&P.kind&&(G=G.filter(K=>K.kind.toLocaleLowerCase("en-US")===P.kind.toLocaleLowerCase("en-US"))),G}function Ge(y,b){var P;const D=(P=y.metadata.annotations)===null||P===void 0?void 0:P[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 ae(y,b){const P=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(P.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 ot{filterEntity(b){var P;return this.values.every(D=>((P=b.metadata.tags)!==null&&P!==void 0?P:[]).includes(D))}toQueryValue(){return this.values}constructor(b){this.values=b}}class yt{filterEntity(b){const P=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 P)if(D.every(ce=>ce!==K)&&G.every(ce=>!ce.includes(K)))return!1;return!0}toUpperArray(b){return b.flat().filter(P=>Boolean(P)).map(P=>P.toLocaleUpperCase("en-US"))}constructor(b){this.value=b}}class At{filterEntity(b){return this.values.some(P=>ht(b,Ee.S4).some(D=>Ie(D,{defaultKind:"group"})===P))}toQueryValue(){return this.values}constructor(b){this.values=b}}class pt{filterEntity(b){return this.values.some(P=>{var D;return((D=b.spec)===null||D===void 0?void 0:D.lifecycle)===P})}toQueryValue(){return this.values}constructor(b){this.values=b}}class St{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,P,D){this.value=b,this.isOwnedEntity=P,this.isStarredEntity=D}}class Lt{filterEntity(b){var P;const D=(P=b.metadata.annotations)===null||P===void 0?void 0:P["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(b){this.value=b}}class kt{filterEntity(b){var P,D;const G=(b==null||(P=b.status)===null||P===void 0||(D=P.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"),rn=({children:y,entity:b,loading:P,error:D,refresh:G})=>{const K={entity:b,loading:P,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(rn,{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 hn(){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:P,loading:D,error:G,refresh:K}=b;return{entity:P,loading:D,error:G,refresh:K}}var _t=t(76635),kn=t(19126),ln=t.n(kn),On=t(10289),pn=t(69294),Hn=t(48760),Ht=t(90736);const Cn=(0,k.createContext)(void 0),$n=({children:y})=>{const b=(0,Ht.default)(),P=(0,n.h_)(g),[D,G]=(0,k.useState)({}),K=(0,On.TH)();var ce;const ie=(0,k.useMemo)(()=>(ce=ln().parse(K.search,{ignoreQueryPrefix:!0}).filters)!==null&&ce!==void 0?ce:{},[K]),[xe,we]=(0,k.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Pe,error:Te},Ye]=(0,pn.default)(async()=>{const Xe=(0,_t.compact)(Object.values(D)),Ot=vt(Xe),Qt=ct(Xe),Yn=ct((0,_t.compact)(Object.values(xe.appliedFilters))),Un=Object.keys(D).reduce((dn,vn)=>{const In=D[vn];return In!=null&&In.toQueryValue&&(dn[vn]=In.toQueryValue()),dn},{});if((0,_t.isEqual)(Yn,Qt))we({appliedFilters:D,backendEntities:xe.backendEntities,entities:xe.backendEntities.filter(Ot)});else{const dn=await P.getEntities({filter:Qt});we({appliedFilters:D,backendEntities:dn.items,entities:dn.items.filter(Ot)})}if(b()){var dr;const dn=ln().parse(K.search,{ignoreQueryPrefix:!0}),vn=ln().stringify({...dn,filters:Un},{addQueryPrefix:!0,arrayFormat:"repeat"}),In=`${window.location.pathname}${vn}`;(dr=window.history)===null||dr===void 0||dr.replaceState(null,document.title,In)}},[P,ie,D,xe],{loading:!0});(0,Hn.Z)(Ye,10,[D]);const bt=(0,k.useCallback)(Xe=>{G(Ot=>{const Qt=typeof Xe=="function"?Xe(Ot):Xe;return{...Ot,...Qt}})},[]),Et=(0,k.useMemo)(()=>({filters:xe.appliedFilters,entities:xe.entities,backendEntities:xe.backendEntities,updateFilters:bt,queryParameters:ie,loading:Pe,error:Te}),[xe,bt,ie,Pe,Te]);return(0,l.jsx)(Cn.Provider,{value:Et,children:y})};function Gt(){const y=(0,k.useContext)(Cn);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var fn=t(18149),cn=t.n(fn);function wn(){const y=(0,n.h_)(g),{filters:{kind:b,type:P},queryParameters:{type:D},updateFilters:G}=Gt(),K=(0,k.useMemo)(()=>[D].flat().filter(Boolean),[D]);var ce;const[ie,xe]=(0,k.useState)(K.length?K:(ce=P==null?void 0:P.getTypes())!==null&&ce!==void 0?ce:[]);(0,k.useEffect)(()=>{K.length&&xe(K)},[K]);const[we,Pe]=(0,k.useState)([]),Te=(0,k.useMemo)(()=>b==null?void 0:b.value,[b]),{error:Ye,loading:bt,value:Et}=(0,Ne.default)(async()=>Te?await y.getEntityFacets({filter:{kind:Te},facets:["spec.type"]}).then(Qt=>Qt.facets["spec.type"]||[]):[],[Te,y]),Xe=(0,k.useRef)(Et);return(0,k.useEffect)(()=>{const Ot=Xe.current;if(Xe.current=Et,bt||!Te||Ot===Et||!Et)return;const Qt=[...new Set(He()(Et,Un=>-Un.count).map(Un=>Un.value.toLocaleLowerCase("en-US")))];Pe(Qt);const Yn=ie.filter(Un=>Qt.includes(Un));cn()(ie,Yn)||xe(Yn)},[bt,Te,ie,xe,Et]),(0,k.useEffect)(()=>{G({type:ie.length?new ke(ie):void 0})},[ie,G]),{loading:bt,error:Ye,availableTypes:we,selectedTypes:ie,setSelectedTypes:xe}}const Bn=20;function yn(y,b){var P,D;const G=b==null||(P=b.type)===null||P===void 0?void 0:P.toLocaleLowerCase("en-US"),K=b==null||(D=b.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),ce=(0,n.h_)(g),{loading:ie,value:xe,error:we}=(0,Ne.default)(async()=>{var Pe;const Te=(Pe=y.relations)===null||Pe===void 0?void 0:Pe.map(Xe=>({type:Xe.type,target:(0,Ee.of)(Xe.targetRef)})).filter(Xe=>(!G||Xe.type.toLocaleLowerCase("en-US")===G)&&(!K||Xe.target.kind===K));if(!Te)return[];const Ye=Object.values((0,_t.groupBy)(Te,({target:Xe})=>`${Xe.kind}:${Xe.namespace}`.toLocaleLowerCase("en-US"))),bt=[];for(const Xe of Ye)bt.push({kind:Xe[0].target.kind,namespace:Xe[0].target.namespace,nameBatches:(0,_t.chunk)(Xe.map(Ot=>Ot.target.name),Bn)});return(await Promise.all(bt.flatMap(Xe=>Xe.nameBatches.map(Ot=>ce.getEntities({filter:{kind:Xe.kind,"metadata.namespace":Xe.namespace,"metadata.name":Ot}}))))).flatMap(Xe=>Xe.items)},[y,G,K]);return{entities:xe,loading:ie,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),P=(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:P}}function Fe(y){return typeof y=="string"?y:(0,Ee.eE)(y)}function Qe(y){const b=(0,n.h_)(L),[P,D]=(0,k.useState)(!1);return(0,k.useEffect)(()=>{const K=b.starredEntitie$().subscribe({next(ce){D(ce.has(Fe(y)))}});return()=>{K.unsubscribe()}},[y,b]),{toggleStarredEntity:(0,k.useCallback)(()=>b.toggleStarred(Fe(y)).then(),[y,b]),isStarredEntity:P}}function xt(){const y=(0,n.h_)(n.$4),{loading:b,value:P}=(0,Ne.default)(async()=>{const{ownershipEntityRefs:G}=await y.getBackstageIdentity();return G},[]),D=(0,k.useMemo)(()=>{const G=new Set(P!=null?P:[]);return K=>{const ce=ht(K,Ee.S4).map(Ee.eE);for(const ie of ce)if(G.has(ie))return!0;return!1}},[P]);return(0,k.useMemo)(()=>({loading:b,isOwnedEntity:D}),[b,D])}var oe=t(25488);function R(y){const{entity:b,loading:P,error:D}=hn(),{allowed:G,loading:K,error:ce}=(0,oe.gI)({permission:y,resourceRef:b?(0,Ee.eE)(b):void 0});return P||K?{loading:!0,allowed:!1}:D?{loading:!1,allowed:!1,error:D}:{loading:!1,allowed:G,error:ce}}function J(){const y=(0,n.h_)(g),[b,P]=(0,k.useState)([]),{error:D,loading:G,value:K}=(0,Ne.default)(async()=>{const ie="kind";return await y.getEntityFacets({facets:[ie]}).then(we=>we.facets[ie]||[])},[y]),ce=(0,k.useRef)(K);return(0,k.useEffect)(()=>{const ie=ce.current;if(ce.current=K,G||ie===K||!K)return;const xe=[...new Set(He()(K,we=>we.value).map(we=>we.value.toLocaleLowerCase("en-US")))];P(xe)},[G,K,P]),{loading:G,error:D,availableKinds:b}}function Ke(y){var b;const{filters:P,queryParameters:{kind:D},updateFilters:G}=Gt(),K=(0,k.useMemo)(()=>[D].flat()[0],[D]);var ce;const[ie,xe]=(0,k.useState)((ce=K!=null?K:(b=P.kind)===null||b===void 0?void 0:b.value)!==null&&ce!==void 0?ce:y.initialFilter);(0,k.useEffect)(()=>{K&&xe(K)},[K]),(0,k.useEffect)(()=>{var Ye;if(!((Ye=P.kind)===null||Ye===void 0)&&Ye.value){var bt;xe((bt=P.kind)===null||bt===void 0?void 0:bt.value)}},[P.kind]);const{availableKinds:we,loading:Pe,error:Te}=J();return(0,k.useEffect)(()=>{G({kind:ie?new Re(ie):void 0})},[ie,G]),{loading:Pe,error:Te,availableKinds:we,selectedKind:ie,setSelectedKind:xe}}const M=y=>{const{hidden:b,initialFilter:P="component"}=y,D=(0,n.h_)(n.$v),{error:G,availableKinds:K,selectedKind:ce,setSelectedKind:ie}=Ke({initialFilter:P});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 xe=[...K.map(we=>({value:we,label:ee()(we)}))];return b?null:(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsx)(E.Ph,{label:"Kind",items:xe,selected:ce,onChange:we=>ie(String(we))})})};var Z=t(79692),le=t(5806),he=t(21324),be=t(86619),De=t(19996),$e=t(25505),We=t(38016),tt=t(88013);const S=(0,Z.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),H=(0,l.jsx)($e.Z,{fontSize:"small"}),me=(0,l.jsx)(De.Z,{fontSize:"small"}),ue=()=>{var y;const b=S(),{updateFilters:P,backendEntities:D,filters:G,queryParameters:{lifecycles:K}}=Gt(),ce=(0,k.useMemo)(()=>[K].flat().filter(Boolean),[K]);var ie;const[xe,we]=(0,k.useState)(ce.length?ce:(ie=(y=G.lifecycles)===null||y===void 0?void 0:y.values)!==null&&ie!==void 0?ie:[]);(0,k.useEffect)(()=>{ce.length&&we(ce)},[ce]),(0,k.useEffect)(()=>{P({lifecycles:xe.length?new pt(xe):void 0})},[xe,P]);const Pe=(0,k.useMemo)(()=>[...new Set(D.map(Te=>{var Ye;return(Ye=Te.spec)===null||Ye===void 0?void 0:Ye.lifecycle}).filter(Boolean))].sort(),[D]);return Pe.length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(X.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(tt.ZP,{multiple:!0,options:Pe,value:xe,onChange:(Te,Ye)=>we(Ye),renderOption:(Te,{selected:Ye})=>(0,l.jsx)(le.Z,{control:(0,l.jsx)(he.Z,{icon:H,checkedIcon:me,checked:Ye}),label:Te}),size:"small",popupIcon:(0,l.jsx)(We.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Te=>(0,l.jsx)(be.Z,{...Te,className:b.input,variant:"outlined"})})]})}):null},Ce=(0,Z.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Oe=(0,l.jsx)($e.Z,{fontSize:"small"}),Ue=(0,l.jsx)(De.Z,{fontSize:"small"}),nt=()=>{var y;const b=Ce(),{updateFilters:P,backendEntities:D,filters:G,queryParameters:{owners:K}}=Gt(),ce=(0,k.useMemo)(()=>[K].flat().filter(Boolean),[K]);var ie;const[xe,we]=(0,k.useState)(ce.length?ce:(ie=(y=G.owners)===null||y===void 0?void 0:y.values)!==null&&ie!==void 0?ie:[]);(0,k.useEffect)(()=>{ce.length&&we(ce)},[ce]),(0,k.useEffect)(()=>{P({owners:xe.length?new At(xe):void 0})},[xe,P]);const Pe=(0,k.useMemo)(()=>[...new Set(D.flatMap(Te=>ht(Te,Ee.S4).map(Ye=>Ie(Ye,{defaultKind:"group"}))).filter(Boolean))].sort(),[D]);return Pe.length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(X.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(tt.ZP,{multiple:!0,options:Pe,value:xe,onChange:(Te,Ye)=>we(Ye),renderOption:(Te,{selected:Ye})=>(0,l.jsx)(le.Z,{control:(0,l.jsx)(he.Z,{icon:Oe,checkedIcon:Ue,checked:Ye}),label:Te}),size:"small",popupIcon:(0,l.jsx)(We.Z,{"data-testid":"owner-picker-expand"}),renderInput:Te=>(0,l.jsx)(be.Z,{...Te,className:b.input,variant:"outlined"})})]})}):null},ft=(0,Z.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),dt=()=>{var y;const b=ft(),{filters:P,updateFilters:D}=useEntityList();var G;const[K,ce]=useState((G=(y=P.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:ie=>ce(ie.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:()=>ce(""),edge:"end",disabled:K.length===0,children:_jsx(Clear,{})})})})})})},_e=Object.freeze({createEntityRefColumn(y){const{defaultKind:b}=y;function P(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 P(G).includes(D)},customSort(D,G){return P(D).localeCompare(P(G))},render:D=>{var G;return(0,l.jsx)(lt,{entityRef:D,defaultKind:b,title:(G=D.metadata)===null||G===void 0?void 0:G.title})}}},createEntityRelationColumn(y){const{title:b,relation:P,defaultKind:D,filter:G}=y;function K(ie){return ht(ie,P,G)}function ce(ie){return K(ie).map(xe=>Ie(xe,{defaultKind:D})).join(", ")}return{title:b,customFilterAndSearch(ie,xe){return ce(xe).includes(ie)},customSort(ie,xe){return ce(ie).localeCompare(ce(xe))},render:ie=>(0,l.jsx)(ut,{entityRefs:K(ie),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"}}}),at=[_e.createEntityRefColumn({defaultKind:"system"}),_e.createDomainColumn(),_e.createOwnerColumn(),_e.createMetadataDescriptionColumn()],wt=[_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"}})),It=y=>{const{entities:b,title:P,emptyContent:D,variant:G="gridItem",columns:K}=y,ce=Tt(),ie={minWidth:"0",width:"100%"};return G==="gridItem"&&(ie.height="calc(100% - 10px)"),(0,l.jsx)(E.iA,{columns:K,title:P,style:ie,emptyContent:D&&(0,l.jsx)("div",{className:ce.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:b})};It.columns=_e,It.systemEntityColumns=at,It.componentEntityColumns=wt;const Ut=(0,Z.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Zn=(0,l.jsx)($e.Z,{fontSize:"small"}),Wn=(0,l.jsx)(De.Z,{fontSize:"small"}),Dt=y=>{var b;const P=Ut(),{updateFilters:D,filters:G,queryParameters:{tags:K}}=Gt(),ce=(0,n.h_)(g),{value:ie}=(0,Ne.default)(async()=>{var Ye;const bt="metadata.tags",{facets:Et}=await ce.getEntityFacets({facets:[bt],filter:(Ye=G.kind)===null||Ye===void 0?void 0:Ye.getCatalogFilters()});return Object.fromEntries(Et[bt].map(({value:Xe,count:Ot})=>[Xe,Ot]))},[G.kind]),xe=(0,k.useMemo)(()=>[K].flat().filter(Boolean),[K]);var we;const[Pe,Te]=(0,k.useState)(xe.length?xe:(we=(b=G.tags)===null||b===void 0?void 0:b.values)!==null&&we!==void 0?we:[]);return(0,k.useEffect)(()=>{xe.length&&Te(xe)},[xe]),(0,k.useEffect)(()=>{D({tags:Pe.length?new ot(Pe):void 0})},[Pe,D]),Object.keys(ie!=null?ie:{}).length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(X.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(tt.ZP,{multiple:!0,options:Object.keys(ie!=null?ie:{}),value:Pe,onChange:(Ye,bt)=>Te(bt),renderOption:(Ye,{selected:bt})=>(0,l.jsx)(le.Z,{control:(0,l.jsx)(he.Z,{icon:Zn,checkedIcon:Wn,checked:bt}),label:y.showCounts?`${Ye} (${ie==null?void 0:ie[Ye]})`:Ye}),size:"small",popupIcon:(0,l.jsx)(We.Z,{"data-testid":"tag-picker-expand"}),renderInput:Ye=>(0,l.jsx)(be.Z,{...Ye,className:P.input,variant:"outlined"})})]})}):null},Nt=y=>{const{hidden:b,initialFilter:P}=y,D=(0,n.h_)(n.$v),{error:G,availableTypes:K,selectedTypes:ce,setSelectedTypes:ie}=wn();if((0,k.useEffect)(()=>{G&&D.post({message:"Failed to load entity types",severity:"error"}),P&&ie([P])},[G,D,P,ie]),K.length===0||G)return null;const xe=[{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:xe,selected:(we=xe.length>1?ce[0]:void 0)!==null&&we!==void 0?we:"all",onChange:Pe=>ie(Pe==="all"?[]:[String(Pe)])})})};var gn=t(15459),Dn=t(61837),sn=t(11640),jn=t(28347);const Nn=(0,gn.Z)({root:{color:"#f3ba37"}})(sn.Z),qn=y=>{const{toggleStarredEntity:b,isStarredEntity:P}=Qe(y.entity);return(0,l.jsx)(Dn.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>b(),children:(0,l.jsx)(rt.ZP,{title:P?"Remove from favorites":"Add to favorites",children:P?(0,l.jsx)(Nn,{}):(0,l.jsx)(jn.Z,{})})})};var En=t(8629),xn=t(79249),_n=t(38724),lr=t(99152),C=t(6487),d=t(49429),m=t(55999),w=t(72779),Y=t.n(w),pe=t(39412);const Se=pe.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 gt(y,b){const P=(0,n.qD)(),D=Be(y,b);return D&&P.getSystemIcon(`kind:${D}`)||Se}function Bt(y){const{kind:b,entityRef:P,...D}=y,G=gt(b,P);return(0,l.jsx)(G,{...D})}const on=(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 Fn(y){const b=(0,n.h_)(g),P=(0,Ee.eE)(y),{loading:D,error:G,value:K}=(0,Ne.default)(async()=>{const ce=await b.getEntityAncestors({entityRef:P}),ie=new Array,xe=new Array;for(const we of ce.items){const Pe=(0,Ee.eE)(we.entity),Te=Pe===ce.rootEntityRef;ie.push({id:Pe,root:Te,...we.entity});for(const Ye of we.parentEntityRefs)xe.push({from:Pe,to:Ye})}return{nodes:ie,edges:xe}},[P]);return{loading:D,error:G,nodes:(K==null?void 0:K.nodes)||[],edges:(K==null?void 0:K.edges)||[]}}function kr({node:y}){const b=on(),P=(0,On.s0)(),D=(0,n.tg)(mt),[G,K]=(0,k.useState)(0),[ce,ie]=(0,k.useState)(0),xe=(0,k.useRef)(null);(0,k.useLayoutEffect)(()=>{if(xe.current){let{height:Ot,width:Qt}=xe.current.getBBox();Ot=Math.round(Ot),Qt=Math.round(Qt),(Ot!==ce||Qt!==G)&&(K(Qt),ie(Ot))}},[G,ce]);const we=10,Pe=ce,Te=Pe+we,Ye=Te+G+we*2,bt=ce+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),Xe=()=>{P(D({kind:y.kind,namespace:y.metadata.namespace||Ee.zG,name:y.metadata.name}))};return(0,l.jsxs)("g",{onClick:Xe,className:b.clickable,children:[(0,l.jsx)("rect",{className:Y()(b.node,y.root?"secondary":"primary"),width:Ye,height:bt,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:xe,className:Y()(b.text,y.root?"secondary":"primary"),y:bt/2,x:Te+(G+we*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Et})]})}function cs(y){const{loading:b,error:P,nodes:D,edges:G}=Fn(y.entity);return b?(0,l.jsx)(E.Ex,{}):P?(0,l.jsx)(E.Gk,{error:P}):(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:kr,direction:E.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var er=t(11776),An=t(38402),cr=t(86136),br=t(99688),Sr=t(49378),ds=t(54506),Cr=t(94339),Or=t(24579),Zs=t(27685);const $r=(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 Gn(y){const b=$r();return(0,l.jsx)(Sr.Z,{...y,primaryTypographyProps:{className:b.monospace},secondaryTypographyProps:{className:b.monospace}})}function wr(y){const b=$r();return(0,l.jsx)(ds.Z,{className:b.monospace,children:y.children})}function gr(y){return(0,l.jsx)(Q.Z,{mt:2,children:(0,l.jsx)(Cr.Z,{variant:"outlined",children:(0,l.jsxs)(Or.Z,{children:[(0,l.jsxs)(X.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,l.jsx)(Tn,{to:y.helpLink})]}),y.children]})})})}function Hr(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function jr(y){const[b,P]=y.entry,D=Hr(P);return(0,l.jsxs)(An.Z,{children:[y.indent&&(0,l.jsx)(cr.Z,{}),(0,l.jsx)(Gn,{primary:b,secondary:D?(0,l.jsx)(E.rU,{to:D,children:P}):P})]})}function Tn(y){const b=$r();return(0,l.jsx)(E.rU,{to:y.to,className:b.helpIcon,children:(0,l.jsx)(Zs.Z,{fontSize:"inherit"})})}const us=(0,Z.Z)({root:{display:"flex",flexDirection:"column"}});function Er(y){var b,P;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],ce=(P=y.metadata.annotations)===null||P===void 0?void 0:P[Ee.q1],{loading:ie,error:xe,value:we}=(0,Ne.default)(async()=>!K&&!ce?[]:(await D.getEntities({filter:[...K?[{[`metadata.annotations.${Ee.P1}`]:K}]:[],...ce?[{[`metadata.annotations.${Ee.q1}`]:ce}]:[]]})).items,[K,ce]);return{loading:ie,error:xe,location:K,originLocation:ce,colocatedEntities:we==null?void 0:we.filter(Pe=>(0,Ee.eE)(Pe)!==G)}}function Ar(y){return(0,l.jsxs)(er.Z,{dense:!0,children:[y.header&&(0,l.jsx)(jr,{entry:y.header},"header"),y.entities.map(b=>(0,l.jsxs)(An.Z,{children:[(0,l.jsx)(cr.Z,{children:(0,l.jsx)(Bt,{kind:b.kind})}),(0,l.jsx)(Gn,{primary:(0,l.jsx)(lt,{entityRef:b})})]},(0,Ee.eE)(b)))]})}function Gr(y){const{entity:b}=y,{loading:P,error:D,location:G,originLocation:K,colocatedEntities:ce}=Er(b);if(P)return(0,l.jsx)(E.Ex,{});if(D)return(0,l.jsx)(E.Gk,{error:D});if(!G&&!K)return(0,l.jsx)(br.Z,{severity:"warning",children:"Entity had no location information."});if(!(ce!=null&&ce.length))return(0,l.jsx)(br.Z,{severity:"info",children:"There were no other entities on this location."});if(G===K)return(0,l.jsx)(Ar,{entities:ce});const ie=ce.filter(we=>{var Pe;return((Pe=we.metadata.annotations)===null||Pe===void 0?void 0:Pe[Ee.P1])===G}),xe=ce.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:[ie.length>0&&(0,l.jsx)(Ar,{entities:ie,header:["At the same location",G]}),xe.length>0&&(0,l.jsx)(Ar,{entities:xe,header:["At the same origin",K]})]})}function hs(y){const b=us();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)(Gr,{entity:y.entity})})]})}function ps(y){return Object.fromEntries([...Object.entries(y)].sort((b,P)=>b[0]<P[0]?-1:1))}function fs(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(ps(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Ds=t(3440),gs=t.n(Ds);const Kr=(0,Z.Z)({root:{display:"flex",flexDirection:"column"}});function ms(y){var b,P;const D=Kr(),{apiVersion:G,kind:K,metadata:ce,spec:ie,relations:xe=[],status:we={}}=y.entity,Pe=gs()(He()(xe,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)(gr,{title:"Identity",children:(0,l.jsxs)(er.Z,{dense:!0,children:[(0,l.jsx)(An.Z,{children:(0,l.jsx)(Gn,{primary:"apiVersion",secondary:G})}),(0,l.jsx)(An.Z,{children:(0,l.jsx)(Gn,{primary:"kind",secondary:K})}),(ie==null?void 0:ie.type)&&(0,l.jsx)(An.Z,{children:(0,l.jsx)(Gn,{primary:"spec.type",secondary:ie.type})}),ce.uid&&(0,l.jsx)(An.Z,{children:(0,l.jsx)(Gn,{primary:"uid",secondary:ce.uid})}),ce.etag&&(0,l.jsx)(An.Z,{children:(0,l.jsx)(Gn,{primary:"etag",secondary:ce.etag})})]})}),(0,l.jsxs)(gr,{title:"Metadata",children:[!!Object.keys(ce.annotations||{}).length&&(0,l.jsx)(er.Z,{dense:!0,subheader:(0,l.jsxs)(wr,{children:["Annotations",(0,l.jsx)(Tn,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ce.annotations).map(Te=>(0,l.jsx)(jr,{indent:!0,entry:Te},Te[0]))}),!!Object.keys(ce.labels||{}).length&&(0,l.jsx)(er.Z,{dense:!0,subheader:(0,l.jsx)(wr,{children:"Labels"}),children:Object.entries(ce.labels).map(Te=>(0,l.jsx)(jr,{indent:!0,entry:Te},Te[0]))}),!!(!((b=ce.tags)===null||b===void 0)&&b.length)&&(0,l.jsx)(er.Z,{dense:!0,subheader:(0,l.jsx)(wr,{children:"Tags"}),children:ce.tags.map((Te,Ye)=>(0,l.jsxs)(An.Z,{children:[(0,l.jsx)(cr.Z,{}),(0,l.jsx)(Gn,{primary:Te})]},`${Te}-${Ye}`))})]}),!!xe.length&&(0,l.jsx)(gr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Pe).map(([Te,Ye],bt)=>(0,l.jsx)("div",{children:(0,l.jsx)(er.Z,{dense:!0,subheader:(0,l.jsx)(wr,{children:Te}),children:Ye.map(Et=>(0,l.jsxs)(An.Z,{children:[(0,l.jsx)(cr.Z,{children:(0,l.jsx)(Bt,{entityRef:Et.targetRef})}),(0,l.jsx)(Gn,{primary:(0,l.jsx)(lt,{entityRef:Et.targetRef})})]},Et.targetRef))})},bt))}),!!(!((P=we.items)===null||P===void 0)&&P.length)&&(0,l.jsx)(gr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:we.items.map((Te,Ye)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(X.Z,{children:[Te.level,": ",Te.type]}),(0,l.jsx)(Q.Z,{ml:2,children:Te.message})]},Ye))})]})]})}var Yr=t(72847);function vs(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:Yr.ZP.stringify(ps(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Jr=(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 Zt(y){const{children:b,value:P,index:D,...G}=y,K=Jr();return(0,l.jsx)("div",{role:"tabpanel",hidden:P!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:K.tabContents,...G,children:P===D&&(0,l.jsx)(Q.Z,{pl:3,pr:3,children:b})})}function mr(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function Qr(y){const b=Jr(),[P,D]=k.useState(0);return(0,k.useEffect)(()=>{D(0)},[y.open]),y.entity?(0,l.jsxs)(En.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)(xn.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(_n.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:b.root,children:[(0,l.jsxs)(lr.Z,{orientation:"vertical",variant:"scrollable",value:P,onChange:(G,K)=>D(K),"aria-label":"Inspector options",className:b.tabs,children:[(0,l.jsx)(C.Z,{label:"Overview",...mr(0)}),(0,l.jsx)(C.Z,{label:"Ancestry",...mr(1)}),(0,l.jsx)(C.Z,{label:"Colocated",...mr(2)}),(0,l.jsx)(C.Z,{label:"Raw JSON",...mr(3)}),(0,l.jsx)(C.Z,{label:"Raw YAML",...mr(4)})]}),(0,l.jsx)(Zt,{value:P,index:0,children:(0,l.jsx)(ms,{entity:y.entity})}),(0,l.jsx)(Zt,{value:P,index:1,children:(0,l.jsx)(cs,{entity:y.entity})}),(0,l.jsx)(Zt,{value:P,index:2,children:(0,l.jsx)(hs,{entity:y.entity})}),(0,l.jsx)(Zt,{value:P,index:3,children:(0,l.jsx)(fs,{entity:y.entity})}),(0,l.jsx)(Zt,{value:P,index:4,children:(0,l.jsx)(vs,{entity:y.entity})})]})}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(_.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var ys=t(85256);function Xr(y){var b;const P=(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",ce=(0,Ne.default)(async()=>{const Et=P.getLocationByRef(D);let Xe;if(!D)Xe=Promise.resolve([]);else{const Ot=`metadata.annotations.${Ee.q1}`;Xe=P.getEntities({filter:{[Ot]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Qt=>Qt.items)}return Promise.all([Et,Xe]).then(([Ot,Qt])=>({location:Ot,colocatedEntities:Qt}))},[P,y]),ie=(0,k.useCallback)(async function(){const{location:Xe}=ce.value;await P.removeLocationById(Xe.id)},[P,ce]),xe=(0,k.useCallback)(async function(){await P.removeEntityByUid(G)},[P,G]);if(K)return{type:"bootstrap",location:D,deleteEntity:xe};const{loading:we,error:Pe,value:Te}=ce;if(we)return{type:"loading"};if(Pe)return{type:"error",error:Pe};const{location:Ye,colocatedEntities:bt}=Te;return Ye?{type:"unregister",location:D,colocatedEntities:bt.map(Ee.iB),unregisterLocation:ie,deleteEntity:xe}:{type:"only-delete",deleteEntity:xe}}var mn=t(23054);const Kn=(0,Z.Z)({advancedButton:{fontSize:"0.7em"}}),xs=({entity:y,onConfirm:b})=>{const P=(0,n.h_)(n.$v),D=(0,n.h_)(n.Ds),G=Kn(),K=Xr(y),[ce,ie]=(0,k.useState)(!1),[xe,we]=(0,k.useState)(!1);var Pe;const Te=(Pe=D.getOptionalString("app.title"))!==null&&Pe!==void 0?Pe:"Backstage",Ye=(0,k.useCallback)(async function(){if("unregisterLocation"in K){we(!0);try{await K.unregisterLocation(),b()}catch(Xe){(0,mn.BD)(Xe),P.post({message:Xe.message})}finally{we(!1)}}},[P,b,K]),bt=(0,k.useCallback)(async function(){if("deleteEntity"in K){we(!0);try{await K.deleteEntity(),b()}catch(Xe){(0,mn.BD)(Xe),P.post({message:Xe.message})}finally{we(!1)}}},[P,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)(br.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:[!ce&&(0,l.jsx)(_.Z,{variant:"text",size:"small",color:"primary",className:G.advancedButton,onClick:()=>ie(!0),children:"Advanced Options"}),ce&&(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)(_.Z,{variant:"contained",color:"secondary",disabled:xe,onClick:bt,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)(_.Z,{variant:"contained",color:"secondary",disabled:xe,onClick:bt,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)(lt,{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)(_.Z,{variant:"contained",color:"secondary",disabled:xe,onClick:Ye,children:"Unregister Location"}),!ce&&(0,l.jsx)(Q.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(_.Z,{variant:"text",size:"small",color:"primary",className:G.advancedButton,onClick:()=>ie(!0),children:"Advanced Options"})})]}),ce&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(ys.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)(_.Z,{variant:"contained",color:"secondary",disabled:xe,onClick:bt,children:"Delete Entity"})]})]}):(0,l.jsx)(br.Z,{severity:"error",children:"Internal error: Unknown state"})},bs=y=>{const{open:b,onConfirm:P,onClose:D,entity:G}=y;return(0,l.jsxs)(En.Z,{open:b,onClose:D,children:[(0,l.jsx)(xn.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(_n.Z,{children:(0,l.jsx)(xs,{entity:G,onConfirm:P})}),(0,l.jsx)(d.Z,{children:(0,l.jsx)(_.Z,{onClick:D,color:"primary",children:"Cancel"})})]})};var Ss=t(12231),Cs=t(9520),ws=t(47603);const js=(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 Es(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:ws.Z},{id:"starred",label:"Starred",icon:sn.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const qr=y=>{const{initialFilter:b,availableFilters:P}=y,D=js(),G=(0,n.h_)(n.Ds);var K;const ce=(K=G.getOptionalString("organization.name"))!==null&&K!==void 0?K:"Company",{filters:ie,updateFilters:xe,backendEntities:we,queryParameters:{kind:Pe,user:Te},loading:Ye}=Gt(),bt=["starred","all"],Et=Es(ce).map(un=>({...un,items:un.items.filter(({id:bn})=>["group","user"].some(Pr=>Pr===Pe)?bt.includes(bn):!P||P.includes(bn))})).filter(({items:un})=>!!un.length),{isStarredEntity:Xe}=Ae(),{isOwnedEntity:Ot,loading:Qt}=xt(),Yn=Ye||Qt,Un=(0,k.useMemo)(()=>new St("owned",Ot,Xe),[Ot,Xe]),dr=(0,k.useMemo)(()=>new St("starred",Ot,Xe),[Ot,Xe]),dn=(0,k.useMemo)(()=>[Te].flat()[0],[Te]),[vn,In]=(0,k.useState)(dn!=null?dn:b),Ir=(0,k.useMemo)(()=>we.filter(vt((0,_t.compact)(Object.values({...ie,user:void 0})))),[ie,we]),Rr=(0,k.useMemo)(()=>({all:Ir.length,starred:Ir.filter(un=>dr.filterEntity(un)).length,owned:Ir.filter(un=>Un.filterEntity(un)).length}),[Ir,dr,Un]);(0,k.useEffect)(()=>{dn&&In(dn)},[dn]),(0,k.useEffect)(()=>{!Yn&&!!vn&&vn!=="all"&&Rr[vn]===0&&In("all")},[Yn,Rr,vn,In]),(0,k.useEffect)(()=>{xe({user:vn?new St(vn,Ot,Xe):void 0})},[vn,Ot,Xe,xe]);var Br;return(0,l.jsx)(Cr.Z,{className:D.root,children:Et.map(un=>(0,l.jsxs)(k.Fragment,{children:[(0,l.jsx)(X.Z,{variant:"subtitle2",component:"span",className:D.title,children:un.name}),(0,l.jsx)(Cr.Z,{className:D.groupWrapper,children:(0,l.jsx)(er.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":un.name,children:un.items.map(bn=>{var Pr;return(0,l.jsxs)(Ss.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>In(bn.id),selected:bn.id===((Pr=ie.user)===null||Pr===void 0?void 0:Pr.value),className:D.menuItem,disabled:Rr[bn.id]===0,"data-testid":`user-picker-${bn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[bn.icon&&(0,l.jsx)(cr.Z,{className:D.listIcon,children:(0,l.jsx)(bn.icon,{fontSize:"small"})}),(0,l.jsx)(Sr.Z,{children:(0,l.jsxs)(X.Z,{variant:"body1",children:[bn.label," "]})}),(0,l.jsx)(Cs.Z,{children:(Br=Rr[bn.id])!==null&&Br!==void 0?Br:"-"})]},bn.id)})})})]},un.name))})},Tr=(0,Z.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ns=(0,l.jsx)($e.Z,{fontSize:"small"}),As=(0,l.jsx)(De.Z,{fontSize:"small"}),_r=()=>{const y=Tr(),{updateFilters:b}=Gt(),[P,D]=(0,k.useState)([]);function G(ie){b({orphan:ie?new Lt(ie):void 0})}function K(ie){b({error:ie?new kt(ie):void 0})}const ce=["Is Orphan","Has Error"];return(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(X.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(tt.ZP,{multiple:!0,options:ce,value:P,onChange:(ie,xe)=>{D(xe),G(xe.includes("Is Orphan")),K(xe.includes("Has Error"))},renderOption:(ie,{selected:xe})=>(0,l.jsx)(le.Z,{control:(0,l.jsx)(he.Z,{icon:Ns,checkedIcon:As,checked:xe}),label:ie}),size:"small",popupIcon:(0,l.jsx)(We.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ie=>(0,l.jsx)(be.Z,{...ie,className:y.input,variant:"outlined"})})]})})},Fs=({children:y,value:b})=>{var P;const[D,G]=useState((P=b==null?void 0:b.filters)!==null&&P!==void 0?P:{}),K=useCallback(bt=>{G(Et=>{const Xe=typeof bt=="function"?bt(Et):bt;return{...Et,...Xe}})},[]),ce=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var ie,xe,we,Pe,Te;const Ye=useMemo(()=>({entities:(ie=b==null?void 0:b.entities)!==null&&ie!==void 0?ie:ce.entities,backendEntities:(xe=b==null?void 0:b.backendEntities)!==null&&xe!==void 0?xe:ce.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:ce.queryParameters,error:b==null?void 0:b.error}),[b,ce,D,K]);return _jsx(EntityListContext.Provider,{value:Ye,children:y})}},33414:function(jt,Me,t){"use strict";t.r(Me),t.d(Me,{AboutCard:function(){return mt},AboutContent:function(){return Ee},AboutField:function(){return ee}});var h=t(52322),n=t(25271),g=t(93414),L=t(25248),V=t(32838),x=t(43297),l=t(79692),k=t(94339),ne=t(32552),q=t(61837),_=t(85256),F=t(24579),Q=t(52866),X=t(30254),ve=t(27604),de=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 ee(Ze){const{label:Ie,value:rt,gridSizes:lt,children:st}=Ze,ut=T(),ct=(0,L.vJ)(st,ht=>ht.getElements()),vt=ct.length>0?ct:(0,h.jsx)($.Z,{variant:"body2",className:ut.value,children:rt||"unknown"});return(0,h.jsxs)(I.Z,{item:!0,...lt,children:[(0,h.jsx)($.Z,{variant:"h2",className:ut.label,children:Ie}),vt]})}var je=t(24851);const He=(0,l.Z)({description:{wordBreak:"break-word"}});function Ne(Ze,Ie,rt){if(Ie==="url"||Ze.includes("://"))return Ze;const lt=rt.type==="file"?`file://${rt.target}`:rt.target;return Ie==="file"||rt.type==="file"?new URL(Ze,lt).href:lt}function Ee(Ze){var Ie,rt,lt,st,ut,ct,vt,ht;const{entity:Ge}=Ze,ae=He(),Re=Ge.kind.toLocaleLowerCase("en-US")==="system",ke=Ge.kind.toLocaleLowerCase("en-US")==="resource",ot=Ge.kind.toLocaleLowerCase("en-US")==="component",yt=Ge.kind.toLocaleLowerCase("en-US")==="api",At=Ge.kind.toLocaleLowerCase("en-US")==="template",pt=Ge.kind.toLocaleLowerCase("en-US")==="location",St=Ge.kind.toLocaleLowerCase("en-US")==="group",Lt=(0,x.hF)(Ge,n.cz,{kind:"system"}),kt=(0,x.hF)(Ge,n.cz,{kind:"component"}),en=(0,x.hF)(Ge,n.cz,{kind:"domain"}),rn=(0,x.hF)(Ge,n.S4);let Vt;try{Vt=(0,n.CV)(Ge)}catch{Vt=void 0}return(0,h.jsxs)(I.Z,{container:!0,children:[(0,h.jsx)(ee,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)($.Z,{variant:"body2",paragraph:!0,className:ae.description,children:(Ge==null||(Ie=Ge.metadata)===null||Ie===void 0?void 0:Ie.description)||"No description"})}),(0,h.jsx)(ee,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:rn.length>0&&(0,h.jsx)(x.rI,{entityRefs:rn,defaultKind:"group"})}),(Re||en.length>0)&&(0,h.jsx)(ee,{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"})}),(yt||ot||ke||Lt.length>0)&&(0,h.jsx)(ee,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Lt.length>0&&(0,h.jsx)(x.rI,{entityRefs:Lt,defaultKind:"system"})}),ot&&kt.length>0&&(0,h.jsx)(ee,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(x.rI,{entityRefs:kt,defaultKind:"component"})}),(yt||ot||ke||At||St||pt||typeof(Ge==null||(rt=Ge.spec)===null||rt===void 0?void 0:rt.type)=="string")&&(0,h.jsx)(ee,{label:"Type",value:Ge==null||(lt=Ge.spec)===null||lt===void 0?void 0:lt.type,gridSizes:{xs:12,sm:6,lg:4}}),(yt||ot||typeof(Ge==null||(st=Ge.spec)===null||st===void 0?void 0:st.lifecycle)=="string")&&(0,h.jsx)(ee,{label:"Lifecycle",value:Ge==null||(ut=Ge.spec)===null||ut===void 0?void 0:ut.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(ee,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ge==null||(ct=Ge.metadata)===null||ct===void 0?void 0:ct.tags)||[]).map(Wt=>(0,h.jsx)(E.Z,{size:"small",label:Wt},Wt))}),pt&&((Ge==null||(vt=Ge.spec)===null||vt===void 0?void 0:vt.targets)||(Ge==null||(ht=Ge.spec)===null||ht===void 0?void 0:ht.target))&&(0,h.jsx)(ee,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(je.s,{cols:1,items:(Ge.spec.targets||[Ge.spec.target]).map(Wt=>Wt).map(Wt=>{var hn;return{text:Wt,href:Ne(Wt,(Ge==null||(hn=Ge.spec)===null||hn===void 0?void 0:hn.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 mt(Ze){var Ie,rt,lt;const{variant:st}=Ze,ut=qe(),{entity:ct}=(0,x.X2)(),vt=(0,L.h_)(V.q3),ht=(0,L.h_)(x.Ah),Ge=(0,L.h_)(L.$v),ae=(0,L.tg)(A.jU),Re=(0,x.CV)(ct,vt),ke=(Ie=ct.metadata.annotations)===null||Ie===void 0?void 0:Ie[n.Tf],ot={label:"View Source",disabled:!Re,icon:(0,h.jsx)(V.nW,{type:Re==null?void 0:Re.integrationType}),href:Re==null?void 0:Re.locationTargetUrl},yt={label:"View TechDocs",disabled:!(!((rt=ct.metadata.annotations)===null||rt===void 0)&&rt["backstage.io/techdocs-ref"])||!ae,icon:(0,h.jsx)(X.Z,{}),href:ae&&ae({namespace:ct.metadata.namespace||n.zG,kind:ct.kind,name:ct.metadata.name})};let At="";st==="gridItem"?At=ut.gridItemCard:st==="fullHeight"&&(At=ut.fullHeightCard);let pt="";st==="gridItem"?pt=ut.gridItemCardContent:st==="fullHeight"&&(pt=ut.fullHeightCardContent);const St=(lt=ct.metadata.annotations)===null||lt===void 0?void 0:lt[n.P1],Lt=(St==null?void 0:St.startsWith("url:"))||(St==null?void 0:St.startsWith("file:")),kt=(0,de.useCallback)(async()=>{await ht.refreshEntity((0,n.eE)(ct)),Ge.post({message:"Refresh scheduled",severity:"info"})},[ht,Ge,ct]);return(0,h.jsxs)(k.Z,{className:At,children:[(0,h.jsx)(ne.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[Lt&&(0,h.jsx)(q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:kt,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:[ot,yt]})}),(0,h.jsx)(_.Z,{}),(0,h.jsx)(F.Z,{className:pt,children:(0,h.jsx)(Ee,{entity:ct})})]})}},79324:function(jt,Me,t){"use strict";t.d(Me,{K:function(){return Q}});var h=t(52322),n=t(2784),g=t(79692),L=t(12420),V=t(97580),x=t(73698),l=t(74603),k=t(12231),ne=t(43297),q=t(64279),_=t(25248);const F=(0,g.Z)(X=>(0,L.Z)({root:{...X.typography.h4}}));function Q(X){const{initialFilter:ve="component",allowedKinds:de}=X,A=F(),I=(0,_.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(rt=>rt.value).sort())||[]})),{filters:E,updateFilters:T,queryParameters:{kind:ee}}=(0,ne.wp)(),je=(0,n.useMemo)(()=>{var Ze;return(Ze=[ee].flat()[0])===null||Ze===void 0?void 0:Ze.toLocaleLowerCase("en-US")},[ee]),[He,Ne]=(0,n.useState)(je!=null?je:ve);(0,n.useEffect)(()=>{var Ze;if(!((Ze=E.kind)===null||Ze===void 0)&&Ze.value){var Ie;Ne((Ie=E.kind)===null||Ie===void 0?void 0:Ie.value)}},[E.kind]),(0,n.useEffect)(()=>{T({kind:He?new ne.zo(He):void 0})},[He,T]),(0,n.useEffect)(()=>{je&&Ne(je)},[je]);var Ee;const mt=[(0,V.Z)(He)].concat((Ee=$==null?void 0:$.filter(Ze=>de?de.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:He}),value:He,onChange:Ze=>Ne(Ze.target.value),classes:A,children:Object.keys(mt).map(Ze=>(0,h.jsx)(k.Z,{value:Ze,children:`${mt[Ze]}s`},Ze))})}},86359:function(jt,Me,t){"use strict";t.d(Me,{E:function(){return de}});var h=t(52322),n=t(25271),g=t(93414),L=t(43297),V=t(90436),x=t(15459),l=t(27604),k=t(2997),ne=t(11640),q=t(28347),_=t(76635),F=t(2784),Q=t(7089);const X=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,ee=T&&T[A]||(I==null?void 0:I.defaultValue);return(0,h.jsx)(h.Fragment,{children:ee&&(0,h.jsx)(Q.Z,{label:ee,size:"small",variant:"outlined"},ee)})},width:"auto"}}}),ve=(0,x.Z)({root:{color:"#f3ba37"}})(ne.Z),de=A=>{var I,$;const{columns:E,actions:T,tableOptions:ee,subtitle:je,emptyContent:He}=A,{isStarredEntity:Ne,toggleStarredEntity:Ee}=(0,L.CR)(),{loading:qe,error:mt,entities:Ze,filters:Ie}=(0,L.wp)(),rt=(0,F.useMemo)(()=>{var ae;return[X.createTitleColumn({hidden:!0}),X.createNameColumn({defaultKind:(ae=Ie.kind)===null||ae===void 0?void 0:ae.value}),...Re(),X.createMetadataDescriptionColumn(),X.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[X.createOwnerColumn()];case"group":case"template":return[X.createSpecTypeColumn()];case"location":return[X.createSpecTypeColumn(),X.createSpecTargetsColumn()];default:return[X.createSystemColumn(),X.createOwnerColumn(),X.createSpecTypeColumn(),X.createSpecLifecycleColumn()]}}},[(I=Ie.kind)===null||I===void 0?void 0:I.value]),lt=Ie.type===void 0;var st;const ut=(0,_.capitalize)((st=($=Ie.user)===null||$===void 0?void 0:$.value)!==null&&st!==void 0?st:"all");if(mt)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:mt.toString()})})});const ct=[({entity:ae})=>{var Re;const ke=(Re=ae.metadata.annotations)===null||Re===void 0?void 0:Re[n.l2],ot="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:ot}),(0,h.jsx)(k.Z,{fontSize:"small"})]}),tooltip:ot,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:ae})=>{var Re;const ke=(Re=ae.metadata.annotations)===null||Re===void 0?void 0:Re[n.Tf],ot="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:ot}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:ot,disabled:!ke,onClick:()=>{!ke||window.open(ke,"_blank")}}},({entity:ae})=>{const Re=Ne(ae),ke=Re?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(V.Z,{variant:"srOnly",children:ke}),Re?(0,h.jsx)(ve,{}):(0,h.jsx)(q.Z,{})]}),tooltip:ke,onClick:()=>Ee(ae)}}],vt=Ze.map(ae=>{const Re=(0,L.hF)(ae,n.cz,{kind:"system"}),ke=(0,L.hF)(ae,n.S4);return{entity:ae,resolved:{name:(0,L.$3)(ae,{defaultKind:"Component"}),ownedByRelationsTitle:ke.map(ot=>(0,L.$3)(ot,{defaultKind:"group"})).join(", "),ownedByRelations:ke,partOfSystemRelationTitle:Re.map(ot=>(0,L.$3)(ot,{defaultKind:"system"})).join(", "),partOfSystemRelations:Re}}}),ht=(E||rt).find(ae=>ae.title==="Type");ht&&(ht.hidden=!lt);const Ge=vt.length>20;return(0,h.jsx)(g.iA,{isLoading:qe,columns:E||rt,options:{paging:Ge,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!qe,padding:"dense",pageSizeOptions:[20,50,100],...ee},title:`${ut} (${Ze.length})`,data:vt,actions:T||ct,subtitle:je,emptyContent:He})};de.columns=X},24851:function(jt,Me,t){"use strict";t.d(Me,{s:function(){return ve}});var h=t(52322),n=t(90348),g=t(11861),L=t(2784),V=t(79692),x=t(95544),l=t(90436),k=t(52160),ne=t(93414);const q=(0,V.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function _(de){const{href:A,text:I,Icon:$}=de,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 X(de){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 de=="number")I=de;else{var $;const T=($=A.find(ee=>ee!==null))!==null&&$!==void 0?$:"xs";var E;I=(E=de==null?void 0:de[T])!==null&&E!==void 0?E:Q[T]}return I}function ve(de){const{items:A,cols:I=void 0}=de,$=X(I);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:$,children:A.map(({text:E,href:T,Icon:ee},je)=>(0,h.jsx)(g.Z,{children:(0,h.jsx)(_,{href:T,text:E!=null?E:T,Icon:ee})},je))})}},19625:function(jt,Me,t){"use strict";t.d(Me,{_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(jt,Me,t){"use strict";t.d(Me,{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 V(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,ee)=>await E.authorize(T,ee),authorizeConditional(T,ee){const je=T;return E.authorize(je,ee)}}}function ne({name:E,attributes:T,resourceType:ee}){return ee?{type:"resource",name:E,attributes:T,resourceType:ee}:{type:"basic",name:E,attributes:T}}var q=t(23054),_=t(96279),F=t.n(_),Q=t(9571),X=t(30195);const ve=X.z.lazy(()=>X.z.object({rule:X.z.string(),resourceType:X.z.string(),params:X.z.record(X.z.any()).optional()}).or(X.z.object({anyOf:X.z.array(ve).nonempty()})).or(X.z.object({allOf:X.z.array(ve).nonempty()})).or(X.z.object({not:ve}))),de=X.z.object({result:X.z.literal(h.ALLOW).or(X.z.literal(h.DENY))}),A=X.z.union([X.z.object({result:X.z.literal(h.ALLOW).or(X.z.literal(h.DENY))}),X.z.object({result:X.z.literal(h.CONDITIONAL),pluginId:X.z.string(),resourceType:X.z.string(),conditions:ve})]),I=(E,T)=>X.z.object({items:X.z.array(X.z.intersection(X.z.object({id:X.z.string()}),E)).refine(ee=>ee.length===T.size&&ee.every(({id:je})=>T.has(je)),{message:"Items in response do not match request"})});class ${async authorize(T,ee){return this.makeRequest(T,de,ee)}async authorizeConditional(T,ee){return this.makeRequest(T,A,ee)}async makeRequest(T,ee,je){if(!this.enabled)return T.map(Ie=>({result:h.ALLOW}));const He={items:T.map(Ie=>({id:Q.Z(),...Ie}))},Ne=await this.discovery.getBaseUrl("permission"),Ee=await F()(`${Ne}/authorize`,{method:"POST",body:JSON.stringify(He),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(ee,new Set(He.items.map(({id:Ie})=>Ie))).parse(qe).items.reduce((Ie,rt)=>(Ie[rt.id]=rt,Ie),{});return He.items.map(Ie=>Ze[Ie.id])}getAuthorizationHeader(T){return T?{Authorization:`Bearer ${T}`}:{}}constructor(T){this.discovery=T.discovery;var ee;this.enabled=(ee=T.config.getOptionalBoolean("permission.enabled"))!==null&&ee!==void 0?ee:!1}}},25488:function(jt,Me,t){"use strict";t.d(Me,{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 V=t(51666);class x{static create(F){const{config:Q,discovery:X,identity:ve}=F,de=new V.Y2({discovery:X,config:Q});return new x(de,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(_){const F=(0,g.h_)(L),{data:Q,error:X}=(0,l.ZP)(_,async ve=>{if((0,V.g2)(ve.permission)&&!ve.resourceRef)return V.rG.DENY;const{result:de}=await F.authorize(ve);return de});return X?{error:X,loading:!1,allowed:!1}:Q===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:Q===V.rG.ALLOW}}const ne=_=>{const{permission:F,resourceRef:Q,errorComponent:X,...ve}=_,de=usePermission(isResourcePermission(F)?{permission:F,resourceRef:Q}:{permission:F}),A=useApp(),{NotFoundErrorPage:I}=A.getComponents();let $=X===void 0?_jsx(I,{}):X;return de.loading?$=null:de.allowed&&($=_.element),_jsx(Route,{...ve,element:$})};function q(_){const{permission:F,resourceRef:Q}=_,X=usePermission(isResourcePermission(F)?{permission:F,resourceRef:Q}:{permission:F}),ve=useApp();if(X.loading)return null;if(X.allowed)return _jsx(_Fragment,{children:_.children});if(_.errorPage)return _jsx(_Fragment,{children:_.errorPage});const{NotFoundErrorPage:de}=ve.getComponents();return _jsx(de,{})}},65826:function(jt,Me,t){"use strict";t.d(Me,{FA:function(){return k},qO:function(){return st},Nd:function(){return Ne},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),V=t(2784),x=t(79692);const l=(0,x.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),k=({text:M,preTag:Z,postTag:le})=>{const he=l(),be=(0,V.useMemo)(()=>M.split(new RegExp(`(${Z}.+?${le})`)),[le,Z,M]);return(0,L.jsx)(L.Fragment,{children:be.map((De,$e)=>De.includes(Z)?(0,L.jsx)("mark",{className:he.highlight,children:De.replace(new RegExp(`${Z}|${le}`,"g"),"")},$e):De)})};var ne=t(48760),q=t(50581),_=t(61837),F=t(74603),Q=t(21853),X=t(33375),ve=t(76635),de=t(64279),A=t(1849),I=t(51837);const $=(0,I.CT)("search-context"),E=()=>{const M=(0,V.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,V.useContext)($)!==void 0,ee={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},je=(M=ee)=>{var Z,le,he,be;const De=(0,h.h_)(n),[$e,We]=(0,V.useState)(M.term),[tt,S]=(0,V.useState)(M.types),[H,me]=(0,V.useState)(M.filters),[ue,Ce]=(0,V.useState)(M.pageLimit),[Oe,Ue]=(0,V.useState)(M.pageCursor),nt=(0,A.Z)($e),ft=(0,A.Z)(H),dt=(0,de.default)(()=>De.query({term:$e,types:tt,filters:H,pageLimit:ue,pageCursor:Oe}),[$e,tt,H,ue,Oe]),_e=!dt.loading&&!dt.error&&((Z=dt.value)===null||Z===void 0?void 0:Z.nextPageCursor),at=!dt.loading&&!dt.error&&((le=dt.value)===null||le===void 0?void 0:le.previousPageCursor),wt=(0,V.useCallback)(()=>{var Ut;Ue((Ut=dt.value)===null||Ut===void 0?void 0:Ut.nextPageCursor)},[(he=dt.value)===null||he===void 0?void 0:he.nextPageCursor]),Tt=(0,V.useCallback)(()=>{var Ut;Ue((Ut=dt.value)===null||Ut===void 0?void 0:Ut.previousPageCursor)},[(be=dt.value)===null||be===void 0?void 0:be.previousPageCursor]);return(0,V.useEffect)(()=>{nt!==void 0&&$e!==nt&&Ue(void 0)},[$e,nt,Ue]),(0,V.useEffect)(()=>{ft!==void 0&&!(0,ve.isEqual)(H,ft)&&Ue(void 0)},[H,ft,Ue]),{result:dt,term:$e,setTerm:We,types:tt,setTypes:S,filters:H,setFilters:me,pageLimit:ue,setPageLimit:Ce,pageCursor:Oe,setPageCursor:Ue,fetchNextPage:_e?wt:void 0,fetchPreviousPage:at?Tt:void 0}},He=M=>{const{initialState:Z,children:le}=M,he=je(Z);return(0,L.jsx)(h.fC,{attributes:{searchTypes:he.types.sort().join(",")},children:(0,L.jsx)($.Provider,{value:(0,I.EI)({1:he}),children:le})})},Ne=M=>{const{initialState:Z,inheritParentContextIfAvailable:le,children:he}=M;return T()&&le?(0,L.jsx)(L.Fragment,{children:he}):(0,L.jsx)(He,{initialState:Z,children:he})},Ee=({children:M})=>{const Z=(0,h.z$)(),{term:le}=E();return(0,V.useEffect)(()=>{le&&Z.captureEvent("search",le)},[Z,le]),(0,L.jsx)(L.Fragment,{children:M})};function qe(M){return(0,V.forwardRef)((Z,le)=>(0,L.jsx)(Ne,{inheritParentContextIfAvailable:!0,children:(0,L.jsx)(M,{...Z,ref:le})}))}const mt=qe((0,V.forwardRef)((M,Z)=>{const{onChange:le,onKeyDown:he=()=>{},onClear:be=()=>{},onSubmit:De=()=>{},debounceTime:$e=200,clearButton:We=!0,fullWidth:tt=!0,value:S,placeholder:H,inputProps:me={},endAdornment:ue,...Ce}=M,Oe=(0,h.h_)(h.Ds),[Ue,nt]=(0,V.useState)("");(0,V.useEffect)(()=>{nt(It=>It!==S?String(S):It)},[S]),(0,ne.Z)(()=>le(Ue),$e,[Ue]);const ft=(0,V.useCallback)(It=>{nt(It.target.value)},[nt]),dt=(0,V.useCallback)(It=>{he&&he(It),De&&It.key==="Enter"&&De()},[he,De]),_e=(0,V.useCallback)(()=>{le(""),be&&be()},[le,be]),at=H!=null?H:`Search in ${Oe.getOptionalString("app.title")||"Backstage"}`,wt=(0,L.jsx)(q.Z,{position:"start",children:(0,L.jsx)(_.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)(_.Z,{"aria-label":"Clear",size:"small",onClick:_e,children:(0,L.jsx)(X.Z,{})})});return(0,L.jsx)(Ee,{children:(0,L.jsx)(F.Z,{"data-testid":"search-bar-next",ref:Z,value:Ue,placeholder:at,startAdornment:wt,endAdornment:We?Tt:ue,inputProps:{"aria-label":"Search",...me},fullWidth:tt,onChange:ft,onKeyDown:dt,...Ce})})})),Ze=qe((0,V.forwardRef)((M,Z)=>{const{value:le="",onChange:he,...be}=M,{term:De,setTerm:$e}=E();(0,V.useEffect)(()=>{le&&$e(String(le))},[le,$e]);const We=(0,V.useCallback)(tt=>{he?he(tt):$e(tt)},[he,$e]);return(0,L.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,L.jsx)(mt,{...be,ref:Z,value:De,onChange:We})})}));var Ie=t(4614),rt=t(88013);const st=(M=>Z=>(0,L.jsx)(Ne,{inheritParentContextIfAvailable:!0,children:(0,L.jsx)(M,{...Z})}))(function(Z){const{loading:le,value:he,onChange:be=()=>{},options:De=[],getOptionLabel:$e=_e=>String(_e),inputPlaceholder:We,inputDebounceTime:tt,freeSolo:S=!0,fullWidth:H=!0,clearOnBlur:me=!1,"data-testid":ue="search-autocomplete",...Ce}=Z,{setTerm:Oe}=E(),Ue=(0,V.useCallback)(_e=>_e?typeof _e=="string"?_e:$e(_e):"",[$e]),nt=(0,V.useMemo)(()=>Ue(he),[he,Ue]),ft=(0,V.useCallback)((_e,at,wt,Tt)=>{Oe(Ue(at)),be(_e,at,wt,Tt)},[Ue,Oe,be]),dt=(0,V.useCallback)(({InputProps:{ref:_e,endAdornment:at},InputLabelProps:wt,...Tt})=>(0,L.jsx)(Ze,{...Tt,ref:_e,clearButton:!1,value:nt,placeholder:We,debounceTime:tt,endAdornment:le?(0,L.jsx)(Ie.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):at}),[le,nt,We,tt]);return(0,L.jsx)(rt.ZP,{...Ce,"data-testid":ue,value:he,onChange:ft,options:De,getOptionLabel:$e,renderInput:dt,freeSolo:S,fullWidth:H,clearOnBlur:me})}),ut=({icon:M,primaryText:Z,primaryTextTypographyProps:le,secondaryText:he,secondaryTextTypographyProps:be,disableTextTypography:De})=>_jsxs(_Fragment,{children:[M?_jsx(ListItemIcon,{children:M}):null,_jsx(ListItemText,{primary:Z,primaryTypographyProps:le,secondary:he,secondaryTypographyProps:be,disableTypography:De})]});var ct=t(42494),vt=t(84899),ht=t(5806),Ge=t(21324),ae=t(56939),Re=t(73698),ke=t(12231),ot=t(86619),yt=t(7089),At=t(69294);const pt=(M,Z,le=[],he=250)=>{const be=(0,V.useRef)({}),De=M||(()=>Promise.resolve([])),[$e,We]=(0,At.default)(De,[Z],{loading:!0});if((0,ne.Z)(()=>{be.current[Z]===void 0&&(be.current[Z]=We(Z).then(S=>(be.current[Z]=S,S)))},he,[We,Z]),le.length)return{loading:!1,value:le};const tt=be.current[Z];return Array.isArray(tt)?{loading:!1,value:tt}:$e},St=(M,Z)=>{const{setFilters:le}=E();(0,V.useEffect)(()=>{Z&&[Z].flat().length>0&&le(he=>({...he,[M]:Z}))},[])},Lt=M=>{const{className:Z,defaultValue:le,name:he,values:be,valuesDebounceMs:De,label:$e,filterSelectedOptions:We,limitTags:tt,multiple:S}=M,[H,me]=(0,V.useState)("");St(he,le);const ue=typeof be=="function"?be:void 0,Ce=typeof be=="function"?void 0:be,{value:Oe,loading:Ue}=pt(ue,H,Ce,De),{filters:nt,setFilters:ft}=E(),dt=nt[he]||(S?[]:null),_e=(Tt,It)=>{ft(Ut=>{const{[he]:Zn,...Wn}=Ut;return It?{...Wn,[he]:It}:{...Wn}})},at=Tt=>(0,L.jsx)(ot.Z,{...Tt,name:"search",variant:"outlined",label:$e,fullWidth:!0}),wt=(Tt,It)=>Tt.map((Ut,Zn)=>(0,L.jsx)(yt.Z,{label:Ut,color:"primary",...It({index:Zn})}));return(0,L.jsx)(rt.ZP,{filterSelectedOptions:We,limitTags:tt,multiple:S,className:Z,id:`${S?"multi-":""}select-filter-${he}--select`,options:Oe||[],loading:Ue,value:dt,onChange:_e,onInputChange:(Tt,It)=>me(It),renderInput:at,renderTags:wt})},kt=(0,x.Z)({label:{textTransform:"capitalize"}}),en=M=>{const{className:Z,defaultValue:le,label:he,name:be,values:De=[],valuesDebounceMs:$e}=M,We=kt(),{filters:tt,setFilters:S}=E();St(be,le);const H=typeof De=="function"?De:void 0,me=typeof De=="function"?void 0:De,{value:ue=[],loading:Ce}=pt(H,"",me,$e),Oe=nt=>{const{target:{value:ft,checked:dt}}=nt;S(_e=>{const{[be]:at,...wt}=_e,Tt=(at||[]).filter(Ut=>Ut!==ft),It=dt?[...Tt,ft]:Tt;return It.length?{...wt,[be]:It}:wt})};var Ue;return(0,L.jsxs)(ct.Z,{className:Z,disabled:Ce,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[he?(0,L.jsx)(vt.Z,{className:We.label,children:he}):null,ue.map(nt=>(0,L.jsx)(ht.Z,{control:(0,L.jsx)(Ge.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":nt},value:nt,name:nt,onChange:Oe,checked:((Ue=tt[be])!==null&&Ue!==void 0?Ue:[]).includes(nt)}),label:nt},nt))]})},rn=M=>{const{className:Z,defaultValue:le,label:he,name:be,values:De,valuesDebounceMs:$e}=M,We=kt();St(be,le);const tt=typeof De=="function"?De:void 0,S=typeof De=="function"?void 0:De,{value:H=[],loading:me}=pt(tt,"",S,$e),{filters:ue,setFilters:Ce}=E(),Oe=Ue=>{const{target:{value:nt}}=Ue;Ce(ft=>{const{[be]:dt,..._e}=ft;return nt?{..._e,[be]:nt}:_e})};return(0,L.jsxs)(ct.Z,{disabled:me,className:Z,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[he?(0,L.jsx)(ae.Z,{className:We.label,margin:"dense",children:he}):null,(0,L.jsxs)(Re.Z,{variant:"outlined",value:ue[be]||"",onChange:Oe,children:[(0,L.jsx)(ke.Z,{value:"",children:(0,L.jsx)("em",{children:"All"})}),H.map(Ue=>(0,L.jsx)(ke.Z,{value:Ue,children:Ue},Ue))]})]})},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:rn}),Vt.Autocomplete=M=>(0,L.jsx)(Vt,{...M,component:Lt});var Wt=t(93414);const hn=M=>{const{children:Z}=M,he=useSearch().result;return Z(he)},_t=M=>{const{query:Z,children:le}=M,he=useApi(searchApiRef),be=useAsync(()=>{const{term:De="",types:$e=[],filters:We={},...tt}=Z;return he.query({...tt,term:De,types:$e,filters:We})},[Z]);return le(be)},kn=M=>{const{query:Z,children:le}=M;return Z?_jsx(_t,{query:Z,children:le}):_jsx(hn,{children:le})},ln=M=>{const{query:Z,children:le}=M;return _jsx(kn,{query:Z,children:({loading:he,error:be,value:De})=>he?_jsx(Progress,{}):be?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:be}):De!=null&&De.results.length?le(De):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},On=M=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(ln,{...M})}),pn=(0,x.Z)(M=>({root:{display:"flex",justifyContent:"space-between",gap:M.spacing(2),margin:M.spacing(2,0)}})),Hn=()=>{const{fetchNextPage:M,fetchPreviousPage:Z}=useSearch(),le=pn();return!M&&!Z?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:le.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 Cn=M=>Ht.from(M.toString(),"utf-8").toString("base64"),$n=M=>M?Number(Ht.from(M,"base64").toString("utf-8")):0,Gt=M=>{const{total:Z=-1,cursor:le,onCursorChange:he,limit:be=25,limitLabel:De="Results per page:",limitText:$e=({from:Ce,to:Oe})=>Z>0?`of ${Z}`:`${Ce}-${Oe}`,limitOptions:We,onLimitChange:tt,...S}=M,H=useMemo(()=>$n(le),[le]),me=useCallback((Ce,Oe)=>{he==null||he(Cn(Oe))},[he]),ue=useCallback(Ce=>{const Oe=Ce.target.value;tt==null||tt(parseInt(Oe,10))},[tt]);return _jsx(TablePagination,{...S,component:"div",count:Z,page:H,onPageChange:me,rowsPerPage:be,labelRowsPerPage:De,labelDisplayedRows:$e,rowsPerPageOptions:We,onRowsPerPageChange:ue})},fn=M=>{const{pageLimit:Z,setPageLimit:le,pageCursor:he,setPageCursor:be}=useSearch();return _jsx(Gt,{...M,limit:Z,onLimitChange:le,cursor:he,onCursorChange:be})},cn=({result:M,highlight:Z,rank:le,icon:he,secondaryAction:be,lineClamp:De=5})=>{const $e=useAnalytics(),We=()=>{$e.captureEvent("discover",M.title,{attributes:{to:M.location},value:le})};return _jsxs(Link,{noTrack:!0,to:M.location,onClick:We,children:[_jsxs(ListItem,{alignItems:"center",children:[he&&_jsx(ListItemIcon,{children:he}),_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})}),be&&_jsx(Box,{alignItems:"flex-end",children:be})]}),_jsx(Divider,{})]})},wn=M=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(cn,{...M})}),Bn=M=>{const{loading:Z,error:le,resultItems:he,renderResultItem:be=We=>_jsx(DefaultResultListItem,{result:We.document},We.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&&le?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:le}):null,!Z&&!le&&(he==null?void 0:he.length)?he.map(be):null,!Z&&!le&&!(he!=null&&he.length)?_jsx(ListItem,{children:De}):null]})},yn=M=>{const{query:Z,disableRenderingWithNoResults:le,...he}=M;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Z,children:({loading:be,error:De,value:$e})=>{var We;return!(!($e==null||(We=$e.results)===null||We===void 0)&&We.length)&&le?null:_jsx(Bn,{...he,loading:be,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:le,children:he,...be}=M;return _jsx(Chip,{...be,className:Z.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[le,": ",he]})})},Fe=()=>null,Qe=(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"}}}})),xt=M=>{const Z=Qe(),{label:le,value:he="None",onChange:be,onDelete:De}=M,$e=useCallback(We=>{be(We.target.value)},[be]);return _jsx(Ae,{label:le,onDelete:De,children:_jsx(Typography,{role:"textbox",component:"span",className:Z.root,onChange:$e,contentEditable:!0,suppressContentEditableWarning:!0,children:he})})},oe=(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}}})),R=M=>{const Z=oe(),{label:le,value:he="none",onChange:be,onDelete:De,children:$e}=M,We=useCallback(tt=>{be(tt.target.value)},[be]);return _jsx(Ae,{label:le,onDelete:De,children:_jsxs(Select,{className:Z.root,value:he,onChange:We,input:_jsx(InputBase,{}),IconComponent:Fe,children:[_jsx(MenuItem,{value:"none",children:"None"}),$e]})})};function J(M){const Z=te(),[le,he]=useState(null),{loading:be,error:De,icon:$e,title:We,titleProps:tt={},link:S=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Z.listSubheaderLinkIcon})]}),linkProps:H={},filterOptions:me,renderFilterOption:ue=Tt=>_jsx(MenuItem,{value:String(Tt),children:Tt},String(Tt)),filterFields:Ce,renderFilterField:Oe,resultItems:Ue,renderResultItem:nt=Tt=>_jsx(DefaultResultListItem,{result:Tt.document},Tt.document.location),noResultsComponent:ft=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...dt}=M,_e=useCallback(Tt=>{he(Tt.currentTarget)},[]),at=useCallback(()=>{he(null)},[]);var wt;return _jsxs(List,{...dt,children:[_jsxs(ListSubheader,{className:Z.listSubheader,children:[$e,_jsx(Typography,{className:Z.listSubheaderName,component:"strong",...tt,children:We}),me?_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,me?_jsx(Menu,{id:"filters-menu",anchorEl:le,open:Boolean(le),onClose:at,onClick:at,keepMounted:!0,children:me.map(ue)}):null,Ce==null?void 0:Ce.map(Tt=>(wt=Oe==null?void 0:Oe(Tt))!==null&&wt!==void 0?wt:null),_jsx(Link,{className:Z.listSubheaderLink,to:"/search",...H,children:S})]}),be?_jsx(Progress,{}):null,!be&&De?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:De}):null,!be&&!De&&(Ue==null?void 0:Ue.length)?Ue.map(nt):null,!be&&!De&&!(Ue!=null&&Ue.length)?_jsx(ListItem,{children:ft}):null]})}function Ke(M){const{query:Z,linkProps:le={},disableRenderingWithNoResults:he,...be}=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:We,value:tt})=>{var S;if(!(!(tt==null||(S=tt.results)===null||S===void 0)&&S.length)&&he)return null;var H;return _jsx(J,{...be,loading:$e,error:We,linkProps:{to:De,...le},resultItems:tt==null?void 0:tt.results,filterFields:Object.keys((H=Z.filters)!==null&&H!==void 0?H:{})})}})})}},61886:function(jt,Me,t){"use strict";t.d(Me,{Ox:function(){return Ie},Zz:function(){return x},oZ:function(){return Ne},DR:function(){return l},ZS:function(){return je},VA:function(){return st},KY:function(){return ne},gT:function(){return X},Dl:function(){return ve},ux:function(){return lt},$L:function(){return Q},x1:function(){return He}});var h=t(52322),n=t(2784),g=t(10289),L=t(25248);const V="techdocs.addons.addon.v1",x="techdocs.addons.wrapper.v1",l=()=>null;(0,L.R5)(l,x,!0);const k=ae=>`${V}.${ae.toLocaleLowerCase("en-US")}`;function ne(ae){const{name:Re,component:ke}=ae;return(0,L.YO)({name:Re,component:{sync:ot=>(0,h.jsx)(ke,{...ot})},data:{[V]:ae,[k(Re)]:!0}})}const q=(ae,Re)=>ae.selectByComponentData({key:Re}).getElements()[0],_=ae=>ae.selectByComponentData({key:x}).selectByComponentData({key:V}),F=ae=>ae.selectByComponentData({key:x}).findComponentData({key:V}),Q=()=>{const ae=(0,g.pC)(),Re=(0,L.vJ)(ae,_),ke=(0,L.vJ)(ae,F),ot=(0,n.useCallback)(pt=>{if(!Re||!pt)return null;const St=k(pt.name);var Lt;return(Lt=q(Re,St))!==null&&Lt!==void 0?Lt:null},[Re]),yt=(0,n.useCallback)(pt=>{const St=ke.find(Lt=>Lt.name===pt);return St?ot(St):null},[ke,ot]),At=(0,n.useCallback)(pt=>{const St=ke.filter(Lt=>Lt.location===pt);return St.length?St.map(ot):null},[ke,ot]);return{renderComponentByName:yt,renderComponentsByLocation:At}},X=(0,L.T0)({id:"plugin.techdocs.service"}),ve=(0,L.T0)({id:"plugin.techdocs.storageservice"});var de=t(64279),A=t(25271),I=t(51837);function $(ae,Re){return Re.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ae.kind=ae.kind.toLocaleLowerCase(),ae.name=ae.name.toLocaleLowerCase(),ae.namespace=ae.namespace.toLocaleLowerCase()),ae}const E=(ae,Re)=>(0,A.eE)(ae)===(0,A.eE)(Re),T={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},ee=(0,I.CT)("techdocs-reader-page-context"),je=(0,n.memo)(({entityRef:ae,children:Re})=>{const ke=(0,L.h_)(X),ot=(0,L.h_)(L.Ds),yt=(0,de.default)(async()=>ke.getTechDocsMetadata(ae),[ae]),At=(0,de.default)(async()=>ke.getEntityMetadata(ae),[ae]),[pt,St]=(0,n.useState)(T.title),[Lt,kt]=(0,n.useState)(T.subtitle),[en,rn]=(0,n.useState)(T.shadowRoot),Vt={metadata:yt,entityRef:$(ae,ot),entityMetadata:At,shadowRoot:en,setShadowRoot:rn,title:pt,setTitle:St,subtitle:Lt,setSubtitle:kt},Wt=(0,I.EI)({1:Vt});return(0,h.jsx)(ee.Provider,{value:Wt,children:Re instanceof Function?Re(Vt):Re})},(ae,Re)=>E(ae.entityRef,Re.entityRef)),He=()=>{const ae=(0,n.useContext)(ee);if(ae===void 0)return T;const Re=ae.atVersion(1);if(Re===void 0)throw new Error("No context found for version 1.");return Re},Ne=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Ee=t(70882),qe=t(50236),mt=t(19219),Ze=t(93414);const Ie="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",rt=ae=>{(0,n.useEffect)(()=>{if(!ae)return()=>{};const Re=ae.querySelectorAll('head > link[rel="stylesheet"]');var ke;let ot=(ke=Re==null?void 0:Re.length)!==null&&ke!==void 0?ke:0;const yt=new CustomEvent(Ie);if(!ot)return ae.dispatchEvent(yt),()=>{};const At=()=>{--ot===0&&ae.dispatchEvent(yt)};return Re==null||Re.forEach(pt=>{pt.addEventListener("load",At)}),()=>{Re==null||Re.forEach(pt=>{pt.removeEventListener("load",At)})}},[ae])},lt=ae=>{const[Re,ke]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!ae)return()=>{};ke(!0);const ot=ae.style;ot.setProperty("opacity","0");const yt=()=>{ke(!1),ot.setProperty("opacity","1")};return ae.addEventListener(Ie,yt),()=>{ae.removeEventListener(Ie,yt)}},[ae]),Re},st=({element:ae,onAppend:Re,children:ke})=>{const[ot,yt]=(0,n.useState)((0,Ee.Ue)({...(0,qe.Z)(),insertionPoint:void 0}));rt(ae);const At=lt(ae),pt=(0,n.useCallback)(St=>{if(!ae||!St)return;yt((0,Ee.Ue)({...(0,qe.Z)(),insertionPoint:ae.querySelector("head")||void 0}));let Lt=St.shadowRoot;Lt||(Lt=St.attachShadow({mode:"open"})),Lt.replaceChildren(ae),typeof Re=="function"&&Re(Lt)},[ae,Re]);return(0,h.jsxs)(h.Fragment,{children:[At&&(0,h.jsx)(Ze.Ex,{}),(0,h.jsxs)(mt.ZP,{jss:ot,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:pt,"data-testid":"techdocs-native-shadowroot"}),ke]})]})};var ut=t(54073);const ct=()=>{const{shadowRoot:ae}=useTechDocsReaderPage();return ae},vt=ae=>{const Re=ct();return Re?ae.map(ke=>Re==null?void 0:Re.querySelectorAll(ke)).filter(ke=>ke.length).map(ke=>Array.from(ke)).flat():[]},ht=ae=>ae.toString()&&ae.rangeCount&&ae.getRangeAt(0).getBoundingClientRect().top,Ge=(ae=0)=>{const Re=ct(),[ke,ot]=useState(null),yt=useMemo(()=>debounce(()=>{const At=Re,pt=At.getSelection?At.getSelection():document.getSelection();pt&&ht(pt)?ot(pt):ot(null)},ae),[Re,ot,ae]);return useEffect(()=>(window.document.addEventListener("selectionchange",yt),()=>window.document.removeEventListener("selectionchange",yt)),[yt]),ke}},52943:function(jt,Me,t){"use strict";t.r(Me),t.d(Me,{EmbeddedDocsRouter:function(){return de},Router:function(){return ve},isTechDocsAvailable:function(){return X}});var h=t(52322),n=t(2784),g=t(10289),L=t(43297),V=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 _=t(18662),F=t(7476);const Q="backstage.io/techdocs-ref",X=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)(_.TechDocsIndexPage,{})}),(0,h.jsx)(g.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(F.TechDocsReaderPage,{})})]}),de=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)(V.sk,{annotation:Q})}},92077:function(jt,Me,t){"use strict";t.d(Me,{k:function(){return V},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 V{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:_}=l,Q=`${await this.getStorageUrl()}/${q}/${ne}/${_}/${k}`,X=await this.fetchApi.fetch(`${Q.endsWith("/")?Q:`${Q}/`}index.html`);let ve="";switch(X.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 X.text()}async syncEntityDocs(l,k=()=>{}){const{kind:ne,namespace:q,name:_}=l,Q=`${await this.getApiOrigin()}/sync/${q}/${ne}/${_}`,{token:X}=await this.identityApi.getCredentials();return new Promise((ve,de)=>{const A=new n.EventSourcePolyfill(Q,{withCredentials:!0,headers:X?{Authorization:`Bearer ${X}`}:{}});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:de(new h.dR(I.message));return;default:de(new Error(I.data));return}}})}async getBaseUrl(l,k,ne){const{kind:q,namespace:_,name:F}=k,X=`${await this.getApiOrigin()}/static/docs/${_}/${q}/${F}/${ne}`;return new URL(l,X.endsWith("/")?X:`${X}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(jt,Me,t){"use strict";t.d(Me,{D:function(){return h}});function h(n,g){return g.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(jt,Me,t){"use strict";t.d(Me,{u:function(){return k}});var h=t(52322),n=t(2784),g=t(93414),L=t(43297),V=t(42081),x=t(48431),l=t(68435);const k=ne=>{const{initialFilter:q="owned",columns:_,actions:F}=ne;return(0,h.jsx)(V.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:_})})]})})]})})}},85478:function(jt,Me,t){"use strict";t.d(Me,{f:function(){return _}});var h=t(52322),n=t(95573),g=t(51953),L=t(25248),V=t(93414),x=t(94339),l=t(16111),k=t(24579),ne=t(14503),q=t(2784);const _=de=>{const{entities:A}=de,I=(0,L.tg)(n.Fw),$=(0,L.h_)(L.Ds);if(!A)return null;var E,T;return(0,h.jsx)(V.Oh,{"data-testid":"docs-explore",children:A!=null&&A.length?A.map((ee,je)=>(0,h.jsxs)(x.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(V.hu,{title:(E=ee.metadata.title)!==null&&E!==void 0?E:ee.metadata.name})}),(0,h.jsx)(k.Z,{children:ee.metadata.description}),(0,h.jsx)(ne.Z,{children:(0,h.jsx)(V.zx,{to:I({namespace:(0,g.D)((T=ee.metadata.namespace)!==null&&T!==void 0?T:"default",$),kind:(0,g.D)(ee.kind,$),name:(0,g.D)(ee.metadata.name,$)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},je)):null})};var F=t(43297);const Q={title:"All Documentation",filterPredicate:()=>!0},X=({entities:de,group:A})=>{const{loading:I,isOwnedEntity:$}=useEntityOwnership(),E=de.filter(ee=>A.filterPredicate==="ownedByUser"?I?!1:$(ee):typeof A.filterPredicate=="function"&&A.filterPredicate(ee)),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:de})=>{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((ee,je)=>((E=ee.metadata.title)!==null&&E!==void 0?E:ee.metadata.name).localeCompare((T=je.metadata.title)!==null&&T!==void 0?T:je.metadata.name)),_jsx(Content,{children:(de||[Q]).map((ee,je)=>_jsx(X,{entities:$,group:ee},`${ee.title}-${je}`))})}},68435:function(jt,Me,t){"use strict";t.d(Me,{H:function(){return $},n:function(){return E}});var h=t(52322),n=t(2784),g=t(95074),L=t(76635),V=t(93414),x=t(43297),l=t(25248),k=t(25271),ne=t(95573),q=t(39981),_=t(2337),F=t(11640),Q=t(28347);const X=(0,_.Z)({root:{color:"#f3ba37"}})(F.Z),ve={createCopyDocsUrlAction(T){return ee=>({icon:()=>(0,h.jsx)(q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${ee.resolved.docsUrl}`)})},createStarEntityAction(T,ee){return({entity:je})=>{const He=T(je);return{cellStyle:{paddingLeft:"1em"},icon:()=>He?(0,h.jsx)(X,{}):(0,h.jsx)(Q.Z,{}),tooltip:He?"Remove from favorites":"Add to favorites",onClick:()=>ee(je)}}}};function de(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)(V.uw,{value:(0,h.jsx)(V.rU,{to:T.resolved.docsUrl,children:de(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:ee,title:je,loading:He,columns:Ne,actions:Ee}=T,[,qe]=(0,g.Z)(),mt=(0,l.tg)(ne.Fw),Ze=(0,l.h_)(l.Ds);if(!ee)return null;const Ie=ee.map(st=>{const ut=(0,x.hF)(st,k.S4);var ct;return{entity:st,resolved:{docsUrl:mt({namespace:(0,I.D)((ct=st.metadata.namespace)!==null&&ct!==void 0?ct:"default",Ze),kind:(0,I.D)(st.kind,Ze),name:(0,I.D)(st.metadata.name,Ze)}),ownedByRelations:ut,ownedByRelationsTitle:ut.map(vt=>(0,x.$3)(vt,{defaultKind:"group"})).join(", ")}}}),rt=[A.createNameColumn(),A.createOwnerColumn(),A.createTypeColumn()],lt=[ve.createCopyDocsUrlAction(qe)];return(0,h.jsx)(h.Fragment,{children:He||Ie&&Ie.length>0?(0,h.jsx)(V.iA,{isLoading:He,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Ie,columns:Ne||rt,actions:Ee||lt,title:je?`${je} (${Ie.length})`:`All (${Ie.length})`}):(0,h.jsx)(V.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(V.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};$.columns=A,$.actions=ve;const E=T=>{var ee;const{columns:je,actions:He}=T,{loading:Ne,error:Ee,entities:qe,filters:mt}=(0,x.wp)(),{isStarredEntity:Ze,toggleStarredEntity:Ie}=(0,x.CR)(),[,rt]=(0,g.Z)();var lt;const st=(0,L.capitalize)((lt=(ee=mt.user)===null||ee===void 0?void 0:ee.value)!==null&&lt!==void 0?lt:"all"),ut=[ve.createCopyDocsUrlAction(rt),ve.createStarEntityAction(Ze,Ie)];return Ee?(0,h.jsx)(V.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(V.Oi,{language:"text",text:Ee.toString()})}):(0,h.jsx)($,{title:st,entities:qe,loading:Ne,actions:He||ut,columns:je})};E.columns=A,E.actions=ve},18662:function(jt,Me,t){"use strict";t.r(Me),t.d(Me,{TechDocsIndexPage:function(){return V}});var h=t(52322),n=t(2784),g=t(10289),L=t(3482);const V=x=>(0,g.pC)()||(0,h.jsx)(L.u,{...x})},42081:function(jt,Me,t){"use strict";t.d(Me,{j:function(){return V}});var h=t(52322),n=t(2784),g=t(93414),L=t(25248);const V=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(jt,Me,t){"use strict";t.d(Me,{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:V}=(0,n.wp)();return(0,h.useEffect)(()=>{V({techdocs:new g})},[V]),null}},89258:function(jt,Me,t){"use strict";t.d(Me,{I6:function(){return q},Jl:function(){return ne},s4:function(){return V}});var h=t(61886),n=t(92077),g=t(95573),L=t(25248);const V=(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:_,discoveryApi:F,identityApi:Q,fetchApi:X})=>new n.k({configApi:_,discoveryApi:F,identityApi:Q,fetchApi:X})}),(0,L.ni)({api:h.gT,deps:{configApi:L.Ds,discoveryApi:L.NW,fetchApi:L.gP},factory:({configApi:_,discoveryApi:F,fetchApi:Q})=>new n.p({configApi:_,discoveryApi:F,fetchApi:Q})})],routes:{root:g._Z,docRoot:g.Fw,entityContent:g.pd}}),x=V.provide((0,L.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(_=>_.Router),mountPoint:g._Z})),l=V.provide((0,L.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(_=>_.EmbeddedDocsRouter),mountPoint:g.pd})),k=V.provide((0,L.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(_=>_.TechDocsCustomHome),mountPoint:g._Z})),ne=V.provide((0,L.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(_=>_.TechDocsIndexPage),mountPoint:g._Z})),q=V.provide((0,L.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(_=>_.TechDocsReaderPage),mountPoint:g.Fw}))},7476:function(jt,Me,t){"use strict";t.r(Me),t.d(Me,{TechDocsReaderLayout:function(){return _},TechDocsReaderPage:function(){return F}});var h=t(52322),n=t(2784),g=t(10289),L=t(93414),V=t(61886),x=t(67896),l=t(93225),k=t(65124),ne=t(95573),q=t(25248);const _=({withSearch:Q,withHeader:X=!0})=>(0,h.jsxs)(L.T3,{themeId:"documentation",children:[X&&(0,h.jsx)(l.S,{}),(0,h.jsx)(k.b,{}),(0,h.jsx)(x.F,{withSearch:Q})]}),F=Q=>{const{kind:X,name:ve,namespace:de}=(0,q.Oi)(ne.Fw),{children:A,entityRef:I={kind:X,name:ve,namespace:de}}=Q,$=(0,g.pC)();if(!A){const T=$?n.Children.toArray($.props.children):[];var E;const je=T.flatMap(He=>{var Ne;return(E=He==null||(Ne=He.props)===null||Ne===void 0?void 0:Ne.children)!==null&&E!==void 0?E:[]}).find(He=>!(0,q.IY)(He,V.Zz));return(0,h.jsx)(V.ZS,{entityRef:I,children:je||(0,h.jsx)(_,{})})}return(0,h.jsx)(V.ZS,{entityRef:I,children:({metadata:T,entityMetadata:ee,onReady:je})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(L.T3,{themeId:"documentation",children:A instanceof Function?A({entityRef:I,techdocsMetadataValue:T.value,entityMetadataValue:ee.value,onReady:je}):A})})})}},67896:function(jt,Me,t){"use strict";t.d(Me,{F:function(){return We}});var h=t(52322),n=t(2784),g=t(79692),L=t(60905),V=t(61886),x=t(93414),l=t(17339),k=t(4614),ne=t(77277),q=t(99688),_=t(12420),F=t(90436),Q=t(61837),X=t(4190),ve=t(87685);const de=(0,g.Z)(S=>(0,_.Z)({paper:{width:"100%",[S.breakpoints.up("sm")]:{width:"75%"},[S.breakpoints.up("md")]:{width:"50%"},padding:S.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:S.palette.background.default}})),A=({buildLog:S,onClose:H})=>{const me=de(),ue=S.length===0?"Waiting for logs...":S.join(`
34
- `);return(0,h.jsxs)(L.Z,{container:!0,direction:"column",className:me.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:ue,classes:{root:me.logs}})]})},I=({buildLog:S})=>{const H=de(),[me,ue]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>ue(!0),children:"Show Build Logs"}),(0,h.jsx)(X.ZP,{classes:{paper:H.paper},anchor:"right",open:me,onClose:()=>ue(!1),children:(0,h.jsx)(A,{buildLog:S,onClose:()=>ue(!1)})})]})};var $=t(25248);const E=({errorMessage:S})=>{const H=(0,$.h_)($.Ds).getOptionalString("techdocs.builder");let me="";return H!=="local"&&(me="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:S||"Documentation not found",additionalInfo:me})};var T=t(95481);const ee=(0,g.Z)(S=>({root:{marginBottom:S.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),je=()=>{let S=null;const H=ee(),{state:me,contentReload:ue,contentErrorMessage:Ce,syncErrorMessage:Oe,buildLog:Ue}=(0,T.DK)();return me==="INITIAL_BUILD"&&(S=(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:Ue}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),me==="CONTENT_STALE_REFRESHING"&&(S=(0,h.jsx)(q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(k.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:Ue}),classes:{root:H.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),me==="CONTENT_STALE_READY"&&(S=(0,h.jsx)(q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(ne.Z,{color:"inherit",onClick:()=>ue(),children:"Refresh"}),classes:{root:H.root},children:"A newer version of this documentation is now available, please refresh to view."})),me==="CONTENT_STALE_ERROR"&&(S=(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:Ue}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",Oe]})),me==="CONTENT_NOT_FOUND"&&(S=(0,h.jsxs)(h.Fragment,{children:[Oe&&(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:Ue}),classes:{root:H.root,message:H.message},children:["Building a newer version of this documentation failed."," ",Oe]}),(0,h.jsx)(E,{errorMessage:Ce})]})),S};var He=t(10289),Ne=t(60364),Ee=t(41156),qe=t(32838),mt=t(35368),Ze=t.n(mt);const Ie=/main\.[A-Fa-f0-9]{8}\.min\.css$/,rt=/^https:\/\/fonts\.googleapis\.com/,lt=/^https:\/\/fonts\.gstatic\.com/,st=S=>S.nodeName==="LINK",ut=S=>{const H=(S==null?void 0:S.getAttribute("href"))||"",me=H.match(Ie),ue=H.match(rt),Ce=H.match(lt);return me||ue||Ce},ct=S=>(st(S)&&!ut(S)&&S.remove(),S),vt=S=>S.nodeName==="IFRAME",ht=(S,H)=>{const me=S.getAttribute("src")||"";try{const{host:ue}=new URL(me);return H.includes(ue)}catch{return!1}},Ge=S=>H=>(vt(H)&&!ht(H,S)&&H.remove(),H),ae=()=>{const S=(0,$.h_)($.Ds);return(0,n.useMemo)(()=>S.getOptionalConfig("techdocs.sanitizer"),[S])},Re=()=>{const S=ae();return(0,n.useCallback)(async H=>{const me=S==null?void 0:S.getOptionalStringArray("allowedIframeHosts");Ze().addHook("beforeSanitizeElements",ct);const ue=["link"];return me&&(ue.push("iframe"),Ze().addHook("beforeSanitizeElements",Ge(me))),Ze().sanitize(H.innerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[S])};var ke=t(41128),ot=({theme:S})=>`
35
- /*================== Variables ==================*/
36
- /*
37
- 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.
38
- 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.
39
- */
40
-
41
- :host {
42
- /* FONT */
43
- --md-default-fg-color: ${S.palette.text.primary};
44
- --md-default-fg-color--light: ${S.palette.text.secondary};
45
- --md-default-fg-color--lighter: ${(0,ke.$n)(S.palette.text.secondary,.7)};
46
- --md-default-fg-color--lightest: ${(0,ke.$n)(S.palette.text.secondary,.3)};
47
-
48
- /* BACKGROUND */
49
- --md-default-bg-color:${S.palette.background.default};
50
- --md-default-bg-color--light: ${S.palette.background.paper};
51
- --md-default-bg-color--lighter: ${(0,ke.$n)(S.palette.background.paper,.7)};
52
- --md-default-bg-color--lightest: ${(0,ke.$n)(S.palette.background.paper,.3)};
53
-
54
- /* PRIMARY */
55
- --md-primary-fg-color: ${S.palette.primary.main};
56
- --md-primary-fg-color--light: ${S.palette.primary.light};
57
- --md-primary-fg-color--dark: ${S.palette.primary.dark};
58
- --md-primary-bg-color: ${S.palette.primary.contrastText};
59
- --md-primary-bg-color--light: ${(0,ke.$n)(S.palette.primary.contrastText,.7)};
60
-
61
- /* ACCENT */
62
- --md-accent-fg-color: var(--md-primary-fg-color);
63
-
64
- /* SHADOW */
65
- --md-shadow-z1: ${S.shadows[1]};
66
- --md-shadow-z2: ${S.shadows[2]};
67
- --md-shadow-z3: ${S.shadows[3]};
68
-
69
- /* EXTENSIONS */
70
- --md-admonition-fg-color: var(--md-default-fg-color);
71
- --md-admonition-bg-color: var(--md-default-bg-color);
72
- /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
73
- --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>');
74
- --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>');
75
- --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>');
76
- --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>');
77
- --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>');
78
- --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>');
79
- --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>');
80
- --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>');
81
- --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>');
82
- --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>');
83
- --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>');
84
- --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>');
85
- --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>');
86
- --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>');
87
- --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>');
88
- --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>');
89
- --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>');
90
- --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>');
91
- --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>');
92
- --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>');
93
- --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>');
94
- --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>');
95
- --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>');
96
- --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>');
97
- --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>');
98
- --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>');
99
- }
100
-
101
- :host > * {
102
- /* CODE */
103
- --md-code-fg-color: ${S.palette.text.primary};
104
- --md-code-bg-color: ${S.palette.background.paper};
105
- --md-code-hl-color: ${(0,ke.Fq)(S.palette.warning.main,.5)};
106
- --md-code-hl-keyword-color: ${S.palette.type==="dark"?S.palette.primary.light:S.palette.primary.dark};
107
- --md-code-hl-function-color: ${S.palette.type==="dark"?S.palette.secondary.light:S.palette.secondary.dark};
108
- --md-code-hl-string-color: ${S.palette.type==="dark"?S.palette.success.light:S.palette.success.dark};
109
- --md-code-hl-number-color: ${S.palette.type==="dark"?S.palette.error.light:S.palette.error.dark};
110
- --md-code-hl-constant-color: var(--md-code-hl-function-color);
111
- --md-code-hl-special-color: var(--md-code-hl-function-color);
112
- --md-code-hl-name-color: var(--md-code-fg-color);
113
- --md-code-hl-comment-color: var(--md-default-fg-color--light);
114
- --md-code-hl-generic-color: var(--md-default-fg-color--light);
115
- --md-code-hl-variable-color: var(--md-default-fg-color--light);
116
- --md-code-hl-operator-color: var(--md-default-fg-color--light);
117
- --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
118
-
119
- /* TYPESET */
120
- --md-typeset-font-size: 1rem;
121
- --md-typeset-color: var(--md-default-fg-color);
122
- --md-typeset-a-color: var(--md-accent-fg-color);
123
- --md-typeset-table-color: ${S.palette.text.primary};
124
- --md-typeset-del-color: ${S.palette.type==="dark"?(0,ke.Fq)(S.palette.error.dark,.5):(0,ke.Fq)(S.palette.error.light,.5)};
125
- --md-typeset-ins-color: ${S.palette.type==="dark"?(0,ke.Fq)(S.palette.success.dark,.5):(0,ke.Fq)(S.palette.success.light,.5)};
126
- --md-typeset-mark-color: ${S.palette.type==="dark"?(0,ke.Fq)(S.palette.warning.dark,.5):(0,ke.Fq)(S.palette.warning.light,.5)};
127
- }
128
-
129
- @media screen and (max-width: 76.1875em) {
130
- :host > * {
131
- /* TYPESET */
132
- --md-typeset-font-size: .9rem;
133
- }
134
- }
135
-
136
- @media screen and (max-width: 600px) {
137
- :host > * {
138
- /* TYPESET */
139
- --md-typeset-font-size: .7rem;
140
- }
141
- }
142
- `,yt=({theme:S})=>`
143
- /*================== Reset ==================*/
144
-
145
- body {
146
- --md-text-color: var(--md-default-fg-color);
147
- --md-text-link-color: var(--md-accent-fg-color);
148
- --md-text-font-family: ${S.typography.fontFamily};
149
- font-family: var(--md-text-font-family);
150
- background-color: unset;
151
- }
152
- `;const At="224px";var pt=({theme:S,sidebar:H})=>`
153
- /*================== Layout ==================*/
154
-
155
- .md-grid {
156
- max-width: 100%;
157
- margin: 0;
158
- }
159
-
160
- .md-nav {
161
- font-size: calc(var(--md-typeset-font-size) * 0.9);
162
- }
163
- .md-nav__link {
164
- display: flex;
165
- align-items: center;
166
- justify-content: space-between;
167
- }
168
- .md-nav__icon {
169
- height: 20px !important;
170
- width: 20px !important;
171
- margin-left:${S.spacing(1)}px;
172
- }
173
- .md-nav__icon svg {
174
- margin: 0;
175
- width: 20px !important;
176
- height: 20px !important;
177
- }
178
- .md-nav__icon:after {
179
- width: 20px !important;
180
- height: 20px !important;
181
- }
182
-
183
- .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
184
- text-decoration: underline;
185
- color: var(--md-typeset-a-color);
186
- }
187
-
188
- .md-main__inner {
189
- margin-top: 0;
190
- }
191
-
192
- .md-sidebar {
193
- bottom: 75px;
194
- position: fixed;
195
- width: 16rem;
196
- overflow-y: auto;
197
- overflow-x: hidden;
198
- scrollbar-color: rgb(193, 193, 193) #eee;
199
- scrollbar-width: thin;
200
- }
201
- .md-sidebar .md-sidebar__scrollwrap {
202
- width: calc(12.1rem);
203
- }
204
- .md-sidebar--secondary {
205
- right: ${S.spacing(3)}px;
206
- }
207
- .md-sidebar::-webkit-scrollbar {
208
- width: 5px;
209
- }
210
- .md-sidebar::-webkit-scrollbar-button {
211
- width: 5px;
212
- height: 5px;
213
- }
214
- .md-sidebar::-webkit-scrollbar-track {
215
- background: #eee;
216
- border: 1 px solid rgb(250, 250, 250);
217
- box-shadow: 0px 0px 3px #dfdfdf inset;
218
- border-radius: 3px;
219
- }
220
- .md-sidebar::-webkit-scrollbar-thumb {
221
- width: 5px;
222
- background: rgb(193, 193, 193);
223
- border: transparent;
224
- border-radius: 3px;
225
- }
226
- .md-sidebar::-webkit-scrollbar-thumb:hover {
227
- background: rgb(125, 125, 125);
228
- }
229
-
230
- .md-content {
231
- max-width: calc(100% - 16rem * 2);
232
- margin-left: 16rem;
233
- margin-bottom: 50px;
234
- }
235
-
236
- .md-footer {
237
- position: fixed;
238
- bottom: 0px;
239
- }
240
- .md-footer__title {
241
- background-color: unset;
242
- }
243
- .md-footer-nav__link {
244
- width: 16rem;
245
- }
246
-
247
- .md-dialog {
248
- background-color: unset;
249
- }
250
-
251
- @media screen and (min-width: 76.25em) {
252
- .md-sidebar {
253
- height: auto;
254
- }
255
- }
256
-
257
- @media screen and (max-width: 76.1875em) {
258
- .md-nav {
259
- transition: none !important;
260
- background-color: var(--md-default-bg-color)
261
- }
262
- .md-nav--primary .md-nav__title {
263
- cursor: auto;
264
- color: var(--md-default-fg-color);
265
- font-weight: 700;
266
- white-space: normal;
267
- line-height: 1rem;
268
- height: auto;
269
- display: flex;
270
- flex-flow: column;
271
- row-gap: 1.6rem;
272
- padding: 1.2rem .8rem .8rem;
273
- background-color: var(--md-default-bg-color);
274
- }
275
- .md-nav--primary .md-nav__title~.md-nav__list {
276
- box-shadow: none;
277
- }
278
- .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
279
- border-top: none;
280
- }
281
- .md-nav--primary .md-nav__title .md-nav__button {
282
- display: none;
283
- }
284
- .md-nav--primary .md-nav__title .md-nav__icon {
285
- color: var(--md-default-fg-color);
286
- position: static;
287
- height: auto;
288
- margin: 0 0 0 -0.2rem;
289
- }
290
- .md-nav--primary > .md-nav__title [for="none"] {
291
- padding-top: 0;
292
- }
293
- .md-nav--primary .md-nav__item {
294
- border-top: none;
295
- }
296
- .md-nav--primary :is(.md-nav__title,.md-nav__item) {
297
- font-size : var(--md-typeset-font-size);
298
- }
299
- .md-nav .md-source {
300
- display: none;
301
- }
302
-
303
- .md-sidebar {
304
- height: 100%;
305
- }
306
- .md-sidebar--primary {
307
- width: 12.1rem !important;
308
- z-index: 200;
309
- left: ${H.isPinned?`calc(-12.1rem + ${At})`:"calc(-12.1rem + 72px)"} !important;
310
- }
311
- .md-sidebar--secondary:not([hidden]) {
312
- display: none;
313
- }
314
-
315
- .md-content {
316
- max-width: 100%;
317
- margin-left: 0;
318
- }
319
-
320
- .md-header__button {
321
- margin: 0.4rem 0;
322
- margin-left: 0.4rem;
323
- padding: 0;
324
- }
325
-
326
- .md-overlay {
327
- left: 0;
328
- }
329
-
330
- .md-footer {
331
- position: static;
332
- padding-left: 0;
333
- }
334
- .md-footer-nav__link {
335
- /* footer links begin to overlap at small sizes without setting width */
336
- width: 50%;
337
- }
338
- }
339
-
340
- @media screen and (max-width: 600px) {
341
- .md-sidebar--primary {
342
- left: -12.1rem !important;
343
- width: 12.1rem;
344
- }
345
- }
346
- `;const St=["h1","h2","h3","h4","h5","h6"];var Lt=({theme:S})=>`
347
- /*================== Typeset ==================*/
348
-
349
- .md-typeset {
350
- font-size: var(--md-typeset-font-size);
351
- }
352
-
353
- ${St.reduce((H,me)=>{var ue;const Ce=(ue=S.typography.htmlFontSize)!==null&&ue!==void 0?ue:16,Oe=S.typography[me],{lineHeight:Ue,fontFamily:nt,fontWeight:ft,fontSize:dt}=Oe,_e=at=>{let wt=1;return typeof at=="number"&&(wt=at/Ce*.6),typeof at=="string"&&(wt=at.replace("rem","")),`calc(${wt} * var(--md-typeset-font-size))`};return H.concat(`
354
- .md-typeset ${me} {
355
- color: var(--md-default-fg-color);
356
- line-height: ${Ue};
357
- font-family: ${nt};
358
- font-weight: ${ft};
359
- font-size: ${_e(dt)};
360
- }
361
- `)},"")}
362
-
363
- .md-typeset .md-content__button {
364
- color: var(--md-default-fg-color);
365
- }
366
-
367
- .md-typeset hr {
368
- border-bottom: 0.05rem dotted ${S.palette.divider};
369
- }
370
-
371
- .md-typeset details {
372
- font-size: var(--md-typeset-font-size) !important;
373
- }
374
- .md-typeset details summary {
375
- padding-left: 2.5rem !important;
376
- }
377
- .md-typeset details summary:before,
378
- .md-typeset details summary:after {
379
- top: 50% !important;
380
- width: 20px !important;
381
- height: 20px !important;
382
- transform: rotate(0deg) translateY(-50%) !important;
383
- }
384
- .md-typeset details[open] > summary:after {
385
- transform: rotate(90deg) translateX(-50%) !important;
386
- }
387
-
388
- .md-typeset blockquote {
389
- color: var(--md-default-fg-color--light);
390
- border-left: 0.2rem solid var(--md-default-fg-color--light);
391
- }
392
-
393
- .md-typeset table:not([class]) {
394
- font-size: var(--md-typeset-font-size);
395
- border: 1px solid var(--md-default-fg-color);
396
- border-bottom: none;
397
- border-collapse: collapse;
398
- }
399
- .md-typeset table:not([class]) th {
400
- font-weight: bold;
401
- }
402
- .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
403
- border-bottom: 1px solid var(--md-default-fg-color);
404
- }
405
-
406
- .md-typeset pre > code::-webkit-scrollbar-thumb {
407
- background-color: hsla(0, 0%, 0%, 0.32);
408
- }
409
- .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
410
- background-color: hsla(0, 0%, 0%, 0.87);
411
- }
412
- `,kt=()=>`
413
- /*================== Animations ==================*/
414
- /*
415
- Disable CSS animations on link colors as they lead to issues in dark mode.
416
- The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
417
- */
418
- .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
419
- transition: none;
420
- }
421
- `,en=({theme:S})=>`
422
- /*================== Extensions ==================*/
423
-
424
- /* HIGHLIGHT */
425
- .highlight .md-clipboard:after {
426
- content: unset;
427
- }
428
-
429
- .highlight .nx {
430
- color: ${S.palette.type==="dark"?"#ff53a3":"#ec407a"};
431
- }
432
-
433
- /* CODE HILITE */
434
- .codehilite .gd {
435
- background-color: ${S.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
436
- }
437
-
438
- .codehilite .gi {
439
- background-color: ${S.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
440
- }
441
-
442
- /* TABBED */
443
- .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
444
- .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
445
- .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
446
- .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
447
- .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
448
- .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
449
- .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
450
- .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
451
- .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
452
- .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
453
- .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
454
- .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
455
- .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
456
- .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
457
- .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
458
- .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
459
- .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
460
- .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
461
- .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
462
- .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
463
- color: var(--md-accent-fg-color);
464
- border-color: var(--md-accent-fg-color);
465
- }
466
-
467
- /* TASK-LIST */
468
- .task-list-control .task-list-indicator::before {
469
- background-color: ${S.palette.action.disabledBackground};
470
- }
471
- .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
472
- background-color: ${S.palette.success.main};
473
- }
474
-
475
- /* ADMONITION */
476
- .admonition {
477
- font-size: var(--md-typeset-font-size) !important;
478
- }
479
- .admonition .admonition-title {
480
- padding-left: 2.5rem !important;
481
- }
482
-
483
- .admonition .admonition-title:before {
484
- top: 50% !important;
485
- width: 20px !important;
486
- height: 20px !important;
487
- transform: translateY(-50%) !important;
488
- }
489
- `;const rn=[ot,yt,pt,Lt,kt,en],Vt=()=>(0,x.Pf)(),Wt=()=>{const S=Vt(),H=(0,Ne.Z)();return(0,n.useMemo)(()=>{const me={theme:H,sidebar:S};return rn.reduce((ue,Ce)=>ue+Ce(me),"")},[H,S])},hn=()=>{const S=Wt();return(0,n.useCallback)(H=>(H.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${S}</style>`),H),[S])},_t=(S,H,me)=>{const ue=S==="src"&&H.endsWith(".svg"),Ce=!H.match(/^([a-z]*:)?\/\//i),Oe=H.startsWith(me);return ue&&(Ce||Oe)},kn=({techdocsStorageApi:S,entityId:H,path:me})=>async ue=>{const Ce=await S.getApiOrigin(),Oe=async(Ue,nt)=>{for(const ft of Ue)if(ft.hasAttribute(nt)){const dt=ft.getAttribute(nt);if(!dt)return;const _e=await S.getBaseUrl(dt,H,me);if(_t(nt,dt,Ce))try{const wt=await(await fetch(_e,{credentials:"include"})).text();ft.setAttribute(nt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(wt)))}`)}catch{ft.setAttribute("alt",`Error: ${dt}`)}else ft.setAttribute(nt,_e)}};return await Promise.all([Oe(ue.querySelectorAll("img"),"src"),Oe(ue.querySelectorAll("script"),"src"),Oe(ue.querySelectorAll("source"),"src"),Oe(ue.querySelectorAll("link"),"href"),Oe(ue.querySelectorAll("a[download]"),"href")]),ue};var ln=t(79158),On=t(67097),pn=t(28316),Hn=t(82717),Ht=t.n(Hn);const Cn=S=>H=>{var me;const ue=H.querySelector('[title="Edit this page"]');if(!ue||!ue.href)return H;const Ce=new URL(ue.href),Oe=S.byUrl(Ce);if((Oe==null?void 0:Oe.type)!=="github"&&(Oe==null?void 0:Oe.type)!=="gitlab")return H;const Ue=((me=H.querySelector("article>h1"))===null||me===void 0?void 0:me.childNodes[0].textContent)||"",nt=encodeURIComponent(`Documentation Feedback: ${Ue}`),ft=encodeURIComponent(`Page source:
490
- ${ue.href}
491
-
492
- Feedback:`),dt=(Oe==null?void 0:Oe.type)==="github"?(0,ln.BT)(Ce.href,"blob"):Ce.href,_e=Ht()(dt),at=`/${_e.organization}/${_e.name}`,wt=ue.cloneNode();switch(Oe==null?void 0:Oe.type){case"gitlab":wt.href=`${Ce.origin}${at}/issues/new?issue[title]=${nt}&issue[description]=${ft}`;break;case"github":wt.href=`${Ce.origin}${at}/issues/new?title=${nt}&body=${ft}`;break;default:return H}return pn.render(n.createElement(On.Z),wt),wt.style.paddingLeft="5px",wt.title="Leave feedback for this page",wt.id="git-feedback-link",ue==null||ue.insertAdjacentElement("beforebegin",wt),H};var $n=t(44882);const Gt=()=>S=>{const H=S.querySelector('.md-header label[for="__drawer"]'),me=S.querySelector("article");if(!H||!me)return S;const ue=H.cloneNode();return pn.render(n.createElement($n.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),me==null||me.prepend(ue),S},fn=()=>S=>(((me,ue)=>{Array.from(me).filter(Ce=>Ce.hasAttribute(ue)).forEach(Ce=>{const Oe=Ce.getAttribute(ue);if(Oe){Oe.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Ue=cn(window.location.href);Ce.setAttribute(ue,new URL(Oe,Ue).toString())}catch{Ce.replaceWith(Ce.textContent||Oe)}}})})(Array.from(S.getElementsByTagName("a")),"href"),S);function cn(S){const H=new URL(S);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const wn=({baseUrl:S,onClick:H})=>me=>(Array.from(me.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",Ce=>{const Ue=ue.getAttribute("href");!Ue||Ue.startsWith(S)&&!ue.hasAttribute("download")&&(Ce.preventDefault(),H(Ce,Ue))})}),me);var Bn=t(15459),yn=t(80030),ge=t(72379),te=t(41547);const Ae=(0,Bn.Z)(S=>({tooltip:{fontSize:"inherit",color:S.palette.text.primary,margin:0,padding:S.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(yn.ZP),Fe=()=>(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"})}),Qe=({text:S})=>{const[H,me]=(0,n.useState)(!1),ue=(0,n.useCallback)(()=>{navigator.clipboard.writeText(S),me(!0)},[S]),Ce=(0,n.useCallback)(()=>{me(!1)},[me]);return(0,h.jsx)(Ae,{title:"Copied to clipboard",placement:"left",open:H,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(Fe,{})})})},xt=S=>H=>{const me=H.querySelectorAll("pre > code");for(const Ce of me){var ue;const Oe=Ce.textContent||"",Ue=document.createElement("div");Ce==null||(ue=Ce.parentElement)===null||ue===void 0||ue.prepend(Ue),pn.render((0,h.jsx)(te.Z,{theme:S,children:(0,h.jsx)(Qe,{text:Oe})}),Ue)}return H},oe=()=>S=>{var H;return(H=S.querySelector(".md-header"))===null||H===void 0||H.remove(),S},R=()=>S=>{var H,me;return(H=S.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(me=S.querySelector(".md-footer-copyright"))===null||me===void 0||me.remove(),S},J=({onLoading:S,onLoaded:H})=>me=>(S(),me.addEventListener(V.Ox,function ue(){H(),me.removeEventListener(V.Ox,ue)}),me),Ke=()=>S=>(setTimeout(()=>{if(window.location.hash){var H;const me=window.location.hash.slice(1);(H=S==null?void 0:S.querySelector(`[id="${me}"]`))===null||H===void 0||H.scrollIntoView()}},200),S),M=()=>S=>(setTimeout(()=>{const H=S==null?void 0:S.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(ue=>{const Ce=ue==null?void 0:ue.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),H[H.length-1].scrollIntoView())},200),S),Z=async(S,H)=>{let me;if(typeof S=="string")me=new DOMParser().parseFromString(S,"text/html").documentElement;else if(S instanceof Element)me=S;else throw new Error("dom is not a recognized type");for(const ue of H)me=await ue(me);return me},le="screen and (max-width: 76.1875em)",he=S=>{const H=(0,He.s0)(),me=(0,Ne.Z)(),ue=(0,Ee.Z)(le),Ce=Re(),Oe=hn(),Ue=(0,$.h_)(V.Dl),nt=(0,$.h_)(qe.q3),{state:ft,path:dt,content:_e}=(0,T.DK)(),[at,wt]=(0,n.useState)(null),Tt=(0,V.ux)(at),It=(0,n.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Nt=>{if(ue)Nt.style.top="0px";else{const jn=document==null?void 0:document.querySelector(".techdocs-reader-page");var gn;const Nn=(gn=jn==null?void 0:jn.getBoundingClientRect().top)!==null&&gn!==void 0?gn:0;var Dn;let qn=(Dn=at.getBoundingClientRect().top)!==null&&Dn!==void 0?Dn:0;const En=at.querySelector(".md-container > .md-tabs");var sn;const xn=(sn=En==null?void 0:En.getBoundingClientRect().height)!==null&&sn!==void 0?sn:0;qn<Nn&&(qn=Nn),Nt.style.top=`${Math.max(qn,0)+xn}px`}Nt.style.setProperty("opacity","1")})},[at,ue]);(0,n.useEffect)(()=>(window.addEventListener("resize",It),window.addEventListener("scroll",It,!0),()=>{window.removeEventListener("resize",It),window.removeEventListener("scroll",It,!0)}),[at,It]);const Ut=(0,n.useCallback)(()=>{if(!at)return;const Dt=at.querySelector(".md-footer");Dt&&(Dt.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,n.useEffect)(()=>(window.addEventListener("resize",Ut),()=>{window.removeEventListener("resize",Ut)}),[at,Ut]),(0,n.useEffect)(()=>{Tt||(Ut(),It())},[ft,Tt,Ut,It]);const Zn=(0,n.useCallback)((Dt,Nt)=>Z(Dt,[Ce,kn({techdocsStorageApi:Ue,entityId:S,path:Nt}),fn(),Gt(),oe(),R(),Cn(nt),Oe]),[S,nt,Ue,Ce,Oe]),Wn=(0,n.useCallback)(async Dt=>Z(Dt,[Ke(),M(),xt(me),wn({baseUrl:window.location.origin,onClick:(Nt,gn)=>{const Dn=Nt.ctrlKey||Nt.metaKey,sn=new URL(gn),jn=`${sn.pathname}${sn.search}${sn.hash}`;if(sn.hash)if(Dn)window.open(jn,"_blank");else{var Nn;H(jn),(Nn=Dt==null?void 0:Dt.querySelector(`[id="${sn.hash.slice(1)}"]`))===null||Nn===void 0||Nn.scrollIntoView()}else Dn?window.open(jn,"_blank"):H(jn)}}),J({onLoading:()=>{},onLoaded:()=>{var Nt;(Nt=Dt.querySelector(".md-nav__title"))===null||Nt===void 0||Nt.removeAttribute("for")}}),J({onLoading:()=>{Array.from(Dt.querySelectorAll(".md-sidebar")).forEach(gn=>{gn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[me,H]);return(0,n.useEffect)(()=>{if(!_e)return()=>{};let Dt=!0;return Zn(_e,dt).then(async Nt=>{if(!(Nt!=null&&Nt.innerHTML)||!Dt)return;window.scroll({top:0});const gn=await Wn(Nt);wt(gn)}),()=>{Dt=!1}},[_e,dt,Zn,Wn]),at};var be=t(8560);const De=()=>{const S=(0,V.$L)(),{shadowRoot:H}=(0,V.x1)(),me=H==null?void 0:H.querySelector('[data-md-component="content"]'),ue=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=ue==null?void 0:ue.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),ue==null||ue.prepend(Ce));const Oe=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ue=Oe==null?void 0:Oe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ue||(Ue=document.createElement("div"),Ue.setAttribute("data-techdocs-addons-location","secondary sidebar"),Oe==null||Oe.prepend(Ue)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:S.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:me,children:S.renderComponentsByLocation(V.oZ.Content)}),(0,h.jsx)(be.Z,{container:Ue,children:S.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},$e=(0,g.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),We=(0,T.m1)(S=>{var H;const{withSearch:me=!0,onReady:ue}=S,Ce=$e(),{entityMetadata:{value:Oe,loading:Ue},entityRef:nt,setShadowRoot:ft}=(0,V.x1)(),dt=he(nt),_e=(0,n.useCallback)(at=>{ft(at),ue instanceof Function&&ue()},[ft,ue]);return Ue===!1&&!Oe?(0,h.jsx)(x.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):dt?(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,{})}),me&&(0,h.jsx)(L.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:nt,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)(V.VA,{element:dt,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(jt,Me,t){"use strict";t.d(Me,{S:function(){return Q}});var h=t(52322),n=t(2784),g=t(18671),L=t(98069),V=t(73250),x=t(61886),l=t(43297),k=t(25271),ne=t(93414),q=t(25248),_=t(95573);const F=(0,h.jsx)(L.Z,{animation:"wave",variant:"text",height:40}),Q=X=>{const{children:ve}=X,de=(0,x.$L)(),A=(0,q.h_)(q.Ds),{title:I,setTitle:$,subtitle:E,setSubtitle:T,entityRef:ee,metadata:{value:je,loading:He},entityMetadata:{value:Ne,loading:Ee}}=(0,x.x1)();(0,n.useEffect)(()=>{!je||($(je.site_name),T(()=>{let{site_description:ht}=je;return(!ht||ht==="None")&&(ht="Home"),ht}))},[je,$,T]);const qe=A.getOptional("app.title")||"Backstage",mt=[I,E,qe].filter(Boolean).join(" | "),{locationMetadata:Ze,spec:Ie}=Ne||{},rt=Ie==null?void 0:Ie.lifecycle,lt=Ne?(0,l.hF)(Ne,k.S4):[],st=(0,q.tg)(_._Z)(),ut=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:ee,title:Ne==null?void 0:Ne.metadata.title,defaultKind:"Component"})}),lt.length>0&&(0,h.jsx)(ne.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:lt,defaultKind:"group"})}),rt?(0,h.jsx)(ne.i9,{label:"Lifecycle",value:rt}):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)(V.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!Ee&&Ne===void 0||!He&&je===void 0?null:(0,h.jsxs)(ne.h4,{type:"Documentation",typeLink:st,title:I||F,subtitle:E||F,children:[(0,h.jsx)(g.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:mt})}),ut,ve,de.renderComponentsByLocation(x.oZ.Header)]})}},65124:function(jt,Me,t){"use strict";t.d(Me,{b:function(){return F}});var h=t(52322),n=t(2784),g=t(79692),L=t(15223),V=t(95544),x=t(80030),l=t(61837),k=t(48348),ne=t(47603),q=t(61886);const _=(0,g.Z)(Q=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:Q.spacing(3,3,0)}})),F=Q=>{const X=_(),[ve,de]=(0,n.useState)(null),A=(0,n.useCallback)(He=>{de(He.currentTarget)},[]),I=(0,n.useCallback)(()=>{de(null)},[]),{entityMetadata:{value:$,loading:E}}=(0,q.x1)(),T=(0,q.$L)(),ee=T.renderComponentsByLocation(q.oZ.Subheader),je=T.renderComponentsByLocation(q.oZ.Settings);return!ee&&!je||E===!1&&!$?null:(0,h.jsx)(L.Z,{classes:X,...Q.toolbarProps,children:(0,h.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[ee,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(jt,Me,t){"use strict";t.d(Me,{DK:function(){return F},m1:function(){return X}});var h=t(52322),n=t(2784),g=t(10289),L=t(61886),V=t(25248),x=t(64279),l=t(77446);function k({contentLoading:ve,content:de,activeSyncState:A}){return ve||A==="BUILD_READY_RELOAD"||!de&&A==="CHECKING"?"CHECKING":!de&&A==="BUILDING"?"INITIAL_BUILD":de?A==="BUILDING"?"CONTENT_STALE_REFRESHING":A==="BUILD_READY"?"CONTENT_STALE_READY":A==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ne(ve,de){const A={...ve};switch(de.type){case"sync":de.state==="CHECKING"&&(A.buildLog=[]),A.activeSyncState=de.state,A.syncError=de.syncError;break;case"contentLoading":A.contentLoading=!0,A.contentError=void 0;break;case"content":typeof de.path=="string"&&(A.path=de.path),A.contentLoading=!1,A.content=de.content,A.contentError=de.contentError;break;case"buildLog":A.buildLog=A.buildLog.concat(de.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(A.activeSyncState)&&["contentLoading","content"].includes(de.type)&&(A.activeSyncState="UP_TO_DATE",A.buildLog=[]),A}function q(ve,de,A,I){var $,E;const[T,ee]=(0,n.useReducer)(ne,{activeSyncState:"CHECKING",path:I,contentLoading:!0,buildLog:[]}),je=(0,V.h_)(L.Dl),{retry:He}=(0,l.Z)(async()=>{ee({type:"contentLoading"});try{const qe=await je.getEntityDocs({kind:ve,namespace:de,name:A},I);return ee({type:"content",content:qe,path:I}),qe}catch(qe){ee({type:"content",contentError:qe,path:I})}},[je,ve,de,A,I]),Ne=(0,n.useRef)({content:void 0,reload:()=>{}});return Ne.current={content:T.content,reload:He},(0,x.default)(async()=>{ee({type:"sync",state:"CHECKING"});const qe=setTimeout(()=>{ee({type:"sync",state:"BUILDING"})},1e3);try{switch(await je.syncEntityDocs({kind:ve,namespace:de,name:A},Ze=>{ee({type:"buildLog",log:Ze})})){case"updated":Ne.current.content?ee({type:"sync",state:"BUILD_READY"}):(Ne.current.reload(),ee({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":ee({type:"sync",state:"UP_TO_DATE"});break;default:ee({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(mt){ee({type:"sync",state:"ERROR",syncError:mt})}finally{clearTimeout(qe)}},[ve,A,de,je,ee,Ne]),{state:(0,n.useMemo)(()=>k({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:He,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 _=(0,n.createContext)({}),F=()=>(0,n.useContext)(_),Q=({children:ve})=>{const{"*":de=""}=(0,g.UO)(),{entityRef:A}=(0,L.x1)(),{kind:I,namespace:$,name:E}=A,T=q(I,$,E,de);return(0,h.jsx)(_.Provider,{value:T,children:ve instanceof Function?ve(T):ve})},X=ve=>de=>(0,h.jsx)(Q,{children:(0,h.jsx)(ve,{...de})})},95573:function(jt,Me,t){"use strict";t.d(Me,{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(jt,Me,t){"use strict";t.d(Me,{S:function(){return I}});var h=t(52322),n=t(2784),g=t(79692),L=t(49378),V=t(38402),x=t(86136),l=t(85256),k=t(93414),ne=t(25248),q=t(65826);const _=(0,g.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),F=$=>{const{result:E,highlight:T,rank:ee,lineClamp:je=5,asListItem:He=!0,asLink:Ne=!0,title:Ee,icon:qe}=$,mt=_(),Ze=(0,ne.z$)(),Ie=()=>{Ze.captureEvent("discover",E.title,{attributes:{to:E.location},value:ee})},rt=()=>{const ut=T!=null&&T.fields.title?(0,h.jsx)(q.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):E.title,ct=T!=null&&T.fields.entityTitle?(0,h.jsx)(q.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):E.entityTitle,vt=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:mt.itemText,primaryTypographyProps:{variant:"h6"},primary:Ee||(0,h.jsxs)(h.Fragment,{children:[ut," | ",ct!=null?ct:vt," 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})})},lt=({children:ut})=>Ne?(0,h.jsx)(k.rU,{noTrack:!0,to:E.location,onClick:Ie,children:ut}):(0,h.jsx)(h.Fragment,{children:ut}),st=({children:ut})=>He?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(V.Z,{alignItems:"flex-start",children:[qe&&(0,h.jsx)(x.Z,{children:qe}),(0,h.jsx)("div",{className:mt.flexContainer,children:ut})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ut});return(0,h.jsx)(lt,{children:(0,h.jsx)(st,{children:(0,h.jsx)(rt,{})})})};var Q=t(27556),X=t(10289);const ve=(0,g.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),de=$=>$==null?void 0:$.document,A=$=>{const{entityId:E,entityTitle:T,debounceTime:ee=150}=$,[je,He]=(0,n.useState)(!1),Ne=(0,X.s0)(),{setFilters:Ee,result:{loading:qe,value:mt}}=(0,q.Rx)(),Ze=ve(),[Ie,rt]=(0,n.useState)([]);(0,n.useEffect)(()=>{let vt=!0;if(vt&&mt){const ht=mt.results.slice(0,10);rt(ht)}return()=>{vt=!1}},[qe,mt]);const{kind:lt,name:st,namespace:ut}=E;(0,n.useEffect)(()=>{Ee(vt=>({...vt,kind:lt,namespace:ut,name:st}))},[lt,ut,st,Ee]);const ct=(vt,ht)=>{if(de(ht)){const{location:Ge}=ht.document;Ne(Ge)}};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:vt=>vt,onClose:()=>{He(!1)},onFocus:()=>{He(!0)},onChange:ct,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ie,renderOption:({document:vt,highlight:ht})=>(0,h.jsx)(F,{result:vt,lineClamp:3,asListItem:!1,asLink:!1,title:vt.title,highlight:ht}),loading:qe,inputDebounceTime:ee,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(jt){var Me=function(h){return jt(jt.s=h)};jt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Me(96215)});var t=jt.O()}]);})();
493
-
494
- //# sourceMappingURL=main.3308728f.js.map