@techdocs/cli 1.2.0-next.2 → 1.2.1-next.1

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 (103) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/PublisherConfig-0ea58467.cjs.js.map +1 -1
  3. package/dist/cjs/generate-b897bd89.cjs.js.map +1 -1
  4. package/dist/cjs/migrate-62035c68.cjs.js.map +1 -1
  5. package/dist/cjs/mkdocs-1501e940.cjs.js.map +1 -1
  6. package/dist/cjs/mkdocsServer-99ec8af2.cjs.js.map +1 -1
  7. package/dist/cjs/publish-af5607e2.cjs.js.map +1 -1
  8. package/dist/cjs/serve-176119a3.cjs.js.map +1 -1
  9. package/dist/cjs/utility-647ad232.cjs.js.map +1 -1
  10. package/dist/embedded-app/.config-schema.json +26 -0
  11. package/dist/embedded-app/index.html +1 -1
  12. package/dist/embedded-app/static/1032.6bf895d9.chunk.js +3 -0
  13. package/dist/embedded-app/static/1032.6bf895d9.chunk.js.map +1 -0
  14. package/dist/embedded-app/static/1105.c6322959.chunk.js +3 -0
  15. package/dist/embedded-app/static/1105.c6322959.chunk.js.map +1 -0
  16. package/dist/embedded-app/static/184.ca141892.chunk.js +3 -0
  17. package/dist/embedded-app/static/184.ca141892.chunk.js.map +1 -0
  18. package/dist/embedded-app/static/2440.1a4b182a.chunk.js +3 -0
  19. package/dist/embedded-app/static/2440.1a4b182a.chunk.js.map +1 -0
  20. package/dist/embedded-app/static/5458.ace70612.chunk.js +3 -0
  21. package/dist/embedded-app/static/5458.ace70612.chunk.js.map +1 -0
  22. package/dist/embedded-app/static/5837.00a42df7.chunk.js +3 -0
  23. package/dist/embedded-app/static/5837.00a42df7.chunk.js.map +1 -0
  24. package/dist/embedded-app/static/{4949.bffcfed7.chunk.js → 5869.f1b2db13.chunk.js} +2 -2
  25. package/dist/embedded-app/static/5869.f1b2db13.chunk.js.map +1 -0
  26. package/dist/embedded-app/static/6051.89d185a1.chunk.js +4 -0
  27. package/dist/embedded-app/static/6051.89d185a1.chunk.js.map +1 -0
  28. package/dist/embedded-app/static/732.069998a1.chunk.js +3 -0
  29. package/dist/embedded-app/static/732.069998a1.chunk.js.map +1 -0
  30. package/dist/embedded-app/static/7560.2275e900.chunk.js +3 -0
  31. package/dist/embedded-app/static/7560.2275e900.chunk.js.map +1 -0
  32. package/dist/embedded-app/static/7750.7df70188.chunk.js +8 -0
  33. package/dist/embedded-app/static/7750.7df70188.chunk.js.map +1 -0
  34. package/dist/embedded-app/static/8951.60ad2c85.chunk.js +3 -0
  35. package/dist/embedded-app/static/8951.60ad2c85.chunk.js.map +1 -0
  36. package/dist/embedded-app/static/9545.2c04e8ca.chunk.js +3 -0
  37. package/dist/embedded-app/static/9545.2c04e8ca.chunk.js.map +1 -0
  38. package/dist/embedded-app/static/9770.b0a8132c.chunk.js +3 -0
  39. package/dist/embedded-app/static/9770.b0a8132c.chunk.js.map +1 -0
  40. package/dist/embedded-app/static/main.32844cc3.js +492 -0
  41. package/dist/embedded-app/static/main.32844cc3.js.map +1 -0
  42. package/dist/embedded-app/static/module-ajv.cf315a37.js +10 -0
  43. package/dist/embedded-app/static/module-ajv.cf315a37.js.map +1 -0
  44. package/dist/embedded-app/static/{module-lodash.32f2edbb.js → module-lodash.e87f9236.js} +2 -2
  45. package/dist/embedded-app/static/{module-lodash.32f2edbb.js.map → module-lodash.e87f9236.js.map} +1 -1
  46. package/dist/embedded-app/static/module-luxon.af9605ef.js +3 -0
  47. package/dist/embedded-app/static/module-luxon.af9605ef.js.map +1 -0
  48. package/dist/embedded-app/static/{module-material-table.cd3af251.js → module-material-table.44314bd8.js} +2 -2
  49. package/dist/embedded-app/static/{module-material-table.cd3af251.js.map → module-material-table.44314bd8.js.map} +1 -1
  50. package/dist/embedded-app/static/module-material-ui.1cc685be.js +74 -0
  51. package/dist/embedded-app/static/module-material-ui.1cc685be.js.map +1 -0
  52. package/dist/embedded-app/static/module-octokit.74ddede2.js +5 -0
  53. package/dist/embedded-app/static/module-octokit.74ddede2.js.map +1 -0
  54. package/dist/embedded-app/static/{module-react-beautiful-dnd.6085a9b0.js → module-react-beautiful-dnd.aca52ceb.js} +2 -2
  55. package/dist/embedded-app/static/{module-react-beautiful-dnd.6085a9b0.js.map → module-react-beautiful-dnd.aca52ceb.js.map} +1 -1
  56. package/dist/embedded-app/static/{module-hot-loader.baa19dda.js → module-react-dom.803aace9.js} +5 -5
  57. package/dist/embedded-app/static/{module-hot-loader.baa19dda.js.map → module-react-dom.803aace9.js.map} +1 -1
  58. package/dist/embedded-app/static/{runtime.1f269f7a.js → runtime.32844cc3.js} +2 -2
  59. package/dist/embedded-app/static/{runtime.1f269f7a.js.map → runtime.32844cc3.js.map} +1 -1
  60. package/dist/embedded-app/static/vendor.32844cc3.js +236 -0
  61. package/dist/embedded-app/static/vendor.32844cc3.js.map +1 -0
  62. package/dist/index.cjs.js +1 -1
  63. package/dist/index.cjs.js.map +1 -1
  64. package/package.json +6 -7
  65. package/dist/embedded-app/static/1553.c2a9eb50.chunk.js +0 -3
  66. package/dist/embedded-app/static/1553.c2a9eb50.chunk.js.map +0 -1
  67. package/dist/embedded-app/static/2426.32fc1ca1.chunk.js +0 -3
  68. package/dist/embedded-app/static/2426.32fc1ca1.chunk.js.map +0 -1
  69. package/dist/embedded-app/static/3555.f3a9371e.chunk.js +0 -8
  70. package/dist/embedded-app/static/3555.f3a9371e.chunk.js.map +0 -1
  71. package/dist/embedded-app/static/390.74a27040.chunk.js +0 -3
  72. package/dist/embedded-app/static/390.74a27040.chunk.js.map +0 -1
  73. package/dist/embedded-app/static/4022.ca590614.chunk.js +0 -3
  74. package/dist/embedded-app/static/4022.ca590614.chunk.js.map +0 -1
  75. package/dist/embedded-app/static/4949.bffcfed7.chunk.js.map +0 -1
  76. package/dist/embedded-app/static/5162.95e4bb5d.chunk.js +0 -3
  77. package/dist/embedded-app/static/5162.95e4bb5d.chunk.js.map +0 -1
  78. package/dist/embedded-app/static/6235.61c00d19.chunk.js +0 -3
  79. package/dist/embedded-app/static/6235.61c00d19.chunk.js.map +0 -1
  80. package/dist/embedded-app/static/6583.492e5219.chunk.js +0 -3
  81. package/dist/embedded-app/static/6583.492e5219.chunk.js.map +0 -1
  82. package/dist/embedded-app/static/7110.766c71fc.chunk.js +0 -3
  83. package/dist/embedded-app/static/7110.766c71fc.chunk.js.map +0 -1
  84. package/dist/embedded-app/static/8061.f5e20bb7.chunk.js +0 -3
  85. package/dist/embedded-app/static/8061.f5e20bb7.chunk.js.map +0 -1
  86. package/dist/embedded-app/static/8718.2becf372.chunk.js +0 -4
  87. package/dist/embedded-app/static/8718.2becf372.chunk.js.map +0 -1
  88. package/dist/embedded-app/static/8792.6f60e67c.chunk.js +0 -3
  89. package/dist/embedded-app/static/8792.6f60e67c.chunk.js.map +0 -1
  90. package/dist/embedded-app/static/9028.1e31ab6a.chunk.js +0 -3
  91. package/dist/embedded-app/static/9028.1e31ab6a.chunk.js.map +0 -1
  92. package/dist/embedded-app/static/main.1f269f7a.js +0 -492
  93. package/dist/embedded-app/static/main.1f269f7a.js.map +0 -1
  94. package/dist/embedded-app/static/module-ajv.f2ae340e.js +0 -10
  95. package/dist/embedded-app/static/module-ajv.f2ae340e.js.map +0 -1
  96. package/dist/embedded-app/static/module-jss.df150ef8.js +0 -38
  97. package/dist/embedded-app/static/module-jss.df150ef8.js.map +0 -1
  98. package/dist/embedded-app/static/module-luxon.ee0def5d.js +0 -3
  99. package/dist/embedded-app/static/module-luxon.ee0def5d.js.map +0 -1
  100. package/dist/embedded-app/static/module-material-ui.cd8dff4a.js +0 -51
  101. package/dist/embedded-app/static/module-material-ui.cd8dff4a.js.map +0 -1
  102. package/dist/embedded-app/static/vendor.1f269f7a.js +0 -102
  103. package/dist/embedded-app/static/vendor.1f269f7a.js.map +0 -1
@@ -0,0 +1,492 @@
1
+ (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(bt,Pe,t){"use strict";t.d(Pe,{n3:function(){return z},MS:function(){return b}});var h=t(25271),n=t(23054),m=t(96279),T=t.n(m);const z=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class b{async getEntityAncestors(B,te){const{kind:q,namespace:Q,name:N}=(0,h.of)(B.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(Q)}/${encodeURIComponent(N)}/ancestry`,te)}async getLocationById(B,te){return await this.requestOptional("GET",`/locations/${encodeURIComponent(B)}`,te)}async getEntities(B,te){const{filter:q=[],fields:Q=[],offset:N,limit:G,after:H}=B!=null?B:{},ae=[];for(const k of[q].flat()){const O=[];for(const[A,ee]of Object.entries(k))for(const pe of[ee].flat())pe===z?O.push(encodeURIComponent(A)):typeof pe=="string"&&O.push(`${encodeURIComponent(A)}=${encodeURIComponent(pe)}`);O.length&&ae.push(`filter=${O.join(",")}`)}Q.length&&ae.push(`fields=${Q.map(encodeURIComponent).join(",")}`),N!==void 0&&ae.push(`offset=${N}`),G!==void 0&&ae.push(`limit=${G}`),H!==void 0&&ae.push(`after=${encodeURIComponent(H)}`);const ie=ae.length?`?${ae.join("&")}`:"",R=await this.requestRequired("GET",`/entities${ie}`,te),I=(k,O)=>{var A,ee;if(((A=k.metadata)===null||A===void 0?void 0:A.name)===void 0||k.kind===void 0||((ee=O.metadata)===null||ee===void 0?void 0:ee.name)===void 0||O.kind===void 0)return 0;const pe=(0,h.eE)(k),Ke=(0,h.eE)(O);return pe<Ke?-1:pe>Ke?1:0};return{items:R.sort(I)}}async getEntityByRef(B,te){const{kind:q,namespace:Q,name:N}=(0,h.of)(B);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(Q)}/${encodeURIComponent(N)}`,te)}async getEntityByName(B,te){const{kind:q,namespace:Q="default",name:N}=B;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(q)}/${encodeURIComponent(Q)}/${encodeURIComponent(N)}`,te)}async refreshEntity(B,te){const q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({entityRef:B})});if(q.status!==200)throw new Error(await q.text())}async getEntityFacets(B,te){const{filter:q=[],facets:Q}=B,N=[];for(const H of[q].flat()){const ae=[];for(const[ie,R]of Object.entries(H))for(const I of[R].flat())I===z?ae.push(encodeURIComponent(ie)):typeof I=="string"&&ae.push(`${encodeURIComponent(ie)}=${encodeURIComponent(I)}`);ae.length&&N.push(`filter=${ae.join(",")}`)}for(const H of Q)N.push(`facet=${encodeURIComponent(H)}`);const G=N.length?`?${N.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${G}`,te)}async addLocation(B,te){const{type:q="url",target:Q,dryRun:N}=B,G=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${N?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(te==null?void 0:te.token)&&{Authorization:`Bearer ${te==null?void 0:te.token}`}},method:"POST",body:JSON.stringify({type:q,target:Q})});if(G.status!==201)throw new Error(await G.text());const{location:H,entities:ae,exists:ie}=await G.json();if(!H)throw new Error(`Location wasn't added: ${Q}`);return{location:H,entities:ae,exists:ie}}async getLocationByRef(B,te){return(await this.requestRequired("GET","/locations",te)).map(Q=>Q.data).find(Q=>B===(0,h.NZ)(Q))}async removeLocationById(B,te){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(B)}`,te)}async removeEntityByUid(B,te){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(B)}`,te)}async requestIgnored(B,te,q){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,N=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},G=await this.fetchApi.fetch(Q,{method:B,headers:N});if(!G.ok)throw await n.VL.fromResponse(G)}async requestRequired(B,te,q){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,N=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},G=await this.fetchApi.fetch(Q,{method:B,headers:N});if(!G.ok)throw await n.VL.fromResponse(G);return await G.json()}async requestOptional(B,te,q){const Q=`${await this.discoveryApi.getBaseUrl("catalog")}${te}`,N=q!=null&&q.token?{Authorization:`Bearer ${q.token}`}:{},G=await this.fetchApi.fetch(Q,{method:B,headers:N});if(!G.ok){if(G.status===404)return;throw await n.VL.fromResponse(G)}return await G.json()}constructor(B){this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi||{fetch:T()}}}},25271:function(bt,Pe,t){"use strict";t.d(Pe,{Tf:function(){return m},P1:function(){return oe},q1:function(){return W},M6:function(){return he},l2:function(){return n},zG:function(){return h},w$:function(){return fn},nP:function(){return Ln},aS:function(){return _e},S4:function(){return zt},cz:function(){return We},iB:function(){return lt},CV:function(){return Ge},of:function(){return ct},Ou:function(){return ve},eE:function(){return nt},NZ:function(){return be}});const h="default",n="backstage.io/view-url",m="backstage.io/edit-url",T="kubernetes.io/api-server",z="kubernetes.io/api-server-certificate-authority",b="kubernetes.io/auth-provider";var l=t(76635),B=t.n(l);class te{async enforce(S){return S.metadata.namespace?S:lodash.merge({metadata:{namespace:this.namespace}},S)}constructor(S=DEFAULT_NAMESPACE){this.namespace=S}}class q{static isValidPrefixAndOrSuffix(S,K,Ae,Oe){if(typeof S!="string")return!1;const Ve=S.split(K);return Ve.length===1?Oe(Ve[0]):Ve.length===2?Ae(Ve[0])&&Oe(Ve[1]):!1}static isJsonSafe(S){try{return B().isEqual(S,JSON.parse(JSON.stringify(S)))}catch{return!1}}static isValidDnsSubdomain(S){return typeof S=="string"&&S.length>=1&&S.length<=253&&S.split(".").every(q.isValidDnsLabel)}static isValidDnsLabel(S){return typeof S=="string"&&S.length>=1&&S.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(S)}static isValidTag(S){return typeof S=="string"&&S.length>=1&&S.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(S)}static isValidUrl(S){if(typeof S!="string")return!1;try{return new URL(S),!0}catch{return!1}}static isValidString(S){var K;return typeof S=="string"&&((K=S==null?void 0:S.trim())===null||K===void 0?void 0:K.length)>=1}static isNonEmptyString(S){var K;return typeof S=="string"&&((K=S==null?void 0:S.trim())===null||K===void 0?void 0:K.length)>=1}}var Q=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}}}}}'),N=t(27991),G=t.n(N),H=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"}}}`),ae=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}}}}}}'),ie=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 R=new Map,I=[Q,H,ae,ie];function k(V){if(!(V!=null&&V.length))throw new TypeError("Unknown error");const S=V[0];throw new TypeError(`${S.instancePath||"<root>"} ${S.message}${S.params?` - ${Object.entries(S.params).map(([K,Ae])=>`${K}: ${Ae}`).join(", ")}`:""}`)}function O(V,S={}){var K;const Ae=(K=S==null?void 0:S.disableCache)!==null&&K!==void 0?K:!1,Oe=Ae?"":JSON.stringify(V);if(!Ae){const Zt=R.get(Oe);if(Zt)return Zt}const Ve=A(V),ot=new(G())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Ve.length&&ot.addSchema(Ve,void 0,void 0,!0);const Ft=ot.compile(V);return Ae||R.set(Oe,Ft),Ft}function A(V){if(typeof V!="object")return[];const S=new Set;V.$id&&S.add(V.$id);const K=new Array,Ae=[V];for(;Ae.length;){const Oe=Ae.pop();for(const Ve of ee(Oe))if(!S.has(Ve)){S.add(Ve);const ot=I.find(Ft=>Ft.$id===Ve);ot&&(K.push(ot),Ae.push(ot))}}return K}function*ee(V){const S=[V];for(;S.length;){const K=S.pop();if(typeof K=="object"&&K)for(const[Ae,Oe]of Object.entries(K))Ae==="$ref"&&typeof Oe=="string"?yield Oe.split("#")[0]:S.push(Oe)}}function pe(V){const S=compileAjvSchema(V||entityEnvelopeSchema);return K=>{if(S(K)===!0)return K;throw throwAjvError(S.errors)}}function Ke(V){const S=O(V);return K=>{var Ae;if(S(K)===!0)return K;const Ve=(Ae=S.errors)===null||Ae===void 0?void 0:Ae.filter(ot=>["/kind","/apiVersion"].includes(ot.instancePath));if((Ve==null?void 0:Ve.length)&&Ve.every(ot=>ot.keyword==="enum"))return!1;throw k(S.errors)}}function qe(V){const S=compileAjvSchema(V||entitySchema);return K=>{if(S(K)===!0)return K;throw throwAjvError(S.errors)}}class He{static isValidApiVersion(S){return q.isValidPrefixAndOrSuffix(S,"/",q.isValidDnsSubdomain,K=>K.length>=1&&K.length<=63&&/^[a-z0-9A-Z]+$/.test(K))}static isValidKind(S){return typeof S=="string"&&S.length>=1&&S.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(S)}static isValidObjectName(S){return typeof S=="string"&&S.length>=1&&S.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(S)}static isValidNamespace(S){return q.isValidDnsLabel(S)}static isValidLabelKey(S){return q.isValidPrefixAndOrSuffix(S,"/",q.isValidDnsSubdomain,He.isValidObjectName)}static isValidLabelValue(S){return S===""||He.isValidObjectName(S)}static isValidAnnotationKey(S){return q.isValidPrefixAndOrSuffix(S,"/",q.isValidDnsSubdomain,He.isValidObjectName)}static isValidAnnotationValue(S){return typeof S=="string"}}const Je={isValidApiVersion:He.isValidApiVersion,isValidKind:He.isValidKind,isValidEntityName:He.isValidObjectName,isValidNamespace:He.isValidNamespace,isValidLabelKey:He.isValidLabelKey,isValidLabelValue:He.isValidLabelValue,isValidAnnotationKey:He.isValidAnnotationKey,isValidAnnotationValue:He.isValidAnnotationValue,isValidTag:V=>typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(V)};function Ye(V={}){return{...Je,...V}}class Ue{async enforce(S){function K(E,X,ye){if(X==null)throw new Error(`${E} must have a value`);let fe;try{fe=ye(X)}catch(ke){throw new Error(`${E} could not be validated, ${ke}`)}if(!fe){let ke;switch(ye.name){case"isValidLabelValue":case"isValidObjectName":ke="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":ke="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":ke="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":ke="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":ke="a string";break;case"isValidKind":ke="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":ke="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":ke="a non empty string";break;default:ke=void 0;break}const De=ke?` expected ${ke} but found "${X}".`:"";throw new Error(`"${E}" is not valid;${De} 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 Ae(E,X,ye){return X===void 0||K(E,X,ye)}K("apiVersion",S.apiVersion,this.validators.isValidApiVersion),K("kind",S.kind,this.validators.isValidKind),K("metadata.name",S.metadata.name,this.validators.isValidEntityName),Ae("metadata.namespace",S.metadata.namespace,this.validators.isValidNamespace);var Oe;for(const[E,X]of Object.entries((Oe=S.metadata.labels)!==null&&Oe!==void 0?Oe:[]))K(`labels.${E}`,E,this.validators.isValidLabelKey),K(`labels.${E}`,X,this.validators.isValidLabelValue);var Ve;for(const[E,X]of Object.entries((Ve=S.metadata.annotations)!==null&&Ve!==void 0?Ve:[]))K(`annotations.${E}`,E,this.validators.isValidAnnotationKey),K(`annotations.${E}`,X,this.validators.isValidAnnotationValue);var ot;const Ft=(ot=S.metadata.tags)!==null&&ot!==void 0?ot:[];for(let E=0;E<Ft.length;++E)K(`tags.${E}`,Ft[E],this.validators.isValidTag);var Zt;const qt=(Zt=S.metadata.links)!==null&&Zt!==void 0?Zt:[];for(let E=0;E<qt.length;++E){var Vt,Ht,jn;K(`links.${E}.url`,(Vt=qt[E])===null||Vt===void 0?void 0:Vt.url,CommonValidatorFunctions.isValidUrl),Ae(`links.${E}.title`,(Ht=qt[E])===null||Ht===void 0?void 0:Ht.title,CommonValidatorFunctions.isNonEmptyString),Ae(`links.${E}.icon`,(jn=qt[E])===null||jn===void 0?void 0:jn.icon,KubernetesValidatorFunctions.isValidObjectName)}return S}constructor(S=makeValidator()){this.validators=S}}class ze{async enforce(S){if(!this.validate){const Oe=new Ajv({allowUnionTypes:!0});this.validate=Oe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(S)===!0)return S;const[Ae]=this.validate.errors||[];throw Ae?new Error(`Malformed envelope, ${Ae.instancePath||"<root>"} ${Ae.message}`):new Error("Malformed envelope, Unknown error")}}function tt(V){let S=V.indexOf(":");const K=V.indexOf("/");K!==-1&&K<S&&(S=-1);const Ae=S===-1?void 0:V.slice(0,S),Oe=K===-1?void 0:V.slice(S+1,K),Ve=V.slice(Math.max(S+1,K+1));if(Ae===""||Oe===""||Ve==="")throw new TypeError(`Entity reference "${V}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ae,namespace:Oe,name:Ve}}function lt(V){return{kind:V.kind,namespace:V.metadata.namespace||h,name:V.metadata.name}}function ct(V,S){if(!V)throw new Error("Entity reference must not be empty");const K=S==null?void 0:S.defaultKind,Ae=(S==null?void 0:S.defaultNamespace)||h;let Oe,Ve,ot;if(typeof V=="string"){const Ht=tt(V);var Ft;Oe=(Ft=Ht.kind)!==null&&Ft!==void 0?Ft:K;var Zt;Ve=(Zt=Ht.namespace)!==null&&Zt!==void 0?Zt:Ae,ot=Ht.name}else{var qt;Oe=(qt=V.kind)!==null&&qt!==void 0?qt:K;var Vt;Ve=(Vt=V.namespace)!==null&&Vt!==void 0?Vt:Ae,ot=V.name}if(Oe)if(Ve){if(!ot){const Ht=JSON.stringify(V);throw new Error(`Entity reference ${Ht} had missing or empty name`)}}else{const Ht=JSON.stringify(V);throw new Error(`Entity reference ${Ht} had missing or empty namespace`)}else{const Ht=JSON.stringify(V);throw new Error(`Entity reference ${Ht} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Oe,namespace:Ve,name:ot}}function nt(V){let S,K,Ae;if("metadata"in V){S=V.kind;var Oe;K=(Oe=V.metadata.namespace)!==null&&Oe!==void 0?Oe:h,Ae=V.metadata.name}else{S=V.kind;var Ve;K=(Ve=V.namespace)!==null&&Ve!==void 0?Ve:h,Ae=V.name}return`${S.toLocaleLowerCase("en-US")}:${K.toLocaleLowerCase("en-US")}/${Ae.toLocaleLowerCase("en-US")}`}class Ce{async enforce(S){let K=S;for(const Ae of this.policies){const Oe=await Ae.enforce(K);if(!Oe)throw new Error(`Policy ${Ae.constructor.name} did not return a result`);K=Oe}return K}constructor(S){this.policies=S}}class rt{async enforce(S){for(const K of this.policies){const Ae=await K.enforce(S);if(Ae)return Ae}throw new Error("The entity did not match any known policy")}constructor(S){this.policies=S}}const gt={allOf(V){return new Ce(V)},oneOf(V){return new rt(V)}};var Le=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 se(V){const S=Ke(V);return{async check(K){return S(K)===K}}}const xe=se(Le);var Re=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const st=se(Re);var pt=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 Ct=se(pt);var dt=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 jt=se(dt);var St=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 Lt=se(St),zt="ownedBy",mt="ownerOf",ln="consumesApi",Nt="apiConsumedBy",dn="providesApi",un="apiProvidedBy",Ln="dependsOn",fn="dependencyOf",On="parentOf",Ee="childOf",Te="memberOf",Be="hasMember",We="partOf",_e="hasPart";var at=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 ht=se(at);var wt=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 Tt=se(wt);var Pt=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 It=se(Pt),oe="backstage.io/managed-by-location",W="backstage.io/managed-by-origin-location",he="backstage.io/source-location";function ve(V){if(typeof V!="string")throw new TypeError(`Unable to parse location ref '${V}', unexpected argument ${typeof V}`);const S=V.indexOf(":");if(S<0)throw new TypeError(`Unable to parse location ref '${V}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const K=V.substring(0,S).trim(),Ae=V.substring(S+1).trim();if(!K||!Ae)throw new TypeError(`Unable to parse location ref '${V}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(K==="http"||K==="https")throw new TypeError(`Invalid location ref '${V}', please prefix it with 'url:', e.g. 'url:${V}'`);return{type:K,target:Ae}}function be(V){const{type:S,target:K}=V;if(S){if(!K)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${S}:${K}`}function Ge(V){var S,K,Ae,Oe,Ve;const ot=(Ve=(S=V.metadata)===null||S===void 0||(K=S.annotations)===null||K===void 0?void 0:K[he])!==null&&Ve!==void 0?Ve:(Ae=V.metadata)===null||Ae===void 0||(Oe=Ae.annotations)===null||Oe===void 0?void 0:Oe[oe];if(!ot)throw new Error(`Entity '${nt(V)}' is missing location`);return ve(ot)}},1515:function(bt,Pe,t){"use strict";t.d(Pe,{zx:function(){return qe},Oi:function(){return Ce},VY:function(){return ji},yW:function(){return Ua},XF:function(){return Le},mn:function(){return he},NX:function(){return h},ub:function(){return qt},mf:function(){return Wa},yu:function(){return x},h4:function(){return Oi},M6:function(){return ts},i9:function(){return tl},aR:function(){return Ei},rJ:function(){return yr},Oh:function(){return ll},hu:function(){return ol},rU:function(){return pe},nU:function(){return os},sk:function(){return jn},Or:function(){return ls},T3:function(){return Bi},g9:function(){return ul},Ex:function(){return ds},Gk:function(){return C},tn:function(){return Ai},Ph:function(){return Qt},YE:function(){return Jo},v7:function(){return Xi},R6:function(){return wi},tR:function(){return Zo},uw:function(){return da},qt:function(){return vi},iA:function(){return Pa},GB:function(){return Bn},po:function(){return rr},mZ:function(){return As},Pf:function(){return Or}});var h={};t.r(h),t.d(h,{Nm:function(){return se},ht:function(){return st},LJ:function(){return Re}});var n=t(52322),m=t(2784),T=t(25248),z=t(19928);function b(e){const[s,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"}}=e;if(useEffect(()=>{const $=d.alert$().subscribe(M=>i(Z=>Z.concat(M)));return()=>{$.unsubscribe()}},[d]),s.length===0)return null;const[g]=s,w=()=>{i($=>$.filter(M=>M!==g))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:w,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:g.severity,children:_jsxs("span",{children:[g.message.toString(),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),B=t(12420);const te=(0,l.Z)(e=>(0,B.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:d}=e,p=te();let g={...d};return i||(g={backgroundColor:stringToColor(s||""),...d}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:g,children:s&&extractInitials(s)})}var Q=t(77277),N=t(72779),G=t.n(N),H=t(86689),ae=t(62833),ie=t(76635);const R=(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"}),I=e=>/^([a-z+.-]+):/.test(e),k=()=>{try{return(0,T.h_)(T.Ds).getOptionalString("app.baseUrl")}catch{return}},O=()=>{const e="http://dummy.dev";var s;const i=(s=k())!==null&&s!==void 0?s:"/",{pathname:d}=new URL(i,e);return(0,ie.trimEnd)(d,"/")},A=e=>{let s=String(e);const i=O(),d=I(s),p=s.startsWith(i);return!d&&!p&&(s=i.concat(s)),s},ee=e=>{if(e instanceof Array)return e.map(ee).join(" ").trim();if(typeof e=="object"&&e){var s,i;return ee((s=e)===null||s===void 0||(i=s.props)===null||i===void 0?void 0:i.children)}return["string","number"].includes(typeof e)?String(e):""},pe=m.forwardRef(({onClick:e,noTrack:s,...i},d)=>{const p=R(),g=(0,T.z$)(),w=A(i.to),$=ee(i.children)||w,M=I(w),Z=M&&!!/^https?:/.exec(w),ue=re=>{e==null||e(re),s||g.captureEvent("click",$,{attributes:{to:w}})};return M?(0,n.jsxs)(H.Z,{...Z?{target:"_blank",rel:"noopener"}:{},...i,ref:d,href:w,onClick:ue,className:G()(p.externalLink,i.className),children:[i.children,(0,n.jsx)("span",{className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(H.Z,{...i,ref:d,component:ae.rU,to:w,onClick:ue})}),Ke=m.forwardRef((e,s)=>(0,n.jsx)(pe,{ref:s,...e,color:"initial"})),qe=m.forwardRef((e,s)=>(0,n.jsx)(Q.Z,{ref:s,component:Ke,...e}));var He=t(60364),Je=t(61837),Ye=t(80030),Ue=t(19353),ze=t(95074);function tt(e){const{text:s,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,g=(0,T.h_)(T.VE),[w,$]=(0,m.useState)(!1),[{error:M},Z]=(0,ze.Z)();(0,m.useEffect)(()=>{M&&g.post(M)},[M,g]);const ue=re=>{re.stopPropagation(),$(!0),Z(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ye.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>$(!1),open:w,children:(0,n.jsx)(Je.Z,{onClick:ue,"aria-label":p,children:(0,n.jsx)(Ue.Z,{})})})})}var lt=t(83229),ct=t(26639),nt=t(39595);function Ce(e){const{text:s,language:i,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:g,showCopyCodeButton:w=!1}=e,$=(0,He.Z)(),M=$.palette.type==="dark"?ct.Z:nt.Z,Z=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(lt.Z,{customStyle:g,language:i,style:M,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:ue=>p!=null&&p.includes(ue)?{style:{backgroundColor:Z}}:{},children:s}),w&&(0,n.jsx)("div",{style:{position:"absolute",top:0,right:0},children:(0,n.jsx)(tt,{text:s})})]})}var rt=t(41156),gt=t(88188);function Le(e){const{title:s,to:i}=e,d=(0,rt.Z)(p=>p.breakpoints.down("xs"));return i?d?(0,n.jsx)(Je.Z,{component:ae.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(gt.Z,{})}):(0,n.jsx)(Q.Z,{component:ae.rU,variant:"contained",color:"primary",to:i,children:s}):null}var se;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(se||(se={}));var xe;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(xe||(xe={}));var Re;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Re||(Re={}));var st;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(st||(st={}));var pt=t(27397),Ct=t(11105),dt=t(97963),jt=t(46506),St=t.n(jt),Lt=t(54073),zt=t.n(Lt),mt=t(10368);const ln=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Nt({node:{id:e}}){const s=ln(),[i,d]=m.useState(0),[p,g]=m.useState(0),w=m.useRef(null);m.useLayoutEffect(()=>{if(w.current){let{height:ue,width:re}=w.current.getBBox();ue=Math.round(ue),re=Math.round(re),(ue!==p||re!==i)&&(d(re),g(ue))}},[i,p]);const $=10,M=i+$*2,Z=p+$*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:M,height:Z,rx:10}),(0,n.jsx)("text",{ref:w,className:s.text,y:Z/2,x:M/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const dn="arrow-marker",un="node",Ln="edge",fn="label",On=(0,mt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Ee=e=>(0,n.jsx)(Nt,{...e});function Te({render:e=Ee,setNode:s,node:i}){const{width:d,height:p,x:g=0,y:w=0}=i,$=i,M=On(),Z=m.useRef(null);return m.useLayoutEffect(()=>{if(Z.current){let{height:ue,width:re}=Z.current.getBBox();ue=Math.round(ue),re=Math.round(re),(ue!==p||re!==d)&&s(i.id,{...i,height:ue,width:re})}},[i,d,p,s]),(0,n.jsx)("g",{ref:Z,"data-testid":un,className:M.node,transform:`translate(${g-d/2},${w-p/2})`,children:e({node:$})})}var Be=t(55876),We=t(66481),_e=t(19574),at=t.n(_e);const ht=(0,mt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function wt({edge:{label:e}}){const s=ht();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const Tt=(0,mt.Z)(e=>({path:{strokeWidth:2,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),Pt=e=>(0,n.jsx)(wt,{...e}),It=Be.Z().x(e=>e.x).y(e=>e.y).curve(We.Z);function oe({render:e=Pt,setEdge:s,id:i,edge:d}){const{x:p=0,y:g=0,width:w,height:$,points:M}=d,Z=d,ue=Tt(),re=m.useRef(null);m.useLayoutEffect(()=>{if(re.current){let{height:Se,width:Fe}=re.current.getBBox();Se=Math.round(Se),Fe=Math.round(Fe),(Se!==$||Fe!==w)&&s(i,{...d,height:Se,width:Fe})}},[d,$,w,s,i]);let ce="";if(M){const Se=M.filter(Fe=>at()(Fe.x)&&at()(Fe.y));ce=It(Se)||""}return(0,n.jsxs)(n.Fragment,{children:[ce&&(0,n.jsx)("path",{"data-testid":Ln,className:ue.path,markerEnd:`url(#${dn})`,d:ce}),Z.label?(0,n.jsx)("g",{ref:re,"data-testid":fn,className:ue.label,transform:`translate(${p},${g})`,children:e({edge:Z})}):null]})}const W="workspace";function he(e){var s,i;const{edges:d,nodes:p,renderNode:g,direction:w=se.TOP_BOTTOM,align:$,nodeMargin:M=50,edgeMargin:Z=10,rankMargin:ue=50,paddingX:re=0,paddingY:ce=0,acyclicer:Se,ranker:Fe=Re.NETWORK_SIMPLEX,labelPosition:ut=st.RIGHT,labelOffset:Mt=10,edgeRanks:Yt=1,edgeWeight:en=1,renderLabel:tn,defs:At,zoom:Xt="enabled",...Jt}=e,dr=(0,dt.Z)(),[Yn,ur]=m.useState(100),[hr,si]=m.useState(100),Gt=m.useRef(new(St()).graphlib.Graph),[_r,lo]=m.useState(((s=Gt.current.graph())===null||s===void 0?void 0:s.width)||0),[es,co]=m.useState(((i=Gt.current.graph())===null||i===void 0?void 0:i.height)||0),[uo,oi]=m.useState([]),[wn,or]=m.useState([]),Jn=Math.max(_r,Yn),Wn=Math.max(es,hr),mn=m.useMemo(()=>zt()(cn=>{if(!cn)return;const Cn=Ct.Z(cn),an=Ct.Z(cn.getElementById(W));function Qn(){Cn.call(pt.sP().scaleExtent([1,10]).on("zoom",pr=>{pr.transform.x=Math.min(0,Math.max(pr.transform.x,Jn-Jn*pr.transform.k)),pr.transform.y=Math.min(0,Math.max(pr.transform.y,Wn-Wn*pr.transform.k)),an.attr("transform",pr.transform)}))}Xt==="enabled"?Qn():Xt==="enable-on-click"&&Cn.on("click",()=>Qn());const{width:Xn,height:ho}=cn.getBoundingClientRect();Yn!==Xn&&ur(Xn),hr!==ho&&si(ho)},100),[hr,Yn,Jn,Wn,Xt]),Rn=m.useCallback(()=>{const cn=Gt.current.nodes(),Cn=Gt.current.edges();cn.forEach(an=>{p.some(Xn=>Xn.id===an)||Gt.current.removeNode(an)}),Cn.forEach(an=>{d.some(Xn=>Xn.from===an.v&&Xn.to===an.w)||Gt.current.removeEdge(an.v,an.w)}),p.forEach(an=>{const Qn=Gt.current.nodes().find(Xn=>an.id===Xn);if(Qn&&Gt.current.node(Qn)){const{width:Xn,height:ho,x:pr,y:Il}=Gt.current.node(Qn);Gt.current.setNode(Qn,{...an,width:Xn,height:ho,x:pr,y:Il})}else Gt.current.setNode(an.id,{...an,width:0,height:0})}),d.forEach(an=>{Gt.current.setEdge(an.from,an.to,{...an,label:an.label,width:0,height:0,labelpos:ut,labeloffset:Mt,weight:en,minlen:Yt})})},[d,p,ut,Mt,en,Yt]),ir=m.useMemo(()=>zt()(()=>{St().layout(Gt.current);const{height:cn,width:Cn}=Gt.current.graph(),an=Math.max(0,cn||0),Qn=Math.max(0,Cn||0);lo(Qn),co(an),oi(Gt.current.nodes()),or(Gt.current.edges())},250,{leading:!0}),[]);m.useEffect(()=>(Gt.current.setGraph({rankdir:w,align:$,nodesep:M,edgesep:Z,ranksep:ue,marginx:re,marginy:ce,acyclicer:Se,ranker:Fe}),Rn(),ir(),ir.cancel),[Se,$,w,Z,re,ce,M,ue,Fe,Rn,ir]);function $r(cn,Cn){return Gt.current.setNode(cn,Cn),ir(),Gt.current}function Is(cn,Cn){return Gt.current.setEdge(cn,Cn),ir(),Gt.current}return(0,n.jsxs)("svg",{ref:mn,...Jt,width:"100%",height:Wn,viewBox:`0 0 ${Jn} ${Wn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:dn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:dr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),At]}),(0,n.jsx)("g",{id:W,children:(0,n.jsxs)("svg",{width:_r,height:es,y:Wn/2-es/2,x:Jn/2-_r/2,viewBox:`0 0 ${_r} ${es}`,children:[wn.map(cn=>{const Cn=Gt.current.edge(cn);return Cn?(0,n.jsx)(oe,{id:cn,setEdge:Is,render:tn,edge:Cn},`${cn.v}-${cn.w}`):null}),uo.map(cn=>{const Cn=Gt.current.node(cn);return Cn?(0,n.jsx)(Te,{setNode:$r,render:g,node:Cn},cn):null})]})})]})}var ve;const be=(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:(ve=e.palette.banner.warning)!==null&&ve!==void 0?ve:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Ge=e=>{const{variant:s,message:i,id:d,fixed:p=!1}=e,g=be(),$=useApi(storageApiRef).forBucket("notifications");var M;const Z=(M=$.snapshot("dismissedBanners").value)!==null&&M!==void 0?M:[],[ue,re]=useState(new Set(Z)),ce=useObservable($.observe$("dismissedBanners"));useEffect(()=>{if(ce!=null&&ce.value){var Fe;const ut=(Fe=ce==null?void 0:ce.value)!==null&&Fe!==void 0?Fe:[];re(new Set(ut))}},[ce==null?void 0:ce.value]);const Se=()=>{$.set("dismissedBanners",[...ue,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ue.has(d),classes:{root:classNames(g.root,!p&&g.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(g.content,g[s]),message:g.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Se,children:_jsx(Close,{className:g.icon})},"dismiss")]})})};var V=t(60905),S=t(90436),K=t.p+"static/missingAnnotation.67f79e98..svg",Ae=t.p+"static/noInformation.4b426325..svg",Oe=t.p+"static/createComponent.975d1e1e..svg",Ve=t.p+"static/noBuild.1715fa71..svg";const ot=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Ft=({missing:e})=>{const s=ot();switch(e){case"field":return(0,n.jsx)("img",{src:K,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:Ae,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:Oe,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:Ve,alt:"no Build",className:s.generalImg});default:return null}},Zt=(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 qt(e){const{title:s,description:i,missing:d,action:p}=e,g=Zt();return(0,n.jsxs)(V.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:g.root,spacing:2,children:[(0,n.jsx)(V.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(V.Z,{container:!0,direction:"column",children:[(0,n.jsx)(V.Z,{item:!0,xs:!0,children:(0,n.jsx)(S.Z,{variant:"h5",children:s})}),(0,n.jsx)(V.Z,{item:!0,xs:!0,children:(0,n.jsx)(S.Z,{variant:"body1",children:i})}),(0,n.jsx)(V.Z,{item:!0,xs:!0,className:g.action,children:p})]})}),(0,n.jsx)(V.Z,{item:!0,xs:12,md:6,className:g.imageContainer,children:typeof d=="string"?(0,n.jsx)(Ft,{missing:d}):d.customImage})]})}const Vt=`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`,Ht=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function jn(e){const{annotation:s,readMoreUrl:i}=e,d=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",p=Ht(),g=(0,n.jsxs)(n.Fragment,{children:["The ",(0,n.jsx)("code",{children:s})," annotation is missing. You need to add the annotation to your component if you want to enable this tool."]});return(0,n.jsx)(qt,{missing:"field",title:"Missing Annotation",description:g,action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:p.code,children:(0,n.jsx)(Ce,{text:Vt.replace("ANNOTATION",s),language:"yaml",showLineNumbers:!0,highlightedNumbers:[6,7],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(Q.Z,{color:"primary",component:pe,to:d,children:"Read more"})]})})}var E=t(11776),X=t(38402),ye=t(49378),fe=t(41128),ke=t(27616),De=t(8284),yt=t(70660),Dt=t(91750),_t=t(38016);const Ut=(e,s)=>(s.palette.type==="light"?fe._j:fe.$n)(s.palette[e].light,.6),nn=(e,s)=>(s.palette.type==="light"?fe.$n:fe._j)(s.palette[e].light,.9),kt=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>Ut(s,e)}})),rn=({severity:e})=>{const s=kt({severity:e});return(0,n.jsx)(Dt.Z,{classes:s})},Gn=({severity:e})=>{const s=kt({severity:e});return(0,n.jsx)(_t.Z,{classes:s})},En=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>nn(s,e),color:({severity:s})=>Ut(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>Ut(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>Ut(s,e),backgroundColor:({severity:s})=>nn(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"}),$n=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Bn(e){const{severity:s="warning",title:i,message:d,children:p,defaultExpanded:g}=e,w=En({severity:s}),$=$n(s)+(i?`: ${i}`:"");return(0,n.jsxs)(ke.Z,{defaultExpanded:g!=null?g:!1,className:w.panel,role:"alert",children:[(0,n.jsxs)(De.Z,{expandIcon:(0,n.jsx)(Gn,{severity:s}),className:w.summary,children:[(0,n.jsx)(rn,{severity:s}),(0,n.jsx)(S.Z,{className:w.summaryText,variant:"subtitle1",children:$})]}),(d||p)&&(0,n.jsx)(yt.Z,{children:(0,n.jsxs)(V.Z,{container:!0,children:[d&&(0,n.jsx)(V.Z,{item:!0,xs:12,children:(0,n.jsx)(S.Z,{className:w.message,variant:"body1",children:d})}),p&&(0,n.jsx)(V.Z,{item:!0,xs:12,className:w.details,children:p})]})})]})}const qn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Wt=({error:e,message:s,stack:i,children:d})=>{const p=qn();return(0,n.jsxs)(E.Z,{dense:!0,children:[(0,n.jsxs)(X.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ye.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(tt,{text:e})]}),(0,n.jsxs)(X.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ye.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(tt,{text:s})]}),i&&(0,n.jsxs)(X.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ye.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(tt,{text:i})]}),d]})};function x(e){const{title:s,error:i,defaultExpanded:d,children:p}=e;return(0,n.jsx)(Bn,{severity:"error",title:s!=null?s:i.message,defaultExpanded:d,children:(0,n.jsx)(Wt,{error:i.name,message:i.message,stack:i.stack,children:p})})}var u=t(85256);const y=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function C(e){var s;const{title:i,error:d,defaultExpanded:p}=e,g=y();if(d.name!=="ResponseError")return(0,n.jsx)(x,{title:i!=null?i:d.message,defaultExpanded:p,error:d});const{body:w,cause:$}=d,{request:M,response:Z}=w,ue=`${Z.statusCode}: ${$.name}`,re=M&&`${M.method} ${M.url}`,ce=$.message.replace(/\\n/g,`
12
+ `),Se=(s=$.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
13
+ `),Fe=JSON.stringify(w,void 0,2);return(0,n.jsxs)(x,{title:i!=null?i:d.message,defaultExpanded:p,error:{name:ue,message:ce,stack:Se},children:[re&&(0,n.jsxs)(X.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ye.Z,{classes:{secondary:g.text},primary:"Request",secondary:M?`${re}`:void 0}),(0,n.jsx)(tt,{text:re})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{component:"li",className:g.divider}),(0,n.jsx)(X.Z,{alignItems:"flex-start",children:(0,n.jsx)(ye.Z,{classes:{secondary:g.text},primary:"Full Error as JSON"})}),(0,n.jsx)(Ce,{language:"json",text:Fe,showCopyCodeButton:!0})]})]})}var Y=t(28316);function de(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function ge(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Ie(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),g=p||de(e);return p||ge(g),g.appendChild(s.current),function(){s.current.remove(),g.childNodes.length===-1&&g.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var et=null;const Ot="core.calloutSeen";function Rt(){const[e,s]=useState(()=>{const d=localStorage.getItem(Ot);return d?JSON.parse(d):{}}),i=useCallback((d,p)=>{const g=localStorage.getItem(Ot),$={...g?JSON.parse(g):{},[d]:p};s($),localStorage.setItem(Ot,JSON.stringify($))},[]);return{states:e,setState:i}}function _n(e){const{states:s,setState:i}=Rt(),d=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:d}}function Cr(e){const{seen:s,markSeen:i}=_n(e);return{show:s===!1,hide:i}}const jr=(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 ar(e){const{featureId:s,title:i,description:d,children:p}=e,{show:g,hide:w}=useShowCallout(s),$=usePortal("core.callout"),M=useRef(null),[Z,ue]=useState(),re=jr(),ce=useCallback(()=>{if(M.current){const Se=M.current.getBoundingClientRect(),Fe=Math.max(Se.width,Se.height),ut=800,Mt=Se.x-(Fe-Se.width)/2-ut,Yt=Se.y-(Fe-Se.height)/2-ut,en=Fe+2*ut,tn=450,At=Se.x+Se.width/2-tn,Xt=Se.y-(Fe-Se.height)/2+Fe+20;ue({dotLeft:Mt,dotTop:Yt,dotSize:en,borderWidth:ut,textTop:Xt,textLeft:At,textWidth:tn})}},[]);return useEffect(()=>(window.addEventListener("resize",ce),window.addEventListener("scroll",ce),()=>{window.removeEventListener("resize",ce),window.removeEventListener("scroll",ce)}),[ce]),useLayoutEffect(ce,[M.current,ce]),g?_jsxs(_Fragment,{children:[_jsx("div",{className:re.featureWrapper,ref:M,children:p}),createPortal(_jsx("div",{className:re.backdrop,children:_jsx(ClickAwayListener,{onClickAway:w,children:_jsxs(_Fragment,{children:[_jsx("div",{className:re.dot,"data-testid":"dot",style:{left:Z==null?void 0:Z.dotLeft,top:Z==null?void 0:Z.dotTop,width:Z==null?void 0:Z.dotSize,height:Z==null?void 0:Z.dotSize,borderWidth:Z==null?void 0:Z.borderWidth},onClick:w,onKeyDown:w,role:"button",tabIndex:0,children:_jsx("div",{className:re.pulseCircle})}),_jsxs("div",{className:re.text,"data-testid":"text",style:{left:Z==null?void 0:Z.textLeft,top:Z==null?void 0:Z.textTop,width:Z==null?void 0:Z.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:i}),_jsx(Typography,{children:d})]})]})})}),$)]}):_jsx(_Fragment,{children:p})}var Br=t(35292);const Zr=(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 Er({color:e="primary",disabled:s=!1,href:i="#",icon:d=(0,n.jsx)(Br.Z,{}),label:p,onClick:g,title:w}){const $=Zr();return s?(0,n.jsxs)(H.Z,{title:w,className:G()($.link,$.disabled),underline:"none",children:[d,(0,n.jsx)("span",{className:$.label,children:p})]}):(0,n.jsxs)(H.Z,{title:w,className:G()($.link,$[e]),to:i,component:pe,onClick:g,children:[d,(0,n.jsx)("span",{className:$.label,children:p})]})}const fr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function ts(e){const{links:s}=e,i=fr();return(0,n.jsx)("nav",{className:i.links,children:s.map((d,p)=>(0,n.jsx)(Er,{...d},p+1))})}const Dr=e=>{const s=e==="dark"?"16%":"97%";return`
14
+ hsl(0, 0%, ${s}) 0%,
15
+ hsla(0, 0%, ${s}, 0.987) 8.1%,
16
+ hsla(0, 0%, ${s}, 0.951) 15.5%,
17
+ hsla(0, 0%, ${s}, 0.896) 22.5%,
18
+ hsla(0, 0%, ${s}, 0.825) 29%,
19
+ hsla(0, 0%, ${s}, 0.741) 35.3%,
20
+ hsla(0, 0%, ${s}, 0.648) 41.2%,
21
+ hsla(0, 0%, ${s}, 0.55) 47.1%,
22
+ hsla(0, 0%, ${s}, 0.45) 52.9%,
23
+ hsla(0, 0%, ${s}, 0.352) 58.8%,
24
+ hsla(0, 0%, ${s}, 0.259) 64.7%,
25
+ hsla(0, 0%, ${s}, 0.175) 71%,
26
+ hsla(0, 0%, ${s}, 0.104) 77.5%,
27
+ hsla(0, 0%, ${s}, 0.049) 84.5%,
28
+ hsla(0, 0%, ${s}, 0.013) 91.9%,
29
+ hsla(0, 0%, ${s}, 0) 100%
30
+ `},ns=100,Zn=10,Dn=(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:ns,height:`calc(100% + ${Zn}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Zn,background:`linear-gradient(90deg, ${Dr(e.palette.type)})`},fadeRight:{right:-Zn,background:`linear-gradient(270deg, ${Dr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function lr(e){const[[s,i],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const g=()=>{const w=p.scrollLeft,$=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([w,$])};return g(),p.addEventListener("scroll",g),window.addEventListener("resize",g),()=>{p.removeEventListener("scroll",g),window.removeEventListener("resize",g)}},[e]),[s,i]}function gr(e,s,i){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const g=performance.now(),w=requestAnimationFrame($=>{if(!e.current)return;const M=$-g,Z=Math.abs(d)*M/s,re=Math.max(i,Z)*Math.sign(d);e.current.scrollBy({left:re});const ce=d-re;Math.sign(d)!==Math.sign(ce)?p(0):p(ce)});return()=>cancelAnimationFrame(w)},[e,d,s,i]),p}function Nr(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:d=5,children:p,...g}=e,w=Dn(e),$=React.useRef(),[M,Z]=lr($),ue=gr($,i,d),re=ce=>{!$.current||ue(ce?s:-s)};return _jsxs("div",{...g,className:w.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:w.container,ref:$,children:p}),_jsx("div",{className:classNames(w.fade,w.fadeLeft,{[w.fadeHidden]:M===0})}),_jsx("div",{className:classNames(w.fade,w.fadeRight,{[w.fadeHidden]:Z===0})}),M>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>re(!1),className:classNames(w.button,w.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Z>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>re(!0),className:classNames(w.button,w.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const rs=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Fr(e){const s=rs(e),{shorthand:i,alpha:d}=e;return i?_jsx("span",{className:s[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx("span",{className:s[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const ss=(0,m.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function os(e){const{Progress:s}=(0,T.qD)().getComponents();return(0,n.jsx)(m.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(ss,{...e})})}const mr=(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"}),vn=(e,s)=>s?typeof s=="string"?e+s:m.Children.toArray(s.props.children).reduce(vn,e):e,Nn=({level:e,children:s})=>{const p=m.Children.toArray(s).reduce(vn,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return m.createElement(`h${e}`,{id:p},s)},vr={code:({inline:e,className:s,children:i,...d})=>{const p=String(i).replace(/\n+$/,""),g=/language-(\w+)/.exec(s||"");return!e&&g?(0,n.jsx)(Ce,{language:g[1],text:p}):(0,n.jsx)("code",{className:s,...d,children:i})},h1:Nn,h2:Nn,h3:Nn,h4:Nn,h5:Nn,h6:Nn};function Rs(e){const{content:s,dialect:i="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:g,className:w}=e,$=mr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${$.markdown} ${w}`,children:s,components:vr,linkTarget:d,transformLinkUri:p,transformImageUri:g})}var Ar=t(23054);const Tr=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),is=({request:e,busy:s,setBusy:i})=>{const d=Tr(),[p,g]=useState(),w=async()=>{i(!0);try{await e.trigger()}catch(M){g(isError(M)?M.message:"An unspecified error occurred")}finally{i(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:w,children:"Log in"})]})};var Ls=null;const Hn=(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 Ps(e){const s=Hn(),[i,d]=useState(!1),p=useApi(oauthRequestApiRef),g=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),w=()=>{g.forEach($=>$.reject())};return _jsxs(Dialog,{open:Boolean(g.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:g.map($=>_jsx(LoginRequestListItem,{request:$,busy:i,setBusy:d},$.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:w,children:"Reject All"})})]})}var Ur=t(15277),Ir=t.n(Ur),Rr=t(29862);const as=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function ls(e){const[s,i]=(0,m.useState)(!1),d=(0,Rr.t)(),p=as(),g=$=>{d()&&i($)};var w;return(0,n.jsx)(Ye.ZP,{title:(w=e.title)!==null&&w!==void 0?w:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(Ir(),{text:e.text,line:e.line,onToggled:g,containerClassName:p.container})})}var cs=t(67358);function ds(e){const[s,i]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{const d=setTimeout(()=>i(!0),250);return()=>clearTimeout(d)},[]),s?(0,n.jsx)(cs.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var Mr=t(94339),zr=t(14503),Lr=t(24579),er=t(32552),sn=t(15459),$t=t(95544),Vr=t(27597);const us=(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 Hr(e){const{link:s,title:i,onClick:d}=e,p=us();return(0,n.jsxs)("div",{children:[(0,n.jsx)(u.Z,{}),(0,n.jsx)(pe,{to:s,onClick:d,underline:"none",children:(0,n.jsxs)($t.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)($t.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(S.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(Vr.Z,{className:p.arrow})]})})]})}const hs=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(qe,{to:s.href,variant:"contained",children:s.name})},ps=class extends m.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:d}=this.state;return d?(0,n.jsx)(x,{title:"Something Went Wrong",error:d,children:(0,n.jsx)(hs,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},fs=(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"}),gs=(0,sn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(zr.Z),Wr={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 yr(e){const{title:s,subheader:i,divider:d=!0,deepLink:p,slackChannel:g,errorBoundaryProps:w,variant:$,children:M,headerStyle:Z,headerProps:ue,icon:re,action:ce,actionsClassName:Se,actions:Fe,cardClassName:ut,actionsTopRight:Mt,className:Yt,noPadding:en,titleTypographyProps:tn}=e,At=fs();let Xt={},Jt={};$&&$.split(/[\s]+/g).forEach(hr=>{Xt={...Xt,...Wr.card[hr]},Jt={...Jt,...Wr.cardContent[hr]}});const dr=()=>(0,n.jsxs)("div",{className:At.headerSubheader,children:[i&&(0,n.jsx)("div",{className:At.subheader,children:i}),re]}),Yn=w||(g?{slackChannel:g}:{});return(0,n.jsx)(Mr.Z,{style:Xt,className:Yt,children:(0,n.jsxs)(ps,{...Yn,children:[s&&(0,n.jsx)(er.Z,{classes:{root:At.header,title:At.headerTitle,subheader:At.headerSubheader,avatar:At.headerAvatar,action:At.headerAction,content:At.headerContent},title:s,subheader:dr(),action:ce,style:{...Z},titleTypographyProps:tn,...ue}),Mt&&(0,n.jsx)(gs,{children:Mt}),d&&(0,n.jsx)(u.Z,{}),(0,n.jsx)(Lr.Z,{className:G()(ut,{[At.noPadding]:en}),style:Jt,children:M}),Fe&&(0,n.jsx)(zr.Z,{className:Se,children:Fe}),p&&(0,n.jsx)(Hr,{...p})]})})}var ks=t(39307);const ms=(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"}),Gr={fractional:!0,inverse:!1,unit:"%",max:100},vs=({palette:e,value:s,inverse:i,max:d})=>{if(isNaN(s))return"#ddd";const p=d||Gr.max,g=i?p-s:s;return g<p/3?e.status.error:g<p*(2/3)?e.status.warning:e.status.ok};function Os(e){const[s,i]=useState(null),{getColor:d=vs}=e,p=ms(e),{palette:g}=useTheme(),{value:w,fractional:$,inverse:M,unit:Z,max:ue,description:re}={...Gr,...e},ce=$?Math.round(w*ue):w,Se=ue!==100?Math.round(w):ce,[Fe,ut]=useState(!1);return useEffect(()=>{const Mt=s,Yt=()=>ut(!0),en=()=>ut(!1);return Mt&&re?(Mt.addEventListener("mouseenter",Yt),Mt.addEventListener("mouseleave",en),()=>{Mt.removeEventListener("mouseenter",Yt),Mt.removeEventListener("mouseleave",en)}):()=>{ut(!1)}},[re,s]),_jsxs("div",{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:ce,strokeWidth:12,trailWidth:12,strokeColor:d({palette:g,value:Se,inverse:M,max:ue}),className:p.circle}),re&&Fe?_jsx("div",{className:p.description,children:re}):_jsx("div",{className:p.overlay,children:isNaN(w)?"N/A":`${Se}${Z}`})]})}const ys=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function $s(e){const s=ys(e),{title:i,subheader:d,progress:p,inverse:g,deepLink:w,description:$,icon:M,variant:Z,getColor:ue}=e,re={inverse:g,description:$,getColor:ue,value:p};return _jsx("div",{className:s.root,children:_jsx(InfoCard,{title:i,subheader:d,deepLink:w,variant:Z,icon:M,children:_jsx(Gauge,{...re})})})}function po(e){const{value:s,getColor:i=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const g=i({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx("span",{children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:g})})})}var v=t(21324),j=t(7089),L=t(1292),D=t(42494),_=t(74603),J=t(56939),le=t(12231),me=t(73698),we=t(72379);const Ne=(0,l.Z)(()=>(0,B.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var je=()=>{const e=Ne();return(0,n.jsx)(we.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 Qe=(0,l.Z)(()=>(0,B.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var vt=()=>{const e=Qe();return(0,n.jsx)(we.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 Xe=(0,sn.Z)(e=>(0,B.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"})(_.Z),Bt=(0,l.Z)(e=>(0,B.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 Qt(e){const{multiple:s,items:i,label:d,placeholder:p,selected:g,onChange:w,triggerReset:$,native:M=!1,disabled:Z=!1,margin:ue}=e,re=Bt(),[ce,Se]=(0,m.useState)(g||(s?[]:"")),[Fe,ut]=(0,m.useState)(!1);(0,m.useEffect)(()=>{Se(s?[]:"")},[$,s]),(0,m.useEffect)(()=>{g!==void 0&&Se(g)},[g]);const Mt=At=>{Se(At.target.value),w(At.target.value)},Yt=At=>{if(Z){At.preventDefault();return}ut(Xt=>s&&!(At.target instanceof HTMLElement)?!0:!Xt)},en=()=>{ut(!1)},tn=At=>()=>{const Xt=ce.filter(Jt=>Jt!==At);Se(Xt),w(Xt)};return(0,n.jsx)("div",{className:re.root,children:(0,n.jsx)(L.Z,{onClickAway:en,children:(0,n.jsxs)(D.Z,{className:re.formControl,children:[(0,n.jsx)(J.Z,{className:re.formLabel,children:d}),(0,n.jsxs)(me.Z,{"aria-label":d,value:ce,native:M,disabled:Z,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ue,onChange:Mt,onClick:Yt,open:Fe,input:(0,n.jsx)(Xe,{}),label:d,tabIndex:0,renderValue:At=>{var Xt;return s&&ce.length!==0?(0,n.jsx)("div",{className:re.chips,children:At.map(Jt=>{var dr,Yn;return(0,n.jsx)(j.Z,{label:(dr=i.find(ur=>ur.value===Jt))===null||dr===void 0?void 0:dr.label,clickable:!0,onDelete:tn(Jt),className:re.chip},(Yn=i.find(ur=>ur.value===Jt))===null||Yn===void 0?void 0:Yn.value)})}):(0,n.jsx)(S.Z,{children:ce.length===0?p||"":(Xt=i.find(Jt=>Jt.value===At))===null||Xt===void 0?void 0:Xt.label})},IconComponent:()=>Fe?(0,n.jsx)(vt,{}):(0,n.jsx)(je,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(le.Z,{value:[],children:p}),M?i&&i.map(At=>(0,n.jsx)("option",{value:At.value,children:At.label},At.value)):i&&i.map(At=>(0,n.jsxs)(le.Z,{value:At.value,children:[s&&(0,n.jsx)(v.Z,{color:"primary",checked:ce.includes(At.value)||!1,className:re.checkbox}),At.label]},At.value))]})]})})})}const Fn=()=>{},An=m.createContext({stepperLength:0,stepIndex:0,setStepIndex:Fn,stepHistory:[],setStepHistory:Fn,onStepChange:Fn});function tr(e){const{children:s,elevated:i,onStepChange:d,activeStep:p=0}=e,[g,w]=useState(p),[$,M]=useState([0]);useEffect(()=>{w(p)},[p]);const Z=[];let ue;return Children.forEach(s,re=>{isValidElement(re)&&(re.props.end?ue=re:Z.push(re))}),_jsxs(_Fragment,{children:[_jsx(An.Provider,{value:{stepIndex:g,setStepIndex:w,stepHistory:$,setStepHistory:M,onStepChange:d,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:g,orientation:"vertical",elevation:i?2:0,children:Z})}),g>=Children.count(s)-1&&ue]})}const hn=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),yn=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),Tn=({text:e,handleClick:s,disabled:i,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(d?"Finish":"Next")}),xr=({text:e,handleClick:s,disabled:i,stepIndex:d})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${d}`,disabled:i,children:e||"Back"}),br=({actions:e={},children:s})=>{const i=hn(),{stepperLength:d,stepIndex:p,setStepIndex:g,stepHistory:w,setStepHistory:$,onStepChange:M}=useContext(VerticalStepperContext),Z=(Se,Fe)=>{Fe&&Fe(),M&&M(p,Se),g(Se)},ue=()=>{const Se=e.nextStep?e.nextStep(p,d-1):p+1;Z(Se,e.onNext),$([...w,Se])},re=()=>{w.pop(),Z(w[w.length-1],e.onBack),$([...w])},ce=()=>{Z(0,e.onRestart),$([0])};return _jsxs("div",{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(xr,{text:e.backText,handleClick:re,disabled:p===0,stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(Tn,{text:e.nextText,handleClick:ue,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(yn,{text:e.restartText,handleClick:ce,stepIndex:p}),s]})},Sr=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function xn(e){const{title:s,children:i,end:d,actions:p,...g}=e,w=Sr();return d?_jsxs("div",{className:w.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...g,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const on=(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 nr(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function fo(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ii(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ai(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function zi(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Vi(e){const s=on(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Pr=t(74600),go=t(15584);const mo=e=>(0,B.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),li={root:{border:"0",verticalAlign:"top"}},ci=e=>(0,B.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),gn=e=>(0,B.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),xs=(0,sn.Z)(mo,{name:"BackstageMetadataTableTitleCell"})(go.Z),vo=(0,sn.Z)(li,{name:"BackstageMetadataTableCell"})(go.Z),Bs=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Zs=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(xs,{children:e}),_jsx(vo,{colSpan:e?1:2,...i,children:s})]}),Kr=(0,sn.Z)(ci,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),di=(0,sn.Z)(gn,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),bs=(0,B.Z)({root:{margin:"0 0",listStyleType:"none"}}),yo=e=>(0,B.Z)({root:{...bs.root,paddingLeft:e.spacing(1)}}),Ds=(0,sn.Z)(bs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Kr,{classes:e,children:s})),Ns=(0,sn.Z)(yo,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Kr,{classes:e,children:s}));function xo(e,s){const i=e.map((d,p)=>_jsx(MetadataListItem,{children:kr(d)},p));return s?_jsx(Ns,{children:i}):_jsx(Ds,{children:i})}function cr(e,s,i){const d=Object.keys(e).map(p=>{const g=kr(e[p],!0),w=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${w}: `,g]},p)});return s?_jsx(Ns,{children:d}):_jsx(Ds,{children:d})}function kr(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?cr(e,s,i):Array.isArray(e)?xo(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const bo=({value:e,options:s})=>_jsx(Fragment,{children:kr(e,s)}),So=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(bo,{value:s,options:i})});function Fs(e,s){return Object.keys(e).map(i=>_jsx(So,{title:i,value:e[i],options:s},i))}function ui(e){const{metadata:s,dense:i=!0,options:d}=e,p=Fs(s,d||{});return _jsx(MetadataTable,{dense:i,children:p})}var wo=t(49429),Co=t(86136),Us=t(79784),hi=t(19126),Ms=t.n(hi);function jo(e){return qs.stringify(e,{strictNullHandling:!0})}function zs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Vs(e,s){return zs(e)[s]}function Hs(e,s,i){const d={...zs(e),[s]:i};return jo(d)}function Ws(e,s=250){const[i,d]=useSearchParams(),p=i.toString(),[g,w]=useState(Vs(p,e));return useEffect(()=>{const $=Vs(p,e);w(M=>isEqual($,M)?M:$)},[p,w,e]),useDebouncedEffect(()=>{const $=Hs(p,e,g);p!==$&&d($,{replace:!0})},[d,g,p,e],s),[g,w]}const Eo={url:"https://github.com/backstage/backstage/issues",items:[{title:"Support Not Configured",icon:"warning",links:[{title:"Add `app.support` config key",url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]};function Gs(){const s=(0,T.I_)().get(T.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return Eo;var d;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(g=>({url:g.getString("url"),title:g.getString("title")}))}))}}var Ao=t(80079);function Un(e,s){const d=(0,T.qD)().getSystemIcon(e);return d?(0,n.jsx)(d,{...s}):(0,n.jsx)(Ao.Z,{...s})}function Hi(e){return Un("brokenImage",e)}function Wi(e){return Un("catalog",e)}function Ss(e){return Un("chat",e)}function Gi(e){return Un("dashboard",e)}function Ki(e){return Un("docs",e)}function pi(e){return Un("email",e)}function fi(e){return Un("github",e)}function To(e){return Un("group",e)}function ws(e){return Un("help",e)}function Yi(e){return Un("user",e)}function Io(e){return Un("warning",e)}const Ks=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Ro=({icon:e})=>{const s=(0,T.qD)();var i;const d=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:ws;return(0,n.jsx)(d,{})};var Cs;const gi=({link:e})=>(0,n.jsx)(pe,{to:e.url,children:(Cs=e.title)!==null&&Cs!==void 0?Cs:e.url}),mi=({item:e})=>{var s;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(Co.Z,{children:(0,n.jsx)(Ro,{icon:e.icon})}),(0,n.jsx)(ye.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,d,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(gi,{link:d},d.url)],[])})]})};function vi(e){const{title:s,children:i}=e,{items:d}=Gs(),[p,g]=(0,m.useState)(!1),[w,$]=(0,m.useState)(null),M=Ks(),Z=(0,rt.Z)(ce=>ce.breakpoints.down("sm")),ue=ce=>{$(ce.currentTarget),g(!0)},re=()=>{g(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($t.Z,{display:"flex",ml:1,children:Z?(0,n.jsx)(Je.Z,{color:"primary",size:"small",onClick:ue,"data-testid":"support-button",children:(0,n.jsx)(ws,{})}):(0,n.jsx)(Q.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ue,startIcon:(0,n.jsx)(ws,{}),children:"Support"})}),(0,n.jsxs)(Us.ZP,{"data-testid":"support-button-popover",open:p,anchorEl:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:re,children:[(0,n.jsxs)(E.Z,{className:M.popoverList,children:[s&&(0,n.jsx)(X.Z,{alignItems:"flex-start",children:(0,n.jsx)(S.Z,{variant:"subtitle1",children:s})}),m.Children.map(i,(ce,Se)=>(0,n.jsx)(X.Z,{alignItems:"flex-start",children:ce},`child-${Se}`)),d&&d.map((ce,Se)=>(0,n.jsx)(mi,{item:ce},`item-${Se}`))]}),(0,n.jsx)(wo.Z,{children:(0,n.jsx)(Q.Z,{color:"primary",onClick:re,children:"Close"})})]})]})}var bn=t(18671),Mn=t(10289);const Yr=72,Lo=24,Po=18,rr={drawerWidthClosed:Yr,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Yr,iconSize:Yr-Lo*2,iconPadding:Lo,selectedIndicatorWidth:3,userBadgePadding:Po,userBadgeDiameter:Yr-Po*2,mobileSidebarHeight:56},yi=e=>({...rr,...e,iconContainerWidth:rr.drawerWidthClosed,iconSize:rr.drawerWidthClosed-rr.iconPadding*2,userBadgeDiameter:rr.drawerWidthClosed-rr.userBadgePadding*2}),ko={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:rr.defaultOpenDelayMs+200},xi=e=>({...ko,...e}),Ji="@backstage/core/sidebar-intro-dismissed",Kn=(0,m.createContext)({sidebarConfig:rr,submenuConfig:ko}),Oo=(0,m.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var js;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(js||(js={}));const Es={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(js.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(js.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var Jr=t(51837);const Ys={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Js=(0,m.createContext)(Ys),Qs=(0,Jr.CT)("sidebar-pin-state-context");function $o(e){const{children:s,value:i}=e;return(0,n.jsx)(Js.Provider,{value:i,children:(0,n.jsx)(Qs.Provider,{value:(0,Jr.EI)({1:i}),children:s})})}const Or=()=>{const e=(0,m.useContext)(Qs),s=(0,m.useContext)(Js);if(e===void 0)return s||Ys;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Bo=(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"}),Xs=(0,m.createContext)({content:{contentRef:void 0}});function Zo(e){const[s,i]=(0,m.useState)(()=>Es.getSidebarPinState()),{sidebarConfig:d}=(0,m.useContext)(Kn),p=(0,m.useRef)(null),g=(0,m.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,m.useEffect)(()=>{Es.setSidebarPinState(s)},[s]);const w=(0,rt.Z)(Z=>Z.breakpoints.down("xs"),{noSsr:!0}),$=()=>i(!s),M=Bo({isPinned:s,sidebarConfig:d});return(0,n.jsx)($o,{value:{isPinned:s,toggleSidebarPinState:$,isMobile:w},children:(0,n.jsx)(Xs.Provider,{value:g,children:(0,n.jsx)("div",{className:M.root,children:e.children})})})}function _s(){const{content:e}=(0,m.useContext)(Xs);return{focusContent:(0,m.useCallback)(()=>{var i,d;e==null||(i=e.contentRef)===null||i===void 0||(d=i.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Do={isOpen:!1,setOpen:()=>{}},eo=(0,m.createContext)(Do),to=(0,Jr.CT)("sidebar-open-state-context");function No(e){const{children:s,value:i}=e;return(0,n.jsx)(eo.Provider,{value:i,children:(0,n.jsx)(to.Provider,{value:(0,Jr.EI)({1:i}),children:s})})}const As=()=>{const e=(0,m.useContext)(to),s=(0,m.useContext)(eo);if(e===void 0)return s||Do;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Fo=t(50023),Uo=t(4190),Mo=t(87685),zo=t(44882),Vo=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"}})),Wo=e=>{const{to:s,label:i,icon:d,value:p}=e,{sidebarConfig:g}=(0,m.useContext)(Kn),w=Ho({sidebarConfig:g}),$=(0,Mn.TH)(),{selectedMenuItemIndex:M,setSelectedMenuItemIndex:Z}=(0,m.useContext)(so),ue=(ce,Se)=>{Z(Se===M?-1:Se)},re=p===M&&M>=0||p!==M&&!(M>=0)&&s===$.pathname;return(0,n.jsx)(Vo.Z,{label:i,icon:d,component:pe,to:s||$.pathname,onChange:ue,value:p,selected:re,classes:w})},zn=e=>{const{children:s,to:i,label:d,icon:p,value:g}=e,{isMobile:w}=Or();return w?(0,n.jsx)(Wo,{to:i,label:d,icon:p,value:g}):(0,n.jsx)(n.Fragment,{children:s})},no=(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,ie.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ko=m.createElement(zn).type,ro=({children:e,label:s="Menu",open:i,onClose:d})=>{const{sidebarConfig:p}=(0,m.useContext)(Kn),g=no({sidebarConfig:p});return(0,n.jsxs)(Uo.ZP,{anchor:"bottom",open:i,onClose:d,ModalProps:{BackdropProps:{classes:{root:g.marginMobileSidebar}}},classes:{root:g.marginMobileSidebar,paperAnchorBottom:g.overlay},children:[(0,n.jsxs)($t.Z,{className:g.overlayHeader,children:[(0,n.jsx)(S.Z,{variant:"h3",children:s}),(0,n.jsx)(Je.Z,{onClick:d,classes:{root:g.overlayHeaderClose},children:(0,n.jsx)(Mo.Z,{})})]}),(0,n.jsx)($t.Z,{component:"nav",children:e})]})},so=(0,m.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Yo=e=>{const{sidebarConfig:s}=(0,m.useContext)(Kn),{children:i}=e,d=no({sidebarConfig:s}),p=(0,Mn.TH)(),[g,w]=(0,m.useState)(-1);(0,m.useEffect)(()=>{w(-1)},[p.pathname]);let $=(0,T.vJ)(i,Z=>Z.getElements().filter(ue=>ue.type===Ko));if(i)$.length?$=Go($):$.push((0,n.jsx)(zn,{icon:(0,n.jsx)(zo.Z,{}),children:i},"default_menu"));else return null;const M=g>=0&&!$[g].props.to;return(0,n.jsx)(No,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(so.Provider,{value:{selectedMenuItemIndex:g,setSelectedMenuItemIndex:w},children:[(0,n.jsx)(ro,{label:$[g]&&$[g].props.label,open:M,onClose:()=>w(-1),children:$[g]&&$[g].props.children}),(0,n.jsx)(Fo.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})},oo=(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 In;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(In||(In={}));const bi=e=>{const{sidebarConfig:s}=(0,m.useContext)(Kn),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:d=s.defaultCloseDelayMs,disableExpandOnHover:p,children:g}=e,w=oo({sidebarConfig:s}),$=(0,rt.Z)(Yt=>Yt.breakpoints.down("md"),{noSsr:!0}),[M,Z]=(0,m.useState)(In.Closed),ue=(0,m.useRef)(),{isPinned:re,toggleSidebarPinState:ce}=Or(),Se=()=>{re||p||(ue.current&&(clearTimeout(ue.current),ue.current=void 0),M!==In.Open&&!$&&(ue.current=window.setTimeout(()=>{ue.current=void 0,Z(In.Open)},i),Z(In.Idle)))},Fe=()=>{re||p||(ue.current&&(clearTimeout(ue.current),ue.current=void 0),M===In.Idle?Z(In.Closed):M===In.Open&&(ue.current=window.setTimeout(()=>{ue.current=void 0,Z(In.Closed)},d)))},ut=M===In.Open&&!$||re,Mt=Yt=>{Yt?(Z(In.Open),ce()):(Z(In.Closed),ce())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(a,{}),(0,n.jsx)(No,{value:{isOpen:ut,setOpen:Mt},children:(0,n.jsx)("div",{className:w.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Se,onFocus:p?()=>{}:Se,onMouseLeave:p?()=>{}:Fe,onBlur:p?()=>{}:Fe,children:(0,n.jsx)("div",{className:G()(w.drawer,{[w.drawerOpen]:ut}),children:g})})})]})},Jo=e=>{var s;const i=yi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var d;const p=xi((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:g,disableExpandOnHover:w,openDelayMs:$,closeDelayMs:M}=e,{isMobile:Z}=Or();return Z?(0,n.jsx)(Yo,{children:g}):(0,n.jsx)(Kn.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(bi,{openDelayMs:$,closeDelayMs:M,disableExpandOnHover:w,children:g})})};function a(){const{sidebarConfig:e}=(0,m.useContext)(Kn),{focusContent:s,contentRef:i}=_s(),d=oo({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(Q.Z,{onClick:s,variant:"contained",className:G()(d.visuallyHidden),children:"Skip to content"}):null}function r(e,s){const i=new URLSearchParams(s.search).toString(),d=Ms().parse(i),p=new URLSearchParams(e.search).toString(),g=Ms().parse(p);return(0,ie.isEqual)(s.pathname,e.pathname)&&(0,ie.isMatch)(g,d)}const o=(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"}),c=e=>{const{title:s,subtitle:i,to:d,icon:p,dropdownItems:g}=e,w=o(),{setIsHoveredOn:$}=useContext(SidebarItemWithSubmenuContext),M=()=>{$(!1)},Z=useResolvedPath(d!=null?d:""),ue=useLocation();let re=isLocationMatch(ue,Z);const[ce,Se]=useState(!1),Fe=()=>{Se(!ce)};return g!==void 0?(g.some(ut=>{const Mt=resolvePath(ut.to);return re=isLocationMatch(ue,Mt),re}),_jsxs("div",{className:w.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:Fe,onTouchStart:ut=>ut.stopPropagation(),className:classnames(w.item,re?w.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:w.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:w.subtitle,children:i})]}),ce?_jsx(ArrowDropUpIcon,{className:w.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:w.dropdownArrow})]})}),g&&ce&&_jsx("div",{className:w.dropdown,children:g.map((ut,Mt)=>_jsx(Tooltip,{title:ut.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:ut.to,underline:"none",className:w.dropdownItem,onClick:M,onTouchStart:Yt=>Yt.stopPropagation(),children:_jsx(Typography,{className:w.textContent,children:ut.title})})},Mt))})]})):_jsx("div",{className:w.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(w.item,re?w.selected:void 0),onClick:M,onTouchStart:ut=>ut.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:w.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:w.subtitle,children:i})]})]})})})};var f;const P=(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:(f=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&f!==void 0?f:"#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"}),F=e=>{const{isOpen:s}=As(),{sidebarConfig:i,submenuConfig:d}=(0,m.useContext)(Kn),p=s?i.drawerWidthOpen:i.drawerWidthClosed,g=P({left:p,submenuConfig:d}),{isHoveredOn:w}=(0,m.useContext)(Oo),[$,M]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{M(w)},[w]),(0,n.jsxs)("div",{className:G()(g.drawer,{[g.drawerOpen]:$}),children:[(0,n.jsx)(S.Z,{variant:"h5",className:g.title,children:e.title}),e.children]})};var U=t(76600),ne=t(26739),Ze=t(98989),$e=t(59797),xt=t(83543);const it=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Et=()=>{const e=it();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 Kt=null;const pn=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Sn=()=>{const e=pn();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 sr=null,Pn,Vn;const Qr=e=>(0,l.Z)(s=>{var i,d;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:(Pn=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&Pn!==void 0?Pn:"#404040"}},highlighted:{background:(Vn=(d=s.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Vn!==void 0?Vn:"#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 Xr(e){return(0,m.useMemo)(()=>Qr(e),[e])()}const Qo=(e,s)=>(0,T.vJ)(e.props.children,i=>{let d=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:g}})=>{if(!d){if(g!=null&&g.length){g.forEach(({to:w})=>d=d||r(s,(0,Mn.i3)(w)));return}p&&(d=r(s,(0,Mn.i3)(p)))}}),d},[s.pathname]);function qr(e){return e.to===void 0}const Xo=m.createElement(F).type,wr=m.forwardRef(function({to:s,end:i,style:d,className:p,activeStyle:g,caseSensitive:w,activeClassName:$="active","aria-current":M="page",...Z},ue){let{pathname:re}=(0,Mn.TH)(),{pathname:ce}=(0,Mn.WU)(s);w||(re=re.toLocaleLowerCase("en-US"),ce=ce.toLocaleLowerCase("en-US"));let Se=re===ce;!Se&&!i&&(Se=re.startsWith(`${ce}/`));const Fe=Se?M:void 0;return(0,n.jsx)(ae.rU,{...Z,to:s,ref:ue,"aria-current":Fe,style:{...d,...Se?g:void 0},className:G()([p,Se?$:void 0])})}),Si=(0,m.forwardRef)((e,s)=>{const{icon:i,text:d,hasNotifications:p=!1,hasSubmenu:g=!1,disableHighlight:w=!1,onClick:$,children:M,className:Z,...ue}=e,{sidebarConfig:re}=(0,m.useContext)(Kn),ce=Xr(re),{isOpen:Se}=As(),Fe=!Se&&g?{display:"flex",marginLeft:"24px"}:{},ut=(0,n.jsxs)("div",{style:Fe,children:[(0,n.jsx)(i,{fontSize:"small"}),!Se&&g?(0,n.jsx)(Ze.Z,{}):(0,n.jsx)(n.Fragment,{})]}),Mt=(0,n.jsx)(ne.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:G()({[ce.closedItemIcon]:!Se}),children:ut}),Yt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"login-button",className:ce.iconContainer,children:Mt}),d&&(0,n.jsx)(S.Z,{variant:"subtitle2",className:ce.label,children:d}),(0,n.jsx)("div",{className:ce.secondaryAction,children:M})]}),en=Se?Yt:Mt,tn={onClick:$,className:G()(Z,ce.root,Se?ce.open:ce.closed,qr(e)&&ce.buttonItem,{[ce.highlightable]:!w})};return qr(e)?(0,n.jsx)("button",{"aria-label":d,...tn,ref:s,children:en}):(0,n.jsx)(wr,{...tn,activeClassName:ce.selected,to:e.to?e.to:"",ref:s,"aria-label":d||e.to,...ue,children:en})}),Qi=({children:e,...s})=>{const{sidebarConfig:i}=(0,m.useContext)(Kn),d=Xr(i),[p,g]=(0,m.useState)(!1),w=(0,Mn.TH)(),$=Qo(e,w),M=(0,rt.Z)(ce=>ce.breakpoints.down("sm")),Z=()=>{g(!0)},ue=()=>{g(!1)},re=()=>M?p?(0,n.jsx)($e.Z,{fontSize:"small",className:d.submenuArrow}):(0,n.jsx)(xt.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,n.jsx)(Ze.Z,{fontSize:"small",className:d.submenuArrow});return(0,n.jsx)(Oo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:g},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ue,onTouchStart:p?ue:Z,onMouseEnter:Z,className:G()(p&&d.highlighted),children:[(0,n.jsx)(Si,{hasSubmenu:!0,className:$?d.selected:"",...s,children:re()}),p&&e]})})},wi=(0,m.forwardRef)((e,s)=>{const[i]=(0,T.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Xo));return i?(0,n.jsx)(Qi,{...e,children:i}):(0,n.jsx)(Si,{...e,ref:s})});function Rl(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,d]=useState(""),p=Xr(s),g=e.icon?e.icon:SearchIcon,w=()=>{e.onSearch(i),d("")},$=re=>{re.key==="Enter"&&(re.preventDefault(),w())},M=re=>{d(re.target.value)},Z=re=>{re.preventDefault(),re.stopPropagation()},ue=re=>{w(),re.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(wi,{icon:g,to:e.to,onClick:ue,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:Z,onChange:M,onKeyDown:$,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Ll=(0,U.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Pl=(0,U.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Xi=(0,U.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),qi=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),kl=(0,U.Z)("div")(({theme:e})=>{const s=qi(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Ol=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=Xr(e),{isOpen:i,setOpen:d}=useSidebarOpenState();if(useMediaQuery(w=>w.breakpoints.down("md"),{noSsr:!0}))return null;const g=()=>{d(!i)};return _jsx("button",{onClick:g,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx("div",{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},_i=(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 ea(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=_i({sidebarConfig:s}),{text:d,onClose:p}=e,g=()=>p();return _jsxs("div",{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx("div",{className:i.introDismiss,children:_jsxs(Link,{component:"button",onClick:g,underline:"none",className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Ci=e=>{const{text:s,onDismiss:i}=e,[d,p]=useState(!1),g=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:i,children:_jsx(ea,{text:s,onClose:g})})},ta=null,na="And your recently viewed plugins will pop up here!";function $l(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[d,p]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:g,recentlyViewedItemsDismissed:w}=d!=null?d:{},$=()=>{p(Z=>({...i,...Z,starredItemsDismissed:!0}))},M=()=>{p(Z=>({...i,...Z,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!g&&_jsxs(_Fragment,{children:[_jsx(Ci,{text:ta,onDismiss:$}),_jsx(SidebarDivider,{})]}),!w&&_jsx(Ci,{text:na,onDismiss:M})]}):null}const ra=(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 ji(e){const{className:s,stretch:i,noPadding:d,children:p,...g}=e,{contentRef:w}=_s(),$=ra();return(0,n.jsx)("article",{ref:w,tabIndex:-1,...g,className:G()($.root,s,{[$.stretch]:i,[$.noPadding]:d}),children:p})}var sa=t(6487),oa=t(99152);const ia=(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 Ei(e){const{tabs:s,onChange:i,selectedIndex:d}=e,[p,g]=(0,m.useState)(d!=null?d:0),w=ia(),$=(0,m.useCallback)((M,Z)=>{d===void 0&&g(Z),i&&d!==Z&&i(Z)},[d,i]);return(0,m.useEffect)(()=>{d!==void 0&&g(d)},[d]),(0,n.jsx)("div",{className:w.tabsWrapper,children:(0,n.jsx)(oa.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:$,value:p,children:s.map((M,Z)=>(0,m.createElement)(sa.Z,{...M.tabProps,"data-testid":`header-tab-${Z}`,label:M.label,key:M.id,value:Z,className:w.defaultTab,classes:{selected:w.selected,root:w.tabRoot}}))})})}function aa(e){const s=(0,Mn.UO)(),d=e.map(({path:ce,children:Se})=>({caseSensitive:!1,path:`${ce}/*`,element:Se})).sort((ce,Se)=>Se.path.replace(/\/\*$/,"").localeCompare(ce.path.replace(/\/\*$/,"")));var p;const g=(p=(0,Mn.V$)(d))!==null&&p!==void 0?p:e[0].children;var w;let $=(w=s["*"])!==null&&w!==void 0?w:"";$.startsWith("/")||($=`/${$}`);var M;const[Z]=(M=(0,Mn.fp)(d,$))!==null&&M!==void 0?M:[],ue=Z?e.findIndex(ce=>`${ce.path}/*`===Z.route.path):0;var re;return{index:ue===-1?0:ue,element:g,route:(re=e[ue])!==null&&re!==void 0?re:e[0]}}function Ai(e){const{routes:s}=e,i=(0,Mn.s0)(),{index:d,route:p,element:g}=aa(s),w=(0,m.useMemo)(()=>s.map(M=>({id:M.path,label:M.title,tabProps:M.tabProps})),[s]),$=M=>{let{path:Z}=s[M];Z=Z.replace(/\/\*$/,""),Z=Z.replace(/^\//,""),i(Z)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ei,{tabs:w,selectedIndex:d,onChange:$}),(0,n.jsxs)(ji,{children:[(0,n.jsx)(bn.q,{title:p.title}),g]})]})}const qo=()=>null;(0,T.R5)(qo,"core.gatherMountPoints",!0);function Ti(e){const s=(0,n.jsx)(qo,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return m.Children.toArray(e).flatMap(i=>{if(!(0,m.isValidElement)(i))return[];if(i.type===m.Fragment)return Ti(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:g,tabProps:w}=i.props;return[{path:d,title:p,children:g,tabProps:w}]})}function la(e){const s=Ti(e.children);return(0,n.jsx)(Ai,{routes:s})}la.Route=qo;const ca=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function da(e){const{value:s,subvalue:i}=e,d=ca();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:d.value,children:s}),(0,n.jsx)("div",{className:d.subvalue,children:i})]})}var ua=t(21070),ha=t(90324),pa=t(98281),fa=t(48049),Ii=t(51209),Ri=t(33375),ga=t(44233),ma=t(27604),_o=t(36444),va=t(37971),ya=t(59709),xa=t(17373),ba=t(3702),Sa=t(93111),io=t(67222);const wa=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:"60px",justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ca=e=>{var s;const i=wa(),{onChangeFilters:d}=e,[p,g]=(0,m.useState)({...e.selectedFilters}),[w,$]=(0,m.useState)(!1),M=()=>{g({}),$(Z=>!Z)};return(0,m.useEffect)(()=>{d(p)},[p,d]),(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)(Q.Z,{color:"primary",onClick:M,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(Z=>(0,n.jsx)(Qt,{triggerReset:w,...Z.element,selected:p[Z.element.label],onChange:ue=>g({...p,[Z.element.label]:ue})},Z.element.label))})]})},ja={Add:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ua.Z,{...e,ref:s})),Check:(0,m.forwardRef)((e,s)=>(0,n.jsx)(pa.Z,{...e,ref:s})),Clear:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),Delete:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ga.Z,{...e,ref:s})),DetailPanel:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),Edit:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ma.Z,{...e,ref:s})),Export:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ba.Z,{...e,ref:s})),Filter:(0,m.forwardRef)((e,s)=>(0,n.jsx)(_o.Z,{...e,ref:s})),FirstPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(va.Z,{...e,ref:s})),LastPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ya.Z,{...e,ref:s})),NextPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),PreviousPage:(0,m.forwardRef)((e,s)=>(0,n.jsx)(fa.Z,{...e,ref:s})),ResetSearch:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),Search:(0,m.forwardRef)((e,s)=>(0,n.jsx)(_o.Z,{...e,ref:s})),SortArrow:(0,m.forwardRef)((e,s)=>(0,n.jsx)(ha.Z,{...e,ref:s})),ThirdStateCheck:(0,m.forwardRef)((e,s)=>(0,n.jsx)(xa.Z,{...e,ref:s})),ViewColumn:(0,m.forwardRef)((e,s)=>(0,n.jsx)(Sa.Z,{...e,ref:s}))};function Li(e,s){const i=s.split(".");let d=e[i[0]];for(let p=1;p<i.length;++p){if(d===void 0)return d;const g=i[p];d=d[g]}return d}const Ea=(0,sn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(io.W$),Pi=(0,sn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(io.UW),Aa=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ta=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ia(e,s){return e.map(i=>{const d={};let p=i.cellStyle||{};if(i.highlight)if(d.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const g=p;p=(w,$,M)=>({...g(w,$,M),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:d,cellStyle:p}})}function Ra(e,s){return(0,ie.transform)(e,(i,d,p)=>{(0,ie.isEqual)(d,s[p])||(i[p]=d)})}const ki={search:"",filtersOpen:!1,filters:{}};function La(e){const{toolbarRef:s,setSearch:i,hasFilters:d,selectedFiltersLength:p,toggleFilters:g}=e,w=Aa(),$=(0,m.useCallback)(M=>{e.onSearchChanged(M),i(M)},[e,i]);return d?(0,n.jsxs)("div",{className:w.root,children:[(0,n.jsxs)("div",{className:w.root,children:[(0,n.jsx)(Je.Z,{onClick:g,"aria-label":"filter list",children:(0,n.jsx)(_o.Z,{})}),(0,n.jsxs)(S.Z,{className:w.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(Pi,{...e,ref:s,onSearchChanged:$})]}):(0,n.jsx)(Pi,{...e,ref:s,onSearchChanged:$})}function Pa(e){const{data:s,columns:i,options:d,title:p,subtitle:g,filters:w,initialState:$,emptyContent:M,onStateChange:Z,components:ue,...re}=e,ce=Ta(),Se=(0,He.Z)(),Fe={...ki,...$},[ut,Mt]=(0,m.useState)(Fe.filtersOpen),Yt=(0,m.useCallback)(()=>Mt(wn=>!wn),[Mt]),[en,tn]=(0,m.useState)(0),[At,Xt]=(0,m.useState)(s),[Jt,dr]=(0,m.useState)(Fe.filters),Yn=Ia(i,Se),[ur,hr]=(0,m.useState)(Fe.search);(0,m.useEffect)(()=>{if(Z){const wn=Ra({search:ur,filtersOpen:ut,filters:Jt},ki);Z(wn)}},[ur,ut,Jt,Z]);const si={headerStyle:{textTransform:"uppercase"}},Gt=(0,m.useCallback)(wn=>{var or;return(or=i.find(Jn=>Jn.title===wn))===null||or===void 0?void 0:or.field},[i]);(0,m.useEffect)(()=>{if(typeof s=="function")return;if(!Jt){Xt(s);return}const wn=Object.values(Jt);if(s&&wn.flat().length){const or=s.filter(Jn=>!!Object.entries(Jt).filter(([,Wn])=>!!Wn.length).every(([Wn,mn])=>{const Rn=Li(Jn,Gt(Wn));return Array.isArray(Rn)&&Array.isArray(mn)?Rn.some(ir=>mn.includes(ir)):Array.isArray(Rn)?Rn.includes(mn):Array.isArray(mn)?mn.includes(Rn):Rn===mn}));Xt(or)}else Xt(s);tn(wn.flat().length)},[s,Jt,Gt]);const _r=(wn,or)=>{const Jn=mn=>{const Rn=new Set,ir=$r=>{$r!=null&&Rn.add($r)};return or&&or.forEach($r=>{const Is=Li($r,Gt(mn));Array.isArray(Is)?Is.forEach(ir):ir(Is)}),Rn},Wn=mn=>({placeholder:"All results",label:mn.column,multiple:mn.type==="multiple-select",items:[...Jn(mn.column)].sort().map(Rn=>({label:Rn,value:Rn}))});return wn.map(mn=>({type:mn.type,element:Wn(mn)}))},lo=!!(w!=null&&w.length),es=(0,m.useCallback)(wn=>(0,n.jsx)(La,{setSearch:hr,hasFilters:lo,selectedFiltersLength:en,toggleFilters:Yt,...wn}),[Yt,lo,en,hr]),co=typeof s!="function"&&s.length===0,uo=i.length,oi=(0,m.useCallback)(wn=>M&&co?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:uo,children:M})})}):(0,n.jsx)(io.os,{...wn}),[co,M,uo]);return(0,n.jsxs)("div",{className:ce.root,children:[ut&&s&&typeof s!="function"&&(w==null?void 0:w.length)&&(0,n.jsx)(Ca,{filters:_r(w,s),selectedFilters:Jt,onChangeFilters:dr}),(0,n.jsx)(io.ZP,{components:{Header:Ea,Toolbar:es,Body:oi,...ue},options:{...si,...d},columns:Yn,icons:ja,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S.Z,{variant:"h5",component:"h2",children:p}),g&&(0,n.jsx)(S.Z,{color:"textSecondary",variant:"body1",children:g})]}),data:typeof s=="function"?s:At,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter"}},...re})]})}const Bl=e=>{const{children:s,value:i,index:d,...p}=e;return _jsx("div",{role:"tabpanel",hidden:i!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:i===d&&_jsx(Box,{p:3,children:s})})},ka=(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=ka(e),{ariaLabel:i,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},Oa=(e,s)=>s?e?"20px":"0":"40px",$a=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Oa(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Dl=e=>{const s=$a(e),{isFirstNav:i,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ba=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Nl=e=>{const s=Ba(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Za=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function Fl(e){const{tabs:s}=e,i=Za(),[d,p]=useState([0,0]),[g,w]=useState(0),[$,M]=useState(0),[Z,ue]=useState([[]]),re=useRef(),{width:ce}=useWindowSize(),Se=(en,tn)=>{p([g,tn])},Fe=()=>{w(g-1)},ut=()=>{w(g+1)},Mt=()=>g+1<Z.length;useEffect(()=>{const tn=g===0?1:2,At=re.current.offsetWidth-20-tn*30,Xt=d[0]*$+d[1],Jt=Math.floor(At/170);M(Jt),ue(chunkArray(s,Jt)),p([Math.floor(Xt/Jt),Xt%Jt])},[ce,s]);const Yt=g===d[0]?d[1]:!1;return _jsxs("div",{className:i.root,children:[_jsx(AppBar,{ref:re,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:Yt,onChange:Se,selectionFollowsFocus:!0,children:[g!==0&&_jsx(StyledIcon,{onClick:Fe,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),Z[g].map((en,tn)=>_jsx(StyledTab,{value:tn,isFirstIndex:tn===0,isFirstNav:g===0,icon:en.icon||void 0,label:en.label||void 0},tn)),Mt()&&_jsx(StyledIcon,{isNext:!0,onClick:ut,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Yt!==!1?Z[g].map((en,tn)=>_jsx(TabPanel,{value:tn,index:Yt,children:en.content},tn)):_jsx(TabPanel,{value:d[1],index:d[1],children:Z[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var Ul=t(44311);function Da(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function Ml(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Da(e.data,s)})]})}const Na=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"}),Fa=({title:e="Unknown page",className:s})=>(0,n.jsx)(S.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ua(e){const{description:s,title:i,titleComponent:d=void 0,children:p,textAlign:g="left"}=e,w=Na({textAlign:g})(),$=d||(0,n.jsx)(Fa,{title:i,className:w.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bn.q,{title:i}),(0,n.jsxs)("div",{className:w.container,children:[(0,n.jsxs)("div",{className:w.leftItemsBox,children:[$,s&&(0,n.jsx)(S.Z,{className:w.description,variant:"body2",children:s})]}),(0,n.jsx)("div",{className:w.rightItemsBox,children:p})]})]})}var Ma=t.p+"static/mic-drop.fe3ef4d0..svg";const za=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",position:"absolute",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",position:"relative",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Va=()=>{const e=za();return(0,n.jsx)("img",{src:Ma,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ha=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:32}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Wa(e){const{status:s,statusMessage:i,additionalInfo:d,supportUrl:p}=e,g=Ha(),w=(0,Mn.s0)(),$=Gs();return(0,n.jsxs)(V.Z,{container:!0,spacing:0,className:g.container,children:[(0,n.jsx)(Va,{}),(0,n.jsxs)(V.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(S.Z,{"data-testid":"error",variant:"body1",className:g.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(S.Z,{variant:"body1",className:g.subtitle,children:d}),(0,n.jsx)(S.Z,{variant:"h2",className:g.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(S.Z,{variant:"h6",children:[(0,n.jsx)(pe,{to:"#","data-testid":"go-back-link",onClick:()=>w(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(pe,{to:p||$.url,children:"contact support"})," if you think this is a bug."]})]})]})}var Ga=t(16173);const Ka=(0,sn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(S.Z),ei=(0,sn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})($t.Z);function Ya(e){const{children:s,...i}=e,[d,p]=m.useState(null),g=m.Children.toArray(s),[w,$,...M]=g,Z=M.length?M.pop():g[g.length-1],ue=g.length>3,re=Fe=>{p(Fe.currentTarget)},ce=()=>{p(null)},Se=Boolean(d);return(0,n.jsxs)(m.Fragment,{children:[(0,n.jsxs)(Ga.Z,{"aria-label":"breadcrumb",...i,children:[g.length>1&&(0,n.jsx)(ei,{clone:!0,children:w}),g.length>2&&(0,n.jsx)(ei,{clone:!0,children:$}),ue&&(0,n.jsx)(Ka,{onClick:re,children:"..."}),(0,n.jsx)($t.Z,{style:{fontStyle:"italic"},children:Z})]}),(0,n.jsx)(Us.ZP,{open:Se,anchorEl:d,onClose:ce,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(E.Z,{children:M.map((Fe,ut)=>(0,n.jsx)(X.Z,{button:!0,children:(0,n.jsx)(ei,{clone:!0,children:Fe})},ut))})})]})}const Ja=(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"}),Qa=({type:e,typeLink:s,classes:i,pageTitle:d})=>e?s?(0,n.jsxs)(Ya,{className:i.breadcrumb,children:[(0,n.jsx)(pe,{to:s,children:e}),(0,n.jsx)(S.Z,{children:d})]}):(0,n.jsx)(S.Z,{className:i.type,children:e}):null,Xa=({pageTitle:e,classes:s,tooltip:i})=>{const d=(0,n.jsx)(S.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(Ye.ZP,{title:i,placement:"top-start",children:d}):d},qa=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(S.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Oi(e){const{children:s,pageTitleOverride:i,style:d,subtitle:p,title:g,tooltip:w,type:$,typeLink:M}=e,Z=Ja(),re=(0,T.h_)(T.Ds).getOptionalString("app.title")||"Backstage",ce=i||g,Se=g||i,Fe=`${ce} | %s | ${re}`,ut=`${ce} | ${re}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bn.q,{titleTemplate:Fe,defaultTitle:ut}),(0,n.jsxs)("header",{style:d,className:Z.header,children:[(0,n.jsxs)($t.Z,{className:Z.leftItemsBox,children:[(0,n.jsx)(Qa,{classes:Z,type:$,typeLink:M,pageTitle:Se}),(0,n.jsx)(Xa,{classes:Z,pageTitle:Se,tooltip:w}),(0,n.jsx)(qa,{classes:Z,subtitle:p})]}),(0,n.jsx)(V.Z,{container:!0,className:Z.rightItemsBox,spacing:4,children:s})]})]})}const _a=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:"bold",letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),el=({value:e,className:s})=>(0,n.jsx)(S.Z,{className:s,children:e});function tl(e){const{label:s,value:i,url:d}=e,p=_a(),g=(0,n.jsx)(el,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(V.Z,{item:!0,children:(0,n.jsxs)("span",{className:p.root,children:[(0,n.jsx)(S.Z,{className:p.label,children:s}),d?(0,n.jsx)(pe,{to:d,children:g}):g]})})}const nl={hour:"2-digit",minute:"2-digit"};function $i(e){const s=new Date,i=window.navigator.language,d=[];if(!e.has("homepage.clocks"))return d;const p=e.getConfigArray("homepage.clocks");for(const g of p)if(g.has("label")&&g.has("timezone")){let w=g.getString("label");const $={timeZone:g.getString("timezone"),...nl};try{new Date().toLocaleString(i,$)}catch{console.warn(`The timezone ${$.timeZone} is invalid. Defaulting to GMT`),$.timeZone="GMT",w="GMT"}const M=s.toLocaleTimeString(i,$);d.push({time:M,label:w})}return d}function zl(e){const s=useApi(configApiRef),i=[],[d,p]=React.useState(i);return React.useEffect(()=>{p($i(s));const g=setInterval(()=>{p($i(s))},1e3);return()=>{clearInterval(g)}},[s]),d.length!==0?_jsx(_Fragment,{children:d.map(g=>_jsx(HeaderLabel,{label:g.label,value:g.time},g.label))}):null}const rl=e=>(0,B.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),sl=(0,l.Z)(rl,{name:"BackstageItemCardHeader"});function ol(e){const{title:s,subtitle:i,children:d}=e,p=sl(e);return(0,n.jsxs)("div",{className:p.root,children:[i&&(0,n.jsx)(S.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(S.Z,{variant:"h6",component:"h4",children:s}),d]})}function Vl(e){const{description:s,tags:i,title:d,type:p,subtitle:g,label:w,onClick:$,href:M}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:g||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((Z,ue)=>_jsx(Chip,{size:"small",label:Z},ue))}):null,s]}),_jsxs(CardActions,{children:[!M&&_jsx(Button,{to:"#",onClick:$,color:"primary",children:w}),M&&_jsx(Button,{to:M,color:"primary",children:w})]})]})}const il=e=>(0,B.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),al=(0,l.Z)(il,{name:"BackstageItemCardGrid"});function ll(e){const{children:s,...i}=e,d=al(i);return(0,n.jsx)("div",{className:d.root,...i,children:s})}var cl=t(41547);const dl=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function Bi(e){const{themeId:s,children:i}=e,{isMobile:d}=Or(),p=dl({isMobile:d});return(0,n.jsx)(cl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function ul(e){const{themeId:s,children:i,...d}=e;return(0,n.jsxs)(Bi,{themeId:s,children:[(0,n.jsx)(Oi,{...d}),i]})}var kn=t(30195);const Hl=kn.z.object({providerInfo:kn.z.object({}).catchall(kn.z.unknown()).optional(),profile:kn.z.object({email:kn.z.string().optional(),displayName:kn.z.string().optional(),picture:kn.z.string().optional()}),backstageIdentity:kn.z.object({token:kn.z.string(),identity:kn.z.object({type:kn.z.literal("user"),userEntityRef:kn.z.string(),ownershipEntityRefs:kn.z.array(kn.z.string())})})}),Zi={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function hl(e){const s=new Date(Date.now()+Zi.defaultTokenExpiryMillis);if(!e)return s;const[i,d,p]=e.split("."),g=JSON.parse(atob(d));return typeof g.exp!="number"?s:new Date(g.exp*1e3-Zi.tokenExpiryMarginMillis)}class Wl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!d)throw new TypeError(`Invalid user entity reference "${i}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:hl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const Gl=e=>{const s=useApi(discoveryApiRef),[{status:i,error:d},{execute:p}]=useAsync(async()=>{const g=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await g.start(),e.onSignInSuccess(g)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},pl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ti=({children:e})=>{const s=pl();return(0,n.jsx)(V.Z,{component:"li",item:!0,classes:s,children:e})};class ni{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 fl(e){const[s,i,d]=e.split(".");return JSON.parse(atob(i))}class ri{getUserId(){return this.result.userId}static fromResult(s){return new ri(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:d}=fl(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:d!=null?d:[]}}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 Ts{static createGuest(){return new ni}static fromLegacy(s){return ri.fromResult(s)}static create(s){return new Ts(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,d){this.identity=s,this.authApi=i,this.profile=d}}const gl={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:d,message:p}=e,g=(0,T.h_)(i),w=(0,T.h_)(T.VE),$=async()=>{try{const M=await g.getBackstageIdentity({instantPopup:!0});if(!M)throw new Error(`The ${d} provider is not configured to support sign-in`);const Z=await g.getProfile();s(Ts.create({identity:M.identity,profile:Z,authApi:g}))}catch(M){w.post(new Ar.SP("Login failed",M))}};return(0,n.jsx)(ti,{children:(0,n.jsx)(yr,{variant:"fullHeight",title:d,actions:(0,n.jsx)(Q.Z,{color:"primary",variant:"outlined",onClick:$,children:"Sign In"}),children:(0,n.jsx)(S.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),d=await i.getBackstageIdentity({optional:!0});if(!d)return;const p=await i.getProfile();return Ts.create({identity:d.identity,profile:p,authApi:i})}},ml={Component:({onSignInSuccess:e})=>(0,n.jsx)(ti,{children:(0,n.jsx)(yr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(Q.Z,{color:"primary",variant:"outlined",onClick:()=>e(new ni),children:"Enter"}),children:(0,n.jsxs)(S.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 ni};var vl=t(63955),Di=t(86619),Ni=t(74828),yl=t(45455),xl=t.n(yl);const bl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Sl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Fi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},wl={Component:({onSignInSuccess:e})=>{const s=Sl(),{register:i,handleSubmit:d,formState:p}=(0,vl.cI)({mode:"onChange"}),{errors:g}=p,w=({userId:$})=>{e(Ts.fromLegacy({userId:$,profile:{email:`${$}@example.com`}}))};return(0,n.jsx)(ti,{children:(0,n.jsxs)(yr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(S.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:d(w),children:[(0,n.jsxs)(D.Z,{children:[(0,n.jsx)(Di.Z,{...Fi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(g.userId)}),g.userId&&(0,n.jsx)(Ni.Z,{error:!0,children:g.userId.message})]}),(0,n.jsxs)(D.Z,{children:[(0,n.jsx)(Di.Z,{...Fi(i("idToken",{required:!1,validate:$=>!$||bl.test($)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(g.idToken)}),g.idToken&&(0,n.jsx)(Ni.Z,{error:!0,children:g.idToken.message})]}),(0,n.jsx)(Q.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!xl()(g),children:"Continue"})]})]})})},loader:async()=>{}},ao="@backstage/core:SignInPage:provider",Ui={guest:ml,custom:wl,common:gl};function Mi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function _l(e){return e.reduce((i,d)=>{if(typeof d=="string")return Mi(d,i),i[d]={components:Ui[d],id:d},i;const{id:p}=d;return Mi(p,i),i[p]={components:Ui.common,id:p,config:d},i},{})}const ec=(e,s)=>{const i=useApi(errorApiRef),d=useApiHolder(),[p,g]=useState(!0),w=useCallback(M=>{s(IdentityApiSignOutProxy.from({identityApi:M,signOut:async()=>{var Z;localStorage.removeItem(ao),await((Z=M.signOut)===null||Z===void 0?void 0:Z.call(M))}}))},[s]);useLayoutEffect(()=>{var M;if(!p)return;const Z=localStorage.getItem(ao);if(Z===null){g(!1);return}const ue=e[Z];if(!ue){g(!1);return}let re=!1;return ue.components.loader(d,(M=ue.config)===null||M===void 0?void 0:M.apiRef).then(ce=>{re||(ce?w(ce):g(!1))}).catch(ce=>{re||(localStorage.removeItem(ao),i.post(ce),g(!1))}),()=>{re=!0}},[p,i,s,d,e,w]);const $=useMemo(()=>Object.keys(e).map(M=>{const Z=e[M],{Component:ue}=Z.components,re=ce=>{localStorage.setItem(ao,Z.id),w(ce)};return _jsx(ue,{config:Z.config,onSignInSuccess:re},Z.id)}),[e,w]);return[p,$]},Cl=({onSignInSuccess:e,providers:s=[],title:i,align:d="left"})=>{const p=useApi(configApiRef),g=useStyles(),w=getSignInProviders(s),[$,M]=useSignInProviders(w,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:g,children:M})]})]})},jl=({provider:e,auto:s,onSignInSuccess:i})=>{const d=useStyles(),p=useApi(e.apiRef),g=useApi(configApiRef),[w,$]=useState(),[M,Z]=useState(!1),ue=async({checkExisting:re,showPopup:ce})=>{try{let Se;if(re&&(Se=await p.getBackstageIdentity({optional:!0})),!Se&&(ce||s)&&(Z(!0),Se=await p.getBackstageIdentity({instantPopup:!0}),!Se))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Se){Z(!0);return}const Fe=await p.getProfile();i(UserIdentity.create({identity:Se.identity,authApi:p,profile:Fe}))}catch(Se){$(Se),Z(!0)}};return useMountEffect(()=>ue({checkExisting:!0})),M?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:g.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ue({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),w&&w.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:w.message})]})})})})]}):_jsx(Progress,{})};function tc(e){return"provider"in e?_jsx(jl,{...e}):_jsx(Cl,{...e})}const El=(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"}),Al=(0,sn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(er.Z);function nc(e){const{slackChannel:s,errorBoundaryProps:i,children:d,title:p,deepLink:g,value:w,onChange:$}=e,M=El(),[Z,ue]=useState(0),re=$||((Fe,ut)=>ue(ut));let ce;w?React.Children.map(d,Fe=>{React.isValidElement(Fe)&&(Fe==null?void 0:Fe.props.value)===w&&(ce=Fe==null?void 0:Fe.props.children)}):React.Children.map(d,(Fe,ut)=>{React.isValidElement(Fe)&&ut===Z&&(ce=Fe==null?void 0:Fe.props.children)});const Se=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Se,children:[p&&_jsx(Al,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:M,value:w||Z,onChange:re,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:ce}),g&&_jsx(BottomLink,{...g})]})})}const Tl=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:"bold"}}),{name:"BackstageCardTab"});function rc(e){const{children:s,...i}=e,d=Tl();return _jsx(Tab,{disableRipple:!0,classes:d,...i})}},25248:function(bt,Pe,t){"use strict";t.d(Pe,{fC:function(){return b},CL:function(){return Ue},sM:function(){return H},$v:function(){return pe},v_:function(){return Ke},hg:function(){return qe},uB:function(){return ee},R5:function(){return Ct},bq:function(){return A},Ds:function(){return He},ni:function(){return G},T0:function(){return N},CO:function(){return _e},x8:function(){return fn},rx:function(){return It},YO:function(){return at},P4:function(){return We},NT:function(){return zt},NW:function(){return Je},VE:function(){return Ye},W0:function(){return ze},gP:function(){return tt},IY:function(){return dt},F4:function(){return ie},ux:function(){return I},Kp:function(){return ae},$4:function(){return lt},p_:function(){return k},ZM:function(){return ct},D:function(){return R},gW:function(){return O},E6:function(){return nt},z$:function(){return gt},h_:function(){return te},I_:function(){return B},qD:function(){return Re},vJ:function(){return Tt},yx:function(){return xe},tg:function(){return Ee},Oi:function(){return Te}});var h=t(52322),n=t(51837),m=t(2784);const T=(0,n.CT)("analytics-context"),z=()=>{const oe=(0,m.useContext)(T);if(oe===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const W=oe.atVersion(1);if(W===void 0)throw new Error("No context found for version 1.");return W},b=oe=>{const{attributes:W,children:he}=oe,be={...z(),...W},Ge=(0,n.EI)({1:be});return(0,h.jsx)(T.Provider,{value:Ge,children:he})};function l(oe,W){const he=ve=>_jsx(b,{attributes:W,children:_jsx(oe,{...ve})});return he.displayName=`WithAnalyticsContext(${oe.displayName||oe.name||"Component"})`,he}function B(){const oe=(0,n.Vt)("api-context");if(!oe)throw new Error("API context is not available");const W=oe.atVersion(1);if(!W)throw new Error("ApiContext v1 not available");return W}function te(oe){const he=B().get(oe);if(!he)throw new Error(`No implementation available for ${oe}`);return he}function q(oe){return function(he){const ve=Ge=>{const V=B(),S={};for(const K in oe)if(oe.hasOwnProperty(K)){const Ae=oe[K],Oe=V.get(Ae);if(!Oe)throw new Error(`No implementation available for ${Ae}`);S[K]=Oe}return _jsx(he,{...Ge,...S})},be=he.displayName||he.name||"Component";return ve.displayName=`withApis(${be})`,ve}}class Q{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(W){if(this.config=W,!W.id.split(".").flatMap(ve=>ve.split("-")).every(ve=>ve.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${W.id}'`)}}function N(oe){return new Q(oe)}function G(oe,W){return"id"in oe?{api:oe,deps:{},factory:()=>W}:oe}var H;(function(oe){oe.SignedIn="SignedIn",oe.SignedOut="SignedOut"})(H||(H={}));const ae=N({id:"core.auth.google"}),ie=N({id:"core.auth.github"}),R=N({id:"core.auth.okta"}),I=N({id:"core.auth.gitlab"}),k=N({id:"core.auth.microsoft"}),O=N({id:"core.auth.onelogin"}),A=N({id:"core.auth.bitbucket"}),ee=N({id:"core.auth.atlassian"}),pe=N({id:"core.alert"}),Ke=N({id:"core.analytics"}),qe=N({id:"core.apptheme"}),He=N({id:"core.config"}),Je=N({id:"core.discovery"}),Ye=N({id:"core.error"});var Ue;(function(oe){oe[oe.None=0]="None",oe[oe.Active=1]="Active"})(Ue||(Ue={}));const ze=N({id:"core.featureflags"}),tt=N({id:"core.fetch"}),lt=N({id:"core.identity"}),ct=N({id:"core.oauthrequest"}),nt=N({id:"core.storage"});class Ce{setContext(W){this.context=W}captureEvent(W,he,{value:ve,attributes:be}={}){try{this.analyticsApi.captureEvent({action:W,subject:he,value:ve,attributes:be,context:this.context})}catch(Ge){console.warn("Error during analytics event capture. %o",Ge)}}constructor(W,he={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=W,this.context=he}}function rt(){try{return te(Ke)}catch{return{captureEvent:()=>{}}}}function gt(){const oe=(0,m.useRef)(null),W=z(),he=rt();function ve(){return oe.current===null&&(oe.current=new Ce(he)),oe.current}const be=ve();return be.setContext(W),be}const Le="plugin-context",se=oe=>{const{children:W,plugin:he}=oe,{Provider:ve}=(0,n.CT)(Le);return(0,h.jsx)(ve,{value:(0,n.EI)({1:{plugin:he}}),children:W})};function xe(){const oe=(0,n.Vt)(Le);if(!oe)throw new Error("Plugin Options context is not available");const W=oe.atVersion(1);if(!W)throw new Error("Plugin Options v1 is not available");return W.plugin.getPluginOptions()}const Re=()=>{const oe=(0,n.Vt)("app-context");if(!oe)throw new Error("App context is not available");const W=oe.atVersion(1);if(!W)throw new Error("AppContext v1 not available");return W},st=(0,n.uW)("component-data-store",()=>new WeakMap),pt="__backstage_data";function Ct(oe,W,he){const ve=oe;var be;let Ge=(be=ve[pt])!==null&&be!==void 0?be:st.get(oe);if(Ge||(Ge={map:new Map},Object.defineProperty(ve,pt,{enumerable:!1,configurable:!0,writable:!1,value:Ge}),st.set(oe,Ge)),Ge.map.has(W)){const V=oe.displayName||oe.name;throw new Error(`Attempted to attach duplicate data "${W}" to component "${V}"`)}Ge.map.set(W,he)}function dt(oe,W){if(!oe)return;const he=oe.type;if(!he)return;var ve;const be=(ve=he[pt])!==null&&ve!==void 0?ve:st.get(he);if(!!be)return be.map.get(W)}const jt=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let St=jt;class Lt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(W,he){this.id=W,this.params=he,this[St]="absolute"}}function zt(oe){var W;return new Lt(oe.id,(W=oe.params)!==null&&W!==void 0?W:[])}const mt=/^\w+$/;let ln=null;class Nt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(W,he,ve,be){this.id=W,this.path=he,this.parent=ve,this.params=be,this[ln]="sub"}}function dn(oe){const{id:W,path:he,parent:ve}=oe,be=he.split("/").filter(S=>S.startsWith(":")).map(S=>S.substring(1)),Ge=[...ve.params,...be];if(ve.params.some(S=>be.includes(S)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!he.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${he}'`);if(he.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${he}'`);for(const S of be)if(!mt.test(S))throw new Error(`SubRouteRef path has invalid param, got '${S}'`);return new Nt(W,he,ve,Ge)}let un=jt;class Ln{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(W,he,ve){this.id=W,this.params=he,this.optional=ve,this[un]="external"}}function fn(oe){var W;return new Ln(oe.id,(W=oe.params)!==null&&W!==void 0?W:[],Boolean(oe.optional))}var On=t(10289);function Ee(oe){const W=(0,On.TH)(),he=(0,n.Vt)("routing-context");if(!he)throw new Error("Routing context is not available");const ve=he.atVersion(1),be=(0,m.useMemo)(()=>ve&&ve.resolve(oe,W),[ve,oe,W]);if(!he)throw new Error("useRouteRef used outside of routing context");if(!ve)throw new Error("RoutingContext v1 not available");const Ge="optional"in oe&&oe.optional;if(!be&&!Ge)throw new Error(`No path for ${oe}`);return be}function Te(oe){return(0,On.UO)()}class Be extends m.Component{static getDerivedStateFromError(W){return{error:W}}render(){const{error:W}=this.state,{app:he,plugin:ve}=this.props,{ErrorBoundaryFallback:be}=he.getComponents();return W?(0,h.jsx)(be,{error:W,resetError:this.handleErrorReset,plugin:ve}):this.props.children}constructor(...W){super(...W),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function We(oe){const{component:W,mountPoint:he,name:ve}=oe;return at({component:{lazy:()=>W().then(be=>{const Ge=S=>{try{Ee(he)}catch(K){if(typeof K=="object"&&K!==null){const{message:Ae}=K;if(typeof Ae=="string"&&Ae.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${he} 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 K}return(0,h.jsx)(be,{...S})},V=ve||be.displayName||be.name||"LazyComponent";return Ge.displayName=`RoutableExtension(${V})`,Ge},be=>V=>{const S=Re(),{BootErrorPage:K}=S.getComponents();return(0,h.jsx)(K,{step:"load-chunk",error:be})})},data:{"core.mountPoint":he},name:ve})}function _e(oe){const{component:W,name:he}=oe;return at({component:W,name:he})}function at(oe){const{data:W={},name:he}=oe;he||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let ve;if("lazy"in oe.component){const Ge=oe.component.lazy;ve=(0,m.lazy)(()=>Ge().then(V=>({default:V})))}else ve=oe.component.sync;const be=he||ve.displayName||ve.name||"Component";return{expose(Ge){const V=S=>{const K=Re(),{Progress:Ae}=K.getComponents(),Oe=W==null?void 0:W["core.mountPoint"];return(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(Ae,{}),children:(0,h.jsx)(Be,{app:K,plugin:Ge,children:(0,h.jsx)(b,{attributes:{pluginId:Ge.getId(),...he&&{extension:he},...Oe&&{routeRef:Oe.id}},children:(0,h.jsx)(se,{plugin:Ge,children:(0,h.jsx)(ve,{...S})})})})})};Ct(V,"core.plugin",Ge);for(const[S,K]of Object.entries(W))Ct(V,S,K);return V.displayName=`Extension(${be})`,V}}}function ht(oe,W,he,ve){return m.Children.toArray(oe).flatMap(be=>{if(!(0,m.isValidElement)(be))return[];if(be.type===m.Fragment)return ht(be.props.children,W,he,ve);if(dt(be,"core.featureFlagged")){const Ge=be.props;return("with"in Ge?W.isActive(Ge.with):!W.isActive(Ge.without))?ht(be.props.children,W,he,ve):[]}if(he===void 0||he(be))return[be];if(ve)throw new Error(ve);return ht(be.props.children,W,he,ve)})}class wt{selectByComponentData(W){const he=ht(this.node,this.featureFlagsApi,ve=>dt(ve,W.key)!==void 0,W.withStrictError);return new wt(he,this.featureFlagsApi)}findComponentData(W){return ht(this.node,this.featureFlagsApi,ve=>dt(ve,W.key)!==void 0).map(ve=>dt(ve,W.key)).filter(ve=>ve!==void 0)}getElements(){return ht(this.node,this.featureFlagsApi)}constructor(W,he){this.node=W,this.featureFlagsApi=he}}function Tt(oe,W,he=[]){const ve=te(ze),be=new wt(oe,ve);return(0,m.useMemo)(()=>W(be),[oe,...he])}class Pt{getId(){return this.config.id}getApis(){var W;return(W=this.config.apis)!==null&&W!==void 0?W:[]}getFeatureFlags(){var W,he;return(he=(W=this.config.featureFlags)===null||W===void 0?void 0:W.slice())!==null&&he!==void 0?he:[]}get routes(){var W;return(W=this.config.routes)!==null&&W!==void 0?W:{}}get externalRoutes(){var W;return(W=this.config.externalRoutes)!==null&&W!==void 0?W:{}}provide(W){return W.expose(this)}__experimentalReconfigure(W){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(W))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var W;return(W=this.options)!==null&&W!==void 0?W:{}}toString(){return`plugin{${this.config.id}}`}constructor(W){this.config=W,this.options=void 0}}function It(oe){return new Pt(oe)}},23054:function(bt,Pe,t){"use strict";t.d(Pe,{SP:function(){return H},dR:function(){return Q},VL:function(){return ie},BD:function(){return n}});function h(R){if(typeof R!="object"||R===null||Array.isArray(R))return!1;const I=R;return!(typeof I.name!="string"||I.name===""||typeof I.message!="string")}function n(R){if(typeof R!="object"||R===null||Array.isArray(R))throw new Error(`Encountered invalid error, not an object, got '${R}'`);const I=R;if(typeof I.name!="string"||I.name==="")throw new Error(`Encountered error object without a name, got '${R}'`);if(typeof I.message!="string")throw new Error(`Encountered error object without a message, got '${R}'`)}var m=t(24852);function T(R,I){const k=serializeErrorInternal(R),O={name:"Unknown",message:"<no reason given>",...k};return I!=null&&I.includeStack||delete O.stack,O}function z(R){const I=(0,m.deserializeError)(R);return R.stack||(I.stack=void 0),I}function b(R){if(h(R)){const I=String(R);return I!=="[object Object]"?I:`${R.name}: ${R.message}`}return`unknown error '${R}'`}class l extends Error{constructor(I,k){var O;let A=I;if(k!==void 0){const ee=b(k);A?A+=`; caused by ${ee}`:A=`caused by ${ee}`}super(A),(O=Error.captureStackTrace)===null||O===void 0||O.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(k)?k:void 0}}class B extends null{}class te extends null{}class q extends null{}class Q extends l{}class N extends null{}class G extends null{}class H extends l{constructor(I,k){super(I,k),this.name=h(k)?k.name:"Error"}}async function ae(R){try{const k=await R.text();if(k){var I;if(!((I=R.headers.get("content-type"))===null||I===void 0)&&I.startsWith("application/json"))try{const O=JSON.parse(k);if(O.error&&O.response)return O}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}, ${k}`},response:{statusCode:R.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}`},response:{statusCode:R.status}}}class ie extends Error{static async fromResponse(I){const k=await ae(I),O=k.response.statusCode||I.status,A=k.error.name||I.statusText,ee=`Request failed with ${O} ${A}`,pe=z(k.error);return new ie({message:ee,response:I,data:k,cause:pe})}constructor(I){super(I.message),this.name="ResponseError",this.response=I.response,this.body=I.data,this.cause=I.cause}}},32838:function(bt,Pe,t){"use strict";t.d(Pe,{nW:function(){return ie},ae:function(){return Q},q3:function(){return N}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var m=new WeakMap;class T{async getCredentials(I){const k=new URL(I.url),O=_class_private_field_get(this,m).find(A=>A.isUrlSupported(k));if(!O)throw new Error(`No auth provider available for '${I.url}', see https://backstage.io/link?scm-auth`);return O.getCredentials(I)}constructor(I){_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_set(this,m,I)}}var z=new WeakMap,b=new WeakMap,l=new WeakMap,B=new WeakMap;class te{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:I,gitlab:k,azure:O,bitbucket:A})=>te.merge(te.forGithub(I),te.forGitlab(k),te.forAzure(O),te.forBitbucket(A))})}static forAuthApi(I,k){return new te("generic",I,k.host,k.scopeMapping)}static forGithub(I,k){var O;const A=(O=k==null?void 0:k.host)!==null&&O!==void 0?O:"github.com";return new te("github",I,A,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(I,k){var O;const A=(O=k==null?void 0:k.host)!==null&&O!==void 0?O:"gitlab.com";return new te("gitlab",I,A,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(I,k){var O;const A=(O=k==null?void 0:k.host)!==null&&O!==void 0?O:"dev.azure.com";return new te("azure",I,A,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(I,k){var O;const A=(O=k==null?void 0:k.host)!==null&&O!==void 0?O:"bitbucket.org";return new te("bitbucket",I,A,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...I){return new T(I)}isUrlSupported(I){return I.host===_class_private_field_get(this,b)}getAdditionalScopesForProvider(I){var k;if(!(I!=null&&I.customScopes)||_class_private_field_get(this,B)==="generic")return[];var O;return(O=(k=I.customScopes)===null||k===void 0?void 0:k[_class_private_field_get(this,B)])!==null&&O!==void 0?O:[]}async getCredentials(I){const{url:k,additionalScope:O,...A}=I,ee=_class_private_field_get(this,l).default.slice();O!=null&&O.repoWrite&&ee.push(..._class_private_field_get(this,l).repoWrite);const pe=this.getAdditionalScopesForProvider(O);pe.length&&ee.push(...pe);const Ke=[...new Set(ee)],qe=await _class_private_field_get(this,z).getAccessToken(Ke,A);return{token:qe,headers:{Authorization:`Bearer ${qe}`}}}constructor(I,k,O,A){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_init(this,b,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,z,k),_class_private_field_set(this,b,O),_class_private_field_set(this,l,A),_class_private_field_set(this,B,I)}}var q=t(39619);class Q{static fromConfig(I){return q.Lx.fromConfig(I)}}const N=(0,h.T0)({id:"integration.scmintegrations"});var G=t(52322),H=t(73250),ae=t(2784);const ie=R=>{const{type:I}=R,k=(0,h.qD)(),O=H.Z;var A;const ee=I&&(A=k.getSystemIcon(I))!==null&&A!==void 0?A:O;return(0,G.jsx)(ee,{})}},39619:function(bt,Pe,t){"use strict";t.d(Pe,{Lx:function(){return Wt},Pb:function(){return yt}});var h=t(82717),n=t.n(h),m=t(76635);function T(x){const u=new URL("http://example.com");return u.host=x,u.host===x}function z(x){try{return new URL(x),!0}catch{return!1}}function b(x,u){return{list(){return x},byUrl(y){try{const C=typeof y=="string"?new URL(y):y;return x.find(Y=>u(Y)===C.host)}catch{return}},byHost(y){return x.find(C=>u(C)===y)}}}function l(x){const{url:u,base:y,lineNumber:C}=x;try{return new URL(u),u}catch{}let Y;if(u.startsWith("/")){const{filepath:de}=n()(y);Y=new URL(y);const ge=(0,m.trimEnd)(Y.pathname.substring(0,Y.pathname.length-de.length),"/");Y.pathname=`${ge}${u}`}else Y=new URL(u,y);return Y.search=new URL(y).search,C&&(Y.hash=`L${C}`),Y.toString()}const B="amazonaws.com";function te(x){const u=x.getOptionalString("endpoint");var y;const C=(y=x.getOptionalBoolean("s3ForcePathStyle"))!==null&&y!==void 0?y:!1;let Y,de;if(u){try{const Rt=new URL(u);Y=Rt.host,de=Rt.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(de!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else Y=B;const ge=x.getOptionalString("accessKeyId"),Ie=x.getOptionalString("secretAccessKey"),et=x.getOptionalString("roleArn"),Ot=x.getOptionalString("externalId");return{host:Y,endpoint:u,s3ForcePathStyle:C,accessKeyId:ge,secretAccessKey:Ie,roleArn:et,externalId:Ot}}function q(x){const u=x.map(te);return u.some(y=>y.host===B)||u.push({host:B}),u}class Q{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Q.factory=({config:x})=>{var u;const y=q((u=x.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return b(y.map(C=>new Q(C)),C=>C.config.host)};var N=t(90383),G=t(22504),H=t(69866);const ae="GB";var ie=new WeakMap,R=new WeakMap,I=new WeakMap,k=new WeakMap,O=new WeakMap,A=new WeakMap,ee=new WeakMap;class pe{static fromRepoUrl(u){const y=new URL(u);let C,Y,de;const ge=y.pathname.split("/").map(_n=>decodeURIComponent(_n));if(ge[2]==="_git"?(C=ge[1],Y=de=ge[3]):ge[3]==="_git"?(C=ge[1],Y=ge[2],de=ge[4]):ge[4]==="_git"&&(C=`${ge[1]}/${ge[2]}`,Y=ge[3],de=ge[5]),!C||!Y||!de)throw new Error("Azure URL must point to a git repository");var Ie;const et=(Ie=y.searchParams.get("path"))!==null&&Ie!==void 0?Ie:void 0;let Ot;const Rt=y.searchParams.get("version");if(Rt){if(Rt.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Ot=Rt.slice(2)}return new pe(y.origin,C,Y,de,et,Ot)}toRepoUrl(){let u;return(0,N.Z)(this,I)===(0,N.Z)(this,k)?u=(0,N.Z)(this,ee).call(this,(0,N.Z)(this,R),"_git",(0,N.Z)(this,k)):u=(0,N.Z)(this,ee).call(this,(0,N.Z)(this,R),(0,N.Z)(this,I),"_git",(0,N.Z)(this,k)),(0,N.Z)(this,O)&&u.searchParams.set("path",(0,N.Z)(this,O)),(0,N.Z)(this,A)&&u.searchParams.set("version",ae+(0,N.Z)(this,A)),u.toString()}toFileUrl(){if(!(0,N.Z)(this,O))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,N.Z)(this,ee).call(this,(0,N.Z)(this,R),(0,N.Z)(this,I),"_apis","git","repositories",(0,N.Z)(this,k),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,N.Z)(this,O)),(0,N.Z)(this,A)&&u.searchParams.set("version",(0,N.Z)(this,A)),u.toString()}toArchiveUrl(){const u=(0,N.Z)(this,ee).call(this,(0,N.Z)(this,R),(0,N.Z)(this,I),"_apis","git","repositories",(0,N.Z)(this,k),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,N.Z)(this,O)&&u.searchParams.set("scopePath",(0,N.Z)(this,O)),(0,N.Z)(this,A)&&u.searchParams.set("version",(0,N.Z)(this,A)),u.toString()}toCommitsUrl(){const u=(0,N.Z)(this,ee).call(this,(0,N.Z)(this,R),(0,N.Z)(this,I),"_apis","git","repositories",(0,N.Z)(this,k),"commits");return u.searchParams.set("api-version","6.0"),(0,N.Z)(this,A)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,N.Z)(this,A)),u.toString()}getOwner(){return(0,N.Z)(this,R)}getProject(){return(0,N.Z)(this,I)}getRepo(){return(0,N.Z)(this,k)}getPath(){return(0,N.Z)(this,O)}getRef(){return(0,N.Z)(this,A)}constructor(u,y,C,Y,de,ge){(0,G.Z)(this,ie,{writable:!0,value:void 0}),(0,G.Z)(this,R,{writable:!0,value:void 0}),(0,G.Z)(this,I,{writable:!0,value:void 0}),(0,G.Z)(this,k,{writable:!0,value:void 0}),(0,G.Z)(this,O,{writable:!0,value:void 0}),(0,G.Z)(this,A,{writable:!0,value:void 0}),(0,G.Z)(this,ee,{writable:!0,value:(...Ie)=>{const et=new URL((0,N.Z)(this,ie));return et.pathname=Ie.map(Ot=>encodeURIComponent(Ot)).join("/"),et}}),(0,H.Z)(this,ie,u),(0,H.Z)(this,R,y),(0,H.Z)(this,I,C),(0,H.Z)(this,k,Y),(0,H.Z)(this,O,de),(0,H.Z)(this,A,ge)}}const Ke="dev.azure.com";function qe(x){var u;const y=(u=x.getOptionalString("host"))!==null&&u!==void 0?u:Ke,C=x.getOptionalString("token");if(!T(y))throw new Error(`Invalid Azure integration config, '${y}' is not a valid host`);return{host:y,token:C}}function He(x){const u=x.map(qe);return u.some(y=>y.host===Ke)||u.push({host:Ke}),u}class Je{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:y,base:C}=u;if(z(y))return y;try{const de=pe.fromRepoUrl(C),ge=new URL(C);var Y;const Ie=new URL(`https://a.com${(Y=de.getPath())!==null&&Y!==void 0?Y:""}`),et=new URL(y,Ie).pathname;return ge.searchParams.set("path",et),u.lineNumber&&(ge.searchParams.set("line",String(u.lineNumber)),ge.searchParams.set("lineEnd",String(u.lineNumber+1)),ge.searchParams.set("lineStartColumn","1"),ge.searchParams.set("lineEndColumn","1")),ge.toString()}catch{return new URL(y,C).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}Je.factory=({config:x})=>{var u;const y=He((u=x.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return b(y.map(C=>new Je(C)),C=>C.config.host)};var Ye=t(48834).lW;function Ue(x){return AzureUrl.fromRepoUrl(x).toFileUrl()}function ze(x){return AzureUrl.fromRepoUrl(x).toArchiveUrl()}function tt(x){return AzureUrl.fromRepoUrl(x).toCommitsUrl()}function lt(x,u){const y=u?{...u}:{};if(x.token){const C=Ye.from(`:${x.token}`,"utf8");y.Authorization=`Basic ${C.toString("base64")}`}return{headers:y}}const ct="bitbucket.org",nt="https://api.bitbucket.org/2.0";function Ce(x){var u;const y=(u=x.getOptionalString("host"))!==null&&u!==void 0?u:ct;let C=x.getOptionalString("apiBaseUrl");const Y=x.getOptionalString("token"),de=x.getOptionalString("username"),ge=x.getOptionalString("appPassword");if(!T(y))throw new Error(`Invalid Bitbucket integration config, '${y}' is not a valid host`);return C?C=(0,m.trimEnd)(C,"/"):y===ct?C=nt:C=`https://${y}/rest/api/1.0`,{host:y,apiBaseUrl:C,token:Y,username:de,appPassword:ge}}function rt(x){const u=x.map(Ce);return u.some(y=>y.host===ct)||u.push({host:ct,apiBaseUrl:nt}),u}class gt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=l(u);if(!u.lineNumber)return y;const C=new URL(y);return this.integrationConfig.host==="bitbucket.org"?C.hash=`lines-${u.lineNumber}`:C.hash=`${u.lineNumber}`,C.toString()}resolveEditUrl(u){const y=n()(u),C=new URL(u);return C.searchParams.set("mode","edit"),C.searchParams.set("spa","0"),C.searchParams.set("at",y.ref),C.toString()}constructor(u){this.integrationConfig=u}}gt.factory=({config:x})=>{var u,y,C;const Y=rt((C=x.getOptionalConfigArray("integrations.bitbucket"))!==null&&C!==void 0?C:[...(u=x.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(y=x.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&y!==void 0?y:[]]);return b(Y.map(de=>new gt(de)),de=>de.config.host)};var Le=t(96279),se=t(48834).lW;async function xe(x,u){const{name:y,owner:C,resource:Y}=parseGitUrl(x),de=Y==="bitbucket.org";let ge=de?`${u.apiBaseUrl}/repositories/${C}/${y}`:`${u.apiBaseUrl}/projects/${C}/repos/${y}/default-branch`,Ie=await fetch(ge,pt(u));if(Ie.status===404&&!de&&(ge=`${u.apiBaseUrl}/projects/${C}/repos/${y}/branches/default`,Ie=await fetch(ge,pt(u))),!Ie.ok){const Ot=`Failed to retrieve default branch from ${ge}, ${Ie.status} ${Ie.statusText}`;throw new Error(Ot)}let et;if(de)et=(await Ie.json()).mainbranch.name;else{const{displayId:Ot}=await Ie.json();et=Ot}if(!et)throw new Error(`Failed to read default branch from ${ge}. Response ${Ie.status} ${Ie.json()}`);return et}async function Re(x,u){const{name:y,owner:C,ref:Y,protocol:de,resource:ge,filepath:Ie}=parseGitUrl(x),et=ge==="bitbucket.org";let Ot=Y;Ot||(Ot=await xe(x,u));const Rt=Ie?`&path=${encodeURIComponent(decodeURIComponent(Ie))}`:"";return et?`${de}://${ge}/${C}/${y}/get/${Ot}.tar.gz`:`${u.apiBaseUrl}/projects/${C}/repos/${y}/archive?format=tgz&at=${Ot}&prefix=${C}-${y}${Rt}`}function st(x,u){try{const{owner:y,name:C,ref:Y,filepathtype:de,filepath:ge}=parseGitUrl(x);if(!y||!C||de!=="browse"&&de!=="raw"&&de!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ie=ge.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!Y)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${y}/${C}/src/${Y}/${Ie}`}return`${u.apiBaseUrl}/projects/${y}/repos/${C}/raw/${Ie}?at=${Y}`}catch(y){throw new Error(`Incorrect URL: ${x}, ${y}`)}}function pt(x){const u={};if(x.token)u.Authorization=`Bearer ${x.token}`;else if(x.username&&x.appPassword){const y=se.from(`${x.username}:${x.appPassword}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}const Ct="bitbucket.org",dt="https://api.bitbucket.org/2.0";function jt(x){const u=Ct,y=dt,C=x.getString("username"),Y=x.getString("appPassword");return{host:u,apiBaseUrl:y,username:C,appPassword:Y}}function St(x){const u=x.map(jt);return u.length===0&&u.push({host:Ct,apiBaseUrl:dt}),u}class Lt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=l(u);if(u.lineNumber){const C=new URL(y);return C.hash=`lines-${u.lineNumber}`,C.toString()}return y}resolveEditUrl(u){const y=n()(u),C=new URL(u);return C.searchParams.set("mode","edit"),C.searchParams.set("at",y.ref),C.toString()}constructor(u){this.integrationConfig=u}}Lt.factory=({config:x})=>{var u;const y=St((u=x.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return b(y.map(C=>new Lt(C)),C=>C.config.host)};var zt=t(48834).lW;async function mt(x,u){const{name:y,owner:C}=parseGitUrl(x),Y=`${u.apiBaseUrl}/repositories/${C}/${y}`,de=await fetch(Y,dn(u));if(!de.ok){const et=`Failed to retrieve default branch from ${Y}, ${de.status} ${de.statusText}`;throw new Error(et)}const Ie=(await de.json()).mainbranch.name;if(!Ie)throw new Error(`Failed to read default branch from ${Y}. Response ${de.status} ${de.json()}`);return Ie}async function ln(x,u){const{name:y,owner:C,ref:Y,protocol:de,resource:ge}=parseGitUrl(x);let Ie=Y;return Ie||(Ie=await mt(x,u)),`${de}://${ge}/${C}/${y}/get/${Ie}.tar.gz`}function Nt(x,u){try{const{owner:y,name:C,ref:Y,filepathtype:de,filepath:ge}=parseGitUrl(x);if(!y||!C||de!=="src"&&de!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ie=ge.replace(/^\//,"");if(!Y)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${y}/${C}/src/${Y}/${Ie}`}catch(y){throw new Error(`Incorrect URL: ${x}, ${y}`)}}function dn(x){const u={};if(x.username&&x.appPassword){const y=zt.from(`${x.username}:${x.appPassword}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}function un(x){const u=x.getString("host");let y=x.getOptionalString("apiBaseUrl");const C=x.getOptionalString("token"),Y=x.getOptionalString("username"),de=x.getOptionalString("password");if(!T(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return y?y=(0,m.trimEnd)(y,"/"):y=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:y,token:C,username:Y,password:de}}function Ln(x){return x.map(un)}class fn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=l(u);if(u.lineNumber){const C=new URL(y);return C.hash=u.lineNumber.toString(),C.toString()}return y}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}fn.factory=({config:x})=>{var u;const y=Ln((u=x.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return b(y.map(C=>new fn(C)),C=>C.config.host)};var On=t(48834).lW;async function Ee(x,u){const{name:y,owner:C}=parseGitUrl(x);let Y=`${u.apiBaseUrl}/projects/${C}/repos/${y}/default-branch`,de=await fetch(Y,We(u));if(de.status===404&&(Y=`${u.apiBaseUrl}/projects/${C}/repos/${y}/branches/default`,de=await fetch(Y,We(u))),!de.ok){const et=`Failed to retrieve default branch from ${Y}, ${de.status} ${de.statusText}`;throw new Error(et)}const{displayId:ge}=await de.json(),Ie=ge;if(!Ie)throw new Error(`Failed to read default branch from ${Y}. Response ${de.status} ${de.json()}`);return Ie}async function Te(x,u){const{name:y,owner:C,ref:Y,filepath:de}=parseGitUrl(x);let ge=Y;ge||(ge=await Ee(x,u));const Ie=de?`&path=${encodeURIComponent(decodeURIComponent(de))}`:"";return`${u.apiBaseUrl}/projects/${C}/repos/${y}/archive?format=tgz&at=${ge}&prefix=${C}-${y}${Ie}`}function Be(x,u){try{const{owner:y,name:C,ref:Y,filepathtype:de,filepath:ge}=parseGitUrl(x);if(!y||!C||de!=="browse"&&de!=="raw"&&de!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ie=ge.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${y}/repos/${C}/raw/${Ie}?at=${Y}`}catch(y){throw new Error(`Incorrect URL: ${x}, ${y}`)}}function We(x){const u={};if(x.token)u.Authorization=`Bearer ${x.token}`;else if(x.username&&x.password){const y=On.from(`${x.username}:${x.password}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}function _e(x){const u=x.getString("host");let y=x.getOptionalString("baseUrl"),C=x.getOptionalString("cloneUrl"),Y=x.getOptionalString("gitilesBaseUrl");const de=x.getOptionalString("username"),ge=x.getOptionalString("password");if(T(u)){if(y&&!z(y))throw new Error(`Invalid Gerrit integration config, '${y}' is not a valid baseUrl`);if(C&&!z(C))throw new Error(`Invalid Gerrit integration config, '${C}' is not a valid cloneUrl`);if(Y&&!z(Y))throw new Error(`Invalid Gerrit integration config, '${Y}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return y?y=(0,m.trimEnd)(y,"/"):y=`https://${u}`,Y?Y=(0,m.trimEnd)(Y,"/"):Y=`https://${u}`,C?C=(0,m.trimEnd)(C,"/"):C=y,{host:u,baseUrl:y,cloneUrl:C,gitilesBaseUrl:Y,username:de,password:ge}}function at(x){return x.map(_e)}var ht=t(48834).lW;const wt=")]}'";function Tt(x,u){const C=u.replace(x.gitilesBaseUrl,"").split("/").filter(Ot=>!!Ot),Y=C.indexOf("+");if(Y<=0)throw new Error(`Unable to parse project from url: ${u}`);const de=(0,m.trimStart)(C.slice(0,Y).join("/"),"/"),ge=C.indexOf("heads");if(ge<=0)throw new Error(`Unable to parse branch from url: ${u}`);const Ie=C[ge+1],et=C.slice(ge+2).join("/");return{branch:Ie,filePath:et===""?"/":et,project:de}}function Pt(x,u,y,C){return`${x.gitilesBaseUrl}/${u}/+/refs/heads/${y}/${(0,m.trimStart)(C,"/")}`}function It(x){return x.password?"/a/":"/"}function oe(x,u){const{branch:y,project:C}=Tt(x,u);return`${x.baseUrl}${It(x)}projects/${encodeURIComponent(C)}/branches/${y}`}function W(x,u){const{project:y}=Tt(x,u);return`${x.cloneUrl}${It(x)}${y}`}function he(x,u){const{branch:y,filePath:C,project:Y}=Tt(x,u);return`${x.baseUrl}${It(x)}projects/${encodeURIComponent(Y)}/branches/${y}/files/${encodeURIComponent(C)}/content`}function ve(x){return`${x.baseUrl}${It(x)}projects/`}function be(x){const u={};if(!x.password)return u;const y=ht.from(`${x.username}:${x.password}`,"utf8");return u.Authorization=`Basic ${y.toString("base64")}`,{headers:u}}async function Ge(x){const u=await x.text();if(u.startsWith(wt))try{return JSON.parse(u.slice(wt.length))}catch(y){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${y}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class V{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:y,base:C,lineNumber:Y}=u;let de;if(y.startsWith("/")){const{branch:ge,project:Ie}=Tt(this.config,C);return Pt(this.config,Ie,ge,y)}return y?de=new URL(y,C):de=new URL(C),Y&&(de.hash=Y.toString()),de.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}V.factory=({config:x})=>{var u;const y=at((u=x.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return b(y.map(C=>new V(C)),C=>C.config.host)};const S="github.com",K="https://api.github.com",Ae="https://raw.githubusercontent.com";function Oe(x){var u,y;const C=(y=x.getOptionalString("host"))!==null&&y!==void 0?y:S;let Y=x.getOptionalString("apiBaseUrl"),de=x.getOptionalString("rawBaseUrl");const ge=x.getOptionalString("token"),Ie=(u=x.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(et=>({appId:et.getNumber("appId"),clientId:et.getString("clientId"),clientSecret:et.getString("clientSecret"),webhookSecret:et.getString("webhookSecret"),privateKey:et.getString("privateKey"),allowedInstallationOwners:et.getOptionalStringArray("allowedInstallationOwners")}));if(!T(C))throw new Error(`Invalid GitHub integration config, '${C}' is not a valid host`);return Y?Y=(0,m.trimEnd)(Y,"/"):C===S&&(Y=K),de?de=(0,m.trimEnd)(de,"/"):C===S&&(de=Ae),{host:C,apiBaseUrl:Y,rawBaseUrl:de,token:ge,apps:Ie}}function Ve(x){const u=x.map(Oe);return u.some(y=>y.host===S)||u.push({host:S,apiBaseUrl:K,rawBaseUrl:Ae}),u}function ot(x,u,y){try{const{owner:C,name:Y,ref:de,filepathtype:ge,filepath:Ie}=parseGitUrl(x);if(!C||!Y||!de||ge!=="blob"&&ge!=="raw"&&ge!=="tree")throw new Error("Invalid GitHub URL or file path");const et=Ie.replace(/^\//,"");return Zt(u,y)==="api"?`${u.apiBaseUrl}/repos/${C}/${Y}/contents/${et}?ref=${de}`:`${u.rawBaseUrl}/${C}/${Y}/${de}/${et}`}catch(C){throw new Error(`Incorrect URL: ${x}, ${C}`)}}function Ft(x,u){const y={};return Zt(x,u)==="api"&&(y.Accept="application/vnd.github.v3.raw"),u.token&&(y.Authorization=`token ${u.token}`),{headers:y}}function Zt(x,u){return x.apiBaseUrl&&(u.token||!x.rawBaseUrl)?"api":"raw"}var qt=t(42822),Vt=t(89393),Ht=t(26228);class jn{async getOrCreateToken(u,y){const C=this.tokenCache.get(u);if(C&&this.isNotExpired(C.expiresAt))return{accessToken:C.token};const Y=await y();return this.tokenCache.set(u,Y),{accessToken:Y.token}}constructor(){this.tokenCache=new Map,this.isNotExpired=u=>u.diff(Ht.ou.local(),"minutes").minutes>50}}const E={Accept:"application/vnd.github.machine-man-preview+json"};class X{async getInstallationCredentials(u,y){const{installationId:C,suspended:Y}=await this.getInstallationData(u);if(this.allowedInstallationOwners){var de;if(!(!((de=this.allowedInstallationOwners)===null||de===void 0)&&de.includes(u)))return{accessToken:void 0}}if(Y)throw new Error(`The GitHub application for ${u} is suspended`);const ge=y?`${u}/${y}`:u;return this.cache.getOrCreateToken(ge,async()=>{const Ie=await this.appClient.apps.createInstallationAccessToken({installation_id:C,headers:E});if(y&&Ie.data.repository_selection==="selected"){const Ot=new Vt.v({baseUrl:this.baseUrl,auth:Ie.data.token}),Rt=await Ot.paginate(Ot.apps.listReposAccessibleToInstallation);var et;if(!((et=Rt.repositories)!==null&&et!==void 0?et:Rt).some(jr=>jr.name===y))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${y}`)}return{token:Ie.data.token,expiresAt:Ht.ou.fromISO(Ie.data.expires_at)}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const C=(await this.getInstallations()).find(de=>{var ge,Ie;return((ge=de.account)===null||ge===void 0||(Ie=ge.login)===null||Ie===void 0?void 0:Ie.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(C)return{installationId:C.id,suspended:Boolean(C.suspended_by)};const Y=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw Y.name="NotFoundError",Y}constructor(u,y){this.cache=new jn,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=y,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
31
+ `)},this.appClient=new Vt.v({baseUrl:y,headers:E,authStrategy:qt.i,auth:this.baseAuthConfig})}}class ye{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(y=>y.getInstallations()))).flat():[]}async getAppToken(u,y){if(this.apps.length===0)return;const C=await Promise.all(this.apps.map(Ie=>Ie.getInstallationCredentials(u,y).then(et=>({credentials:et,error:void 0}),et=>({credentials:void 0,error:et})))),Y=C.find(Ie=>Ie.credentials);if(Y)return Y.credentials.accessToken;const ge=C.map(Ie=>Ie.error).find(Ie=>Ie.name!=="NotFoundError");if(ge)throw ge}constructor(u){var y,C;this.apps=(C=(y=u.apps)===null||y===void 0?void 0:y.map(Y=>new X(Y,u.apiBaseUrl)))!==null&&C!==void 0?C:[]}}class fe{async getCredentials(u){const y=n()(u.url),C=y.owner||y.name,Y=y.owner?y.name:void 0;let de="app",ge=await this.githubAppCredentialsMux.getAppToken(C,Y);return ge||(de="token",ge=this.token),{headers:ge?{Authorization:`Bearer ${ge}`}:void 0,token:ge,type:de}}constructor(u,y){this.githubAppCredentialsMux=u,this.token=y}}fe.create=x=>new fe(new ye(x),x.token);class ke{static fromIntegrations(u){const y=new Map;return u.github.list().forEach(C=>{const Y=SingleInstanceGithubCredentialsProvider.create(C.config);y.set(C.config.host,Y)}),new ke(y)}async getCredentials(u){const y=new URL(u.url),C=this.providers.get(y.host);if(!C)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return C.getCredentials(u)}constructor(u){this.providers=u}}class De{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return yt(l(u),"tree")}resolveEditUrl(u){return yt(u,"edit")}constructor(u){this.integrationConfig=u}}De.factory=({config:x})=>{var u;const y=Ve((u=x.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return b(y.map(C=>new De(C)),C=>C.config.host)};function yt(x,u){return x.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(y,C,Y,de)=>`//${C}/${Y}/${de}/${u}/`)}const Dt="gitlab.com",_t="https://gitlab.com/api/v4";function Ut(x){const u=x.getString("host");let y=x.getOptionalString("apiBaseUrl");const C=x.getOptionalString("token");let Y=x.getOptionalString("baseUrl");if(y?y=(0,m.trimEnd)(y,"/"):u===Dt&&(y=_t),Y?Y=(0,m.trimEnd)(Y,"/"):Y=`https://${u}`,T(u)){if(!y||!z(y))throw new Error(`Invalid GitLab integration config, '${y}' is not a valid apiBaseUrl`);if(!z(Y))throw new Error(`Invalid GitLab integration config, '${Y}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:C,apiBaseUrl:y,baseUrl:Y}}function nn(x){const u=x.map(Ut);return u.some(y=>y.host===Dt)||u.push({host:Dt,apiBaseUrl:_t,baseUrl:`https://${Dt}`}),u}function kt(x){let u="";return x.host!==Dt&&(u=new URL(x.baseUrl).pathname),trimEnd(u,"/")}async function rn(x,u){const y=await $n(x,u);return En(x,y,u).toString()}function Gn(x){const{token:u=""}=x;return{headers:{"PRIVATE-TOKEN":u}}}function En(x,u,y){try{const C=new URL(x),Y=C.pathname.split("/blob/").slice(1).join("/blob/"),[de,...ge]=Y.split("/"),Ie=getGitLabIntegrationRelativePath(y);return C.pathname=[...Ie?[Ie]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(ge.join("/"))),"raw"].join("/"),C.search=`?ref=${de}`,C}catch(C){throw new Error(`Incorrect url: ${x}, ${C}`)}}async function $n(x,u){const y=new URL(x);if(!y.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let C=y.pathname.split("/-/blob/")[0].split("/blob/")[0];const Y=getGitLabIntegrationRelativePath(u);Y&&(C=C.replace(Y,""));const de=new URL(`${y.origin}${Y}/api/v4/projects/${encodeURIComponent(C.replace(/^\//,""))}`),ge=await fetch(de.toString(),Gn(u)),Ie=await ge.json();if(!ge.ok)throw new Error(`GitLab Error '${Ie.error}', ${Ie.error_description}`);return Number(Ie.id)}catch(C){throw new Error(`Could not get GitLab project ID for: ${x}, ${C}`)}}class Bn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return qn(u,"edit")}constructor(u){this.integrationConfig=u}}Bn.factory=({config:x})=>{var u;const y=nn((u=x.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return b(y.map(C=>new Bn(C)),C=>C.config.host)};function qn(x,u){return x.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class Wt{static fromConfig(u){return new Wt({awsS3:Q.factory({config:u}),azure:Je.factory({config:u}),bitbucket:gt.factory({config:u}),bitbucketCloud:Lt.factory({config:u}),bitbucketServer:fn.factory({config:u}),gerrit:V.factory({config:u}),github:De.factory({config:u}),gitlab:Bn.factory({config:u})})}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}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let y=Object.values(this.byType).map(C=>C.byUrl(u)).filter(Boolean);if(y.length>1){const C=y.filter(Y=>!(Y instanceof gt));C.length!==0&&(y=C)}return y[0]}byHost(u){return Object.values(this.byType).map(y=>y.byHost(u)).find(Boolean)}resolveUrl(u){const y=this.byUrl(u.base);return y?y.resolveUrl(u):l(u)}resolveEditUrl(u){const y=this.byUrl(u);return y?y.resolveEditUrl(u):u}constructor(u){this.byType=u}}},96215:function(bt,Pe,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return A.s4}});var n=t(52322),m=t(2784),T=t(28316),z=t(10289),b=t(25248);const l=(0,b.T0)({id:"plugin.techdocs.storageservice"}),B=(0,b.T0)({id:"plugin.techdocs.service"});var te=t(92077),q=t(95481),Q=t(7476),N=t(93225),G=t(67896),H=t(65124),ae=t(17339),ie=t(85478),R=t(68435),I=t(3482),k=t(42081),O=t(48431),A=t(89258),ee=t(52943),pe=t(61886),Ke=t(13980),qe=t.n(Ke);class He{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var Je=t(51837);const Ye=(0,Je.CT)("api-context"),Ue=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,m.useContext)(Ye))===null||r===void 0?void 0:r.atVersion(1),P=f?new He(o,f):o;return(0,n.jsx)(Ye.Provider,{value:(0,Je.EI)({1:P}),children:c})};Ue.propTypes={apis:qe().shape({get:qe().func.isRequired}).isRequired,children:qe().node};class ze{static validateFactories(r,o){for(const c of o){const f=[c],P=new Set;for(;f.length;){const F=f.shift(),U=r.get(F);if(!!U)for(const ne of Object.values(U.deps)){if(ne.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);P.has(ne)||(P.add(ne),f.push(ne))}}}}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 P=this.loadDeps(r,f.deps,[...o,f.api]),F=f.factory(P);return this.apis.set(r.id,F),F}loadDeps(r,o,c){const f={};for(const P in o)if(o.hasOwnProperty(P)){const F=o[P],U=this.load(F,c);if(!U)throw new Error(`No API factory available for dependency ${F} of dependent ${r}`);f[P]=U}return f}constructor(r){this.factories=r,this.apis=new Map}}var tt;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(tt||(tt={}));class lt{register(r,o){const c=tt[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 ct(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,P=window.screen.width/2-c/2,F=window.screen.height/2-f/2,U=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${F},left=${P}`);let ne="";if(!U||typeof U.closed=="undefined"||U.closed){const it=new Error("Failed to open auth popup.");it.name="PopupRejectedError",o(it);return}const Ze=it=>{if(it.source!==U||it.origin!==a.origin)return;const{data:Et}=it;if(Et.type==="config_info"){ne=Et.targetOrigin;return}if(Et.type!=="authorization_response")return;const Kt=Et;if("error"in Kt){const pn=new Error(Kt.error.message);pn.name=Kt.error.name,o(pn)}else r(Kt.response);xt()},$e=setInterval(()=>{if(U.closed){const it=`Login failed, ${ne&&ne!==window.location.origin?`Incorrect app origin, expected ${ne}`:"popup was closed"}`,Et=new Error(it);Et.name="PopupClosedError",o(Et),xt()}},100);function xt(){window.removeEventListener("message",Ze),clearInterval($e)}window.addEventListener("message",Ze)})}function nt(a){return[...a].join(" ")}class Ce{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 ct({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:P=nt,oauthRequestApi:F,sessionTransform:U=ne=>ne}=r;this.authRequester=F.createAuthRequester({provider:f,onAuthRequest:ne=>this.showPopup(ne)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=P,this.sessionTransform=U}}function rt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class gt{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return rt(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 P of f)c.add(P)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var Le=t(82394),se=t.n(Le);let xe=Symbol.observable;class Re{[xe](){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(se())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let st=Symbol.observable;class pt{[st](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(se())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class Ct{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?b.sM.SignedIn:b.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new pt(b.sM.SignedOut),this.signedIn=!1}}class dt{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),P=this.sessionScopesFunc(c);return rt(P,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 Ct;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:P}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=P,this.helper=new gt({sessionScopes:f,defaultScopes:c})}}class jt{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 St={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Lt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=St,oauthRequestApi:P,defaultScopes:F=[],scopeTransform:U=$e=>$e}=r,ne=new Ce({discoveryApi:o,environment:c,provider:f,oauthRequestApi:P,sessionTransform($e){return{...$e,providerInfo:{idToken:$e.providerInfo.idToken,accessToken:$e.providerInfo.accessToken,scopes:Lt.normalizeScopes(U,$e.providerInfo.scope),expiresAt:new Date(Date.now()+$e.providerInfo.expiresInSeconds*1e3)}}}}),Ze=new dt({connector:ne,defaultScopes:new Set(F),sessionScopes:$e=>$e.providerInfo.scopes,sessionShouldRefresh:$e=>($e.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Lt({sessionManager:Ze,scopeTransform:U})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=Lt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var P;return(P=f==null?void 0:f.providerInfo.accessToken)!==null&&P!==void 0?P:""}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 zt={id:"github",title:"GitHub",icon:()=>null};class mt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=zt,oauthRequestApi:P,defaultScopes:F=["read:user"]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:F})}}const ln={id:"gitlab",title:"GitLab",icon:()=>null};class Nt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ln,oauthRequestApi:P,defaultScopes:F=["read_user"]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:F})}}const dn={id:"google",title:"Google",icon:()=>null},un="https://www.googleapis.com/auth/";class Ln{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:P=dn,defaultScopes:F=["openid",`${un}userinfo.email`,`${un}userinfo.profile`]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:c,provider:P,environment:f,defaultScopes:F,scopeTransform(U){return U.map(ne=>ne==="openid"?ne:ne==="profile"||ne==="email"?`${un}userinfo.${ne}`:ne.startsWith(un)?ne:`${un}${ne}`)}})}}const fn={id:"okta",title:"Okta",icon:()=>null},On=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Ee="okta.";class Te{static create(r){const{discoveryApi:o,environment:c="development",provider:f=fn,oauthRequestApi:P,defaultScopes:F=["openid","email","profile","offline_access"]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:F,scopeTransform(U){return U.map(ne=>On.has(ne)||ne.startsWith(Ee)?ne:`${Ee}${ne}`)}})}}var Be=t(30195);const We=Be.z.object({profile:Be.z.object({email:Be.z.string().optional(),displayName:Be.z.string().optional(),picture:Be.z.string().optional()}),backstageIdentity:Be.z.object({token:Be.z.string(),identity:Be.z.object({type:Be.z.literal("user"),userEntityRef:Be.z.string(),ownershipEntityRefs:Be.z.array(Be.z.string())})})}),_e={id:"saml",title:"SAML",icon:()=>null};class at{static create(r){const{discoveryApi:o,environment:c="development",provider:f=_e}=r,P=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),F=new StaticAuthSessionManager({connector:P}),U=new AuthSessionStore({manager:F,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new at(U)}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 ht={id:"microsoft",title:"Microsoft",icon:()=>null};class wt{static create(r){const{environment:o="development",provider:c=ht,oauthRequestApi:f,discoveryApi:P,defaultScopes:F=["openid","offline_access","profile","email","User.Read"]}=r;return Lt.create({discoveryApi:P,oauthRequestApi:f,provider:c,environment:o,defaultScopes:F})}}const Tt={id:"onelogin",title:"onelogin",icon:()=>null},Pt=new Set(["openid","profile","email","phone","address","groups","offline_access"]),It="onelogin.";class oe{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Tt,oauthRequestApi:P}=r;return Lt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(U=>Pt.has(U)||U.startsWith(It)?U:`${It}${U}`)}})}}const W={id:"bitbucket",title:"Bitbucket",icon:()=>null};class he{static create(r){const{discoveryApi:o,environment:c="development",provider:f=W,oauthRequestApi:P,defaultScopes:F=["team"]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c,defaultScopes:F})}}const ve={id:"atlassian",title:"Atlassian",icon:()=>null};class be{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ve,oauthRequestApi:P}=r;return Lt.create({discoveryApi:o,oauthRequestApi:P,provider:f,environment:c})}}class Ge{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Re}}class V{captureEvent(r){}}const S="theme";class K{static createWithStorage(r){const o=new K(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(S))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe(P=>{P?window.localStorage.setItem(S,P):window.localStorage.removeItem(S)}),window.addEventListener("storage",P=>{if(P.key===S){var F;const U=(F=localStorage.getItem(S))!==null&&F!==void 0?F:void 0;o.setActiveThemeId(U)}}),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 pt(void 0)}}var Ae=t(9850),Oe=t.n(Ae),Ve=t(12782),ot=t.n(Ve);const Ft=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Zt(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function qt(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 Vt={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 Ht{static fromConfigs(r){return r.length===0?new Ht(void 0):r.reduce((o,{data:c,context:f,filteredKeys:P,deprecatedKeys:F})=>{const U=new Ht(c,f,o);if(U.filteredKeys=P,F)for(const{key:ne,description:Ze}of F)console.warn(`The configuration key '${ne}' of ${f} is deprecated and may be removed soon. ${Ze||""}`);return U},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(Vt.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=Oe()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var P;return f}else if(f===void 0)return c;return ot()({},{value:f},{value:c},(F,U)=>!Zt(U)||!Zt(F)?U:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error(Vt.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(Zt(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(Vt.type(this.fullKey(r),this.context,qt(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error(Vt.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[P,F]of f.entries())if(!Zt(F))return{expected:"object-array",value:F,key:`${r}[${P}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,P)=>this.copy(f,`${r}[${P}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error(Vt.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(Vt.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error(Vt.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(Vt.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(Vt.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 Ht(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 P;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const F=o(c);if(F!==!0){const{key:U=r,value:ne=c,expected:Ze}=F;throw new TypeError(Vt.type(this.fullKey(U),this.context,qt(ne),Ze))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!Ft.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,P]of o.entries())if(Zt(c))c=c[P];else if(c!==void 0){const F=this.fullKey(o.slice(0,f).join("."));throw new TypeError(Vt.type(F,this.context,qt(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 jn="Invalid discovery URL pattern,";class E{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(`${jn} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${jn} URL must not have a hash`);if(f.search)throw new Error(`${jn} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${jn} URL must not end with a slash`);return new E(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class X{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 ye{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new Re}}class fe{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function ke(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 De{registerFlag(r){ke(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===b.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===b.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,P])=>(ke(f),P===b.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function yt(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 Dt{static create(r){var o,c;const f=_t(r),P=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",F=((c=r.header)===null||c===void 0?void 0:c.value)||(U=>`Bearer ${U}`);return new Dt(r.identityApi,f,P,F)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:P}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof P!="string"||!P||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue(P)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function _t(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?Ut(a.urlPrefixAllowlist):a.config?Ut([a.config.getString("backend.baseUrl")]):()=>!1}function Ut(a){const r=a.map(o=>o.replace(/\/$/,""));return o=>r.some(c=>o===c||o.startsWith(`${c}/`))}function nn(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class kt{apply(r){return async(o,c)=>{const f=new Request(o,c),P="plugin://";if(!f.url.startsWith(P))return r(o,c);const{hostname:F,pathname:U,search:ne,hash:Ze,username:$e,password:xt}=new URL(`http://${f.url.substring(P.length)}`);let it=await this.discoveryApi.getBaseUrl(F);if($e||xt){const Kt=new URL(it),pn=`${$e}${xt?`:${xt}`:""}@`;it=`${Kt.protocol}//${pn}${Kt.host}${Kt.pathname}`}const Et=`${nn(it,U)}${ne}${Ze}`;return r(Et,typeof o=="string"||rn(o)?c:o)}}constructor(r){this.discoveryApi=r}}function rn(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Gn{static resolvePluginProtocol(r){return new kt(r.discoveryApi)}static injectIdentityAuth(r){return Dt.create(r)}constructor(){}}function En(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function $n(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class Bn{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=>En(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)=>$n(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 pt(this.getCurrentPending())}}class qn{createAuthRequester(r){const o=new Bn,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const P=this.currentRequests.slice(),F=this.makeAuthRequest(f,r);F?P[c]=F:delete P[c],this.currentRequests=P,this.subject.next(P.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 pt([]),this.currentRequests=[],this.handlerCount=0}}const Wt=new Map;class x{static create(r){var o;return new x((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,(P,F)=>(typeof F=="object"&&F!==null&&Object.freeze(F),F)),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 Wt.has(o)||Wt.set(o,new x(o,this.errorApi)),Wt.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(se())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var u=t(64279);function y(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:m.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:P}=o.shift();m.Children.forEach(c,F=>{if(!(0,m.isValidElement)(F))return;const U={};for(const ne in r)if(r.hasOwnProperty(ne)){const Ze=r[ne];U[ne]=Ze.visit(Ze.accumulator,F,f,P[ne])}for(const ne of a.discoverers){const Ze=ne(F);Ze&&o.push({node:Ze,parent:F,contexts:U})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function C(a,r){return()=>({accumulator:a(),visit:r})}function Y(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function de(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 ge=C(()=>new Set,(a,r)=>{const o=(0,b.IY)(r,"core.plugin");o&&a.add(o)}),Ie=a=>{const{children:r}=a,o=(0,b.h_)(b.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,b.R5)(Ie,"core.featureFlagged",!0);const et={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Ot(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 Rt(a,r=new Array){return m.Children.forEach(a,o=>{if(!(0,m.isValidElement)(o))return;const c=(0,b.IY)(o,"core.mountPoint");if(c){const f=(0,b.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}Rt(o.props.children,r)}),r}const _n=C(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,P;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const F=(f=r.props)===null||f===void 0?void 0:f.path,U=(0,b.IY)(r,"core.mountPoint");if(U&&F)throw new Error(`Path property may not be set directly on a routable extension "${Ot(r)}"`);var ne;const Ze=(ne=c==null||(P=c.obj)===null||P===void 0?void 0:P.children)!==null&&ne!==void 0?ne:a.objects;if(F!==void 0){if(typeof F!="string")throw new Error(`Element path must be a string at "${Ot(r)}"`);const Et=F.startsWith("/")?F.slice(1):F,Kt=r.props.element;if((0,b.IY)(r,"core.gatherMountPoints")){var $e;if(Kt)throw new Error(`Mount point gatherers may not have an element prop "${Ot(r)}"`);const pn={path:Et,element:"gathered",routeRefs:new Set,caseSensitive:Boolean(($e=r.props)===null||$e===void 0?void 0:$e.caseSensitive),children:[et],plugin:void 0};return Ze.push(pn),{obj:pn,gatherPath:Et,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(Kt){var xt;const[pn,...Sn]=Rt(Kt);if(Sn.length>0)throw new Error(`Route element with path "${F}" may not contain multiple routable extensions`);if(!pn)return c;const{routeRef:sr,plugin:Pn}=pn,Vn={path:Et,element:"mounted",routeRefs:new Set([sr]),caseSensitive:Boolean((xt=r.props)===null||xt===void 0?void 0:xt.caseSensitive),children:[et],plugin:Pn};return Ze.push(Vn),a.paths.set(sr,Et),a.parents.set(sr,c==null?void 0:c.routeRef),{obj:Vn,routeRef:sr!=null?sr:c==null?void 0:c.routeRef,gatherPath:Et,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(U){var it;if(!(c!=null&&c.gatherPath))throw new Error(`Routable extension "${Ot(r)}" with mount point "${U}" must be assigned a path`);return c==null||(it=c.obj)===null||it===void 0||it.routeRefs.add(U),a.paths.set(U,c.gatherPath),a.parents.set(U,c==null?void 0:c.gatherRouteRef),{...c,routeRef:U}}return c}),Cr=C(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,P,F;if((o==null?void 0:o.props.element)===r)return c;let U=c==null?void 0:c.obj,ne=c==null?void 0:c.routeRef,Ze=c==null?void 0:c.sticky;const $e=(f=r.props)===null||f===void 0?void 0:f.path;var xt;const it=(xt=U==null?void 0:U.children)!==null&&xt!==void 0?xt:a.objects,Et=Boolean((P=r.props)===null||P===void 0?void 0:P.caseSensitive);let Kt=c==null?void 0:c.path;if((0,b.IY)(r,"core.gatherMountPoints")){if(!$e)throw new Error("Mount point gatherer must have a path");Kt=$e}const pn=(F=r.props)===null||F===void 0?void 0:F.element;let Sn=(0,b.IY)(r,"core.mountPoint");if(!Sn&&(0,m.isValidElement)(pn)&&(Sn=(0,b.IY)(pn,"core.mountPoint")),Sn){let Vn=$e;if(Kt&&(Vn?Kt=void 0:Vn=Kt),!Vn)throw new Error("Mounted routable extension must have a path");a.paths.set(Sn,Vn),ne&&Ze?(a.parents.set(Sn,ne),$e&&(ne=Sn,Ze=!1)):(a.parents.set(Sn,ne),ne=Sn),$e?(U={caseSensitive:Et,path:$e,element:"mounted",routeRefs:new Set([Sn]),children:[et],plugin:(0,b.IY)(r.props.element,"core.plugin")},it.push(U)):U==null||U.routeRefs.add(Sn)}if((0,b.IY)(r,"core.gatherMountPoints")&&(Ze=!0),(0,b.IY)(r,"core.gatherMountPoints")){if(!$e)throw new Error("Mount point gatherer must have a path");if(!Sn){var Pn;U={caseSensitive:Et,path:$e,element:"gathered",routeRefs:new Set,children:[et],plugin:c==null||(Pn=c.obj)===null||Pn===void 0?void 0:Pn.plugin},it.push(U)}}return{obj:U,path:Kt,routeRef:ne,sticky:Ze}}),jr=C(()=>new Set,(a,r)=>{if(r.type===Ie){const o=r.props;a.add("with"in o?o.with:o.without)}}),ar=(0,Je.uW)("route-ref-type",()=>Symbol("route-ref-type"));function Br(a){return a[ar]==="absolute"}function Zr(a){return a[ar]==="sub"}function Er(a){return a[ar]==="external"}function fr(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function ts(a,r,o){let c,f="";if(Br(a))c=a;else if(Zr(a))c=a.parent,f=a.path;else if(Er(a)){const U=o.get(a);if(!U)return[void 0,""];if(Br(U))c=U;else if(Zr(U))c=U.parent,f=U.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${U}`)}else throw a[ar]?new Error(`Unknown or invalid route ref type, ${a[ar]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const P=r.get(c);if(P===void 0)return[void 0,""];const F=fr(P,f);return[c,F]}function Dr(a,r,o,c,f){var P;const F=(P=(0,z.fp)(f,r))!==null&&P!==void 0?P:[],U=Array();let ne=-1;for(let xt=a;xt&&(ne=F.findIndex(it=>it.route.routeRefs.has(xt)),ne===-1);xt=c.get(xt))U.unshift(xt);U.length===0&&(ne-=1);const Ze=ne===-1?"":F[ne].pathname,$e=U.slice(0,-1).map(xt=>{const it=o.get(xt);if(it===void 0)throw new Error(`No path for ${xt}`);if(it.includes(":"))throw new Error(`Cannot route to ${a} with parent ${xt} as it has parameters`);return it});return`${fr(Ze,...$e)}/`}class ns{resolve(r,o){const[c,f]=ts(r,this.routePaths,this.routeBindings);if(!c)return;let P;typeof o=="string"?P=this.trimPath(o):o.pathname?P={...o,pathname:this.trimPath(o.pathname)}:P=o;const F=this.appBasePath+Dr(c,P,this.routePaths,this.routeParents,this.routeObjects);return(...[ne])=>fr(F,(0,z.Gn)(f,ne))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,P){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=P}}const Zn=(0,Je.CT)("routing-context"),Dn=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:P})=>{const F=new ns(a,r,o,c,f),U=(0,Je.EI)({1:F});return(0,n.jsx)(Zn.Provider,{value:U,children:P})},lr=(a,r)=>{try{var o,c;const f=(0,z.fp)(r,{pathname:a}),P=(o=f==null?void 0:f.filter(U=>{var ne;return((ne=U==null?void 0:U.route.routeRefs)===null||ne===void 0?void 0:ne.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!P)return{};let F;return P.routeRefs.size===1&&(F=P.routeRefs.values().next().value),{extension:"App",pluginId:((c=P.plugin)===null||c===void 0?void 0:c.getId())||"root",...F?{routeRef:F.id}:{}}}catch{return{}}},gr=({pathname:a,search:r,hash:o})=>{const c=(0,b.z$)();return(0,m.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},Nr=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,z.TH)();return(0,n.jsx)(b.fC,{attributes:lr(r,a),children:(0,n.jsx)(gr,{pathname:r,search:o,hash:c})})};function rs(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,P="";for(;f;){const U=a.get(f);if(U===void 0)throw new Error(`No path for ${f}`);P=fr(U,P),f=r.get(f)}const F=P.match(/:(\w+)/g);if(F){for(let U=0;U<F.length;U++)for(let ne=U+1;ne<F.length;ne++)if(F[ne]===F[U])throw new Error(`Parameter ${F[ne]} is duplicated in path ${P}`)}}}function Fr(a,r){for(const o of r)if(!!o.externalRoutes){for(const[c,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.has(f))throw new Error(`External route '${c}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const ss=(0,Je.CT)("app-context"),os=({appContext:a,children:r})=>{const o=(0,Je.EI)({1:a});return(0,n.jsx)(ss.Provider,{value:o,children:r})};function mr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function vn(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class Nn{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw mr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return vn("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw mr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return vn("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 vn("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 vr=t(72164);function Rs(a,r,o){if(a!==void 0){const f=o.find(P=>P.id===a);if(f)return f}if(r){const f=o.find(P=>P.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const Ar=()=>{const a=(0,m.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,m.useState)(a.matches);return(0,m.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function Tr({children:a}){const r=(0,b.h_)(b.hg),o=(0,vr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?Ar():!1,f=Rs(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const is=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 Ls{add(r,o){return this.apis.push([r.id,o]),o}build(){return new Hn(new Map(this.apis))}constructor(){this.apis=[]}}class Hn{static builder(){return new Ls}static from(r){return new Hn(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new Hn(new Map([[r.id,o]]))}with(r,o){return new Hn(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function Ps(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[P,F]of Object.entries(f)){const U=c[P];if(!U)throw new Error(`Key ${P} is not an existing external route`);if(!F&&!U.optional)throw new Error(`External route ${P} is required but was undefined`);F&&r.set(U,F)}}}),r}function Ur(){const[a]=(0,z.is)((0,n.jsx)(z.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const Ir=(0,m.createContext)({routeObjects:[]});function Rr(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 as(a,r,o){const c=Boolean(a),f=(0,u.default)(a||(()=>Promise.resolve([])));let P;if(c&&f.loading){const{Progress:Ze}=r;P=(0,n.jsx)(Ze,{})}else if(f.error){const{BootErrorPage:Ze}=r;P=(0,n.jsx)(Ze,{step:"load-config",error:f.error})}const{ThemeProvider:F=Tr}=r;if(P)return{node:(0,n.jsx)(Ue,{apis:Hn.with(b.hg,o),children:(0,n.jsx)(F,{children:P})})};var U;return{api:Ht.fromConfigs((U=f.value)!==null&&U!==void 0?U:[])}}class ls{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 cs{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new ls(this);let o=!1;return({children:f})=>{const P=(0,m.useMemo)(()=>K.createWithStorage(this.themes),[]),{routing:F,featureFlags:U,routeBindings:ne}=(0,m.useMemo)(()=>{const it=y({root:f,discoverers:[Y,de],collectors:{routing:Ur()?Cr:_n,collectedPlugins:ge,featureFlags:jr}});return it.collectedPlugins.forEach(Et=>this.plugins.add(Et)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...it,routeBindings:Ps(this.bindRoutes)}},[f]);o||(o=!0,rs(F.paths,F.parents),Fr(ne,this.plugins));const Ze=as(this.configLoader,this.components,P),$e="api"in Ze;if($e){const{api:it}=Ze;this.configApi=it}if((0,m.useEffect)(()=>{if($e){const it=this.getApiHolder().get(b.W0);for(const Et of this.plugins.values())if("getFeatureFlags"in Et)for(const Kt of Et.getFeatureFlags())it.registerFlag({name:Kt.name,pluginId:Et.getId()});else for(const Kt of Et.output())Kt.type==="feature-flag"&&it.registerFlag({name:Kt.name,pluginId:Et.getId()});for(const Et of U)it.registerFlag({name:Et,pluginId:""})}},[$e,Ze,U]),"node"in Ze)return Ze.node;const{ThemeProvider:xt=Tr}=this.components;return(0,n.jsx)(Ue,{apis:this.getApiHolder(),children:(0,n.jsx)(os,{appContext:r,children:(0,n.jsx)(xt,{children:(0,n.jsx)(Dn,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:ne,basePath:Rr(Ze.api),children:(0,n.jsx)(Ir.Provider,{value:{routeObjects:F.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:P,children:F})=>{const[U,ne]=(0,m.useState)(),Ze=(0,b.h_)(b.Ds),$e=Rr(Ze);return U?(this.appIdentityProxy.setTarget(U,{signOutTargetUrl:$e||"/"}),F):(0,n.jsx)(P,{onSignInSuccess:ne})};return({children:P})=>{const F=(0,b.h_)(b.Ds),U=Rr(F),ne=`${U}/*`,{routeObjects:Ze}=(0,m.useContext)(Ir);return o?(0,n.jsxs)(r,{children:[(0,n.jsx)(Nr,{routeObjects:Ze}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(z.Z5,{children:(0,n.jsx)(z.AW,{path:ne,element:(0,n.jsx)(n.Fragment,{children:P})})})})]}):(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:U||"/"}),(0,n.jsxs)(r,{children:[(0,n.jsx)(Nr,{routeObjects:Ze}),(0,n.jsx)(z.Z5,{children:(0,n.jsx)(z.AW,{path:ne,element:(0,n.jsx)(n.Fragment,{children:P})})})]}))}}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 ze.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:b.hg,deps:{},factory:()=>K.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:b.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:b.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:b.W0,deps:{},factory:()=>new De});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 ze.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new ze(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 Nn;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:is;var P;this.defaultApis=(P=r.defaultApis)!==null&&P!==void 0?P:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new lt}}function ds(a){return new cs(a)}let Mr=!1;const zr=a=>{const r=(0,b.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,m.useMemo)(()=>Ur(),[]),P=[...(0,b.vJ)(a.children,F=>F.getElements().flatMap(U=>{let ne=U.props.path;if(ne==="")return[];var Ze;ne=(Ze=ne==null?void 0:ne.replace(/\/\*$/,""))!==null&&Ze!==void 0?Ze:"/";let $e=c?U:U.props.element;return!c&&!$e&&($e=U,Mr||(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] />} />."),Mr=!0)),[{path:ne,element:$e,children:U.props.children?[{path:ne==="/"?"/":"*",element:U.props.children}]:void 0}]}).sort((U,ne)=>ne.path.localeCompare(U.path)).map(U=>({...U,path:U.path==="/"?"/":`${U.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,z.V$)(P)};var Lr=t(25488);const er=[(0,b.ni)({api:b.NW,deps:{configApi:b.Ds},factory:({configApi:a})=>E.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,b.ni)({api:b.$v,deps:{},factory:()=>new Ge}),(0,b.ni)({api:b.v_,deps:{},factory:()=>new V}),(0,b.ni)({api:b.VE,deps:{alertApi:b.$v},factory:({alertApi:a})=>{const r=new X(a,new ye);return fe.forward(r,{hidden:!1}),r}}),(0,b.ni)({api:b.E6,deps:{errorApi:b.VE},factory:({errorApi:a})=>x.create({errorApi:a})}),(0,b.ni)({api:b.gP,deps:{configApi:b.Ds,identityApi:b.$4,discoveryApi:b.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>yt({middleware:[Gn.resolvePluginProtocol({discoveryApi:o}),Gn.injectIdentityAuth({identityApi:r,config:a})]})}),(0,b.ni)({api:b.ZM,deps:{},factory:()=>new qn}),(0,b.ni)({api:b.Kp,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Ln.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.p_,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>wt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.F4,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>mt.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.D,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Te.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.ux,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Nt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.gW,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>oe.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.bq,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>he.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:b.uB,deps:{discoveryApi:b.NW,oauthRequestApi:b.ZM,configApi:b.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>be.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,b.ni)({api:Lr.RV,deps:{discovery:b.NW,identity:b.$4,config:b.Ds},factory:({config:a,discovery:r,identity:o})=>Lr.iM.create({config:a,discovery:r,identity:o})})];var sn=t(77277),$t=t(1515),Vr=t(62833);function us({children:a}){return(0,z.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(z.VA,{children:a})}const Hr=()=>(0,n.jsx)($t.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),hs=({step:a,error:r})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${r.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(us,{children:(0,n.jsx)($t.mf,{status:"501",statusMessage:o})})},ps=({error:a,resetError:r,plugin:o})=>(0,n.jsx)($t.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(sn.Z,{variant:"outlined",onClick:r,children:"Retry"})}),fs={Progress:$t.Ex,Router:Vr.VK,NotFoundErrorPage:Hr,BootErrorPage:hs,ErrorBoundaryFallback:ps};var gs=t(43642),Wr=t(80079),yr=t(90941),ks=t(32915),ms=t(40562),Gr=t(21853),vs=t(60744),Os=t(66569),ys=t(30254),$s=t(13384),po=t(15933),v=t(58838),j=t(86737),L=t(4989),D=t(44407),_=t(18628),J=t(84219),le=t(98685),me=t(39781);const we={brokenImage:Wr.Z,catalog:_.Z,scaffolder:ks.Z,techdocs:ms.Z,search:Gr.Z,chat:vs.Z,dashboard:Os.Z,docs:ys.Z,email:$s.Z,github:v.Z,group:J.Z,help:j.Z,"kind:api":po.Z,"kind:component":D.Z,"kind:domain":gs.Z,"kind:group":J.Z,"kind:location":L.Z,"kind:system":yr.Z,"kind:user":le.Z,user:le.Z,warning:me.Z};var Ne=t(73689),Me=t(48032);const je={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")`},Qe={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 ft(a){const{colors:r,shape:o,options:c}=a,P=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,F=`${o}, ${P}`;var U;const ne=(U=c==null?void 0:c.fontColor)!==null&&U!==void 0?U:"#FFFFFF";return{colors:r,shape:o,backgroundImage:F,fontColor:ne}}const vt={home:ft({colors:Qe.teal,shape:je.wave}),documentation:ft({colors:Qe.pinkSea,shape:je.wave2}),tool:ft({colors:Qe.purpleSky,shape:je.round}),service:ft({colors:Qe.marineBlue,shape:je.wave}),website:ft({colors:Qe.veryBlue,shape:je.wave}),library:ft({colors:Qe.rubyRed,shape:je.wave}),other:ft({colors:Qe.darkGrey,shape:je.wave}),app:ft({colors:Qe.toastyOrange,shape:je.wave}),apis:ft({colors:Qe.teal,shape:je.wave2}),card:ft({colors:Qe.greens,shape:je.wave})},Xe=16,Bt='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Qt(a){const{palette:r,htmlFontSize:o=Xe,fontFamily:c=Bt,defaultPageTheme:f,pageTheme:P=vt}=a;if(!P[f])throw new Error(`${f} is not defined in pageTheme.`);var F;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:P[f],getPageTheme:({themeId:U})=>(F=P[U])!==null&&F!==void 0?F:P[f]}}function Fn(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,Me.darken)(a.palette.link,.3),background:(0,Me.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 An(a){const r=Qt(a),o=(0,Ne.Z)(r),c=Fn(o);return{...o,overrides:c}}var tr=t(34505);const hn=An({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:tr.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:vt}),yn=An({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:tr.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:vt});var Tn=t(98192),xr=t(15222),br=t(41547),Sr=t(87561);const xn=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(xr.Z,{}),Provider:({children:a})=>(0,n.jsx)(br.Z,{theme:hn,children:(0,n.jsx)(Sr.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(Tn.Z,{}),Provider:({children:a})=>(0,n.jsx)(br.Z,{theme:yn,children:(0,n.jsx)(Sr.ZP,{children:a})})}];function on(a){var r,o,c;return ds({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...fs,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:er,icons:{...we,...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:xn})}var nr=t(25271),fo=t(76635);async function ii({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,fo.isArray)(c))return;var f;const P=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(fo.isString).map(F=>F.split(":")).filter(F=>F.length===4&&F[0]==="entity").map(([F,U,ne,Ze])=>(0,nr.eE)({kind:U,namespace:ne,name:Ze})).forEach(F=>P.add(F)),await o.set("entityRefs",Array.from(P)),await r.remove("starredEntities")}class ai{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(se())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),ii(r).then(),this.settingsStore=r.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var zi=t(33414),Vi=t(79324),Pr=t(79692),go=t(23362);const mo=(0,Pr.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function li(a){var r,o;const c=a.result,f=mo(),P=useAnalytics(),F=()=>{P.captureEvent("discover",c.title,{attributes:{to:c.location},value:a.rank})};return _jsxs(Link,{noTrack:!0,to:c.location,onClick:F,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 ci=t(86359),gn=t(46285),xs=t(95544),vo=t(99688),Bs=t(12231),Zs=t(86136),Kr=t(49378),di=t(85256),bs=t(61837),yo=t(79784),Ds=t(50758),Ns=t(31654),xo=t(43054),cr=t(51666);const kr="catalog-entity",bo=(0,cr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:kr}),So=(0,cr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Fs=(0,cr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:kr}),ui=(0,cr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:kr}),wo=(0,cr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Co=(0,cr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Us=(0,cr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),hi=[bo,So,Fs,ui,wo,Co,Us];var Ms=t(49166);function jo(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,P=typeof(r==null?void 0:r.disableUnregister)=="boolean";var F;const U=(F=!o||(P?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&F!==void 0?F:!1;let ne=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(ne=(0,n.jsxs)(Bs.Z,{onClick:()=>{f(),c()},disabled:U,children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Ms.Z,{fontSize:"small"})}),(0,n.jsx)(Kr.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:ne})}const zs=(0,Pr.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Vs(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[P,F]=(0,m.useState)(),U=zs(),Ze=(0,gn.N$)(Fs).allowed,$e=Et=>{F(Et.currentTarget)},xt=()=>{F(void 0)},it=r&&[...r.map(Et=>(0,n.jsxs)(Bs.Z,{onClick:()=>{xt(),Et.onClick()},children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Et.Icon,{fontSize:"small"})}),(0,n.jsx)(Kr.Z,{primary:Et.title})]},Et.title)),(0,n.jsx)(di.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!P,role:"button",onClick:$e,"data-testid":"menu-button",className:U.button,id:"long-menu",children:(0,n.jsx)(xo.Z,{})}),(0,n.jsx)(yo.ZP,{open:Boolean(P),onClose:xt,anchorEl:P,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(Ds.Z,{children:[it,(0,n.jsx)(jo,{unregisterEntityOptions:o,isUnregisterAllowed:Ze,onUnregisterEntity:c,onClose:xt}),(0,n.jsxs)(Bs.Z,{onClick:()=>{xt(),f()},children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Ns.Z,{fontSize:"small"})}),(0,n.jsx)(Kr.Z,{primary:"Inspect entity"})]})]})})]})}const Hs="plugin.catalog.entityLayoutRoute",Ws=()=>null;(0,b.R5)(Ws,Hs,!0),(0,b.R5)(Ws,"core.gatherMountPoints",!0);function Eo(a){const{entity:r,title:o}=a;return(0,n.jsxs)(xs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(xs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(gn.LH,{entity:r})]})}function Gs(a,r,o,c){var f;const P=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var F;const U=(F=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&F!==void 0?F:"";var ne,Ze,$e;return{headerTitle:`${($e=(Ze=(ne=c==null?void 0:c.metadata.title)!==null&&ne!==void 0?ne:o)!==null&&Ze!==void 0?Ze:c==null?void 0:c.metadata.name)!==null&&$e!==void 0?$e:""}${U&&U!==nr.zG?` in ${U}`:""}`,headerType:(()=>{let it=P.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(it+=" \u2014 ",it+=c.spec.type.toLocaleLowerCase("en-US")),it})()}}function Ao(a){var r;const{entity:o}=a,c=(0,gn.hF)(o,nr.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)($t.i9,{label:"Owner",value:(0,n.jsx)(gn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)($t.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Un=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:P,NotFoundComponent:F}=a,{kind:U,namespace:ne,name:Ze}=(0,b.Oi)(gn.wi),{entity:$e,loading:xt,error:it}=(0,gn.ce)(),Et=(0,z.TH)(),Kt=(0,b.vJ)(P,Xo=>Xo.selectByComponentData({key:Hs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:wr})=>{if($e){if(wr.if&&!wr.if($e))return[]}else return[];return[{path:wr.path,title:wr.title,children:wr.children,tabProps:wr.tabProps}]}),[$e]),{headerTitle:pn,headerType:Sn}=Gs(U,ne,Ze,$e),[sr,Pn]=(0,m.useState)(!1),[Vn,Qr]=(0,m.useState)(!1),Xr=(0,z.s0)(),Qo=async()=>{Pn(!1),Qr(!1),Xr("/")};(0,m.useEffect)(()=>{Pn(!1),Qr(!1)},[Et.pathname]);var qr;return(0,n.jsxs)($t.T3,{themeId:(qr=$e==null||(r=$e.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&qr!==void 0?qr:"home",children:[(0,n.jsx)($t.h4,{title:(0,n.jsx)(Eo,{title:pn,entity:$e}),pageTitleOverride:pn,type:Sn,children:$e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ao,{entity:$e}),(0,n.jsx)(Vs,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Pn(!0),onInspectEntity:()=>Qr(!0)})]})}),xt&&(0,n.jsx)($t.Ex,{}),$e&&(0,n.jsx)($t.tn,{routes:Kt}),it&&(0,n.jsx)($t.VY,{children:(0,n.jsx)(vo.Z,{severity:"error",children:it.toString()})}),!xt&&!it&&!$e&&(0,n.jsx)($t.VY,{children:F||(0,n.jsxs)($t.GB,{title:"Entity not found",children:["There is no ",U," with the requested"," ",(0,n.jsx)($t.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(gn.pp,{open:sr,entity:$e,onConfirm:Qo,onClose:()=>Pn(!1)}),(0,n.jsx)(gn.U_,{open:Vn,entity:$e,onClose:()=>Qr(!1)})]})};Un.Route=Ws;var Hi=t(23054);function Wi(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[P,F]=useState(!1),U=useApi(catalogApiRef),ne=useApi(alertApiRef),Ze=async()=>{F(!0);try{const $e=f.metadata.uid;await U.removeEntityByUid($e),c()}catch($e){assertError($e),ne.post({message:$e.message})}finally{F(!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:P,onClick:Ze,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Ss=t(19625);function Gi(a){var r,o;return(a==null||(r=a.metadata)===null||r===void 0||(o=r.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function Ki(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),P=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:P,onClose:()=>c(!1)})]})}var pi=t(29644);const fi=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function To(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var P,F;return{errors:((F=(P=f.entity.status)===null||P===void 0?void 0:P.items)!==null&&F!==void 0?F:[]).filter(fi).map(Ze=>Ze.error).filter(Ze=>Boolean(Ze)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function ws(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await To(stringifyEntityRef(a),o)).items.length>0}function Yi(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:P}=useAsync(async()=>To(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!P?null:_jsx(_Fragment,{children:P.items.map((F,U)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(F.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:F.entity})]}),F.errors.map((ne,Ze)=>_jsx(ResponseErrorPanel,{error:ne},Ze))]},U))})}const Io="core.backstage.entitySwitch",Ks=a=>null;(0,b.R5)(Ks,Io,!0);const Ro=a=>{var r;const{entity:o,loading:c}=(0,gn.ce)(),f=(0,b.I_)(),P=(0,b.vJ)(a.children,ne=>ne.selectByComponentData({key:Io,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Ze=>{if(c)return[];const{if:$e,children:xt}=Ze.props;if(!o)return[{if:$e===void 0,children:xt}];var it;return[{if:(it=$e==null?void 0:$e(o,{apis:f}))!==null&&it!==void 0?it:!0,children:xt}]}),[f,o,c]);if(P.some(ne=>typeof ne.if=="object"&&"then"in ne.if))return(0,n.jsx)(Cs,{results:P});var U;return(U=(r=P.find(ne=>ne.if))===null||r===void 0?void 0:r.children)!==null&&U!==void 0?U:null};function Cs({results:a}){const{loading:r,value:o}=(0,u.default)(async()=>{const c=a.map(async({if:P,children:F})=>{try{if(await P)return F}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}Ro.Case=Ks;const gi=null,mi=gn._i.Filters,vi=gn._i.Content,bn=(0,b.rx)({id:"catalog",apis:[(0,b.ni)({api:gn.Ah,deps:{discoveryApi:b.NW,fetchApi:b.gP},factory:({discoveryApi:a,fetchApi:r})=>new pi.MS({discoveryApi:a,fetchApi:r})}),(0,b.ni)({api:gn.p3,deps:{storageApi:b.E6},factory:({storageApi:a})=>new ai({storageApi:a})})],routes:{catalogIndex:Ss._Z,catalogEntity:gn.wi},externalRoutes:{createComponent:Ss.yw,viewTechDoc:Ss.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Mn=bn.provide((0,b.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Ss._Z})),Yr=bn.provide((0,b.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:gn.wi})),Lo=bn.provide((0,b.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),Po=bn.provide((0,b.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),rr=bn.provide((0,b.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),yi=bn.provide((0,b.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),ko=bn.provide((0,b.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),xi=bn.provide((0,b.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Ji=bn.provide((0,b.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),Kn=bn.provide((0,b.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),Oo=bn.provide((0,b.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),js=bn.provide((0,b.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Es=t(32838);class Jr{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}`,P=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if(P.status===404)throw new Error("Page not found");return P.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 Ys{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 Js=[(0,b.ni)({api:pe.Dl,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Jr({configApi:a,discoveryApi:r,identityApi:o})}),(0,b.ni)({api:pe.gT,deps:{configApi:b.Ds,discoveryApi:b.NW,identityApi:b.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Ys({configApi:a,discoveryApi:r,identityApi:o})}),(0,b.ni)({api:Es.q3,deps:{configApi:b.Ds},factory:({configApi:a})=>Es.ae.fromConfig(a)})],Qs={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},$o={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Or(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function Bo(){const a=await is(),r=await Or();return[...a,{context:"detected",data:r?Qs:$o}]}var Xs=t(86689),Zo=t(58845);const _s=(0,Pr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var eo=()=>{const a=_s();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 to=(0,Pr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var As=()=>{const a=to();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 Fo=(0,Pr.Z)({root:{width:$t.po.drawerWidthClosed,height:3*$t.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:$t.po.drawerWidthClosed,marginLeft:24}}),Uo=()=>{const a=Fo(),{isOpen:r}=(0,$t.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(Xs.Z,{component:Vr.OL,to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(eo,{}):(0,n.jsx)(As,{})})})},Mo=({children:a})=>(0,n.jsxs)($t.tR,{children:[(0,n.jsxs)($t.YE,{children:[(0,n.jsx)(Uo,{}),(0,n.jsx)($t.v7,{}),(0,n.jsx)($t.R6,{icon:Zo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var zo=t(80030),Vo=t(32388),Ho=t(4142);const Wo=(0,Pr.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 zn;(function(a){a.LIGHT="light",a.DARK="dark"})(zn||(zn={}));const no=()=>{const a=(0,b.h_)(b.hg),r=Wo(),[o,c]=(0,m.useState)(a.getActiveThemeId()===zn.DARK?zn.DARK:zn.LIGHT),f={[zn.LIGHT]:{icon:Ho.Z,title:"Dark theme"},[zn.DARK]:{icon:Vo.Z,title:"Light theme"}},{title:P,icon:F}=f[o],U=()=>{c(ne=>{const Ze=ne===zn.LIGHT?zn.DARK:zn.LIGHT;return a.setActiveThemeId(Ze),Ze})};return(0,n.jsx)(xs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(zo.ZP,{title:P,arrow:!0,children:(0,n.jsx)(bs.Z,{size:"small",onClick:U,children:(0,n.jsx)(F,{className:r.headerIcon})})})})},Go=()=>(0,n.jsxs)(A.I6,{children:[(0,n.jsx)(N.S,{}),(0,n.jsx)(G.F,{withSearch:!1})]}),Ko=(0,n.jsx)(Go,{}),ro=on({apis:Js,configLoader:Bo,plugins:Object.values(h)}),so=ro.getProvider(),Yo=ro.getRouter(),oo=A.s4.provide((0,pe.KY)({name:"ThemeToggleAddon",component:no,location:pe.oZ.Header})),In=(0,n.jsxs)(zr,{children:[(0,n.jsx)(z.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(z.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(Yr,{})}),(0,n.jsx)(z.AW,{path:"/docs",element:(0,n.jsx)(A.Jl,{}),children:(0,n.jsx)(I.u,{})}),(0,n.jsxs)(z.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(A.I6,{}),children:[Ko,(0,n.jsx)(pe.DR,{children:(0,n.jsx)(oo,{})})]})]});var Jo=()=>(0,n.jsx)(so,{children:(0,n.jsx)(Yo,{children:(0,n.jsx)(Mo,{children:In})})});T.render((0,n.jsx)(Jo,{}),document.getElementById("root"))},51837:function(bt,Pe,t){"use strict";t.d(Pe,{CT:function(){return b},EI:function(){return te},uW:function(){return T},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(),m=q=>`__@backstage/${q}__`;function T(q,Q){const N=m(q);let G=n[N];return G||(G=Q(),n[N]=G,G)}var z=t(2784);function b(q){return T(q,()=>(0,z.createContext)(void 0))}function l(q){return(0,z.useContext)(b(q))}function B(q){return{set(Q){globalThis[`__@backstage/${q}__`]=createContext(createVersionedValueMap(Q))},reset(){delete globalThis[`__@backstage/${q}__`]}}}function te(q){return Object.freeze(q),{atVersion(Q){return q[Q]}}}},46285:function(bt,Pe,t){"use strict";t.d(Pe,{h$:function(){return ee},n3:function(){return h.n3},_i:function(){return k},zo:function(){return un},df:function(){return Ht},UO:function(){return xe},dq:function(){return ye},nl:function(){return $s},dx:function(){return Nt},rI:function(){return dn},u3:function(){return Ut},xE:function(){return Gn},sL:function(){return Bn},LH:function(){return C},U_:function(){return $t},pp:function(){return fs},EW:function(){return Gr},Ah:function(){return m},wi:function(){return St},hF:function(){return rt},CV:function(){return gt},$3:function(){return zt},p3:function(){return T},ce:function(){return qe},X2:function(){return Ke},wp:function(){return Re},ZW:function(){return he},N$:function(){return be},eK:function(){return wt},CR:function(){return It}});var h=t(29644),n=t(25248);const m=(0,n.T0)({id:"plugin.catalog.service"}),T=(0,n.T0)({id:"catalog-react.starred-entities"});var z=t(82394);class b{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const L of this.subscribers)L.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)}))}}var l=t(52322),B=t(2784),te=t(41156),q=t(60364),Q=t(77277),N=t(4190),G=t(95544),H=t(90436),ae=t(60905),ie=t(36444);const R=v=>{const j=(0,te.Z)(J=>J.breakpoints.down("md")),L=(0,q.Z)(),[D,_]=(0,B.useState)(!1);return j?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{style:{marginTop:L.spacing(1),marginLeft:L.spacing(1)},onClick:()=>_(!0),startIcon:(0,l.jsx)(ie.Z,{}),children:"Filters"}),(0,l.jsx)(N.ZP,{open:D,onClose:()=>_(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(G.Z,{m:2,children:[(0,l.jsx)(H.Z,{variant:"h6",component:"h2",style:{marginBottom:L.spacing(1)},children:"Filters"}),v.children]})})]}):(0,l.jsx)(ae.Z,{item:!0,lg:2,children:v.children})},I=v=>(0,l.jsx)(ae.Z,{item:!0,xs:12,lg:10,children:v.children}),k=v=>(0,l.jsx)(ae.Z,{container:!0,style:{position:"relative"},children:v.children});k.Filters=R,k.Content=I;var O=t(51837);const A=(0,O.CT)("entity-context"),ee=({children:v,entity:j,loading:L,error:D,refresh:_})=>{const J={entity:j,loading:L,error:D,refresh:_};return(0,l.jsx)(A.Provider,{value:(0,O.EI)({1:J}),children:v})},pe=v=>_jsx(ee,{entity:v.entity,loading:!Boolean(v.entity),error:void 0,refresh:void 0,children:v.children});function Ke(){const v=(0,O.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const j=v.atVersion(1);if(!j)throw new Error("EntityContext v1 not available");if(!j.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:j.entity}}function qe(){const v=(0,O.Vt)("entity-context");if(!v)throw new Error("Entity context is not available");const j=v.atVersion(1);if(!j)throw new Error("EntityContext v1 not available");const{entity:L,loading:D,error:_,refresh:J}=j;return{entity:L,loading:D,error:_,refresh:J}}var He=t(76635),Je=t(19126),Ye=t.n(Je),Ue=t(10289),ze=t(69294),tt=t(48760),lt=t(90736);function ct(v){return v.reduce((j,L)=>({...j,...L.getCatalogFilters?L.getCatalogFilters():{}}),{})}function nt(v){return j=>v.every(L=>!L.filterEntity||L.filterEntity(j))}var Ce=t(25271);function rt(v,j,L){var D;let _=(v==null||(D=v.relations)===null||D===void 0?void 0:D.filter(J=>J.type===j).map(J=>(0,Ce.of)(J.targetRef)))||[];return L!=null&&L.kind&&(_=_.filter(J=>J.kind.toLocaleLowerCase("en-US")===L.kind.toLocaleLowerCase("en-US"))),_}function gt(v,j){var L;const D=(L=v.metadata.annotations)===null||L===void 0?void 0:L[Ce.M6];if(!!D)try{const _=(0,Ce.Ou)(D),J=j.byUrl(_.target);return{locationTargetUrl:_.target,integrationType:J==null?void 0:J.type}}catch{return}}function Le(v,j){const L=new Set([...getEntityRelations(v,RELATION_MEMBER_OF,{kind:"group"}),...v?[getCompoundEntityRef(v)]:[]].map(stringifyEntityRef)),D=getEntityRelations(j,RELATION_OWNED_BY).map(stringifyEntityRef);for(const _ of D)if(L.has(_))return!0;return!1}const se=(0,B.createContext)(void 0),xe=({children:v})=>{const j=(0,lt.default)(),L=(0,n.h_)(m),[D,_]=(0,B.useState)({}),J=(0,Ue.TH)();var le;const me=(0,B.useMemo)(()=>(le=Ye().parse(J.search,{ignoreQueryPrefix:!0}).filters)!==null&&le!==void 0?le:{},[J]),[we,Ne]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Me,error:je},Qe]=(0,ze.default)(async()=>{const Xe=(0,He.compact)(Object.values(D)),Bt=nt(Xe),Qt=ct(Xe),Fn=ct((0,He.compact)(Object.values(we.appliedFilters))),An=Object.keys(D).reduce((hn,yn)=>{const Tn=D[yn];return Tn!=null&&Tn.toQueryValue&&(hn[yn]=Tn.toQueryValue()),hn},{});if((0,He.isEqual)(Fn,Qt))Ne({appliedFilters:D,backendEntities:we.backendEntities,entities:we.backendEntities.filter(Bt)});else{const hn=await L.getEntities({filter:Qt});Ne({appliedFilters:D,backendEntities:hn.items,entities:hn.items.filter(Bt)})}if(j()){var tr;const hn=Ye().parse(J.search,{ignoreQueryPrefix:!0}),yn=Ye().stringify({...hn,filters:An},{addQueryPrefix:!0,arrayFormat:"repeat"}),Tn=`${window.location.pathname}${yn}`;(tr=window.history)===null||tr===void 0||tr.replaceState(null,document.title,Tn)}},[L,me,D,we],{loading:!0});(0,tt.Z)(Qe,10,[D]);const ft=(0,B.useCallback)(Xe=>{_(Bt=>{const Qt=typeof Xe=="function"?Xe(Bt):Xe;return{...Bt,...Qt}})},[]),vt=(0,B.useMemo)(()=>({filters:we.appliedFilters,entities:we.entities,backendEntities:we.backendEntities,updateFilters:ft,queryParameters:me,loading:Me,error:je}),[we,ft,me,Me,je]);return(0,l.jsx)(se.Provider,{value:vt,children:v})};function Re(){const v=(0,B.useContext)(se);if(!v)throw new Error("useEntityList must be used within EntityListProvider");return v}var st=t(64279),pt=t(18149),Ct=t.n(pt),dt=t(829),jt=t.n(dt);const St=(0,O.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Lt(v){var j,L;return{kind:v.kind.toLocaleLowerCase("en-US"),namespace:(L=(j=v.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:v.metadata.name}}function zt(v,j){const L=j==null?void 0:j.defaultKind;let D,_,J;return"metadata"in v?(D=v.kind,_=v.metadata.namespace,J=v.metadata.name):(D=v.kind,_=v.namespace,J=v.name),_===Ce.zG&&(_=void 0),D=D.toLocaleLowerCase("en-US"),D=L&&L.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${_?`${_}/`:""}${J}`}var mt=t(1515),ln=t(80030);const Nt=(0,B.forwardRef)((v,j)=>{const{entityRef:L,defaultKind:D,title:_,children:J,...le}=v,me=(0,n.tg)(St);let we,Ne,Me;if(typeof L=="string"){const Xe=(0,Ce.of)(L);we=Xe.kind,Ne=Xe.namespace,Me=Xe.name}else"metadata"in L?(we=L.kind,Ne=L.metadata.namespace,Me=L.metadata.name):(we=L.kind,Ne=L.namespace,Me=L.name);we=we.toLocaleLowerCase("en-US");var je;Ne=(je=Ne==null?void 0:Ne.toLocaleLowerCase("en-US"))!==null&&je!==void 0?je:Ce.zG;const Qe={kind:we,namespace:Ne,name:Me},ft=zt({kind:we,namespace:Ne,name:Me},{defaultKind:D}),vt=(0,l.jsxs)(mt.rU,{...le,ref:j,to:me(Qe),children:[J,!J&&(_!=null?_:ft)]});return _?(0,l.jsx)(ln.ZP,{title:ft,children:vt}):vt});function dn(v){const{entityRefs:j,defaultKind:L,...D}=v;return(0,l.jsx)(l.Fragment,{children:j.map((_,J)=>(0,l.jsxs)(B.Fragment,{children:[J>0&&", ",(0,l.jsx)(Nt,{...D,entityRef:_,defaultKind:L})]},J))})}class un{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){this.value=j}}class Ln{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){this.value=j}}class fn{filterEntity(j){var L;return this.values.every(D=>((L=j.metadata.tags)!==null&&L!==void 0?L:[]).includes(D))}toQueryValue(){return this.values}constructor(j){this.values=j}}class On{filterEntity(j){const L=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([j.metadata.tags]),_=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const J of L)if(D.every(le=>le!==J)&&_.every(le=>!le.includes(J)))return!1;return!0}toUpperArray(j){return j.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(j){this.value=j}}class Ee{filterEntity(j){return this.values.some(L=>rt(j,Ce.S4).some(D=>zt(D,{defaultKind:"group"})===L))}toQueryValue(){return this.values}constructor(j){this.values=j}}class Te{filterEntity(j){return this.values.some(L=>{var D;return((D=j.spec)===null||D===void 0?void 0:D.lifecycle)===L})}toQueryValue(){return this.values}constructor(j){this.values=j}}class Be{filterEntity(j){switch(this.value){case"owned":return this.isOwnedEntity(j);case"starred":return this.isStarredEntity(j);default:return!0}}toQueryValue(){return this.value}constructor(j,L,D){this.value=j,this.isOwnedEntity=L,this.isStarredEntity=D}}class We{filterEntity(j){var L;const D=(L=j.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(j){this.value=j}}class _e{filterEntity(j){var L,D,_;const J=((L=j)===null||L===void 0||(D=L.status)===null||D===void 0||(_=D.items)===null||_===void 0?void 0:_.length)>0;return J!==void 0&&this.value===J}constructor(j){this.value=j}}function at(){const v=(0,n.h_)(m),{filters:{kind:j,type:L},queryParameters:{type:D},updateFilters:_}=Re(),J=(0,B.useMemo)(()=>[D].flat().filter(Boolean),[D]);var le;const[me,we]=(0,B.useState)(J.length?J:(le=L==null?void 0:L.getTypes())!==null&&le!==void 0?le:[]);(0,B.useEffect)(()=>{J.length&&we(J)},[J]);const[Ne,Me]=(0,B.useState)([]),je=(0,B.useMemo)(()=>j==null?void 0:j.value,[j]),{error:Qe,loading:ft,value:vt}=(0,st.default)(async()=>je?await v.getEntityFacets({filter:{kind:je},facets:["spec.type"]}).then(Qt=>Qt.facets["spec.type"]||[]):[],[je,v]),Xe=(0,B.useRef)(vt);return(0,B.useEffect)(()=>{const Bt=Xe.current;if(Xe.current=vt,ft||!je||Bt===vt||!vt)return;const Qt=[...new Set(jt()(vt,An=>-An.count).map(An=>An.value.toLocaleLowerCase("en-US")))];Me(Qt);const Fn=me.filter(An=>Qt.includes(An));Ct()(me,Fn)||we(Fn)},[ft,je,me,we,vt]),(0,B.useEffect)(()=>{_({type:me.length?new Ln(me):void 0})},[me,_]),{loading:ft,error:Qe,availableTypes:Ne,selectedTypes:me,setSelectedTypes:we}}const ht=20;function wt(v,j){var L,D;const _=j==null||(L=j.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),J=j==null||(D=j.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),le=(0,n.h_)(m),{loading:me,value:we,error:Ne}=(0,st.default)(async()=>{var Me;const je=(Me=v.relations)===null||Me===void 0?void 0:Me.map(Xe=>({type:Xe.type,target:(0,Ce.of)(Xe.targetRef)})).filter(Xe=>(!_||Xe.type.toLocaleLowerCase("en-US")===_)&&(!J||Xe.target.kind===J));if(!je)return[];const Qe=Object.values((0,He.groupBy)(je,({target:Xe})=>`${Xe.kind}:${Xe.namespace}`.toLocaleLowerCase("en-US"))),ft=[];for(const Xe of Qe)ft.push({kind:Xe[0].target.kind,namespace:Xe[0].target.namespace,nameBatches:(0,He.chunk)(Xe.map(Bt=>Bt.target.name),ht)});return(await Promise.all(ft.flatMap(Xe=>Xe.nameBatches.map(Bt=>le.getEntities({filter:{kind:Xe.kind,"metadata.namespace":Xe.namespace,"metadata.name":Bt}}))))).flatMap(Xe=>Xe.items)},[v,_,J]);return{entities:we,loading:me,error:Ne}}var Tt=t(72164);function Pt(v){return typeof v=="string"?v:(0,Ce.eE)(v)}function It(){const v=(0,n.h_)(T),j=(0,Tt.Z)(v.starredEntitie$(),new Set),L=(0,B.useCallback)(_=>j.has(Pt(_)),[j]),D=(0,B.useCallback)(_=>v.toggleStarred(Pt(_)).then(),[v]);return{starredEntities:j,toggleStarredEntity:D,isStarredEntity:L}}function oe(v){return typeof v=="string"?v:(0,Ce.eE)(v)}function W(v){const j=(0,n.h_)(T),[L,D]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const J=j.starredEntitie$().subscribe({next(le){D(le.has(oe(v)))}});return()=>{J.unsubscribe()}},[v,j]),{toggleStarredEntity:(0,B.useCallback)(()=>j.toggleStarred(oe(v)).then(),[v,j]),isStarredEntity:L}}function he(){const v=(0,n.h_)(n.$4),{loading:j,value:L}=(0,st.default)(async()=>{const{ownershipEntityRefs:_}=await v.getBackstageIdentity();return _},[]),D=(0,B.useMemo)(()=>{const _=new Set(L!=null?L:[]);return J=>{const le=rt(J,Ce.S4).map(Ce.eE);for(const me of le)if(_.has(me))return!0;return!1}},[L]);return(0,B.useMemo)(()=>({loading:j,isOwnedEntity:D}),[j,D])}var ve=t(25488);function be(v){const{entity:j,loading:L,error:D}=qe(),{allowed:_,loading:J,error:le}=(0,ve.gI)({permission:v,resourceRef:j?(0,Ce.eE)(j):void 0});return L||J?{loading:!0,allowed:!1}:D?{loading:!1,allowed:!1,error:D}:{loading:!1,allowed:_,error:le}}const Ge=v=>{const{initialFilter:j,hidden:L}=v,{updateFilters:D,queryParameters:{kind:_}}=useEntityList();var J;const[le]=useState((J=[_].flat()[0])!==null&&J!==void 0?J:j);return useEffect(()=>{D({kind:le?new EntityKindFilter(le):void 0})},[le,D]),L?null:_jsx(Alert,{severity:"warning",children:"Kind filter not yet available"})};var V=t(79692),S=t(5806),K=t(21324),Ae=t(86619),Oe=t(19996),Ve=t(25505),ot=t(38016),Ft=t(88013);const Zt=(0,V.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),qt=(0,l.jsx)(Ve.Z,{fontSize:"small"}),Vt=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Ht=()=>{var v;const j=Zt(),{updateFilters:L,backendEntities:D,filters:_,queryParameters:{lifecycles:J}}=Re(),le=(0,B.useMemo)(()=>[J].flat().filter(Boolean),[J]);var me;const[we,Ne]=(0,B.useState)(le.length?le:(me=(v=_.lifecycles)===null||v===void 0?void 0:v.values)!==null&&me!==void 0?me:[]);(0,B.useEffect)(()=>{le.length&&Ne(le)},[le]),(0,B.useEffect)(()=>{L({lifecycles:we.length?new Te(we):void 0})},[we,L]);const Me=(0,B.useMemo)(()=>[...new Set(D.map(je=>{var Qe;return(Qe=je.spec)===null||Qe===void 0?void 0:Qe.lifecycle}).filter(Boolean))].sort(),[D]);return Me.length?(0,l.jsx)(G.Z,{pb:1,pt:1,children:(0,l.jsxs)(H.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(Ft.ZP,{multiple:!0,options:Me,value:we,onChange:(je,Qe)=>Ne(Qe),renderOption:(je,{selected:Qe})=>(0,l.jsx)(S.Z,{control:(0,l.jsx)(K.Z,{icon:qt,checkedIcon:Vt,checked:Qe}),label:je}),size:"small",popupIcon:(0,l.jsx)(ot.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:je=>(0,l.jsx)(Ae.Z,{...je,className:j.input,variant:"outlined"})})]})}):null},jn=(0,V.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),E=(0,l.jsx)(Ve.Z,{fontSize:"small"}),X=(0,l.jsx)(Oe.Z,{fontSize:"small"}),ye=()=>{var v;const j=jn(),{updateFilters:L,backendEntities:D,filters:_,queryParameters:{owners:J}}=Re(),le=(0,B.useMemo)(()=>[J].flat().filter(Boolean),[J]);var me;const[we,Ne]=(0,B.useState)(le.length?le:(me=(v=_.owners)===null||v===void 0?void 0:v.values)!==null&&me!==void 0?me:[]);(0,B.useEffect)(()=>{le.length&&Ne(le)},[le]),(0,B.useEffect)(()=>{L({owners:we.length?new Ee(we):void 0})},[we,L]);const Me=(0,B.useMemo)(()=>[...new Set(D.flatMap(je=>rt(je,Ce.S4).map(Qe=>zt(Qe,{defaultKind:"group"}))).filter(Boolean))].sort(),[D]);return Me.length?(0,l.jsx)(G.Z,{pb:1,pt:1,children:(0,l.jsxs)(H.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(Ft.ZP,{multiple:!0,options:Me,value:we,onChange:(je,Qe)=>Ne(Qe),renderOption:(je,{selected:Qe})=>(0,l.jsx)(S.Z,{control:(0,l.jsx)(K.Z,{icon:E,checkedIcon:X,checked:Qe}),label:je}),size:"small",popupIcon:(0,l.jsx)(ot.Z,{"data-testid":"owner-picker-expand"}),renderInput:je=>(0,l.jsx)(Ae.Z,{...je,className:j.input,variant:"outlined"})})]})}):null},fe=(0,V.Z)(v=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),ke=()=>{var v;const j=fe(),{filters:L,updateFilters:D}=useEntityList();var _;const[J,le]=useState((_=(v=L.text)===null||v===void 0?void 0:v.value)!==null&&_!==void 0?_:"");return useDebounce(()=>{D({text:J.length?new EntityTextFilter(J):void 0})},250,[J,D]),_jsx(Toolbar,{className:j.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:j.input,placeholder:"Search",autoComplete:"off",onChange:me=>le(me.target.value),value:J,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>le(""),edge:"end",disabled:J.length===0,children:_jsx(Clear,{})})})})})})},De=Object.freeze({createEntityRefColumn(v){const{defaultKind:j}=v;function L(D){var _;return((_=D.metadata)===null||_===void 0?void 0:_.title)||zt(D,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(D,_){return L(_).includes(D)},customSort(D,_){return L(D).localeCompare(L(_))},render:D=>{var _;return(0,l.jsx)(Nt,{entityRef:D,defaultKind:j,title:(_=D.metadata)===null||_===void 0?void 0:_.title})}}},createEntityRelationColumn(v){const{title:j,relation:L,defaultKind:D,filter:_}=v;function J(me){return rt(me,L,_)}function le(me){return J(me).map(we=>zt(we,{defaultKind:D})).join(", ")}return{title:j,customFilterAndSearch(me,we){return le(we).includes(me)},customSort(me,we){return le(me).localeCompare(le(we))},render:me=>(0,l.jsx)(dn,{entityRefs:J(me),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:Ce.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:Ce.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:Ce.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:v=>(0,l.jsx)(mt.Or,{text:v.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),yt=[De.createEntityRefColumn({defaultKind:"system"}),De.createDomainColumn(),De.createOwnerColumn(),De.createMetadataDescriptionColumn()],Dt=[De.createEntityRefColumn({defaultKind:"component"}),De.createSystemColumn(),De.createOwnerColumn(),De.createSpecTypeColumn(),De.createSpecLifecycleColumn(),De.createMetadataDescriptionColumn()],_t=(0,V.Z)(v=>({empty:{padding:v.spacing(2),display:"flex",justifyContent:"center"}})),Ut=v=>{const{entities:j,title:L,emptyContent:D,variant:_="gridItem",columns:J}=v,le=_t(),me={minWidth:"0",width:"100%"};return _==="gridItem"&&(me.height="calc(100% - 10px)"),(0,l.jsx)(mt.iA,{columns:J,title:L,style:me,emptyContent:D&&(0,l.jsx)("div",{className:le.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:j})};Ut.columns=De,Ut.systemEntityColumns=yt,Ut.componentEntityColumns=Dt;const nn=(0,V.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),kt=(0,l.jsx)(Ve.Z,{fontSize:"small"}),rn=(0,l.jsx)(Oe.Z,{fontSize:"small"}),Gn=()=>{var v;const j=nn(),{updateFilters:L,filters:D,queryParameters:{tags:_}}=Re(),J=(0,n.h_)(m),{value:le}=(0,st.default)(async()=>{var je;const Qe="metadata.tags",{facets:ft}=await J.getEntityFacets({facets:[Qe],filter:(je=D.kind)===null||je===void 0?void 0:je.getCatalogFilters()});return ft[Qe].map(({value:vt})=>vt)},[D.kind]),me=(0,B.useMemo)(()=>[_].flat().filter(Boolean),[_]);var we;const[Ne,Me]=(0,B.useState)(me.length?me:(we=(v=D.tags)===null||v===void 0?void 0:v.values)!==null&&we!==void 0?we:[]);return(0,B.useEffect)(()=>{me.length&&Me(me)},[me]),(0,B.useEffect)(()=>{L({tags:Ne.length?new fn(Ne):void 0})},[Ne,L]),le!=null&&le.length?(0,l.jsx)(G.Z,{pb:1,pt:1,children:(0,l.jsxs)(H.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(Ft.ZP,{multiple:!0,options:le,value:Ne,onChange:(je,Qe)=>Me(Qe),renderOption:(je,{selected:Qe})=>(0,l.jsx)(S.Z,{control:(0,l.jsx)(K.Z,{icon:kt,checkedIcon:rn,checked:Qe}),label:je}),size:"small",popupIcon:(0,l.jsx)(ot.Z,{"data-testid":"tag-picker-expand"}),renderInput:je=>(0,l.jsx)(Ae.Z,{...je,className:j.input,variant:"outlined"})})]})}):null};var En=t(82108),$n=t.n(En);const Bn=v=>{const{hidden:j,initialFilter:L}=v,D=(0,n.h_)(n.$v),{error:_,availableTypes:J,selectedTypes:le,setSelectedTypes:me}=at();if((0,B.useEffect)(()=>{_&&D.post({message:"Failed to load entity types",severity:"error"}),L&&me([L])},[_,D,L,me]),J.length===0||_)return null;const we=[{value:"all",label:"All"},...J.map(Me=>({value:Me,label:$n()(Me)}))];var Ne;return j?null:(0,l.jsx)(G.Z,{pb:1,pt:1,children:(0,l.jsx)(mt.Ph,{label:"Type",items:we,selected:(Ne=we.length>1?le[0]:void 0)!==null&&Ne!==void 0?Ne:"all",onChange:Me=>me(Me==="all"?[]:[String(Me)])})})};var qn=t(15459),Wt=t(61837),x=t(11640),u=t(28347);const y=(0,qn.Z)({root:{color:"#f3ba37"}})(x.Z),C=v=>{const{toggleStarredEntity:j,isStarredEntity:L}=W(v.entity);return(0,l.jsx)(Wt.Z,{"aria-label":"favorite",color:"inherit",...v,onClick:()=>j(),children:(0,l.jsx)(ln.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,l.jsx)(y,{}):(0,l.jsx)(u.Z,{})})})};var Y=t(8629),de=t(79249),ge=t(38724),Ie=t(99152),et=t(6487),Ot=t(49429),Rt=t(55999),_n=t(72779),Cr=t.n(_n),jr=t(39412);const ar=jr.Z;function Br(v,j){if(v)return v.toLocaleLowerCase("en-US");if(j)try{return(0,Ce.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function Zr(v,j){const L=(0,n.qD)(),D=Br(v,j);return D&&L.getSystemIcon(`kind:${D}`)||ar}function Er(v){const{kind:j,entityRef:L,...D}=v,_=Zr(j,L);return(0,l.jsx)(_,{...D})}const fr=(0,V.Z)(v=>({node:{fill:v.palette.grey[300],stroke:v.palette.grey[300],"&.primary":{fill:v.palette.primary.light,stroke:v.palette.primary.light},"&.secondary":{fill:v.palette.secondary.light,stroke:v.palette.secondary.light}},text:{fill:v.palette.getContrastText(v.palette.grey[300]),"&.primary":{fill:v.palette.primary.contrastText},"&.secondary":{fill:v.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function ts(v){const j=(0,n.h_)(m),L=(0,Ce.eE)(v),{loading:D,error:_,value:J}=(0,st.default)(async()=>{const le=await j.getEntityAncestors({entityRef:L}),me=new Array,we=new Array;for(const Ne of le.items){const Me=(0,Ce.eE)(Ne.entity),je=Me===le.rootEntityRef;me.push({id:Me,root:je,...Ne.entity});for(const Qe of Ne.parentEntityRefs)we.push({from:Me,to:Qe})}return{nodes:me,edges:we}},[L]);return{loading:D,error:_,nodes:(J==null?void 0:J.nodes)||[],edges:(J==null?void 0:J.edges)||[]}}function Dr({node:v}){const j=fr(),L=(0,Ue.s0)(),D=(0,n.tg)(St),[_,J]=(0,B.useState)(0),[le,me]=(0,B.useState)(0),we=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(we.current){let{height:Bt,width:Qt}=we.current.getBBox();Bt=Math.round(Bt),Qt=Math.round(Qt),(Bt!==le||Qt!==_)&&(J(Qt),me(Bt))}},[_,le]);const Ne=10,Me=le,je=Me+Ne,Qe=je+_+Ne*2,ft=le+Ne*2,vt=v.metadata.title||(v.kind&&v.metadata.name&&v.metadata.namespace?zt({kind:v.kind,name:v.metadata.name,namespace:v.metadata.namespace||""}):v.id),Xe=()=>{L(D({kind:v.kind,namespace:v.metadata.namespace||Ce.zG,name:v.metadata.name}))};return(0,l.jsxs)("g",{onClick:Xe,className:j.clickable,children:[(0,l.jsx)("rect",{className:Cr()(j.node,v.root?"secondary":"primary"),width:Qe,height:ft,rx:10}),(0,l.jsx)(Er,{kind:v.kind,y:Ne,x:Ne,width:Me,height:Me,className:Cr()(j.text,v.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:we,className:Cr()(j.text,v.root?"secondary":"primary"),y:ft/2,x:je+(_+Ne*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:vt})]})}function ns(v){const{loading:j,error:L,nodes:D,edges:_}=ts(v.entity);return j?(0,l.jsx)(mt.Ex,{}):L?(0,l.jsx)(mt.Gk,{error:L}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(Rt.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)(mt.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)(G.Z,{mt:4,children:(0,l.jsx)(mt.mn,{nodes:D,edges:_,renderNode:Dr,direction:mt.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Zn=t(11776),Dn=t(38402),lr=t(86136),gr=t(99688),Nr=t(49378),rs=t(54506),Fr=t(94339),ss=t(24579),os=t(27685);const mr=(0,V.Z)(v=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:v.spacing(2)},helpIcon:{marginLeft:v.spacing(1),color:v.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function vn(v){const j=mr();return(0,l.jsx)(Nr.Z,{...v,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Nn(v){const j=mr();return(0,l.jsx)(rs.Z,{className:j.monospace,children:v.children})}function vr(v){return(0,l.jsx)(G.Z,{mt:2,children:(0,l.jsx)(Fr.Z,{variant:"outlined",children:(0,l.jsxs)(ss.Z,{children:[(0,l.jsxs)(H.Z,{variant:"h6",gutterBottom:!0,children:[v.title,v.helpLink&&(0,l.jsx)(Tr,{to:v.helpLink})]}),v.children]})})})}function Rs(v){if(v.match(/^url:https?:\/\//))return v.slice(4);if(v.match(/^https?:\/\//))return v}function Ar(v){const[j,L]=v.entry,D=Rs(L);return(0,l.jsxs)(Dn.Z,{children:[v.indent&&(0,l.jsx)(lr.Z,{}),(0,l.jsx)(vn,{primary:j,secondary:D?(0,l.jsx)(mt.rU,{to:D,children:L}):L})]})}function Tr(v){const j=mr();return(0,l.jsx)(mt.rU,{to:v.to,className:j.helpIcon,children:(0,l.jsx)(os.Z,{fontSize:"inherit"})})}const is=(0,V.Z)({root:{display:"flex",flexDirection:"column"}});function Ls(v){var j,L;const D=(0,n.h_)(m),_=(0,Ce.eE)(v),J=(j=v.metadata.annotations)===null||j===void 0?void 0:j[Ce.P1],le=(L=v.metadata.annotations)===null||L===void 0?void 0:L[Ce.q1],{loading:me,error:we,value:Ne}=(0,st.default)(async()=>!J&&!le?[]:(await D.getEntities({filter:[...J?[{[`metadata.annotations.${Ce.P1}`]:J}]:[],...le?[{[`metadata.annotations.${Ce.q1}`]:le}]:[]]})).items,[J,le]);return{loading:me,error:we,location:J,originLocation:le,colocatedEntities:Ne==null?void 0:Ne.filter(Me=>(0,Ce.eE)(Me)!==_)}}function Hn(v){return(0,l.jsxs)(Zn.Z,{dense:!0,children:[v.header&&(0,l.jsx)(Ar,{entry:v.header},"header"),v.entities.map(j=>(0,l.jsxs)(Dn.Z,{children:[(0,l.jsx)(lr.Z,{children:(0,l.jsx)(Er,{kind:j.kind})}),(0,l.jsx)(vn,{primary:(0,l.jsx)(Nt,{entityRef:j})})]},(0,Ce.eE)(j)))]})}function Ps(v){const{entity:j}=v,{loading:L,error:D,location:_,originLocation:J,colocatedEntities:le}=Ls(j);if(L)return(0,l.jsx)(mt.Ex,{});if(D)return(0,l.jsx)(mt.Gk,{error:D});if(!_&&!J)return(0,l.jsx)(gr.Z,{severity:"warning",children:"Entity had no location information."});if(!(le!=null&&le.length))return(0,l.jsx)(gr.Z,{severity:"info",children:"There were no other entities on this location."});if(_===J)return(0,l.jsx)(Hn,{entities:le});const me=le.filter(Ne=>{var Me;return((Me=Ne.metadata.annotations)===null||Me===void 0?void 0:Me[Ce.P1])===_}),we=le.filter(Ne=>{var Me;return((Me=Ne.metadata.annotations)===null||Me===void 0?void 0:Me[Ce.q1])===J});return(0,l.jsxs)(l.Fragment,{children:[me.length>0&&(0,l.jsx)(Hn,{entities:me,header:["At the same location",_]}),we.length>0&&(0,l.jsx)(Hn,{entities:we,header:["At the same origin",J]})]})}function Ur(v){const j=is();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(Rt.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:j.root,children:(0,l.jsx)(Ps,{entity:v.entity})})]})}function Ir(v){return Object.fromEntries([...Object.entries(v)].sort((j,L)=>j[0]<L[0]?-1:1))}function Rr(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(Rt.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(Rt.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(mt.Oi,{text:JSON.stringify(Ir(v.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var as=t(3440),ls=t.n(as);const cs=(0,V.Z)({root:{display:"flex",flexDirection:"column"}});function ds(v){var j,L;const D=cs(),{apiVersion:_,kind:J,metadata:le,spec:me,relations:we=[],status:Ne={}}=v.entity,Me=ls()(jt()(we,je=>je.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:D.root,children:[(0,l.jsx)(vr,{title:"Identity",children:(0,l.jsxs)(Zn.Z,{dense:!0,children:[(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"apiVersion",secondary:_})}),(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"kind",secondary:J})}),(me==null?void 0:me.type)&&(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"spec.type",secondary:me.type})}),le.uid&&(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"uid",secondary:le.uid})}),le.etag&&(0,l.jsx)(Dn.Z,{children:(0,l.jsx)(vn,{primary:"etag",secondary:le.etag})})]})}),(0,l.jsxs)(vr,{title:"Metadata",children:[!!Object.keys(le.annotations||{}).length&&(0,l.jsx)(Zn.Z,{dense:!0,subheader:(0,l.jsxs)(Nn,{children:["Annotations",(0,l.jsx)(Tr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(le.annotations).map(je=>(0,l.jsx)(Ar,{indent:!0,entry:je},je[0]))}),!!Object.keys(le.labels||{}).length&&(0,l.jsx)(Zn.Z,{dense:!0,subheader:(0,l.jsx)(Nn,{children:"Labels"}),children:Object.entries(le.labels).map(je=>(0,l.jsx)(Ar,{indent:!0,entry:je},je[0]))}),!!(!((j=le.tags)===null||j===void 0)&&j.length)&&(0,l.jsx)(Zn.Z,{dense:!0,subheader:(0,l.jsx)(Nn,{children:"Tags"}),children:le.tags.map((je,Qe)=>(0,l.jsxs)(Dn.Z,{children:[(0,l.jsx)(lr.Z,{}),(0,l.jsx)(vn,{primary:je})]},`${je}-${Qe}`))})]}),!!we.length&&(0,l.jsx)(vr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Me).map(([je,Qe],ft)=>(0,l.jsx)("div",{children:(0,l.jsx)(Zn.Z,{dense:!0,subheader:(0,l.jsx)(Nn,{children:je}),children:Qe.map(vt=>(0,l.jsxs)(Dn.Z,{children:[(0,l.jsx)(lr.Z,{children:(0,l.jsx)(Er,{entityRef:vt.targetRef})}),(0,l.jsx)(vn,{primary:(0,l.jsx)(Nt,{entityRef:vt.targetRef})})]},vt.targetRef))})},ft))}),!!(!((L=Ne.items)===null||L===void 0)&&L.length)&&(0,l.jsx)(vr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ne.items.map((je,Qe)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(H.Z,{children:[je.level,": ",je.type]}),(0,l.jsx)(G.Z,{ml:2,children:je.message})]},Qe))})]})]})}var Mr=t(72847);function zr(v){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(Rt.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(Rt.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(mt.Oi,{text:Mr.ZP.stringify(Ir(v.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Lr=(0,V.Z)(v=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:v.palette.background.paper},tabs:{borderRight:`1px solid ${v.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function er(v){const{children:j,value:L,index:D,..._}=v,J=Lr();return(0,l.jsx)("div",{role:"tabpanel",hidden:L!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:J.tabContents,..._,children:L===D&&(0,l.jsx)(G.Z,{pl:3,pr:3,children:j})})}function sn(v){return{id:`vertical-tab-${v}`,"aria-controls":`vertical-tabpanel-${v}`}}function $t(v){const j=Lr(),[L,D]=B.useState(0);return(0,B.useEffect)(()=>{D(0)},[v.open]),v.entity?(0,l.jsxs)(Y.Z,{fullWidth:!0,maxWidth:"xl",open:v.open,onClose:v.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,l.jsx)(de.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(ge.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:j.root,children:[(0,l.jsxs)(Ie.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(_,J)=>D(J),"aria-label":"Inspector options",className:j.tabs,children:[(0,l.jsx)(et.Z,{label:"Overview",...sn(0)}),(0,l.jsx)(et.Z,{label:"Ancestry",...sn(1)}),(0,l.jsx)(et.Z,{label:"Colocated",...sn(2)}),(0,l.jsx)(et.Z,{label:"Raw JSON",...sn(3)}),(0,l.jsx)(et.Z,{label:"Raw YAML",...sn(4)})]}),(0,l.jsx)(er,{value:L,index:0,children:(0,l.jsx)(ds,{entity:v.entity})}),(0,l.jsx)(er,{value:L,index:1,children:(0,l.jsx)(ns,{entity:v.entity})}),(0,l.jsx)(er,{value:L,index:2,children:(0,l.jsx)(Ur,{entity:v.entity})}),(0,l.jsx)(er,{value:L,index:3,children:(0,l.jsx)(Rr,{entity:v.entity})}),(0,l.jsx)(er,{value:L,index:4,children:(0,l.jsx)(zr,{entity:v.entity})})]})}),(0,l.jsx)(Ot.Z,{children:(0,l.jsx)(Q.Z,{onClick:v.onClose,color:"primary",children:"Close"})})]}):null}var Vr=t(85256);function us(v){var j;const L=(0,n.h_)(m),D=(j=v.metadata.annotations)===null||j===void 0?void 0:j[Ce.q1],_=v.metadata.uid,J=D==="bootstrap:bootstrap",le=(0,st.default)(async()=>{const vt=L.getLocationByRef(D);let Xe;if(!D)Xe=Promise.resolve([]);else{const Bt=`metadata.annotations.${Ce.q1}`;Xe=L.getEntities({filter:{[Bt]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Qt=>Qt.items)}return Promise.all([vt,Xe]).then(([Bt,Qt])=>({location:Bt,colocatedEntities:Qt}))},[L,v]),me=(0,B.useCallback)(async function(){const{location:Xe}=le.value;await L.removeLocationById(Xe.id)},[L,le]),we=(0,B.useCallback)(async function(){await L.removeEntityByUid(_)},[L,_]);if(J)return{type:"bootstrap",location:D,deleteEntity:we};const{loading:Ne,error:Me,value:je}=le;if(Ne)return{type:"loading"};if(Me)return{type:"error",error:Me};const{location:Qe,colocatedEntities:ft}=je;return Qe?{type:"unregister",location:D,colocatedEntities:ft.map(Ce.iB),unregisterLocation:me,deleteEntity:we}:{type:"only-delete",deleteEntity:we}}var Hr=t(23054);const hs=(0,V.Z)({advancedButton:{fontSize:"0.7em"}}),ps=({entity:v,onConfirm:j})=>{const L=(0,n.h_)(n.$v),D=(0,n.h_)(n.Ds),_=hs(),J=us(v),[le,me]=(0,B.useState)(!1),[we,Ne]=(0,B.useState)(!1);var Me;const je=(Me=D.getOptionalString("app.title"))!==null&&Me!==void 0?Me:"Backstage",Qe=(0,B.useCallback)(async function(){if("unregisterLocation"in J){Ne(!0);try{await J.unregisterLocation(),j()}catch(Xe){(0,Hr.BD)(Xe),L.post({message:Xe.message})}finally{Ne(!1)}}},[L,j,J]),ft=(0,B.useCallback)(async function(){if("deleteEntity"in J){Ne(!0);try{await J.deleteEntity(),j()}catch(Xe){(0,Hr.BD)(Xe),L.post({message:Xe.message})}finally{Ne(!1)}}},[L,j,J]);return J.type==="loading"?(0,l.jsx)(mt.Ex,{}):J.type==="error"?(0,l.jsx)(mt.Gk,{error:J.error}):J.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(gr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',J.location,'"). If you believe this is in error, please contact the ',je," ","integrator."]}),(0,l.jsxs)(G.Z,{marginTop:2,children:[!le&&(0,l.jsx)(Q.Z,{variant:"text",size:"small",color:"primary",className:_.advancedButton,onClick:()=>me(!0),children:"Advanced Options"}),le&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.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)(Q.Z,{variant:"contained",color:"secondary",disabled:we,onClick:ft,children:"Delete Entity"})]})]})]}):J.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.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)(Q.Z,{variant:"contained",color:"secondary",disabled:we,onClick:ft,children:"Delete Entity"})]}):J.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(Rt.Z,{component:"ul",children:J.colocatedEntities.map(vt=>(0,l.jsx)("li",{children:(0,l.jsx)(Nt,{entityRef:vt})},`${vt.kind}:${vt.namespace}/${vt.name}`))}),(0,l.jsx)(Rt.Z,{children:"Located at the following location:"}),(0,l.jsx)(Rt.Z,{component:"ul",children:(0,l.jsx)("li",{children:J.location})}),(0,l.jsxs)(Rt.Z,{children:["To undo, just re-register the entity in ",je,"."]}),(0,l.jsxs)(G.Z,{marginTop:2,children:[(0,l.jsx)(Q.Z,{variant:"contained",color:"secondary",disabled:we,onClick:Qe,children:"Unregister Location"}),!le&&(0,l.jsx)(G.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(Q.Z,{variant:"text",size:"small",color:"primary",className:_.advancedButton,onClick:()=>me(!0),children:"Advanced Options"})})]}),le&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(G.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(Vr.Z,{})}),(0,l.jsx)(Rt.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)(Q.Z,{variant:"contained",color:"secondary",disabled:we,onClick:ft,children:"Delete Entity"})]})]}):(0,l.jsx)(gr.Z,{severity:"error",children:"Internal error: Unknown state"})},fs=v=>{const{open:j,onConfirm:L,onClose:D,entity:_}=v;return(0,l.jsxs)(Y.Z,{open:j,onClose:D,children:[(0,l.jsx)(de.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(ge.Z,{children:(0,l.jsx)(ps,{entity:_,onConfirm:L})}),(0,l.jsx)(Ot.Z,{children:(0,l.jsx)(Q.Z,{onClick:D,color:"primary",children:"Cancel"})})]})};var gs=t(12231),Wr=t(9520),yr=t(47603);const ks=(0,V.Z)(v=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:v.spacing(1,0,1,0)},title:{margin:v.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:v.palette.text.primary},menuItem:{minHeight:v.spacing(6)},groupWrapper:{margin:v.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function ms(v){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:yr.Z},{id:"starred",label:"Starred",icon:x.Z}]},{name:v!=null?v:"Company",items:[{id:"all",label:"All"}]}]}const Gr=v=>{const{initialFilter:j,availableFilters:L}=v,D=ks(),_=(0,n.h_)(n.Ds);var J;const le=(J=_.getOptionalString("organization.name"))!==null&&J!==void 0?J:"Company",{filters:me,updateFilters:we,backendEntities:Ne,queryParameters:{kind:Me,user:je},loading:Qe}=Re(),ft=["starred","all"],vt=ms(le).map(xn=>({...xn,items:xn.items.filter(({id:on})=>["group","user"].some(nr=>nr===Me)?ft.includes(on):!L||L.includes(on))})).filter(({items:xn})=>!!xn.length),{isStarredEntity:Xe}=It(),{isOwnedEntity:Bt,loading:Qt}=he(),Fn=Qe||Qt,An=(0,B.useMemo)(()=>new Be("owned",Bt,Xe),[Bt,Xe]),tr=(0,B.useMemo)(()=>new Be("starred",Bt,Xe),[Bt,Xe]),hn=(0,B.useMemo)(()=>[je].flat()[0],[je]),[yn,Tn]=(0,B.useState)(hn!=null?hn:j),xr=(0,B.useMemo)(()=>Ne.filter(nt((0,He.compact)(Object.values({...me,user:void 0})))),[me,Ne]),br=(0,B.useMemo)(()=>({all:xr.length,starred:xr.filter(xn=>tr.filterEntity(xn)).length,owned:xr.filter(xn=>An.filterEntity(xn)).length}),[xr,tr,An]);(0,B.useEffect)(()=>{hn&&Tn(hn)},[hn]),(0,B.useEffect)(()=>{!Fn&&!!yn&&yn!=="all"&&br[yn]===0&&Tn("all")},[Fn,br,yn,Tn]),(0,B.useEffect)(()=>{we({user:yn?new Be(yn,Bt,Xe):void 0})},[yn,Bt,Xe,we]);var Sr;return(0,l.jsx)(Fr.Z,{className:D.root,children:vt.map(xn=>(0,l.jsxs)(B.Fragment,{children:[(0,l.jsx)(H.Z,{variant:"subtitle2",component:"span",className:D.title,children:xn.name}),(0,l.jsx)(Fr.Z,{className:D.groupWrapper,children:(0,l.jsx)(Zn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":xn.name,children:xn.items.map(on=>{var nr;return(0,l.jsxs)(gs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Tn(on.id),selected:on.id===((nr=me.user)===null||nr===void 0?void 0:nr.value),className:D.menuItem,disabled:br[on.id]===0,"data-testid":`user-picker-${on.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[on.icon&&(0,l.jsx)(lr.Z,{className:D.listIcon,children:(0,l.jsx)(on.icon,{fontSize:"small"})}),(0,l.jsx)(Nr.Z,{children:(0,l.jsxs)(H.Z,{variant:"body1",children:[on.label," "]})}),(0,l.jsx)(Wr.Z,{children:(Sr=br[on.id])!==null&&Sr!==void 0?Sr:"-"})]},on.id)})})})]},xn.name))})},vs=(0,V.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Os=(0,l.jsx)(Ve.Z,{fontSize:"small"}),ys=(0,l.jsx)(Oe.Z,{fontSize:"small"}),$s=()=>{const v=vs(),{updateFilters:j}=Re(),[L,D]=(0,B.useState)([]);function _(me){j({orphan:me?new We(me):void 0})}function J(me){j({error:me?new _e(me):void 0})}const le=["Is Orphan","Has Error"];return(0,l.jsx)(G.Z,{pb:1,pt:1,children:(0,l.jsxs)(H.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(Ft.ZP,{multiple:!0,options:le,value:L,onChange:(me,we)=>{D(we),_(we.includes("Is Orphan")),J(we.includes("Has Error"))},renderOption:(me,{selected:we})=>(0,l.jsx)(S.Z,{control:(0,l.jsx)(K.Z,{icon:Os,checkedIcon:ys,checked:we}),label:me}),size:"small",popupIcon:(0,l.jsx)(ot.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:me=>(0,l.jsx)(Ae.Z,{...me,className:v.input,variant:"outlined"})})]})})},po=({children:v,value:j})=>{var L;const[D,_]=useState((L=j==null?void 0:j.filters)!==null&&L!==void 0?L:{}),J=useCallback(ft=>{_(vt=>{const Xe=typeof ft=="function"?ft(vt):ft;return{...vt,...Xe}})},[]),le=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var me,we,Ne,Me,je;const Qe=useMemo(()=>({entities:(me=j==null?void 0:j.entities)!==null&&me!==void 0?me:le.entities,backendEntities:(we=j==null?void 0:j.backendEntities)!==null&&we!==void 0?we:le.backendEntities,updateFilters:(Ne=j==null?void 0:j.updateFilters)!==null&&Ne!==void 0?Ne:J,filters:D,loading:(Me=j==null?void 0:j.loading)!==null&&Me!==void 0?Me:!1,queryParameters:(je=j==null?void 0:j.queryParameters)!==null&&je!==void 0?je:le.queryParameters,error:j==null?void 0:j.error}),[j,le,D,J]);return _jsx(EntityListContext.Provider,{value:Qe,children:v})}},33414:function(bt,Pe,t){"use strict";t.r(Pe),t.d(Pe,{AboutCard:function(){return Ye},AboutContent:function(){return He},AboutField:function(){return ee}});var h=t(52322),n=t(25271),m=t(1515),T=t(25248),z=t(32838),b=t(46285),l=t(79692),B=t(94339),te=t(32552),q=t(61837),Q=t(85256),N=t(24579),G=t(52866),H=t(30254),ae=t(27604),ie=t(2784),R=t(19625),I=t(60905),k=t(90436),O=t(7089);const A=(0,l.Z)(Ue=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ue.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function ee(Ue){const{label:ze,value:tt,gridSizes:lt,children:ct}=Ue,nt=A(),Ce=(0,T.vJ)(ct,gt=>gt.getElements()),rt=Ce.length>0?Ce:(0,h.jsx)(k.Z,{variant:"body2",className:nt.value,children:tt||"unknown"});return(0,h.jsxs)(I.Z,{item:!0,...lt,children:[(0,h.jsx)(k.Z,{variant:"h2",className:nt.label,children:ze}),rt]})}var pe=t(24851);const Ke=(0,l.Z)({description:{wordBreak:"break-word"}});function qe(Ue,ze,tt){if(ze==="url"||Ue.includes("://"))return Ue;const lt=tt.type==="file"?`file://${tt.target}`:tt.target;return ze==="file"||tt.type==="file"?new URL(Ue,lt).href:lt}function He(Ue){var ze,tt,lt,ct,nt,Ce,rt,gt;const{entity:Le}=Ue,se=Ke(),xe=Le.kind.toLocaleLowerCase("en-US")==="system",Re=Le.kind.toLocaleLowerCase("en-US")==="resource",st=Le.kind.toLocaleLowerCase("en-US")==="component",pt=Le.kind.toLocaleLowerCase("en-US")==="api",Ct=Le.kind.toLocaleLowerCase("en-US")==="template",dt=Le.kind.toLocaleLowerCase("en-US")==="location",jt=Le.kind.toLocaleLowerCase("en-US")==="group",St=(0,b.hF)(Le,n.cz,{kind:"system"}),Lt=(0,b.hF)(Le,n.cz,{kind:"component"}),zt=(0,b.hF)(Le,n.cz,{kind:"domain"}),mt=(0,b.hF)(Le,n.S4);let ln;try{ln=(0,n.CV)(Le)}catch{ln=void 0}return(0,h.jsxs)(I.Z,{container:!0,children:[(0,h.jsx)(ee,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(k.Z,{variant:"body2",paragraph:!0,className:se.description,children:(Le==null||(ze=Le.metadata)===null||ze===void 0?void 0:ze.description)||"No description"})}),(0,h.jsx)(ee,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:mt.length>0&&(0,h.jsx)(b.rI,{entityRefs:mt,defaultKind:"group"})}),(xe||zt.length>0)&&(0,h.jsx)(ee,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:zt.length>0&&(0,h.jsx)(b.rI,{entityRefs:zt,defaultKind:"domain"})}),(pt||st||Re||St.length>0)&&(0,h.jsx)(ee,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:St.length>0&&(0,h.jsx)(b.rI,{entityRefs:St,defaultKind:"system"})}),st&&Lt.length>0&&(0,h.jsx)(ee,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(b.rI,{entityRefs:Lt,defaultKind:"component"})}),(pt||st||Re||Ct||jt||dt||typeof(Le==null||(tt=Le.spec)===null||tt===void 0?void 0:tt.type)=="string")&&(0,h.jsx)(ee,{label:"Type",value:Le==null||(lt=Le.spec)===null||lt===void 0?void 0:lt.type,gridSizes:{xs:12,sm:6,lg:4}}),(pt||st||typeof(Le==null||(ct=Le.spec)===null||ct===void 0?void 0:ct.lifecycle)=="string")&&(0,h.jsx)(ee,{label:"Lifecycle",value:Le==null||(nt=Le.spec)===null||nt===void 0?void 0:nt.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:((Le==null||(Ce=Le.metadata)===null||Ce===void 0?void 0:Ce.tags)||[]).map(Nt=>(0,h.jsx)(O.Z,{size:"small",label:Nt},Nt))}),dt&&((Le==null||(rt=Le.spec)===null||rt===void 0?void 0:rt.targets)||(Le==null||(gt=Le.spec)===null||gt===void 0?void 0:gt.target))&&(0,h.jsx)(ee,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(pe.s,{cols:1,items:(Le.spec.targets||[Le.spec.target]).map(Nt=>Nt).map(Nt=>{var dn;return{text:Nt,href:qe(Nt,(Le==null||(dn=Le.spec)===null||dn===void 0?void 0:dn.type)||"unknown",ln)}})})})]})}const Je=(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 Ye(Ue){var ze,tt,lt;const{variant:ct}=Ue,nt=Je(),{entity:Ce}=(0,b.X2)(),rt=(0,T.h_)(z.q3),gt=(0,T.h_)(b.Ah),Le=(0,T.h_)(T.$v),se=(0,T.tg)(R.jU),xe=(0,b.CV)(Ce,rt),Re=(ze=Ce.metadata.annotations)===null||ze===void 0?void 0:ze[n.Tf],st={label:"View Source",disabled:!xe,icon:(0,h.jsx)(z.nW,{type:xe==null?void 0:xe.integrationType}),href:xe==null?void 0:xe.locationTargetUrl},pt={label:"View TechDocs",disabled:!(!((tt=Ce.metadata.annotations)===null||tt===void 0)&&tt["backstage.io/techdocs-ref"])||!se,icon:(0,h.jsx)(H.Z,{}),href:se&&se({namespace:Ce.metadata.namespace||n.zG,kind:Ce.kind,name:Ce.metadata.name})};let Ct="";ct==="gridItem"?Ct=nt.gridItemCard:ct==="fullHeight"&&(Ct=nt.fullHeightCard);let dt="";ct==="gridItem"?dt=nt.gridItemCardContent:ct==="fullHeight"&&(dt=nt.fullHeightCardContent);const jt=(lt=Ce.metadata.annotations)===null||lt===void 0?void 0:lt[n.P1],St=(jt==null?void 0:jt.startsWith("url:"))||(jt==null?void 0:jt.startsWith("file:")),Lt=(0,ie.useCallback)(async()=>{await gt.refreshEntity((0,n.eE)(Ce)),Le.post({message:"Refresh scheduled",severity:"info"})},[gt,Le,Ce]);return(0,h.jsxs)(B.Z,{className:Ct,children:[(0,h.jsx)(te.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[St&&(0,h.jsx)(q.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Lt,children:(0,h.jsx)(G.Z,{})}),(0,h.jsx)(q.Z,{component:m.rU,"aria-label":"Edit",disabled:!Re,title:"Edit Metadata",to:Re!=null?Re:"#",children:(0,h.jsx)(ae.Z,{})})]}),subheader:(0,h.jsx)(m.M6,{links:[st,pt]})}),(0,h.jsx)(Q.Z,{}),(0,h.jsx)(N.Z,{className:dt,children:(0,h.jsx)(He,{entity:Ce})})]})}},79324:function(bt,Pe,t){"use strict";t.d(Pe,{K:function(){return G}});var h=t(52322),n=t(2784),m=t(79692),T=t(12420),z=t(97580),b=t(73698),l=t(74603),B=t(12231),te=t(46285),q=t(64279),Q=t(25248);const N=(0,m.Z)(H=>(0,T.Z)({root:{...H.typography.h4}}));function G(H){const{initialFilter:ae="component",allowedKinds:ie}=H,R=N(),I=(0,Q.h_)(te.Ah),{value:k}=(0,q.default)(async()=>await I.getEntityFacets({facets:["kind"]}).then(Ye=>{var Ue;return((Ue=Ye.facets.kind)===null||Ue===void 0?void 0:Ue.map(ze=>ze.value).sort())||[]})),{updateFilters:O,queryParameters:{kind:A}}=(0,te.wp)(),ee=(0,n.useMemo)(()=>{var Ye;return(Ye=[A].flat()[0])===null||Ye===void 0?void 0:Ye.toLocaleLowerCase("en-US")},[A]),[pe,Ke]=(0,n.useState)(ee!=null?ee:ae);(0,n.useEffect)(()=>{O({kind:pe?new te.zo(pe):void 0})},[pe,O]),(0,n.useEffect)(()=>{ee&&Ke(ee)},[ee]);var qe;const Je=[(0,z.Z)(pe)].concat((qe=k==null?void 0:k.filter(Ye=>ie?ie.some(Ue=>Ue.toLocaleLowerCase("en-US")===Ye.toLocaleLowerCase("en-US")):!0))!==null&&qe!==void 0?qe:[]).sort().reduce((Ye,Ue)=>(Ye[Ue.toLocaleLowerCase("en-US")]=Ue,Ye),{});return(0,h.jsx)(b.Z,{input:(0,h.jsx)(l.Z,{value:pe}),value:pe,onChange:Ye=>Ke(Ye.target.value),classes:R,children:Object.keys(Je).map(Ye=>(0,h.jsx)(B.Z,{value:Ye,children:`${Je[Ye]}s`},Ye))})}},86359:function(bt,Pe,t){"use strict";t.d(Pe,{E:function(){return ie}});var h=t(52322),n=t(25271),m=t(1515),T=t(46285),z=t(90436),b=t(15459),l=t(27604),B=t(2997),te=t(11640),q=t(28347),Q=t(76635),N=t(2784),G=t(7089);const H=Object.freeze({createNameColumn(R){function I(k){var O;return((O=k.metadata)===null||O===void 0?void 0:O.title)||(0,T.$3)(k,{defaultKind:R==null?void 0:R.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:k},{entity:O}){return I(k).localeCompare(I(O))},render:({entity:k})=>{var O;return(0,h.jsx)(T.dx,{entityRef:k,defaultKind:(R==null?void 0:R.defaultKind)||"Component",title:(O=k.metadata)===null||O===void 0?void 0:O.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:R})=>(0,h.jsx)(T.rI,{entityRefs:R.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,h.jsx)(T.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:R})=>{var I,k;return(0,h.jsx)(h.Fragment,{children:((R==null||(I=R.spec)===null||I===void 0?void 0:I.targets)||(R==null||(k=R.spec)===null||k===void 0?void 0:k.target))&&(0,h.jsx)(m.Or,{text:(R.spec.targets||[R.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:R})=>(0,h.jsx)(m.Or,{text:R.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:R})=>(0,h.jsx)(h.Fragment,{children:R.metadata.tags&&R.metadata.tags.map(I=>(0,h.jsx)(G.Z,{label:I,size:"small",variant:"outlined",style:{marginBottom:"0px"}},I))}),width:"auto"}},createTitleColumn(R){return{title:"Title",field:"entity.metadata.title",hidden:R==null?void 0:R.hidden,searchable:!0}}}),ae=(0,b.Z)({root:{color:"#f3ba37"}})(te.Z),ie=R=>{var I,k;const{columns:O,actions:A,tableOptions:ee,subtitle:pe}=R,{isStarredEntity:Ke,toggleStarredEntity:qe}=(0,T.CR)(),{loading:He,error:Je,entities:Ye,filters:Ue}=(0,T.wp)(),ze=(0,N.useMemo)(()=>{var Le;return[H.createTitleColumn({hidden:!0}),H.createNameColumn({defaultKind:(Le=Ue.kind)===null||Le===void 0?void 0:Le.value}),...se(),H.createMetadataDescriptionColumn(),H.createTagsColumn()];function se(){var xe;switch((xe=Ue.kind)===null||xe===void 0?void 0:xe.value){case"user":return[];case"domain":case"system":return[H.createOwnerColumn()];case"group":case"template":return[H.createSpecTypeColumn()];case"location":return[H.createSpecTypeColumn(),H.createSpecTargetsColumn()];default:return[H.createSystemColumn(),H.createOwnerColumn(),H.createSpecTypeColumn(),H.createSpecLifecycleColumn()]}}},[(I=Ue.kind)===null||I===void 0?void 0:I.value]),tt=Ue.type===void 0;var lt;const ct=(0,Q.capitalize)((lt=(k=Ue.user)===null||k===void 0?void 0:k.value)!==null&&lt!==void 0?lt:"all");if(Je)return(0,h.jsx)("div",{children:(0,h.jsx)(m.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(m.Oi,{language:"text",text:Je.toString()})})});const nt=[({entity:Le})=>{var se;const xe=(se=Le.metadata.annotations)===null||se===void 0?void 0:se[n.l2],Re="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:Re}),(0,h.jsx)(B.Z,{fontSize:"small"})]}),tooltip:Re,disabled:!xe,onClick:()=>{!xe||window.open(xe,"_blank")}}},({entity:Le})=>{var se;const xe=(se=Le.metadata.annotations)===null||se===void 0?void 0:se[n.Tf],Re="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:Re}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:Re,disabled:!xe,onClick:()=>{!xe||window.open(xe,"_blank")}}},({entity:Le})=>{const se=Ke(Le),xe=se?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"srOnly",children:xe}),se?(0,h.jsx)(ae,{}):(0,h.jsx)(q.Z,{})]}),tooltip:xe,onClick:()=>qe(Le)}}],Ce=Ye.map(Le=>{const se=(0,T.hF)(Le,n.cz,{kind:"system"}),xe=(0,T.hF)(Le,n.S4);return{entity:Le,resolved:{name:(0,T.$3)(Le,{defaultKind:"Component"}),ownedByRelationsTitle:xe.map(Re=>(0,T.$3)(Re,{defaultKind:"group"})).join(", "),ownedByRelations:xe,partOfSystemRelationTitle:se.map(Re=>(0,T.$3)(Re,{defaultKind:"system"})).join(", "),partOfSystemRelations:se}}}),rt=(O||ze).find(Le=>Le.title==="Type");rt&&(rt.hidden=!tt);const gt=Ce.length>20;return(0,h.jsx)(m.iA,{isLoading:He,columns:O||ze,options:{paging:gt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!He,padding:"dense",pageSizeOptions:[20,50,100],...ee},title:`${ct} (${Ye.length})`,data:Ce,actions:A||nt,subtitle:pe})};ie.columns=H},24851:function(bt,Pe,t){"use strict";t.d(Pe,{s:function(){return ae}});var h=t(52322),n=t(90348),m=t(11861),T=t(2784),z=t(79692),b=t(95544),l=t(90436),B=t(52160),te=t(1515);const q=(0,z.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function Q(ie){const{href:R,text:I,Icon:k}=ie,O=q();return(0,h.jsxs)(b.Z,{display:"flex",children:[(0,h.jsx)(b.Z,{mr:1,className:O.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:k?(0,h.jsx)(k,{}):(0,h.jsx)(B.Z,{})})}),(0,h.jsx)(b.Z,{flexGrow:"1",children:(0,h.jsx)(te.rU,{to:R,target:"_blank",rel:"noopener",children:I||R})})]})}var N=t(41156);const G={xs:1,sm:1,md:1,lg:2,xl:3};function H(ie){const R=[(0,N.Z)(A=>A.breakpoints.up("xl"))?"xl":null,(0,N.Z)(A=>A.breakpoints.up("lg"))?"lg":null,(0,N.Z)(A=>A.breakpoints.up("md"))?"md":null,(0,N.Z)(A=>A.breakpoints.up("sm"))?"sm":null,(0,N.Z)(A=>A.breakpoints.up("xs"))?"xs":null];let I=1;if(typeof ie=="number")I=ie;else{var k;const A=(k=R.find(ee=>ee!==null))!==null&&k!==void 0?k:"xs";var O;I=(O=ie==null?void 0:ie[A])!==null&&O!==void 0?O:G[A]}return I}function ae(ie){const{items:R,cols:I=void 0}=ie,k=H(I);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:k,children:R.map(({text:O,href:A,Icon:ee},pe)=>(0,h.jsx)(m.Z,{children:(0,h.jsx)(Q,{href:A,text:O!=null?O:A,Icon:ee})},pe))})}},19625:function(bt,Pe,t){"use strict";t.d(Pe,{_Z:function(){return T},jU:function(){return m},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),m=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),T=(0,h.NT)({id:"catalog"})},51666:function(bt,Pe,t){"use strict";t.d(Pe,{rG:function(){return h},Y2:function(){return k},J$:function(){return te},g2:function(){return m}});var h;(function(O){O.DENY="DENY",O.ALLOW="ALLOW",O.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(O,A){return O.name===A.name}function m(O,A){return"resourceType"in O?!A||O.resourceType===A:!1}function T(O){return O.attributes.action==="create"}function z(O){return O.attributes.action==="read"}function b(O){return O.attributes.action==="update"}function l(O){return O.attributes.action==="delete"}function B(O){return{authorize:async(A,ee)=>await O.authorize(A,ee),authorizeConditional(A,ee){const pe=A;return O.authorize(pe,ee)}}}function te({name:O,attributes:A,resourceType:ee}){return ee?{type:"resource",name:O,attributes:A,resourceType:ee}:{type:"basic",name:O,attributes:A}}var q=t(23054),Q=t(96279),N=t.n(Q),G=t(9571),H=t(30195);const ae=H.z.lazy(()=>H.z.object({rule:H.z.string(),resourceType:H.z.string(),params:H.z.array(H.z.unknown())}).or(H.z.object({anyOf:H.z.array(ae).nonempty()})).or(H.z.object({allOf:H.z.array(ae).nonempty()})).or(H.z.object({not:ae}))),ie=H.z.object({result:H.z.literal(h.ALLOW).or(H.z.literal(h.DENY))}),R=H.z.union([H.z.object({result:H.z.literal(h.ALLOW).or(H.z.literal(h.DENY))}),H.z.object({result:H.z.literal(h.CONDITIONAL),pluginId:H.z.string(),resourceType:H.z.string(),conditions:ae})]),I=(O,A)=>H.z.object({items:H.z.array(H.z.intersection(H.z.object({id:H.z.string()}),O)).refine(ee=>ee.length===A.size&&ee.every(({id:pe})=>A.has(pe)),{message:"Items in response do not match request"})});class k{async authorize(A,ee){return this.makeRequest(A,ie,ee)}async authorizeConditional(A,ee){return this.makeRequest(A,R,ee)}async makeRequest(A,ee,pe){if(!this.enabled)return A.map(ze=>({result:h.ALLOW}));const Ke={items:A.map(ze=>({id:G.Z(),...ze}))},qe=await this.discovery.getBaseUrl("permission"),He=await N()(`${qe}/authorize`,{method:"POST",body:JSON.stringify(Ke),headers:{...this.getAuthorizationHeader(pe==null?void 0:pe.token),"content-type":"application/json"}});if(!He.ok)throw await q.VL.fromResponse(He);const Je=await He.json(),Ue=I(ee,new Set(Ke.items.map(({id:ze})=>ze))).parse(Je).items.reduce((ze,tt)=>(ze[tt.id]=tt,ze),{});return Ke.items.map(ze=>Ue[ze.id])}getAuthorizationHeader(A){return A?{Authorization:`Bearer ${A}`}:{}}constructor(A){this.discovery=A.discovery;var ee;this.enabled=(ee=A.config.getOptionalBoolean("permission.enabled"))!==null&&ee!==void 0?ee:!1}}},25488:function(bt,Pe,t){"use strict";t.d(Pe,{iM:function(){return b},RV:function(){return T},gI:function(){return B}});var h=t(52322),n=t(2784),m=t(25248);const T=(0,m.T0)({id:"plugin.permission.api"});var z=t(51666);class b{static create(N){const{config:G,discovery:H,identity:ae}=N,ie=new z.Y2({discovery:H,config:G});return new b(ie,ae)}async authorize(N){return(await this.permissionClient.authorize([N],await this.identityApi.getCredentials()))[0]}constructor(N,G){this.permissionClient=N,this.identityApi=G}}var l=t(49857);function B(Q){const N=(0,m.h_)(T),{data:G,error:H}=(0,l.ZP)(Q,async ae=>{if((0,z.g2)(ae.permission)&&!ae.resourceRef)return z.rG.DENY;const{result:ie}=await N.authorize(ae);return ie});return H?{error:H,loading:!1,allowed:!1}:G===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:G===z.rG.ALLOW}}const te=Q=>{const{permission:N,resourceRef:G,errorComponent:H,...ae}=Q,ie=usePermission(isResourcePermission(N)?{permission:N,resourceRef:G}:{permission:N}),R=useApp(),{NotFoundErrorPage:I}=R.getComponents();let k=H===void 0?_jsx(I,{}):H;return ie.loading?k=null:ie.allowed&&(k=Q.element),_jsx(Route,{...ae,element:k})};function q(Q){const{permission:N,resourceRef:G}=Q,H=usePermission(isResourcePermission(N)?{permission:N,resourceRef:G}:{permission:N}),ae=useApp();if(H.loading)return null;if(H.allowed)return _jsx(_Fragment,{children:Q.children});if(Q.errorPage)return _jsx(_Fragment,{children:Q.errorPage});const{NotFoundErrorPage:ie}=ae.getComponents();return _jsx(ie,{})}},23362:function(bt,Pe,t){"use strict";t.d(Pe,{FA:function(){return B},qO:function(){return lt},Nd:function(){return Ke},Rx:function(){return k}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class m{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Te){this.mockedResults=Te}}var T=t(52322),z=t(2784),b=t(79692);const l=(0,b.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),B=({text:Ee,preTag:Te,postTag:Be})=>{const We=l(),_e=(0,z.useMemo)(()=>Ee.split(new RegExp(`(${Te}.+?${Be})`)),[Be,Te,Ee]);return(0,T.jsx)(T.Fragment,{children:_e.map((at,ht)=>at.includes(Te)?(0,T.jsx)("mark",{className:We.highlight,children:at.replace(new RegExp(`${Te}|${Be}`,"g"),"")},ht):at)})};var te=t(48760),q=t(50581),Q=t(61837),N=t(74603),G=t(21853),H=t(33375),ae=t(51837),ie=t(64279),R=t(1849);const I=(0,ae.CT)("search-context"),k=()=>{const Ee=(0,z.useContext)(I);if(!Ee)throw new Error("useSearch must be used within a SearchContextProvider");const Te=Ee.atVersion(1);if(!Te)throw new Error("No SearchContext v1 found");return Te},O=()=>(0,z.useContext)(I)!==void 0,A={term:"",pageCursor:void 0,filters:{},types:[]},ee=(Ee=A)=>{var Te,Be,We,_e;const at=(0,h.h_)(n),[ht,wt]=(0,z.useState)(Ee.pageCursor),[Tt,Pt]=(0,z.useState)(Ee.filters),[It,oe]=(0,z.useState)(Ee.term),[W,he]=(0,z.useState)(Ee.types),ve=(0,R.Z)(It),be=(0,ie.default)(()=>at.query({term:It,filters:Tt,pageCursor:ht,types:W}),[It,Tt,W,ht]),Ge=!be.loading&&!be.error&&((Te=be.value)===null||Te===void 0?void 0:Te.nextPageCursor),V=!be.loading&&!be.error&&((Be=be.value)===null||Be===void 0?void 0:Be.previousPageCursor),S=(0,z.useCallback)(()=>{var Oe;wt((Oe=be.value)===null||Oe===void 0?void 0:Oe.nextPageCursor)},[(We=be.value)===null||We===void 0?void 0:We.nextPageCursor]),K=(0,z.useCallback)(()=>{var Oe;wt((Oe=be.value)===null||Oe===void 0?void 0:Oe.previousPageCursor)},[(_e=be.value)===null||_e===void 0?void 0:_e.previousPageCursor]);return(0,z.useEffect)(()=>{ve!==void 0&&It!==ve&&wt(void 0)},[It,ve,wt]),{result:be,filters:Tt,setFilters:Pt,term:It,setTerm:oe,types:W,setTypes:he,pageCursor:ht,setPageCursor:wt,fetchNextPage:Ge?S:void 0,fetchPreviousPage:V?K:void 0}},pe=Ee=>{const{initialState:Te,children:Be}=Ee,We=ee(Te);return(0,T.jsx)(h.fC,{attributes:{searchTypes:We.types.sort().join(",")},children:(0,T.jsx)(I.Provider,{value:(0,ae.EI)({1:We}),children:Be})})},Ke=Ee=>{const{initialState:Te,inheritParentContextIfAvailable:Be,children:We}=Ee;return O()&&Be?(0,T.jsx)(T.Fragment,{children:We}):(0,T.jsx)(pe,{initialState:Te,children:We})},qe=({children:Ee})=>{const Te=(0,h.z$)(),{term:Be}=k();return(0,z.useEffect)(()=>{Be&&Te.captureEvent("search",Be)},[Te,Be]),(0,T.jsx)(T.Fragment,{children:Ee})};function He(Ee){return(0,z.forwardRef)((Te,Be)=>(0,T.jsx)(Ke,{inheritParentContextIfAvailable:!0,children:(0,T.jsx)(Ee,{...Te,ref:Be})}))}const Je=He((0,z.forwardRef)((Ee,Te)=>{const{onChange:Be,onKeyDown:We=()=>{},onClear:_e=()=>{},onSubmit:at=()=>{},debounceTime:ht=200,clearButton:wt=!0,fullWidth:Tt=!0,value:Pt,placeholder:It,inputProps:oe={},endAdornment:W,...he}=Ee,ve=(0,h.h_)(h.Ds),[be,Ge]=(0,z.useState)("");(0,z.useEffect)(()=>{Ge(ot=>ot!==Pt?String(Pt):ot)},[Pt]),(0,te.Z)(()=>Be(be),ht,[be]);const V=(0,z.useCallback)(ot=>{Ge(ot.target.value)},[Ge]),S=(0,z.useCallback)(ot=>{We&&We(ot),at&&ot.key==="Enter"&&at()},[We,at]),K=(0,z.useCallback)(()=>{Be(""),_e&&_e()},[Be,_e]),Ae=It!=null?It:`Search in ${ve.getOptionalString("app.title")||"Backstage"}`,Oe=(0,T.jsx)(q.Z,{position:"start",children:(0,T.jsx)(Q.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,T.jsx)(G.Z,{})})}),Ve=(0,T.jsx)(q.Z,{position:"end",children:(0,T.jsx)(Q.Z,{"aria-label":"Clear",size:"small",onClick:K,children:(0,T.jsx)(H.Z,{})})});return(0,T.jsx)(qe,{children:(0,T.jsx)(N.Z,{"data-testid":"search-bar-next",ref:Te,value:be,placeholder:Ae,startAdornment:Oe,endAdornment:wt?Ve:W,inputProps:{"aria-label":"Search",...oe},fullWidth:Tt,onChange:V,onKeyDown:S,...he})})})),Ye=He((0,z.forwardRef)((Ee,Te)=>{const{value:Be="",onChange:We,..._e}=Ee,{term:at,setTerm:ht}=k();(0,z.useEffect)(()=>{Be&&ht(String(Be))},[Be,ht]);const wt=(0,z.useCallback)(Tt=>{We?We(Tt):ht(Tt)},[We,ht]);return(0,T.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,T.jsx)(Je,{..._e,ref:Te,value:at,onChange:wt})})}));var Ue=t(4614),ze=t(88013);const lt=(Ee=>Te=>(0,T.jsx)(Ke,{inheritParentContextIfAvailable:!0,children:(0,T.jsx)(Ee,{...Te})}))(function(Te){const{loading:Be,value:We,onChange:_e=()=>{},options:at=[],getOptionLabel:ht=K=>String(K),inputPlaceholder:wt,inputDebounceTime:Tt,freeSolo:Pt=!0,fullWidth:It=!0,clearOnBlur:oe=!1,"data-testid":W="search-autocomplete",...he}=Te,{setTerm:ve}=k(),be=(0,z.useCallback)(K=>K?typeof K=="string"?K:ht(K):"",[ht]),Ge=(0,z.useMemo)(()=>be(We),[We,be]),V=(0,z.useCallback)((K,Ae,Oe,Ve)=>{ve(be(Ae)),_e(K,Ae,Oe,Ve)},[be,ve,_e]),S=(0,z.useCallback)(({InputProps:{ref:K,endAdornment:Ae},InputLabelProps:Oe,...Ve})=>(0,T.jsx)(Ye,{...Ve,ref:K,clearButton:!1,value:Ge,placeholder:wt,debounceTime:Tt,endAdornment:Be?(0,T.jsx)(Ue.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Ae}),[Be,Ge,wt,Tt]);return(0,T.jsx)(ze.ZP,{...he,"data-testid":W,value:We,onChange:V,options:at,getOptionLabel:ht,renderInput:S,freeSolo:Pt,fullWidth:It,clearOnBlur:oe})}),ct=({icon:Ee,primaryText:Te,primaryTextTypographyProps:Be,secondaryText:We,secondaryTextTypographyProps:_e,disableTextTypography:at})=>_jsxs(_Fragment,{children:[Ee?_jsx(ListItemIcon,{children:Ee}):null,_jsx(ListItemText,{primary:Te,primaryTypographyProps:Be,secondary:We,secondaryTypographyProps:_e,disableTypography:at})]});var nt=t(42494),Ce=t(84899),rt=t(5806),gt=t(21324),Le=t(56939),se=t(73698),xe=t(12231),Re=t(86619),st=t(7089),pt=t(69294);const Ct=(Ee,Te,Be=[],We=250)=>{const _e=(0,z.useRef)({}),at=Ee||(()=>Promise.resolve([])),[ht,wt]=(0,pt.default)(at,[Te],{loading:!0});if((0,te.Z)(()=>{_e.current[Te]===void 0&&(_e.current[Te]=wt(Te).then(Pt=>(_e.current[Te]=Pt,Pt)))},We,[wt,Te]),Be.length)return{loading:!1,value:Be};const Tt=_e.current[Te];return Array.isArray(Tt)?{loading:!1,value:Tt}:ht},dt=(Ee,Te)=>{const{setFilters:Be}=k();(0,z.useEffect)(()=>{Te&&[Te].flat().length>0&&Be(We=>({...We,[Ee]:Te}))},[])},jt=Ee=>{const{className:Te,defaultValue:Be,name:We,values:_e,valuesDebounceMs:at,label:ht,filterSelectedOptions:wt,limitTags:Tt,multiple:Pt}=Ee,[It,oe]=(0,z.useState)("");dt(We,Be);const W=typeof _e=="function"?_e:void 0,he=typeof _e=="function"?void 0:_e,{value:ve,loading:be}=Ct(W,It,he,at),{filters:Ge,setFilters:V}=k(),S=Ge[We]||(Pt?[]:null),K=(Ve,ot)=>{V(Ft=>{const{[We]:Zt,...qt}=Ft;return ot?{...qt,[We]:ot}:{...qt}})},Ae=Ve=>(0,T.jsx)(Re.Z,{...Ve,name:"search",variant:"outlined",label:ht,fullWidth:!0}),Oe=(Ve,ot)=>Ve.map((Ft,Zt)=>(0,T.jsx)(st.Z,{label:Ft,color:"primary",...ot({index:Zt})}));return(0,T.jsx)(ze.ZP,{filterSelectedOptions:wt,limitTags:Tt,multiple:Pt,className:Te,id:`${Pt?"multi-":""}select-filter-${We}--select`,options:ve||[],loading:be,value:S,onChange:K,onInputChange:(Ve,ot)=>oe(ot),renderInput:Ae,renderTags:Oe})},St=(0,b.Z)({label:{textTransform:"capitalize"}}),Lt=Ee=>{const{className:Te,defaultValue:Be,label:We,name:_e,values:at=[],valuesDebounceMs:ht}=Ee,wt=St(),{filters:Tt,setFilters:Pt}=k();dt(_e,Be);const It=typeof at=="function"?at:void 0,oe=typeof at=="function"?void 0:at,{value:W=[],loading:he}=Ct(It,"",oe,ht),ve=Ge=>{const{target:{value:V,checked:S}}=Ge;Pt(K=>{const{[_e]:Ae,...Oe}=K,Ve=(Ae||[]).filter(Ft=>Ft!==V),ot=S?[...Ve,V]:Ve;return ot.length?{...Oe,[_e]:ot}:Oe})};var be;return(0,T.jsxs)(nt.Z,{className:Te,disabled:he,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[We?(0,T.jsx)(Ce.Z,{className:wt.label,children:We}):null,W.map(Ge=>(0,T.jsx)(rt.Z,{control:(0,T.jsx)(gt.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":Ge},value:Ge,name:Ge,onChange:ve,checked:((be=Tt[_e])!==null&&be!==void 0?be:[]).includes(Ge)}),label:Ge},Ge))]})},zt=Ee=>{const{className:Te,defaultValue:Be,label:We,name:_e,values:at,valuesDebounceMs:ht}=Ee,wt=St();dt(_e,Be);const Tt=typeof at=="function"?at:void 0,Pt=typeof at=="function"?void 0:at,{value:It=[],loading:oe}=Ct(Tt,"",Pt,ht),{filters:W,setFilters:he}=k(),ve=be=>{const{target:{value:Ge}}=be;he(V=>{const{[_e]:S,...K}=V;return Ge?{...K,[_e]:Ge}:K})};return(0,T.jsxs)(nt.Z,{disabled:oe,className:Te,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[We?(0,T.jsx)(Le.Z,{className:wt.label,margin:"dense",children:We}):null,(0,T.jsxs)(se.Z,{variant:"outlined",value:W[_e]||"",onChange:ve,children:[(0,T.jsx)(xe.Z,{value:"",children:(0,T.jsx)("em",{children:"All"})}),It.map(be=>(0,T.jsx)(xe.Z,{value:be,children:be},be))]})]})},mt=({component:Ee,...Te})=>(0,T.jsx)(Ee,{...Te});mt.Checkbox=Ee=>(0,T.jsx)(mt,{...Ee,component:Lt}),mt.Select=Ee=>(0,T.jsx)(mt,{...Ee,component:zt}),mt.Autocomplete=Ee=>(0,T.jsx)(mt,{...Ee,component:jt});var ln=t(1515);const Nt=({children:Ee})=>{const{result:{loading:Te,error:Be,value:We}}=useSearch();return Te?_jsx(Progress,{}):Be?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Be}):We!=null&&We.results.length?_jsx(_Fragment,{children:Ee({results:We.results})}):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})},dn=Ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Nt,{...Ee})}),un=(0,b.Z)(Ee=>({root:{display:"flex",justifyContent:"space-between",gap:Ee.spacing(2),margin:Ee.spacing(2,0)}})),Ln=()=>{const{fetchNextPage:Ee,fetchPreviousPage:Te}=useSearch(),Be=un();return!Ee&&!Te?_jsx(_Fragment,{}):_jsxs("nav",{"arial-label":"pagination navigation",className:Be.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Te,onClick:Te,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!Ee,onClick:Ee,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},fn=({result:Ee,highlight:Te,rank:Be,icon:We,secondaryAction:_e,lineClamp:at=5})=>{const ht=useAnalytics(),wt=()=>{ht.captureEvent("discover",Ee.title,{attributes:{to:Ee.location},value:Be})};return _jsxs(Link,{noTrack:!0,to:Ee.location,onClick:wt,children:[_jsxs(ListItem,{alignItems:"center",children:[We&&_jsx(ListItemIcon,{children:We}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:Te!=null&&Te.fields.title?_jsx(HighlightedSearchResultText,{text:Te.fields.title,preTag:Te.preTag,postTag:Te.postTag}):Ee.title,secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:at,overflow:"hidden"},children:Te!=null&&Te.fields.text?_jsx(HighlightedSearchResultText,{text:Te.fields.text,preTag:Te.preTag,postTag:Te.postTag}):Ee.text})}),_e&&_jsx(Box,{alignItems:"flex-end",children:_e})]}),_jsx(Divider,{})]})},On=Ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(fn,{...Ee})})},61886:function(bt,Pe,t){"use strict";t.d(Pe,{Ox:function(){return ze},Zz:function(){return b},oZ:function(){return qe},DR:function(){return l},ZS:function(){return pe},VA:function(){return ct},KY:function(){return te},gT:function(){return H},Dl:function(){return ae},ux:function(){return lt},$L:function(){return G},x1:function(){return Ke}});var h=t(52322),n=t(2784),m=t(10289),T=t(25248);const z="techdocs.addons.addon.v1",b="techdocs.addons.wrapper.v1",l=()=>null;(0,T.R5)(l,b,!0);const B=se=>`${z}.${se.toLocaleLowerCase("en-US")}`;function te(se){const{name:xe,component:Re}=se;return(0,T.YO)({name:xe,component:{sync:st=>(0,h.jsx)(Re,{...st})},data:{[z]:se,[B(xe)]:!0}})}const q=(se,xe)=>se.selectByComponentData({key:xe}).getElements()[0],Q=se=>se.selectByComponentData({key:b}).selectByComponentData({key:z}),N=se=>se.selectByComponentData({key:b}).findComponentData({key:z}),G=()=>{const se=(0,m.pC)(),xe=(0,T.vJ)(se,Q),Re=(0,T.vJ)(se,N),st=(0,n.useCallback)(dt=>{if(!xe||!dt)return null;const jt=B(dt.name);var St;return(St=q(xe,jt))!==null&&St!==void 0?St:null},[xe]),pt=(0,n.useCallback)(dt=>{const jt=Re.find(St=>St.name===dt);return jt?st(jt):null},[Re,st]),Ct=(0,n.useCallback)(dt=>{const jt=Re.filter(St=>St.location===dt);return jt.length?jt.map(st):null},[Re,st]);return{renderComponentByName:pt,renderComponentsByLocation:Ct}},H=(0,T.T0)({id:"plugin.techdocs.service"}),ae=(0,T.T0)({id:"plugin.techdocs.storageservice"});var ie=t(64279),R=t(25271),I=t(51837);function k(se,xe){return xe.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(se.kind=se.kind.toLocaleLowerCase(),se.name=se.name.toLocaleLowerCase(),se.namespace=se.namespace.toLocaleLowerCase()),se}const O=(se,xe)=>(0,R.eE)(se)===(0,R.eE)(xe),A={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},ee=(0,I.CT)("techdocs-reader-page-context"),pe=(0,n.memo)(({entityRef:se,children:xe})=>{const Re=(0,T.h_)(H),st=(0,T.h_)(T.Ds),pt=(0,ie.default)(async()=>Re.getTechDocsMetadata(se),[se]),Ct=(0,ie.default)(async()=>Re.getEntityMetadata(se),[se]),[dt,jt]=(0,n.useState)(A.title),[St,Lt]=(0,n.useState)(A.subtitle),[zt,mt]=(0,n.useState)(A.shadowRoot),ln={metadata:pt,entityRef:k(se,st),entityMetadata:Ct,shadowRoot:zt,setShadowRoot:mt,title:dt,setTitle:jt,subtitle:St,setSubtitle:Lt},Nt=(0,I.EI)({1:ln});return(0,h.jsx)(ee.Provider,{value:Nt,children:xe instanceof Function?xe(ln):xe})},(se,xe)=>O(se.entityRef,xe.entityRef)),Ke=()=>{const se=(0,n.useContext)(ee);if(se===void 0)return A;const xe=se.atVersion(1);if(xe===void 0)throw new Error("No context found for version 1.");return xe},qe=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var He=t(70882),Je=t(50236),Ye=t(19219),Ue=t(1515);const ze="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",tt=se=>{(0,n.useEffect)(()=>{if(!se)return()=>{};const xe=se.querySelectorAll('head > link[rel="stylesheet"]');var Re;let st=(Re=xe==null?void 0:xe.length)!==null&&Re!==void 0?Re:0;const pt=new CustomEvent(ze);if(!st)return se.dispatchEvent(pt),()=>{};const Ct=()=>{--st===0&&se.dispatchEvent(pt)};return xe==null||xe.forEach(dt=>{dt.addEventListener("load",Ct)}),()=>{xe==null||xe.forEach(dt=>{dt.removeEventListener("load",Ct)})}},[se])},lt=se=>{const[xe,Re]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!se)return()=>{};Re(!0);const st=se.style;st.setProperty("opacity","0");const pt=()=>{Re(!1),st.setProperty("opacity","1")};return se.addEventListener(ze,pt),()=>{se.removeEventListener(ze,pt)}},[se]),xe},ct=({element:se,onAppend:xe,children:Re})=>{const[st,pt]=(0,n.useState)((0,He.Ue)({...(0,Je.Z)(),insertionPoint:void 0}));tt(se);const Ct=lt(se),dt=(0,n.useCallback)(jt=>{if(!se||!jt)return;pt((0,He.Ue)({...(0,Je.Z)(),insertionPoint:se.querySelector("head")||void 0}));let St=jt.shadowRoot;St||(St=jt.attachShadow({mode:"open"})),St.replaceChildren(se),typeof xe=="function"&&xe(St)},[se,xe]);return(0,h.jsxs)(h.Fragment,{children:[Ct&&(0,h.jsx)(Ue.Ex,{}),(0,h.jsxs)(Ye.ZP,{jss:st,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:dt,"data-testid":"techdocs-native-shadowroot"}),Re]})]})};var nt=t(54073);const Ce=()=>{const{shadowRoot:se}=useTechDocsReaderPage();return se},rt=se=>{const xe=Ce();return xe?se.map(Re=>xe==null?void 0:xe.querySelectorAll(Re)).filter(Re=>Re.length).map(Re=>Array.from(Re)).flat():[]},gt=se=>se.toString()&&se.rangeCount&&se.getRangeAt(0).getBoundingClientRect().top,Le=(se=0)=>{const xe=Ce(),[Re,st]=useState(null),pt=useMemo(()=>debounce(()=>{const Ct=xe,dt=Ct.getSelection?Ct.getSelection():document.getSelection();dt&&gt(dt)?st(dt):st(null)},se),[xe,st,se]);return useEffect(()=>(window.document.addEventListener("selectionchange",pt),()=>window.document.removeEventListener("selectionchange",pt)),[pt]),Re}},52943:function(bt,Pe,t){"use strict";t.r(Pe),t.d(Pe,{EmbeddedDocsRouter:function(){return ie},Router:function(){return ae},isTechDocsAvailable:function(){return H}});var h=t(52322),n=t(2784),m=t(10289),T=t(46285),z=t(1515),b=t(25271),l=t(89258),B=t(65124),te=t(67896);const q=({entity:R})=>{const I=(0,b.iB)(R);return(0,h.jsxs)(l.I6,{entityRef:I,children:[(0,h.jsx)(B.b,{}),(0,h.jsx)(te.F,{withSearch:!1})]})};var Q=t(18662),N=t(7476);const G="backstage.io/techdocs-ref",H=R=>{var I,k;return Boolean(R==null||(I=R.metadata)===null||I===void 0||(k=I.annotations)===null||k===void 0?void 0:k[G])},ae=()=>(0,h.jsxs)(m.Z5,{children:[(0,h.jsx)(m.AW,{path:"/",element:(0,h.jsx)(Q.TechDocsIndexPage,{})}),(0,h.jsx)(m.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(N.TechDocsReaderPage,{})})]}),ie=R=>{var I;const{children:k}=R,{entity:O}=(0,T.X2)(),A=(0,m.V$)([{path:"/*",element:(0,h.jsx)(q,{entity:O}),children:[{path:"*",element:k}]}]);return((I=O.metadata.annotations)===null||I===void 0?void 0:I[G])?A:(0,h.jsx)(z.sk,{annotation:G})}},92077:function(bt,Pe,t){"use strict";t.d(Pe,{k:function(){return z},p:function(){return T}});var h=t(23054),n=t(76372),m=t.n(n);class T{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:B,namespace:te,name:q}=l,N=`${await this.getApiOrigin()}/metadata/techdocs/${te}/${B}/${q}`,G=await this.fetchApi.fetch(`${N}`);if(!G.ok)throw await h.VL.fromResponse(G);return await G.json()}async getEntityMetadata(l){const{kind:B,namespace:te,name:q}=l,N=`${await this.getApiOrigin()}/metadata/entity/${te}/${B}/${q}`,G=await this.fetchApi.fetch(`${N}`);if(!G.ok)throw await h.VL.fromResponse(G);return await G.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class z{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,B){const{kind:te,namespace:q,name:Q}=l,G=`${await this.getStorageUrl()}/${q}/${te}/${Q}/${B}`,H=await this.fetchApi.fetch(`${G.endsWith("/")?G:`${G}/`}index.html`);let ae="";switch(H.status){case 404:throw ae="Page not found. ",B||(ae+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ae);case 500:throw ae="Could not generate documentation or an error in the TechDocs backend. ",new Error(ae);default:break}return H.text()}async syncEntityDocs(l,B=()=>{}){const{kind:te,namespace:q,name:Q}=l,G=`${await this.getApiOrigin()}/sync/${q}/${te}/${Q}`,{token:H}=await this.identityApi.getCredentials();return new Promise((ae,ie)=>{const R=new n.EventSourcePolyfill(G,{withCredentials:!0,headers:H?{Authorization:`Bearer ${H}`}:{}});R.addEventListener("log",I=>{I.data&&B(JSON.parse(I.data))}),R.addEventListener("finish",I=>{let k=!1;I.data&&({updated:k}=JSON.parse(I.data)),ae(k?"updated":"cached")}),R.onerror=I=>{switch(R.close(),I.status){case 404:ie(new h.dR(I.message));return;default:ie(new Error(I.data));return}}})}async getBaseUrl(l,B,te){const{kind:q,namespace:Q,name:N}=B,H=`${await this.getApiOrigin()}/static/docs/${Q}/${q}/${N}/${te}`;return new URL(l,H.endsWith("/")?H:`${H}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(bt,Pe,t){"use strict";t.d(Pe,{D:function(){return h}});function h(n,m){return m.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(bt,Pe,t){"use strict";t.d(Pe,{u:function(){return B}});var h=t(52322),n=t(2784),m=t(1515),T=t(46285),z=t(42081),b=t(48431),l=t(68435);const B=te=>{const{initialFilter:q="owned",columns:Q,actions:N}=te;return(0,h.jsx)(z.j,{children:(0,h.jsxs)(m.VY,{children:[(0,h.jsx)(m.yW,{title:"",children:(0,h.jsx)(m.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(T.UO,{children:(0,h.jsxs)(T._i,{children:[(0,h.jsxs)(T._i.Filters,{children:[(0,h.jsx)(b.f,{}),(0,h.jsx)(T.EW,{initialFilter:q}),(0,h.jsx)(T.dq,{}),(0,h.jsx)(T.xE,{})]}),(0,h.jsx)(T._i.Content,{children:(0,h.jsx)(l.n,{actions:N,columns:Q})})]})})]})})}},85478:function(bt,Pe,t){"use strict";t.d(Pe,{f:function(){return Q}});var h=t(52322),n=t(95573),m=t(51953),T=t(25248),z=t(1515),b=t(94339),l=t(16111),B=t(24579),te=t(14503),q=t(2784);const Q=H=>{const{entities:ae}=H,ie=(0,T.tg)(n.Fw),R=(0,T.h_)(T.Ds);if(!ae)return null;var I,k;return(0,h.jsx)(z.Oh,{"data-testid":"docs-explore",children:ae!=null&&ae.length?ae.map((O,A)=>(0,h.jsxs)(b.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(z.hu,{title:(I=O.metadata.title)!==null&&I!==void 0?I:O.metadata.name})}),(0,h.jsx)(B.Z,{children:O.metadata.description}),(0,h.jsx)(te.Z,{children:(0,h.jsx)(z.zx,{to:ie({namespace:(0,m.D)((k=O.metadata.namespace)!==null&&k!==void 0?k:"default",R),kind:(0,m.D)(O.kind,R),name:(0,m.D)(O.metadata.name,R)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},A)):null})};var N=t(46285);const G=()=>{const{loading:H,error:ae,entities:ie}=useEntityList();if(ae)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:ae.toString()})});if(H||!ie)return _jsx(Progress,{});var R,I;return ie.sort((k,O)=>((R=k.metadata.title)!==null&&R!==void 0?R:k.metadata.name).localeCompare((I=O.metadata.title)!==null&&I!==void 0?I:O.metadata.name)),_jsx(DocsCardGrid,{entities:ie})}},68435:function(bt,Pe,t){"use strict";t.d(Pe,{H:function(){return k},n:function(){return O}});var h=t(52322),n=t(2784),m=t(95074),T=t(76635),z=t(1515),b=t(46285),l=t(25248),B=t(25271),te=t(95573),q=t(39981),Q=t(2337),N=t(11640),G=t(28347);const H=(0,Q.Z)({root:{color:"#f3ba37"}})(N.Z),ae={createCopyDocsUrlAction(A){return ee=>({icon:()=>(0,h.jsx)(q.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>A(`${window.location.origin}${ee.resolved.docsUrl}`)})},createStarEntityAction(A,ee){return({entity:pe})=>{const Ke=A(pe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ke?(0,h.jsx)(H,{}):(0,h.jsx)(G.Z,{}),tooltip:Ke?"Remove from favorites":"Add to favorites",onClick:()=>ee(pe)}}}};function ie(A){return A.metadata.title||A.metadata.name}const R={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:A=>(0,h.jsx)(z.uw,{value:(0,h.jsx)(z.rU,{to:A.resolved.docsUrl,children:ie(A.entity)}),subvalue:A.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:A})=>(0,h.jsx)(b.rI,{entityRefs:A.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var I=t(51953);const k=A=>{const{entities:ee,title:pe,loading:Ke,columns:qe,actions:He}=A,[,Je]=(0,m.Z)(),Ye=(0,l.tg)(te.Fw),Ue=(0,l.h_)(l.Ds);if(!ee)return null;const ze=ee.map(ct=>{const nt=(0,b.hF)(ct,B.S4);var Ce;return{entity:ct,resolved:{docsUrl:Ye({namespace:(0,I.D)((Ce=ct.metadata.namespace)!==null&&Ce!==void 0?Ce:"default",Ue),kind:(0,I.D)(ct.kind,Ue),name:(0,I.D)(ct.metadata.name,Ue)}),ownedByRelations:nt,ownedByRelationsTitle:nt.map(rt=>(0,b.$3)(rt,{defaultKind:"group"})).join(", ")}}}),tt=[R.createNameColumn(),R.createOwnerColumn(),R.createTypeColumn()],lt=[ae.createCopyDocsUrlAction(Je)];return(0,h.jsx)(h.Fragment,{children:Ke||ze&&ze.length>0?(0,h.jsx)(z.iA,{isLoading:Ke,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:ze,columns:qe||tt,actions:He||lt,title:pe?`${pe} (${ze.length})`:`All (${ze.length})`}):(0,h.jsx)(z.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(z.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};k.columns=R,k.actions=ae;const O=A=>{var ee;const{columns:pe,actions:Ke}=A,{loading:qe,error:He,entities:Je,filters:Ye}=(0,b.wp)(),{isStarredEntity:Ue,toggleStarredEntity:ze}=(0,b.CR)(),[,tt]=(0,m.Z)();var lt;const ct=(0,T.capitalize)((lt=(ee=Ye.user)===null||ee===void 0?void 0:ee.value)!==null&&lt!==void 0?lt:"all"),nt=[ae.createCopyDocsUrlAction(tt),ae.createStarEntityAction(Ue,ze)];return He?(0,h.jsx)(z.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(z.Oi,{language:"text",text:He.toString()})}):(0,h.jsx)(k,{title:ct,entities:Je,loading:qe,actions:Ke||nt,columns:pe})};O.columns=R,O.actions=ae},18662:function(bt,Pe,t){"use strict";t.r(Pe),t.d(Pe,{TechDocsIndexPage:function(){return z}});var h=t(52322),n=t(2784),m=t(10289),T=t(3482);const z=b=>(0,m.pC)()||(0,h.jsx)(T.u,{...b})},42081:function(bt,Pe,t){"use strict";t.d(Pe,{j:function(){return z}});var h=t(52322),n=t(2784),m=t(1515),T=t(25248);const z=b=>{const{children:l}=b,B=(0,T.h_)(T.Ds);var te;const q=`Documentation available in ${(te=B.getOptionalString("organization.name"))!==null&&te!==void 0?te:"Backstage"}`;return(0,h.jsx)(m.g9,{title:"Documentation",subtitle:q,themeId:"documentation",children:l})}},48431:function(bt,Pe,t){"use strict";t.d(Pe,{f:function(){return T}});var h=t(2784),n=t(46285);class m{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const T=()=>{const{updateFilters:z}=(0,n.wp)();return(0,h.useEffect)(()=>{z({techdocs:new m})},[z]),null}},89258:function(bt,Pe,t){"use strict";t.d(Pe,{I6:function(){return q},Jl:function(){return te},s4:function(){return z}});var h=t(61886),n=t(92077),m=t(95573),T=t(25248);const z=(0,T.rx)({id:"techdocs",apis:[(0,T.ni)({api:h.Dl,deps:{configApi:T.Ds,discoveryApi:T.NW,identityApi:T.$4,fetchApi:T.gP},factory:({configApi:Q,discoveryApi:N,identityApi:G,fetchApi:H})=>new n.k({configApi:Q,discoveryApi:N,identityApi:G,fetchApi:H})}),(0,T.ni)({api:h.gT,deps:{configApi:T.Ds,discoveryApi:T.NW,fetchApi:T.gP},factory:({configApi:Q,discoveryApi:N,fetchApi:G})=>new n.p({configApi:Q,discoveryApi:N,fetchApi:G})})],routes:{root:m._Z,docRoot:m.Fw,entityContent:m.pd}}),b=z.provide((0,T.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(Q=>Q.Router),mountPoint:m._Z})),l=z.provide((0,T.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(Q=>Q.EmbeddedDocsRouter),mountPoint:m.pd})),B=z.provide((0,T.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(Q=>Q.TechDocsCustomHome),mountPoint:m._Z})),te=z.provide((0,T.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(Q=>Q.TechDocsIndexPage),mountPoint:m._Z})),q=z.provide((0,T.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(Q=>Q.TechDocsReaderPage),mountPoint:m.Fw}))},7476:function(bt,Pe,t){"use strict";t.r(Pe),t.d(Pe,{TechDocsReaderLayout:function(){return Q},TechDocsReaderPage:function(){return N}});var h=t(52322),n=t(2784),m=t(10289),T=t(1515),z=t(61886),b=t(67896),l=t(93225),B=t(65124),te=t(95573),q=t(25248);const Q=({withSearch:G,withHeader:H=!0})=>(0,h.jsxs)(T.T3,{themeId:"documentation",children:[H&&(0,h.jsx)(l.S,{}),(0,h.jsx)(B.b,{}),(0,h.jsx)(b.F,{withSearch:G})]}),N=G=>{const{kind:H,name:ae,namespace:ie}=(0,q.Oi)(te.Fw),{children:R,entityRef:I={kind:H,name:ae,namespace:ie}}=G,k=(0,m.pC)();if(!R){const A=(k?n.Children.toArray(k.props.children):[]).find(ee=>{var pe,Ke;if((0,q.IY)(ee,z.Zz))return!1;const qe=(pe=ee)===null||pe===void 0||(Ke=pe.props)===null||Ke===void 0?void 0:Ke.children;return qe?!n.Children.toArray(qe).some(He=>(0,q.IY)(He,z.Zz)):!0});return(0,h.jsx)(z.ZS,{entityRef:I,children:A||(0,h.jsx)(Q,{})})}return(0,h.jsx)(z.ZS,{entityRef:I,children:({metadata:O,entityMetadata:A,onReady:ee})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(T.T3,{themeId:"documentation",children:R instanceof Function?R({entityRef:I,techdocsMetadataValue:O.value,entityMetadataValue:A.value,onReady:ee}):R})})})}},67896:function(bt,Pe,t){"use strict";t.d(Pe,{F:function(){return Ht}});var h=t(52322),n=t(2784),m=t(79692),T=t(60905),z=t(61886),b=t(1515),l=t(17339),B=t(4614),te=t(77277),q=t(99688),Q=t(12420),N=t(90436),G=t(61837),H=t(4190),ae=t(87685);const ie=(0,m.Z)(E=>(0,Q.Z)({paper:{width:"100%",[E.breakpoints.up("sm")]:{width:"75%"},[E.breakpoints.up("md")]:{width:"50%"},padding:E.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:E.palette.background.default}})),R=({buildLog:E,onClose:X})=>{const ye=ie(),fe=E.length===0?"Waiting for logs...":E.join(`
32
+ `);return(0,h.jsxs)(T.Z,{container:!0,direction:"column",className:ye.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(T.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(N.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(G.Z,{title:"Close the drawer",onClick:X,color:"inherit",children:(0,h.jsx)(ae.Z,{})},"dismiss")]}),(0,h.jsx)(b.nU,{text:fe,classes:{root:ye.logs}})]})},I=({buildLog:E})=>{const X=ie(),[ye,fe]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(te.Z,{color:"inherit",onClick:()=>fe(!0),children:"Show Build Logs"}),(0,h.jsx)(H.ZP,{classes:{paper:X.paper},anchor:"right",open:ye,onClose:()=>fe(!1),children:(0,h.jsx)(R,{buildLog:E,onClose:()=>fe(!1)})})]})};var k=t(25248);const O=({errorMessage:E})=>{const X=(0,k.h_)(k.Ds).getOptionalString("techdocs.builder");let ye="";return X!=="local"&&(ye="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)(b.mf,{status:"404",statusMessage:E||"Documentation not found",additionalInfo:ye})};var A=t(95481);const ee=(0,m.Z)(E=>({root:{marginBottom:E.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),pe=()=>{let E=null;const X=ee(),{state:ye,contentReload:fe,contentErrorMessage:ke,syncErrorMessage:De,buildLog:yt}=(0,A.DK)();return ye==="INITIAL_BUILD"&&(E=(0,h.jsx)(q.Z,{classes:{root:X.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(B.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:yt}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),ye==="CONTENT_STALE_REFRESHING"&&(E=(0,h.jsx)(q.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(B.Z,{size:"24px"}),action:(0,h.jsx)(I,{buildLog:yt}),classes:{root:X.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),ye==="CONTENT_STALE_READY"&&(E=(0,h.jsx)(q.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(te.Z,{color:"inherit",onClick:()=>fe(),children:"Refresh"}),classes:{root:X.root},children:"A newer version of this documentation is now available, please refresh to view."})),ye==="CONTENT_STALE_ERROR"&&(E=(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:yt}),classes:{root:X.root,message:X.message},children:["Building a newer version of this documentation failed."," ",De]})),ye==="CONTENT_NOT_FOUND"&&(E=(0,h.jsxs)(h.Fragment,{children:[De&&(0,h.jsxs)(q.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(I,{buildLog:yt}),classes:{root:X.root,message:X.message},children:["Building a newer version of this documentation failed."," ",De]}),(0,h.jsx)(O,{errorMessage:ke})]})),E};var Ke=t(10289),qe=t(60364),He=t(41156),Je=t(32838),Ye=t(35368),Ue=t.n(Ye);const ze=/main\.[A-Fa-f0-9]{8}\.min\.css$/,tt=/^https:\/\/fonts\.googleapis\.com/,lt=/^https:\/\/fonts\.gstatic\.com/,ct=E=>E.nodeName==="LINK",nt=E=>{const X=(E==null?void 0:E.getAttribute("href"))||"",ye=X.match(ze),fe=X.match(tt),ke=X.match(lt);return ye||fe||ke},Ce=E=>(ct(E)&&!nt(E)&&E.remove(),E),rt=E=>E.nodeName==="IFRAME",gt=(E,X)=>{const ye=E.getAttribute("src")||"";try{const{host:fe}=new URL(ye);return X.includes(fe)}catch{return!1}},Le=E=>X=>(rt(X)&&!gt(X,E)&&X.remove(),X),se=()=>{const E=(0,k.h_)(k.Ds);return(0,n.useMemo)(()=>E.getOptionalConfig("techdocs.sanitizer"),[E])},xe=()=>{const E=se();return(0,n.useCallback)(async X=>{const ye=E==null?void 0:E.getOptionalStringArray("allowedIframeHosts");Ue().addHook("beforeSanitizeElements",Ce);const fe=["link"];return ye&&(fe.push("iframe"),Ue().addHook("beforeSanitizeElements",Le(ye))),Ue().sanitize(X.innerHTML,{ADD_TAGS:fe,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[E])};var Re=t(41128),st=({theme:E})=>`
33
+ /*================== Variables ==================*/
34
+ /*
35
+ As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
36
+ As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
37
+ */
38
+
39
+ :host {
40
+ /* FONT */
41
+ --md-default-fg-color: ${E.palette.text.primary};
42
+ --md-default-fg-color--light: ${E.palette.text.secondary};
43
+ --md-default-fg-color--lighter: ${(0,Re.$n)(E.palette.text.secondary,.7)};
44
+ --md-default-fg-color--lightest: ${(0,Re.$n)(E.palette.text.secondary,.3)};
45
+
46
+ /* BACKGROUND */
47
+ --md-default-bg-color:${E.palette.background.default};
48
+ --md-default-bg-color--light: ${E.palette.background.paper};
49
+ --md-default-bg-color--lighter: ${(0,Re.$n)(E.palette.background.paper,.7)};
50
+ --md-default-bg-color--lightest: ${(0,Re.$n)(E.palette.background.paper,.3)};
51
+
52
+ /* PRIMARY */
53
+ --md-primary-fg-color: ${E.palette.primary.main};
54
+ --md-primary-fg-color--light: ${E.palette.primary.light};
55
+ --md-primary-fg-color--dark: ${E.palette.primary.dark};
56
+ --md-primary-bg-color: ${E.palette.primary.contrastText};
57
+ --md-primary-bg-color--light: ${(0,Re.$n)(E.palette.primary.contrastText,.7)};
58
+
59
+ /* ACCENT */
60
+ --md-accent-fg-color: var(--md-primary-fg-color);
61
+
62
+ /* SHADOW */
63
+ --md-shadow-z1: ${E.shadows[1]};
64
+ --md-shadow-z2: ${E.shadows[2]};
65
+ --md-shadow-z3: ${E.shadows[3]};
66
+
67
+ /* EXTENSIONS */
68
+ --md-admonition-fg-color: var(--md-default-fg-color);
69
+ --md-admonition-bg-color: var(--md-default-bg-color);
70
+ /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
71
+ --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
72
+ --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
73
+ --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
74
+ --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
75
+ --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
76
+ --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
77
+ --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
78
+ --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
79
+ --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
80
+ --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
81
+ --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
82
+ --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
83
+ --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
84
+ --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
85
+ --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
86
+ --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
87
+ --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
88
+ --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
89
+ --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
90
+ --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
91
+ --md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
92
+ --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
93
+ --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
94
+ --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
95
+ --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
96
+ --md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
97
+ }
98
+
99
+ :host > * {
100
+ /* CODE */
101
+ --md-code-fg-color: ${E.palette.text.primary};
102
+ --md-code-bg-color: ${E.palette.background.paper};
103
+ --md-code-hl-color: ${(0,Re.Fq)(E.palette.warning.main,.5)};
104
+ --md-code-hl-keyword-color: ${E.palette.type==="dark"?E.palette.primary.light:E.palette.primary.dark};
105
+ --md-code-hl-function-color: ${E.palette.type==="dark"?E.palette.secondary.light:E.palette.secondary.dark};
106
+ --md-code-hl-string-color: ${E.palette.type==="dark"?E.palette.success.light:E.palette.success.dark};
107
+ --md-code-hl-number-color: ${E.palette.type==="dark"?E.palette.error.light:E.palette.error.dark};
108
+ --md-code-hl-constant-color: var(--md-code-hl-function-color);
109
+ --md-code-hl-special-color: var(--md-code-hl-function-color);
110
+ --md-code-hl-name-color: var(--md-code-fg-color);
111
+ --md-code-hl-comment-color: var(--md-default-fg-color--light);
112
+ --md-code-hl-generic-color: var(--md-default-fg-color--light);
113
+ --md-code-hl-variable-color: var(--md-default-fg-color--light);
114
+ --md-code-hl-operator-color: var(--md-default-fg-color--light);
115
+ --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
116
+
117
+ /* TYPESET */
118
+ --md-typeset-font-size: 1rem;
119
+ --md-typeset-color: var(--md-default-fg-color);
120
+ --md-typeset-a-color: var(--md-accent-fg-color);
121
+ --md-typeset-table-color: ${E.palette.text.primary};
122
+ --md-typeset-del-color: ${E.palette.type==="dark"?(0,Re.Fq)(E.palette.error.dark,.5):(0,Re.Fq)(E.palette.error.light,.5)};
123
+ --md-typeset-ins-color: ${E.palette.type==="dark"?(0,Re.Fq)(E.palette.success.dark,.5):(0,Re.Fq)(E.palette.success.light,.5)};
124
+ --md-typeset-mark-color: ${E.palette.type==="dark"?(0,Re.Fq)(E.palette.warning.dark,.5):(0,Re.Fq)(E.palette.warning.light,.5)};
125
+ }
126
+
127
+ @media screen and (max-width: 76.1875em) {
128
+ :host > * {
129
+ /* TYPESET */
130
+ --md-typeset-font-size: .9rem;
131
+ }
132
+ }
133
+
134
+ @media screen and (max-width: 600px) {
135
+ :host > * {
136
+ /* TYPESET */
137
+ --md-typeset-font-size: .7rem;
138
+ }
139
+ }
140
+ `,pt=({theme:E})=>`
141
+ /*================== Reset ==================*/
142
+
143
+ body {
144
+ --md-text-color: var(--md-default-fg-color);
145
+ --md-text-link-color: var(--md-accent-fg-color);
146
+ --md-text-font-family: ${E.typography.fontFamily};
147
+ font-family: var(--md-text-font-family);
148
+ background-color: unset;
149
+ }
150
+ `;const Ct="224px";var dt=({theme:E,sidebar:X})=>`
151
+ /*================== Layout ==================*/
152
+
153
+ .md-grid {
154
+ max-width: 100%;
155
+ margin: 0;
156
+ }
157
+
158
+ .md-nav {
159
+ font-size: calc(var(--md-typeset-font-size) * 0.9);
160
+ }
161
+ .md-nav__link {
162
+ display: flex;
163
+ align-items: center;
164
+ justify-content: space-between;
165
+ }
166
+ .md-nav__icon {
167
+ height: 20px !important;
168
+ width: 20px !important;
169
+ margin-left:${E.spacing(1)}px;
170
+ }
171
+ .md-nav__icon svg {
172
+ margin: 0;
173
+ width: 20px !important;
174
+ height: 20px !important;
175
+ }
176
+ .md-nav__icon:after {
177
+ width: 20px !important;
178
+ height: 20px !important;
179
+ }
180
+
181
+ .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
182
+ text-decoration: underline;
183
+ color: var(--md-typeset-a-color);
184
+ }
185
+
186
+ .md-main__inner {
187
+ margin-top: 0;
188
+ }
189
+
190
+ .md-sidebar {
191
+ bottom: 75px;
192
+ position: fixed;
193
+ width: 16rem;
194
+ overflow-y: auto;
195
+ overflow-x: hidden;
196
+ scrollbar-color: rgb(193, 193, 193) #eee;
197
+ scrollbar-width: thin;
198
+ }
199
+ .md-sidebar .md-sidebar__scrollwrap {
200
+ width: calc(12.1rem);
201
+ }
202
+ .md-sidebar--secondary {
203
+ right: ${E.spacing(3)}px;
204
+ }
205
+ .md-sidebar::-webkit-scrollbar {
206
+ width: 5px;
207
+ }
208
+ .md-sidebar::-webkit-scrollbar-button {
209
+ width: 5px;
210
+ height: 5px;
211
+ }
212
+ .md-sidebar::-webkit-scrollbar-track {
213
+ background: #eee;
214
+ border: 1 px solid rgb(250, 250, 250);
215
+ box-shadow: 0px 0px 3px #dfdfdf inset;
216
+ border-radius: 3px;
217
+ }
218
+ .md-sidebar::-webkit-scrollbar-thumb {
219
+ width: 5px;
220
+ background: rgb(193, 193, 193);
221
+ border: transparent;
222
+ border-radius: 3px;
223
+ }
224
+ .md-sidebar::-webkit-scrollbar-thumb:hover {
225
+ background: rgb(125, 125, 125);
226
+ }
227
+
228
+ .md-content {
229
+ max-width: calc(100% - 16rem * 2);
230
+ margin-left: 16rem;
231
+ margin-bottom: 50px;
232
+ }
233
+
234
+ .md-footer {
235
+ position: fixed;
236
+ bottom: 0px;
237
+ }
238
+ .md-footer__title {
239
+ background-color: unset;
240
+ }
241
+ .md-footer-nav__link {
242
+ width: 16rem;
243
+ }
244
+
245
+ .md-dialog {
246
+ background-color: unset;
247
+ }
248
+
249
+ @media screen and (min-width: 76.25em) {
250
+ .md-sidebar {
251
+ height: auto;
252
+ }
253
+ }
254
+
255
+ @media screen and (max-width: 76.1875em) {
256
+ .md-nav {
257
+ transition: none !important;
258
+ background-color: var(--md-default-bg-color)
259
+ }
260
+ .md-nav--primary .md-nav__title {
261
+ cursor: auto;
262
+ color: var(--md-default-fg-color);
263
+ font-weight: 700;
264
+ white-space: normal;
265
+ line-height: 1rem;
266
+ height: auto;
267
+ display: flex;
268
+ flex-flow: column;
269
+ row-gap: 1.6rem;
270
+ padding: 1.2rem .8rem .8rem;
271
+ background-color: var(--md-default-bg-color);
272
+ }
273
+ .md-nav--primary .md-nav__title~.md-nav__list {
274
+ box-shadow: none;
275
+ }
276
+ .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
277
+ border-top: none;
278
+ }
279
+ .md-nav--primary .md-nav__title .md-nav__button {
280
+ display: none;
281
+ }
282
+ .md-nav--primary .md-nav__title .md-nav__icon {
283
+ color: var(--md-default-fg-color);
284
+ position: static;
285
+ height: auto;
286
+ margin: 0 0 0 -0.2rem;
287
+ }
288
+ .md-nav--primary > .md-nav__title [for="none"] {
289
+ padding-top: 0;
290
+ }
291
+ .md-nav--primary .md-nav__item {
292
+ border-top: none;
293
+ }
294
+ .md-nav--primary :is(.md-nav__title,.md-nav__item) {
295
+ font-size : var(--md-typeset-font-size);
296
+ }
297
+ .md-nav .md-source {
298
+ display: none;
299
+ }
300
+
301
+ .md-sidebar {
302
+ height: 100%;
303
+ }
304
+ .md-sidebar--primary {
305
+ width: 12.1rem !important;
306
+ z-index: 200;
307
+ left: ${X.isPinned?`calc(-12.1rem + ${Ct})`:"calc(-12.1rem + 72px)"} !important;
308
+ }
309
+ .md-sidebar--secondary:not([hidden]) {
310
+ display: none;
311
+ }
312
+
313
+ .md-content {
314
+ max-width: 100%;
315
+ margin-left: 0;
316
+ }
317
+
318
+ .md-header__button {
319
+ margin: 0.4rem 0;
320
+ margin-left: 0.4rem;
321
+ padding: 0;
322
+ }
323
+
324
+ .md-overlay {
325
+ left: 0;
326
+ }
327
+
328
+ .md-footer {
329
+ position: static;
330
+ padding-left: 0;
331
+ }
332
+ .md-footer-nav__link {
333
+ /* footer links begin to overlap at small sizes without setting width */
334
+ width: 50%;
335
+ }
336
+ }
337
+
338
+ @media screen and (max-width: 600px) {
339
+ .md-sidebar--primary {
340
+ left: -12.1rem !important;
341
+ width: 12.1rem;
342
+ }
343
+ }
344
+ `;const jt=["h1","h2","h3","h4","h5","h6"];var St=({theme:E})=>`
345
+ /*================== Typeset ==================*/
346
+
347
+ .md-typeset {
348
+ font-size: var(--md-typeset-font-size);
349
+ }
350
+
351
+ ${jt.reduce((X,ye)=>{var fe;const ke=(fe=E.typography.htmlFontSize)!==null&&fe!==void 0?fe:16,De=E.typography[ye],{lineHeight:yt,fontFamily:Dt,fontWeight:_t,fontSize:Ut}=De,nn=kt=>{let rn=1;return typeof kt=="number"&&(rn=kt/ke*.6),typeof kt=="string"&&(rn=kt.replace("rem","")),`calc(${rn} * var(--md-typeset-font-size))`};return X.concat(`
352
+ .md-typeset ${ye} {
353
+ color: var(--md-default-fg-color);
354
+ line-height: ${yt};
355
+ font-family: ${Dt};
356
+ font-weight: ${_t};
357
+ font-size: ${nn(Ut)};
358
+ }
359
+ `)},"")}
360
+
361
+ .md-typeset .md-content__button {
362
+ color: var(--md-default-fg-color);
363
+ }
364
+
365
+ .md-typeset hr {
366
+ border-bottom: 0.05rem dotted ${E.palette.divider};
367
+ }
368
+
369
+ .md-typeset details {
370
+ font-size: var(--md-typeset-font-size) !important;
371
+ }
372
+ .md-typeset details summary {
373
+ padding-left: 2.5rem !important;
374
+ }
375
+ .md-typeset details summary:before,
376
+ .md-typeset details summary:after {
377
+ top: 50% !important;
378
+ width: 20px !important;
379
+ height: 20px !important;
380
+ transform: rotate(0deg) translateY(-50%) !important;
381
+ }
382
+ .md-typeset details[open] > summary:after {
383
+ transform: rotate(90deg) translateX(-50%) !important;
384
+ }
385
+
386
+ .md-typeset blockquote {
387
+ color: var(--md-default-fg-color--light);
388
+ border-left: 0.2rem solid var(--md-default-fg-color--light);
389
+ }
390
+
391
+ .md-typeset table:not([class]) {
392
+ font-size: var(--md-typeset-font-size);
393
+ border: 1px solid var(--md-default-fg-color);
394
+ border-bottom: none;
395
+ border-collapse: collapse;
396
+ }
397
+ .md-typeset table:not([class]) th {
398
+ font-weight: bold;
399
+ }
400
+ .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
401
+ border-bottom: 1px solid var(--md-default-fg-color);
402
+ }
403
+
404
+ .md-typeset pre > code::-webkit-scrollbar-thumb {
405
+ background-color: hsla(0, 0%, 0%, 0.32);
406
+ }
407
+ .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
408
+ background-color: hsla(0, 0%, 0%, 0.87);
409
+ }
410
+ `,Lt=()=>`
411
+ /*================== Animations ==================*/
412
+ /*
413
+ Disable CSS animations on link colors as they lead to issues in dark mode.
414
+ The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
415
+ */
416
+ .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
417
+ transition: none;
418
+ }
419
+ `,zt=({theme:E})=>`
420
+ /*================== Extensions ==================*/
421
+
422
+ /* HIGHLIGHT */
423
+ .highlight .md-clipboard:after {
424
+ content: unset;
425
+ }
426
+
427
+ .highlight .nx {
428
+ color: ${E.palette.type==="dark"?"#ff53a3":"#ec407a"};
429
+ }
430
+
431
+ /* CODE HILITE */
432
+ .codehilite .gd {
433
+ background-color: ${E.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
434
+ }
435
+
436
+ .codehilite .gi {
437
+ background-color: ${E.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
438
+ }
439
+
440
+ /* TABBED */
441
+ .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
442
+ .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
443
+ .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
444
+ .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
445
+ .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
446
+ .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
447
+ .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
448
+ .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
449
+ .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
450
+ .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
451
+ .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
452
+ .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
453
+ .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
454
+ .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
455
+ .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
456
+ .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
457
+ .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
458
+ .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
459
+ .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
460
+ .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
461
+ color: var(--md-accent-fg-color);
462
+ border-color: var(--md-accent-fg-color);
463
+ }
464
+
465
+ /* TASK-LIST */
466
+ .task-list-control .task-list-indicator::before {
467
+ background-color: ${E.palette.action.disabledBackground};
468
+ }
469
+ .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
470
+ background-color: ${E.palette.success.main};
471
+ }
472
+
473
+ /* ADMONITION */
474
+ .admonition {
475
+ font-size: var(--md-typeset-font-size) !important;
476
+ }
477
+ .admonition .admonition-title {
478
+ padding-left: 2.5rem !important;
479
+ }
480
+
481
+ .admonition .admonition-title:before {
482
+ top: 50% !important;
483
+ width: 20px !important;
484
+ height: 20px !important;
485
+ transform: translateY(-50%) !important;
486
+ }
487
+ `;const mt=[st,pt,dt,St,Lt,zt],ln=()=>(0,b.Pf)(),Nt=()=>{const E=ln(),X=(0,qe.Z)();return(0,n.useMemo)(()=>{const ye={theme:X,sidebar:E};return mt.reduce((fe,ke)=>fe+ke(ye),"")},[X,E])},dn=()=>{const E=Nt();return(0,n.useCallback)(X=>(X.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${E}</style>`),X),[E])},un=(E,X,ye)=>{const fe=E==="src"&&X.endsWith(".svg"),ke=!X.match(/^([a-z]*:)?\/\//i),De=X.startsWith(ye);return fe&&(ke||De)},Ln=({techdocsStorageApi:E,entityId:X,path:ye})=>async fe=>{const ke=await E.getApiOrigin(),De=async(yt,Dt)=>{for(const _t of yt)if(_t.hasAttribute(Dt)){const Ut=_t.getAttribute(Dt);if(!Ut)return;const nn=await E.getBaseUrl(Ut,X,ye);if(un(Dt,Ut,ke))try{const rn=await(await fetch(nn,{credentials:"include"})).text();_t.setAttribute(Dt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(rn)))}`)}catch{_t.setAttribute("alt",`Error: ${Ut}`)}else _t.setAttribute(Dt,nn)}};return await Promise.all([De(fe.querySelectorAll("img"),"src"),De(fe.querySelectorAll("script"),"src"),De(fe.querySelectorAll("source"),"src"),De(fe.querySelectorAll("link"),"href"),De(fe.querySelectorAll("a[download]"),"href")]),fe};var fn=t(39619),On=t(67097),Ee=t(28316),Te=t(82717),Be=t.n(Te);const We=E=>X=>{var ye;const fe=X.querySelector('[title="Edit this page"]');if(!fe||!fe.href)return X;const ke=new URL(fe.href),De=E.byUrl(ke);if((De==null?void 0:De.type)!=="github"&&(De==null?void 0:De.type)!=="gitlab")return X;const yt=((ye=X.querySelector("article>h1"))===null||ye===void 0?void 0:ye.childNodes[0].textContent)||"",Dt=encodeURIComponent(`Documentation Feedback: ${yt}`),_t=encodeURIComponent(`Page source:
488
+ ${fe.href}
489
+
490
+ Feedback:`),Ut=(De==null?void 0:De.type)==="github"?(0,fn.Pb)(ke.href,"blob"):ke.href,nn=Be()(Ut),kt=`/${nn.organization}/${nn.name}`,rn=fe.cloneNode();switch(De==null?void 0:De.type){case"gitlab":rn.href=`${ke.origin}${kt}/issues/new?issue[title]=${Dt}&issue[description]=${_t}`;break;case"github":rn.href=`${ke.origin}${kt}/issues/new?title=${Dt}&body=${_t}`;break;default:return X}return Ee.render(n.createElement(On.Z),rn),rn.style.paddingLeft="5px",rn.title="Leave feedback for this page",rn.id="git-feedback-link",fe==null||fe.insertAdjacentElement("beforebegin",rn),X};var _e=t(44882);const at=()=>E=>{const X=E.querySelector('.md-header label[for="__drawer"]'),ye=E.querySelector("article");if(!X||!ye)return E;const fe=X.cloneNode();return Ee.render(n.createElement(_e.Z),fe),fe.id="toggle-sidebar",fe.title="Toggle Sidebar",fe.classList.add("md-content__button"),fe.style.setProperty("padding","0 0 0 5px"),fe.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ye==null||ye.prepend(fe),E},ht=()=>E=>(((ye,fe)=>{Array.from(ye).filter(ke=>ke.hasAttribute(fe)).forEach(ke=>{const De=ke.getAttribute(fe);if(De){De.match(/^https?:\/\//i)&&ke.setAttribute("target","_blank");try{const yt=wt(window.location.href);ke.setAttribute(fe,new URL(De,yt).toString())}catch{ke.replaceWith(ke.textContent||De)}}})})(Array.from(E.getElementsByTagName("a")),"href"),E);function wt(E){const X=new URL(E);return!X.pathname.endsWith("/")&&!X.pathname.endsWith(".html")&&(X.pathname+="/"),X.toString()}const Tt=({baseUrl:E,onClick:X})=>ye=>(Array.from(ye.getElementsByTagName("a")).forEach(fe=>{fe.addEventListener("click",ke=>{const yt=fe.getAttribute("href");!yt||yt.startsWith(E)&&!fe.hasAttribute("download")&&(ke.preventDefault(),X(ke,yt))})}),ye);var Pt=t(15459),It=t(80030),oe=t(72379),W=t(41547);const he=(0,Pt.Z)(E=>({tooltip:{fontSize:"inherit",color:E.palette.text.primary,margin:0,padding:E.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(It.ZP),ve=()=>(0,h.jsx)(oe.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"})}),be=({text:E})=>{const[X,ye]=(0,n.useState)(!1),fe=(0,n.useCallback)(()=>{navigator.clipboard.writeText(E),ye(!0)},[E]),ke=(0,n.useCallback)(()=>{ye(!1)},[ye]);return(0,h.jsx)(he,{title:"Copied to clipboard",placement:"left",open:X,onClose:ke,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:fe,children:(0,h.jsx)(ve,{})})})},Ge=E=>X=>{const ye=X.querySelectorAll("pre > code");for(const ke of ye){var fe;const De=ke.textContent||"",yt=document.createElement("div");ke==null||(fe=ke.parentElement)===null||fe===void 0||fe.prepend(yt),Ee.render((0,h.jsx)(W.Z,{theme:E,children:(0,h.jsx)(be,{text:De})}),yt)}return X},V=()=>E=>{var X;return(X=E.querySelector(".md-header"))===null||X===void 0||X.remove(),E},S=()=>E=>{var X,ye;return(X=E.querySelector(".md-footer .md-copyright"))===null||X===void 0||X.remove(),(ye=E.querySelector(".md-footer-copyright"))===null||ye===void 0||ye.remove(),E},K=({onLoading:E,onLoaded:X})=>ye=>(E(),ye.addEventListener(z.Ox,function fe(){X(),ye.removeEventListener(z.Ox,fe)}),ye),Ae=()=>E=>(setTimeout(()=>{if(window.location.hash){var X;const ye=window.location.hash.slice(1);(X=E==null?void 0:E.querySelector(`[id="${ye}"]`))===null||X===void 0||X.scrollIntoView()}},200),E),Oe=()=>E=>(setTimeout(()=>{const X=E==null?void 0:E.querySelectorAll("li.md-nav__item--active");X.length!==0&&(X.forEach(fe=>{const ke=fe==null?void 0:fe.querySelector("input");ke!=null&&ke.checked||ke==null||ke.click()}),X[X.length-1].scrollIntoView())},200),E),Ve=async(E,X)=>{let ye;if(typeof E=="string")ye=new DOMParser().parseFromString(E,"text/html").documentElement;else if(E instanceof Element)ye=E;else throw new Error("dom is not a recognized type");for(const fe of X)ye=await fe(ye);return ye},ot="screen and (max-width: 76.1875em)",Ft=E=>{const X=(0,Ke.s0)(),ye=(0,qe.Z)(),fe=(0,He.Z)(ot),ke=xe(),De=dn(),yt=(0,k.h_)(z.Dl),Dt=(0,k.h_)(Je.q3),{state:_t,path:Ut,content:nn}=(0,A.DK)(),[kt,rn]=(0,n.useState)(null),Gn=(0,z.ux)(kt),En=(0,n.useCallback)(()=>{if(!kt)return;kt.querySelectorAll(".md-sidebar").forEach(x=>{if(fe)x.style.top="0px";else{const Y=document==null?void 0:document.querySelector(".techdocs-reader-page");var u;const de=(u=Y==null?void 0:Y.getBoundingClientRect().top)!==null&&u!==void 0?u:0;var y;let ge=(y=kt.getBoundingClientRect().top)!==null&&y!==void 0?y:0;const Ie=kt.querySelector(".md-container > .md-tabs");var C;const et=(C=Ie==null?void 0:Ie.getBoundingClientRect().height)!==null&&C!==void 0?C:0;ge<de&&(ge=de),x.style.top=`${Math.max(ge,0)+et}px`}x.style.setProperty("opacity","1")})},[kt,fe]);(0,n.useEffect)(()=>(window.addEventListener("resize",En),window.addEventListener("scroll",En,!0),()=>{window.removeEventListener("resize",En),window.removeEventListener("scroll",En,!0)}),[kt,En]);const $n=(0,n.useCallback)(()=>{if(!kt)return;const Wt=kt.querySelector(".md-footer");Wt&&(Wt.style.width=`${kt.getBoundingClientRect().width}px`)},[kt]);(0,n.useEffect)(()=>(window.addEventListener("resize",$n),()=>{window.removeEventListener("resize",$n)}),[kt,$n]),(0,n.useEffect)(()=>{Gn||($n(),En())},[_t,Gn,$n,En]);const Bn=(0,n.useCallback)((Wt,x)=>Ve(Wt,[ke,Ln({techdocsStorageApi:yt,entityId:E,path:x}),ht(),at(),V(),S(),We(Dt),De]),[E,Dt,yt,ke,De]),qn=(0,n.useCallback)(async Wt=>Ve(Wt,[Ae(),Oe(),Ge(ye),Tt({baseUrl:window.location.origin,onClick:(x,u)=>{const y=x.ctrlKey||x.metaKey,C=new URL(u);if(C.hash)if(y)window.open(`${C.pathname}${C.hash}`,"_blank");else{var Y;X(`${C.pathname}${C.hash}`),(Y=Wt==null?void 0:Wt.querySelector(`[id="${C.hash.slice(1)}"]`))===null||Y===void 0||Y.scrollIntoView()}else y?window.open(C.pathname,"_blank"):X(C.pathname)}}),K({onLoading:()=>{},onLoaded:()=>{var x;(x=Wt.querySelector(".md-nav__title"))===null||x===void 0||x.removeAttribute("for")}}),K({onLoading:()=>{Array.from(Wt.querySelectorAll(".md-sidebar")).forEach(u=>{u.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ye,X]);return(0,n.useEffect)(()=>{if(!nn)return()=>{};let Wt=!0;return Bn(nn,Ut).then(async x=>{if(!(x!=null&&x.innerHTML)||!Wt)return;window.scroll({top:0});const u=await qn(x);rn(u)}),()=>{Wt=!1}},[nn,Ut,Bn,qn]),kt};var Zt=t(8560);const qt=()=>{const E=(0,z.$L)(),{shadowRoot:X}=(0,z.x1)(),ye=X==null?void 0:X.querySelector('[data-md-component="content"]'),fe=X==null?void 0:X.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ke=fe==null?void 0:fe.querySelector('[data-techdocs-addons-location="primary sidebar"]');ke||(ke=document.createElement("div"),ke.setAttribute("data-techdocs-addons-location","primary sidebar"),fe==null||fe.prepend(ke));const De=X==null?void 0:X.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let yt=De==null?void 0:De.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return yt||(yt=document.createElement("div"),yt.setAttribute("data-techdocs-addons-location","secondary sidebar"),De==null||De.prepend(yt)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Zt.Z,{container:ke,children:E.renderComponentsByLocation(z.oZ.PrimarySidebar)}),(0,h.jsx)(Zt.Z,{container:ye,children:E.renderComponentsByLocation(z.oZ.Content)}),(0,h.jsx)(Zt.Z,{container:yt,children:E.renderComponentsByLocation(z.oZ.SecondarySidebar)})]})},Vt=(0,m.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Ht=(0,A.m1)(E=>{var X;const{withSearch:ye=!0,onReady:fe}=E,ke=Vt(),{entityMetadata:{value:De,loading:yt},entityRef:Dt,setShadowRoot:_t}=(0,z.x1)(),Ut=Ft(Dt),nn=(0,n.useCallback)(kt=>{_t(kt),fe instanceof Function&&fe()},[_t,fe]);return yt===!1&&!De?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ut?(0,h.jsx)(b.VY,{children:(0,h.jsxs)(T.Z,{container:!0,children:[(0,h.jsx)(T.Z,{xs:12,item:!0,children:(0,h.jsx)(pe,{})}),ye&&(0,h.jsx)(T.Z,{className:ke.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:Dt,entityTitle:De==null||(X=De.metadata)===null||X===void 0?void 0:X.title})}),(0,h.jsx)(T.Z,{xs:12,item:!0,children:(0,h.jsx)(z.VA,{element:Ut,onAppend:nn,children:(0,h.jsx)(qt,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)(T.Z,{container:!0,children:(0,h.jsx)(T.Z,{xs:12,item:!0,children:(0,h.jsx)(pe,{})})})})}),jn=null},93225:function(bt,Pe,t){"use strict";t.d(Pe,{S:function(){return G}});var h=t(52322),n=t(2784),m=t(18671),T=t(98069),z=t(73250),b=t(61886),l=t(46285),B=t(25271),te=t(1515),q=t(25248),Q=t(95573);const N=(0,h.jsx)(T.Z,{animation:"wave",variant:"text",height:40}),G=H=>{const{children:ae}=H,ie=(0,b.$L)(),R=(0,q.h_)(q.Ds),{title:I,setTitle:k,subtitle:O,setSubtitle:A,entityRef:ee,metadata:{value:pe,loading:Ke},entityMetadata:{value:qe,loading:He}}=(0,b.x1)();(0,n.useEffect)(()=>{!pe||(k(pe.site_name),A(()=>{let{site_description:gt}=pe;return(!gt||gt==="None")&&(gt="Home"),gt}))},[pe,k,A]);const Je=R.getOptional("app.title")||"Backstage",Ye=[I,O,Je].filter(Boolean).join(" | "),{locationMetadata:Ue,spec:ze}=qe||{},tt=ze==null?void 0:ze.lifecycle,lt=qe?(0,l.hF)(qe,B.S4):[],ct=(0,q.tg)(Q._Z)(),nt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(te.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:ee,title:qe==null?void 0:qe.metadata.title,defaultKind:"Component"})}),lt.length>0&&(0,h.jsx)(te.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:lt,defaultKind:"group"})}),tt?(0,h.jsx)(te.i9,{label:"Lifecycle",value:tt}):null,Ue&&Ue.type!=="dir"&&Ue.type!=="file"?(0,h.jsx)(te.i9,{label:"",value:(0,h.jsx)("a",{href:Ue.target,target:"_blank",rel:"noopener noreferrer",children:(0,h.jsx)(z.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!He&&qe===void 0||!Ke&&pe===void 0?null:(0,h.jsxs)(te.h4,{type:"Documentation",typeLink:ct,title:I||N,subtitle:O||N,children:[(0,h.jsx)(m.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ye})}),nt,ae,ie.renderComponentsByLocation(b.oZ.Header)]})}},65124:function(bt,Pe,t){"use strict";t.d(Pe,{b:function(){return N}});var h=t(52322),n=t(2784),m=t(79692),T=t(15223),z=t(95544),b=t(80030),l=t(61837),B=t(48348),te=t(47603),q=t(61886);const Q=(0,m.Z)(G=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:G.spacing(3,3,0)}})),N=G=>{const H=Q(),[ae,ie]=(0,n.useState)(null),R=(0,n.useCallback)(Ke=>{ie(Ke.currentTarget)},[]),I=(0,n.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:k,loading:O}}=(0,q.x1)(),A=(0,q.$L)(),ee=A.renderComponentsByLocation(q.oZ.Subheader),pe=A.renderComponentsByLocation(q.oZ.Settings);return!ee&&!pe||O===!1&&!k?null:(0,h.jsx)(T.Z,{classes:H,...G.toolbarProps,children:(0,h.jsxs)(z.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[ee,pe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:R,children:(0,h.jsx)(te.Z,{})})}),(0,h.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ae,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ae),onClose:I,keepMounted:!0,children:pe})]}):null]})})}},95481:function(bt,Pe,t){"use strict";t.d(Pe,{DK:function(){return N},m1:function(){return H}});var h=t(52322),n=t(2784),m=t(10289),T=t(61886),z=t(25248),b=t(64279),l=t(77446);function B({contentLoading:ae,content:ie,activeSyncState:R}){return ae||R==="BUILD_READY_RELOAD"||!ie&&R==="CHECKING"?"CHECKING":!ie&&R==="BUILDING"?"INITIAL_BUILD":ie?R==="BUILDING"?"CONTENT_STALE_REFRESHING":R==="BUILD_READY"?"CONTENT_STALE_READY":R==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(ae,ie){const R={...ae};switch(ie.type){case"sync":ie.state==="CHECKING"&&(R.buildLog=[]),R.activeSyncState=ie.state,R.syncError=ie.syncError;break;case"contentLoading":R.contentLoading=!0,R.contentError=void 0;break;case"content":typeof ie.path=="string"&&(R.path=ie.path),R.contentLoading=!1,R.content=ie.content,R.contentError=ie.contentError;break;case"buildLog":R.buildLog=R.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(R.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(R.activeSyncState="UP_TO_DATE",R.buildLog=[]),R}function q(ae,ie,R,I){var k,O;const[A,ee]=(0,n.useReducer)(te,{activeSyncState:"CHECKING",path:I,contentLoading:!0,buildLog:[]}),pe=(0,z.h_)(T.Dl),{retry:Ke}=(0,l.Z)(async()=>{ee({type:"contentLoading"});try{const Je=await pe.getEntityDocs({kind:ae,namespace:ie,name:R},I);return ee({type:"content",content:Je,path:I}),Je}catch(Je){ee({type:"content",contentError:Je,path:I})}},[pe,ae,ie,R,I]),qe=(0,n.useRef)({content:void 0,reload:()=>{}});return qe.current={content:A.content,reload:Ke},(0,b.default)(async()=>{ee({type:"sync",state:"CHECKING"});const Je=setTimeout(()=>{ee({type:"sync",state:"BUILDING"})},1e3);try{switch(await pe.syncEntityDocs({kind:ae,namespace:ie,name:R},Ue=>{ee({type:"buildLog",log:Ue})})){case"updated":qe.current.content?ee({type:"sync",state:"BUILD_READY"}):(qe.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(Ye){ee({type:"sync",state:"ERROR",syncError:Ye})}finally{clearTimeout(Je)}},[ae,R,ie,pe,ee,qe]),{state:(0,n.useMemo)(()=>B({activeSyncState:A.activeSyncState,contentLoading:A.contentLoading,content:A.content}),[A.activeSyncState,A.content,A.contentLoading]),contentReload:Ke,path:A.path,content:A.content,contentErrorMessage:(k=A.contentError)===null||k===void 0?void 0:k.toString(),syncErrorMessage:(O=A.syncError)===null||O===void 0?void 0:O.toString(),buildLog:A.buildLog}}const Q=(0,n.createContext)({}),N=()=>(0,n.useContext)(Q),G=({children:ae})=>{const{"*":ie=""}=(0,m.UO)(),{entityRef:R}=(0,T.x1)(),{kind:I,namespace:k,name:O}=R,A=q(I,k,O,ie);return(0,h.jsx)(Q.Provider,{value:A,children:ae instanceof Function?ae(A):ae})},H=ae=>ie=>(0,h.jsx)(G,{children:(0,h.jsx)(ae,{...ie})})},95573:function(bt,Pe,t){"use strict";t.d(Pe,{Fw:function(){return m},_Z:function(){return n},pd:function(){return T}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),m=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),T=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(bt,Pe,t){"use strict";t.d(Pe,{S:function(){return I}});var h=t(52322),n=t(2784),m=t(79692),T=t(49378),z=t(38402),b=t(86136),l=t(85256),B=t(1515),te=t(25248),q=t(23362);const Q=(0,m.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),N=k=>{const{result:O,highlight:A,rank:ee,lineClamp:pe=5,asListItem:Ke=!0,asLink:qe=!0,title:He,icon:Je}=k,Ye=Q(),Ue=(0,te.z$)(),ze=()=>{Ue.captureEvent("discover",O.title,{attributes:{to:O.location},value:ee})},tt=()=>{const nt=A!=null&&A.fields.title?(0,h.jsx)(q.FA,{text:A.fields.title,preTag:A.preTag,postTag:A.postTag}):O.title,Ce=A!=null&&A.fields.entityTitle?(0,h.jsx)(q.FA,{text:A.fields.entityTitle,preTag:A.preTag,postTag:A.postTag}):O.entityTitle,rt=A!=null&&A.fields.name?(0,h.jsx)(q.FA,{text:A.fields.name,preTag:A.preTag,postTag:A.postTag}):O.name;return(0,h.jsx)(T.Z,{className:Ye.itemText,primaryTypographyProps:{variant:"h6"},primary:He||(0,h.jsxs)(h.Fragment,{children:[nt," | ",Ce!=null?Ce:rt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:pe,overflow:"hidden"},children:A!=null&&A.fields.text?(0,h.jsx)(q.FA,{text:A.fields.text,preTag:A.preTag,postTag:A.postTag}):O.text})})},lt=({children:nt})=>qe?(0,h.jsx)(B.rU,{noTrack:!0,to:O.location,onClick:ze,children:nt}):(0,h.jsx)(h.Fragment,{children:nt}),ct=({children:nt})=>Ke?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(z.Z,{alignItems:"flex-start",children:[Je&&(0,h.jsx)(b.Z,{children:Je}),(0,h.jsx)("div",{className:Ye.flexContainer,children:nt})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:nt});return(0,h.jsx)(lt,{children:(0,h.jsx)(ct,{children:(0,h.jsx)(tt,{})})})};var G=t(27556),H=t(10289);const ae=(0,m.Z)(k=>({root:{width:"100%"},bar:{padding:k.spacing(1)}})),ie=k=>k==null?void 0:k.document,R=k=>{const{entityId:O,entityTitle:A,debounceTime:ee=150}=k,[pe,Ke]=(0,n.useState)(!1),qe=(0,H.s0)(),{setFilters:He,result:{loading:Je,value:Ye}}=(0,q.Rx)(),Ue=ae(),[ze,tt]=(0,n.useState)([]);(0,n.useEffect)(()=>{let rt=!0;if(rt&&Ye){const gt=Ye.results.slice(0,10);tt(gt)}return()=>{rt=!1}},[Je,Ye]);const{kind:lt,name:ct,namespace:nt}=O;(0,n.useEffect)(()=>{He(rt=>({...rt,kind:lt,namespace:nt,name:ct}))},[lt,nt,ct,He]);const Ce=(rt,gt)=>{if(ie(gt)){const{location:Le}=gt.document;qe(Le)}};return(0,h.jsx)(G.Z,{className:Ue.bar,variant:"outlined",children:(0,h.jsx)(q.qO,{classes:{root:Ue.root},"data-testid":"techdocs-search-bar",size:"small",open:pe,getOptionLabel:()=>"",filterOptions:rt=>rt,onClose:()=>{Ke(!1)},onFocus:()=>{Ke(!0)},onChange:Ce,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:ze,renderOption:({document:rt,highlight:gt})=>(0,h.jsx)(N,{result:rt,lineClamp:3,asListItem:!1,asLink:!1,title:rt.title,highlight:gt}),loading:Je,inputDebounceTime:ee,inputPlaceholder:`Search ${A||O.name} docs`,freeSolo:!1})})},I=k=>{const O={term:"",types:["techdocs"],pageCursor:"",filters:k.entityId};return(0,h.jsx)(q.Nd,{initialState:O,children:(0,h.jsx)(R,{...k})})}},53260:function(){}},function(bt){var Pe=function(h){return bt(bt.s=h)};bt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Pe(96215)});var t=bt.O()}]);})();
491
+
492
+ //# sourceMappingURL=main.32844cc3.js.map