@techdocs/cli 1.4.4-next.0 → 1.4.4

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 (87) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/{PublisherConfig-a2649fb7.cjs.js → PublisherConfig-cbad5748.cjs.js} +11 -5
  3. package/dist/cjs/{PublisherConfig-a2649fb7.cjs.js.map → PublisherConfig-cbad5748.cjs.js.map} +1 -1
  4. package/dist/cjs/generate-d9c4c0d9.cjs.js.map +1 -1
  5. package/dist/cjs/{migrate-32510d4d.cjs.js → migrate-6884188f.cjs.js} +2 -2
  6. package/dist/cjs/{migrate-32510d4d.cjs.js.map → migrate-6884188f.cjs.js.map} +1 -1
  7. package/dist/cjs/mkdocs-582c42fd.cjs.js.map +1 -1
  8. package/dist/cjs/mkdocsServer-99ec8af2.cjs.js.map +1 -1
  9. package/dist/cjs/{publish-2c1fe164.cjs.js → publish-009fdf9f.cjs.js} +2 -2
  10. package/dist/cjs/{publish-2c1fe164.cjs.js.map → publish-009fdf9f.cjs.js.map} +1 -1
  11. package/dist/cjs/{serve-461aaf60.cjs.js → serve-552eaafd.cjs.js} +12 -1
  12. package/dist/cjs/{serve-461aaf60.cjs.js.map → serve-552eaafd.cjs.js.map} +1 -1
  13. package/dist/cjs/utility-3c0df5a9.cjs.js.map +1 -1
  14. package/dist/embedded-app/index.html +1 -1
  15. package/dist/embedded-app/static/1032.5be56bbf.chunk.js +3 -0
  16. package/dist/embedded-app/static/1032.5be56bbf.chunk.js.map +1 -0
  17. package/dist/embedded-app/static/{1049.fc74e20d.chunk.js → 1049.e59b8f46.chunk.js} +1 -1
  18. package/dist/embedded-app/static/{1049.fc74e20d.chunk.js.map → 1049.e59b8f46.chunk.js.map} +1 -1
  19. package/dist/embedded-app/static/1105.cbd84f5c.chunk.js +3 -0
  20. package/dist/embedded-app/static/1105.cbd84f5c.chunk.js.map +1 -0
  21. package/dist/embedded-app/static/184.78d680e0.chunk.js +3 -0
  22. package/dist/embedded-app/static/184.78d680e0.chunk.js.map +1 -0
  23. package/dist/embedded-app/static/2440.8f7574d6.chunk.js +3 -0
  24. package/dist/embedded-app/static/2440.8f7574d6.chunk.js.map +1 -0
  25. package/dist/embedded-app/static/5458.4a158b26.chunk.js +3 -0
  26. package/dist/embedded-app/static/5458.4a158b26.chunk.js.map +1 -0
  27. package/dist/embedded-app/static/{6051.e79907ed.chunk.js → 6051.e6ab645f.chunk.js} +1 -1
  28. package/dist/embedded-app/static/{6051.e79907ed.chunk.js.map → 6051.e6ab645f.chunk.js.map} +1 -1
  29. package/dist/embedded-app/static/732.fb0762a2.chunk.js +3 -0
  30. package/dist/embedded-app/static/732.fb0762a2.chunk.js.map +1 -0
  31. package/dist/embedded-app/static/{7560.d0f6ed99.chunk.js → 7560.8ef9e30a.chunk.js} +1 -1
  32. package/dist/embedded-app/static/{7560.d0f6ed99.chunk.js.map → 7560.8ef9e30a.chunk.js.map} +1 -1
  33. package/dist/embedded-app/static/{7670.8d59317d.chunk.js → 7670.714e8960.chunk.js} +1 -1
  34. package/dist/embedded-app/static/{7670.8d59317d.chunk.js.map → 7670.714e8960.chunk.js.map} +1 -1
  35. package/dist/embedded-app/static/{7750.fe6b6d6f.chunk.js → 7750.1b5340d0.chunk.js} +1 -1
  36. package/dist/embedded-app/static/{7750.fe6b6d6f.chunk.js.map → 7750.1b5340d0.chunk.js.map} +1 -1
  37. package/dist/embedded-app/static/{8951.bd3e96f5.chunk.js → 8951.fea20091.chunk.js} +1 -1
  38. package/dist/embedded-app/static/{8951.bd3e96f5.chunk.js.map → 8951.fea20091.chunk.js.map} +1 -1
  39. package/dist/embedded-app/static/{9323.9b74c02c.chunk.js → 9323.61727faa.chunk.js} +1 -1
  40. package/dist/embedded-app/static/{9323.9b74c02c.chunk.js.map → 9323.61727faa.chunk.js.map} +1 -1
  41. package/dist/embedded-app/static/9545.dea948d9.chunk.js +3 -0
  42. package/dist/embedded-app/static/9545.dea948d9.chunk.js.map +1 -0
  43. package/dist/embedded-app/static/9770.1e5df227.chunk.js +3 -0
  44. package/dist/embedded-app/static/9770.1e5df227.chunk.js.map +1 -0
  45. package/dist/embedded-app/static/main.fef15b74.js +522 -0
  46. package/dist/embedded-app/static/main.fef15b74.js.map +1 -0
  47. package/dist/embedded-app/static/{module-material-table.e97c8359.js → module-material-table.1d463a12.js} +2 -2
  48. package/dist/embedded-app/static/{module-material-table.e97c8359.js.map → module-material-table.1d463a12.js.map} +1 -1
  49. package/dist/embedded-app/static/module-material-ui.1afbaa53.js +51 -0
  50. package/dist/embedded-app/static/module-material-ui.1afbaa53.js.map +1 -0
  51. package/dist/embedded-app/static/{module-react-beautiful-dnd.c3c3faee.js → module-react-beautiful-dnd.ad887878.js} +2 -2
  52. package/dist/embedded-app/static/{module-react-beautiful-dnd.c3c3faee.js.map → module-react-beautiful-dnd.ad887878.js.map} +1 -1
  53. package/dist/embedded-app/static/{module-react-dom.d698fbed.js → module-react-dom.bd3fd0c6.js} +1 -1
  54. package/dist/embedded-app/static/{module-react-dom.d698fbed.js.map → module-react-dom.bd3fd0c6.js.map} +1 -1
  55. package/dist/embedded-app/static/{module-react-router-dom.cf49e816.js → module-react-router-dom.ef191c8f.js} +1 -1
  56. package/dist/embedded-app/static/{module-react-router-dom.cf49e816.js.map → module-react-router-dom.ef191c8f.js.map} +1 -1
  57. package/dist/embedded-app/static/{module-react-router.a589137b.js → module-react-router.d2e96318.js} +1 -1
  58. package/dist/embedded-app/static/{module-react-router.a589137b.js.map → module-react-router.d2e96318.js.map} +1 -1
  59. package/dist/embedded-app/static/{runtime.9303dbab.js → runtime.fef15b74.js} +2 -2
  60. package/dist/embedded-app/static/{runtime.9303dbab.js.map → runtime.fef15b74.js.map} +1 -1
  61. package/dist/embedded-app/static/vendor.fef15b74.js +212 -0
  62. package/dist/embedded-app/static/vendor.fef15b74.js.map +1 -0
  63. package/dist/index.cjs.js +4 -4
  64. package/dist/index.cjs.js.map +1 -1
  65. package/package.json +5 -5
  66. package/dist/embedded-app/static/1032.386b1848.chunk.js +0 -3
  67. package/dist/embedded-app/static/1032.386b1848.chunk.js.map +0 -1
  68. package/dist/embedded-app/static/1105.209c5cde.chunk.js +0 -3
  69. package/dist/embedded-app/static/1105.209c5cde.chunk.js.map +0 -1
  70. package/dist/embedded-app/static/184.8440cd01.chunk.js +0 -3
  71. package/dist/embedded-app/static/184.8440cd01.chunk.js.map +0 -1
  72. package/dist/embedded-app/static/2440.3a9ca67a.chunk.js +0 -3
  73. package/dist/embedded-app/static/2440.3a9ca67a.chunk.js.map +0 -1
  74. package/dist/embedded-app/static/5458.799ae5d6.chunk.js +0 -3
  75. package/dist/embedded-app/static/5458.799ae5d6.chunk.js.map +0 -1
  76. package/dist/embedded-app/static/732.e558c17c.chunk.js +0 -3
  77. package/dist/embedded-app/static/732.e558c17c.chunk.js.map +0 -1
  78. package/dist/embedded-app/static/9545.af619fb2.chunk.js +0 -3
  79. package/dist/embedded-app/static/9545.af619fb2.chunk.js.map +0 -1
  80. package/dist/embedded-app/static/9770.961c4c09.chunk.js +0 -3
  81. package/dist/embedded-app/static/9770.961c4c09.chunk.js.map +0 -1
  82. package/dist/embedded-app/static/main.9303dbab.js +0 -522
  83. package/dist/embedded-app/static/main.9303dbab.js.map +0 -1
  84. package/dist/embedded-app/static/module-material-ui.09dab505.js +0 -51
  85. package/dist/embedded-app/static/module-material-ui.09dab505.js.map +0 -1
  86. package/dist/embedded-app/static/vendor.9303dbab.js +0 -212
  87. package/dist/embedded-app/static/vendor.9303dbab.js.map +0 -1
@@ -1,522 +0,0 @@
1
- (()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(It,Pe,n){"use strict";n.d(Pe,{n3:function(){return m},MS:function(){return ve}});var r=n(87612),p=n(25271),W=n(23054),f=n(96279),V=n.n(f);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function h(ce){return!ce.cursor}function F(ce){return!h(ce)}class ve{async getEntityAncestors(z,de){const{kind:$,namespace:A,name:oe}=(0,p.of)(z.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent($)}/${encodeURIComponent(A)}/${encodeURIComponent(oe)}/ancestry`,de)}async getLocationById(z,de){return await this.requestOptional("GET",`/locations/${encodeURIComponent(z)}`,de)}async getEntities(z,de){const{filter:$=[],fields:A=[],order:oe,offset:se,limit:ee,after:X}=z!=null?z:{},K=this.getParams($);if(A.length&&K.push(`fields=${A.map(encodeURIComponent).join(",")}`),oe)for(const Z of[oe].flat())Z&&K.push(`order=${encodeURIComponent(Z.order)}:${encodeURIComponent(Z.field)}`);se!==void 0&&K.push(`offset=${se}`),ee!==void 0&&K.push(`limit=${ee}`),X!==void 0&&K.push(`after=${encodeURIComponent(X)}`);const T=K.length?`?${K.join("&")}`:"",w=await this.requestRequired("GET",`/entities${T}`,de),I=(Z,xe)=>{var Se,B;if(((Se=Z.metadata)===null||Se===void 0?void 0:Se.name)===void 0||Z.kind===void 0||((B=xe.metadata)===null||B===void 0?void 0:B.name)===void 0||xe.kind===void 0)return 0;const Ge=(0,p.eE)(Z),xt=(0,p.eE)(xe);return Ge<xt?-1:Ge>xt?1:0};return{items:w.sort(I)}}async getEntitiesByRefs(z,de){var $,A,oe;const se={entityRefs:z.entityRefs};!(($=z.fields)===null||$===void 0)&&$.length&&(se.fields=z.fields);const X=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,K=await this.fetchApi.fetch(X,{headers:{"Content-Type":"application/json",...((A=de)===null||A===void 0?void 0:A.token)&&{Authorization:`Bearer ${(oe=de)===null||oe===void 0?void 0:oe.token}`}},method:"POST",body:JSON.stringify(se)});if(!K.ok)throw await W.VL.fromResponse(K);const{items:T}=await K.json();return{items:T.map(w=>w!=null?w:void 0)}}async queryEntities(z={},de){const $=[];if(h(z)){var A,oe,se,ee;const{fields:K=[],filter:T,limit:w,orderFields:I,fullTextFilter:Z}=z;$.push(...this.getParams(T)),w!==void 0&&$.push(`limit=${w}`),I!==void 0&&(Array.isArray(I)?I:[I]).forEach(({field:Se,order:B})=>$.push(`orderField=${Se},${B}`)),K.length&&$.push(`fields=${K.map(encodeURIComponent).join(",")}`);const xe=(oe=Z)===null||oe===void 0||(A=oe.term)===null||A===void 0?void 0:A.trim();xe&&$.push(`fullTextFilterTerm=${xe}`),!((ee=Z)===null||ee===void 0||(se=ee.fields)===null||se===void 0)&&se.length&&$.push(`fullTextFilterFields=${Z.fields.join(",")}`)}else{const{fields:K=[],limit:T,cursor:w}=z;$.push(`cursor=${w}`),T!==void 0&&$.push(`limit=${T}`),K.length&&$.push(`fields=${K.map(encodeURIComponent).join(",")}`)}const X=$.length?`?${$.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${X}`,de)}async getEntityByRef(z,de){const{kind:$,namespace:A,name:oe}=(0,p.of)(z);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent($)}/${encodeURIComponent(A)}/${encodeURIComponent(oe)}`,de)}async getEntityByName(z,de){const{kind:$,namespace:A="default",name:oe}=z;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent($)}/${encodeURIComponent(A)}/${encodeURIComponent(oe)}`,de)}async refreshEntity(z,de){var $,A;const oe=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(($=de)===null||$===void 0?void 0:$.token)&&{Authorization:`Bearer ${(A=de)===null||A===void 0?void 0:A.token}`}},method:"POST",body:JSON.stringify({entityRef:z})});if(oe.status!==200)throw new Error(await oe.text())}async getEntityFacets(z,de){const{filter:$=[],facets:A}=z,oe=this.getParams($);for(const ee of A)oe.push(`facet=${encodeURIComponent(ee)}`);const se=oe.length?`?${oe.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${se}`,de)}async addLocation(z,de){var $,A;const{type:oe="url",target:se,dryRun:ee}=z,X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${ee?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(($=de)===null||$===void 0?void 0:$.token)&&{Authorization:`Bearer ${(A=de)===null||A===void 0?void 0:A.token}`}},method:"POST",body:JSON.stringify({type:oe,target:se})});if(X.status!==201)throw new Error(await X.text());const{location:K,entities:T,exists:w}=await X.json();if(!K)throw new Error(`Location wasn't added: ${se}`);return{location:K,entities:T,exists:w}}async getLocationByRef(z,de){return(await this.requestRequired("GET","/locations",de)).map(A=>A.data).find(A=>z===(0,p.NZ)(A))}async removeLocationById(z,de){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(z)}`,de)}async removeEntityByUid(z,de){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(z)}`,de)}async validateEntity(z,de,$){var A,oe;const se=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...((A=$)===null||A===void 0?void 0:A.token)&&{Authorization:`Bearer ${(oe=$)===null||oe===void 0?void 0:oe.token}`}},method:"POST",body:JSON.stringify({entity:z,location:de})});if(se.ok)return{valid:!0};if(se.status!==400)throw await W.VL.fromResponse(se);const{errors:ee=[]}=await se.json();return{valid:!1,errors:ee}}async requestIgnored(z,de,$){var A;const oe=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,se=!((A=$)===null||A===void 0)&&A.token?{Authorization:`Bearer ${$.token}`}:{},ee=await this.fetchApi.fetch(oe,{method:z,headers:se});if(!ee.ok)throw await W.VL.fromResponse(ee)}async requestRequired(z,de,$){var A;const oe=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,se=!((A=$)===null||A===void 0)&&A.token?{Authorization:`Bearer ${$.token}`}:{},ee=await this.fetchApi.fetch(oe,{method:z,headers:se});if(!ee.ok)throw await W.VL.fromResponse(ee);return ee.json()}async requestOptional(z,de,$){var A;const oe=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,se=!((A=$)===null||A===void 0)&&A.token?{Authorization:`Bearer ${$.token}`}:{},ee=await this.fetchApi.fetch(oe,{method:z,headers:se});if(!ee.ok){if(ee.status===404)return;throw await W.VL.fromResponse(ee)}return await ee.json()}getParams(z=[]){const de=[];for(const $ of[z].flat()){const A=[];for(const[oe,se]of Object.entries($))for(const ee of[se].flat())ee===m?A.push(encodeURIComponent(oe)):typeof ee=="string"&&A.push(`${encodeURIComponent(oe)}=${encodeURIComponent(ee)}`);A.length&&de.push(`filter=${A.join(",")}`)}return de}constructor(z){(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.discoveryApi=z.discoveryApi,this.fetchApi=z.fetchApi||{fetch:V()}}}},25271:function(It,Pe,n){"use strict";n.d(Pe,{Tf:function(){return W},P1:function(){return Rn},q1:function(){return Hn},M6:function(){return Ln},l2:function(){return p},zG:function(){return r},w$:function(){return mn},nP:function(){return hn},aS:function(){return Jt},S4:function(){return gt},cz:function(){return Xe},wI:function(){return xe},iB:function(){return Ft},CV:function(){return Re},of:function(){return Yt},Ou:function(){return we},eE:function(){return dt},NZ:function(){return pe}});const r="default",p="backstage.io/view-url",W="backstage.io/edit-url",f="kubernetes.io/api-server",V="kubernetes.io/api-server-certificate-authority",m="kubernetes.io/auth-provider";var h=n(76635),F=n.n(h);class ve{async enforce(N){return N.metadata.namespace?N:lodash.merge({metadata:{namespace:this.namespace}},N)}constructor(N=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=N}}class ce{static isValidPrefixAndOrSuffix(N,ae,Ae,Ze){if(typeof N!="string")return!1;const qe=N.split(ae);return qe.length===1?Ze(qe[0]):qe.length===2?Ae(qe[0])&&Ze(qe[1]):!1}static isJsonSafe(N){try{return F().isEqual(N,JSON.parse(JSON.stringify(N)))}catch{return!1}}static isValidDnsSubdomain(N){return typeof N=="string"&&N.length>=1&&N.length<=253&&N.split(".").every(ce.isValidDnsLabel)}static isValidDnsLabel(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(N)}static isValidTag(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(N)}static isValidUrl(N){if(typeof N!="string")return!1;try{return new URL(N),!0}catch{return!1}}static isValidString(N){var ae,Ae;return typeof N=="string"&&((Ae=N)===null||Ae===void 0||(ae=Ae.trim())===null||ae===void 0?void 0:ae.length)>=1}static isNonEmptyString(N){var ae,Ae;return typeof N=="string"&&((Ae=N)===null||Ae===void 0||(ae=Ae.trim())===null||ae===void 0?void 0:ae.length)>=1}}var z=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}}}}}'),de=n(27991),$=n.n(de),A=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"}}}`),oe=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}}}}}}'),se=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","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"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 ee=new Map,X=[z,A,oe,se];function K(H){var N;if(!(!((N=H)===null||N===void 0)&&N.length))throw new TypeError("Unknown error");const ae=H[0];throw new TypeError(`${ae.instancePath||"<root>"} ${ae.message}${ae.params?` - ${Object.entries(ae.params).map(([Ae,Ze])=>`${Ae}: ${Ze}`).join(", ")}`:""}`)}function T(H,N={}){var ae,Ae;const Ze=(Ae=(ae=N)===null||ae===void 0?void 0:ae.disableCache)!==null&&Ae!==void 0?Ae:!1,qe=Ze?"":JSON.stringify(H);if(!Ze){const Xt=ee.get(qe);if(Xt)return Xt}const Pt=w(H),$t=new($())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Pt.length&&$t.addSchema(Pt,void 0,void 0,!0);const Qt=$t.compile(H);return Ze||ee.set(qe,Qt),Qt}function w(H){if(typeof H!="object")return[];const N=new Set;H.$id&&N.add(H.$id);const ae=new Array,Ae=[H];for(;Ae.length;){const Ze=Ae.pop();for(const qe of I(Ze))if(!N.has(qe)){N.add(qe);const Pt=X.find($t=>$t.$id===qe);Pt&&(ae.push(Pt),Ae.push(Pt))}}return ae}function*I(H){const N=[H];for(;N.length;){const ae=N.pop();if(typeof ae=="object"&&ae)for(const[Ae,Ze]of Object.entries(ae))Ae==="$ref"&&typeof Ze=="string"?yield Ze.split("#")[0]:N.push(Ze)}}function Z(H){const N=compileAjvSchema(H||entityEnvelopeSchema);return ae=>{if(N(ae)===!0)return ae;throw throwAjvError(N.errors)}}function xe(H){const N=T(H);return ae=>{var Ae,Ze;if(N(ae)===!0)return ae;const Pt=(Ae=N.errors)===null||Ae===void 0?void 0:Ae.filter($t=>["/kind","/apiVersion"].includes($t.instancePath));if(!((Ze=Pt)===null||Ze===void 0)&&Ze.length&&Pt.every($t=>$t.keyword==="enum"))return!1;throw K(N.errors)}}function Se(H){const N=compileAjvSchema(H||entitySchema);return ae=>{if(N(ae)===!0)return ae;throw throwAjvError(N.errors)}}class B{static isValidApiVersion(N){return ce.isValidPrefixAndOrSuffix(N,"/",ce.isValidDnsSubdomain,ae=>ae.length>=1&&ae.length<=63&&/^[a-z0-9A-Z]+$/.test(ae))}static isValidKind(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(N)}static isValidObjectName(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(N)}static isValidNamespace(N){return ce.isValidDnsLabel(N)}static isValidLabelKey(N){return ce.isValidPrefixAndOrSuffix(N,"/",ce.isValidDnsSubdomain,B.isValidObjectName)}static isValidLabelValue(N){return N===""||B.isValidObjectName(N)}static isValidAnnotationKey(N){return ce.isValidPrefixAndOrSuffix(N,"/",ce.isValidDnsSubdomain,B.isValidObjectName)}static isValidAnnotationValue(N){return typeof N=="string"}}const Ge={isValidApiVersion:B.isValidApiVersion,isValidKind:B.isValidKind,isValidEntityName:B.isValidObjectName,isValidNamespace:B.isValidNamespace,isValidLabelKey:B.isValidLabelKey,isValidLabelValue:B.isValidLabelValue,isValidAnnotationKey:B.isValidAnnotationKey,isValidAnnotationValue:B.isValidAnnotationValue,isValidTag:H=>typeof H=="string"&&H.length>=1&&H.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(H)};function xt(H={}){return{...Ge,...H}}class Nt{async enforce(N){function ae(Y,v,O){if(v==null)throw new Error(`${Y} must have a value`);let M;try{M=O(v)}catch(G){throw new Error(`${Y} could not be validated, ${G}`)}if(!M){let G;switch(O.name){case"isValidLabelValue":case"isValidObjectName":G="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":G="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":G="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":G="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":G="a string";break;case"isValidKind":G="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":G="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":G="a non empty string";break;default:G=void 0;break}const ue=G?` expected ${G} but found "${v}".`:"";throw new Error(`"${Y}" is not valid;${ue} 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(Y,v,O){return v===void 0||ae(Y,v,O)}ae("apiVersion",N.apiVersion,this.validators.isValidApiVersion),ae("kind",N.kind,this.validators.isValidKind),ae("metadata.name",N.metadata.name,this.validators.isValidEntityName),Ae("metadata.namespace",N.metadata.namespace,this.validators.isValidNamespace);var Ze;for(const[Y,v]of Object.entries((Ze=N.metadata.labels)!==null&&Ze!==void 0?Ze:[]))ae(`labels.${Y}`,Y,this.validators.isValidLabelKey),ae(`labels.${Y}`,v,this.validators.isValidLabelValue);var qe;for(const[Y,v]of Object.entries((qe=N.metadata.annotations)!==null&&qe!==void 0?qe:[]))ae(`annotations.${Y}`,Y,this.validators.isValidAnnotationKey),ae(`annotations.${Y}`,v,this.validators.isValidAnnotationValue);var Pt;const $t=(Pt=N.metadata.tags)!==null&&Pt!==void 0?Pt:[];for(let Y=0;Y<$t.length;++Y)ae(`tags.${Y}`,$t[Y],this.validators.isValidTag);var Qt;const Xt=(Qt=N.metadata.links)!==null&&Qt!==void 0?Qt:[];for(let Y=0;Y<Xt.length;++Y){var an,ne,te;ae(`links.${Y}.url`,(an=Xt[Y])===null||an===void 0?void 0:an.url,CommonValidatorFunctions.isValidUrl),Ae(`links.${Y}.title`,(ne=Xt[Y])===null||ne===void 0?void 0:ne.title,CommonValidatorFunctions.isNonEmptyString),Ae(`links.${Y}.icon`,(te=Xt[Y])===null||te===void 0?void 0:te.icon,KubernetesValidatorFunctions.isValidObjectName)}return N}constructor(N=makeValidator()){_define_property(this,"validators",void 0),this.validators=N}}class zt{async enforce(N){if(!this.validate){const Ze=new Ajv({allowUnionTypes:!0});this.validate=Ze.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(N)===!0)return N;const[Ae]=this.validate.errors||[];throw Ae?new Error(`Malformed envelope, ${Ae.instancePath||"<root>"} ${Ae.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Tt(H){let N=H.indexOf(":");const ae=H.indexOf("/");ae!==-1&&ae<N&&(N=-1);const Ae=N===-1?void 0:H.slice(0,N),Ze=ae===-1?void 0:H.slice(N+1,ae),qe=H.slice(Math.max(N+1,ae+1));if(Ae===""||Ze===""||qe==="")throw new TypeError(`Entity reference "${H}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ae,namespace:Ze,name:qe}}function Ft(H){return{kind:H.kind,namespace:H.metadata.namespace||r,name:H.metadata.name}}function Yt(H,N){var ae,Ae;if(!H)throw new Error("Entity reference must not be empty");const Ze=(ae=N)===null||ae===void 0?void 0:ae.defaultKind,qe=((Ae=N)===null||Ae===void 0?void 0:Ae.defaultNamespace)||r;let Pt,$t,Qt;if(typeof H=="string"){const Y=Tt(H);var Xt;Pt=(Xt=Y.kind)!==null&&Xt!==void 0?Xt:Ze;var an;$t=(an=Y.namespace)!==null&&an!==void 0?an:qe,Qt=Y.name}else{var ne;Pt=(ne=H.kind)!==null&&ne!==void 0?ne:Ze;var te;$t=(te=H.namespace)!==null&&te!==void 0?te:qe,Qt=H.name}if(Pt)if($t){if(!Qt){const Y=JSON.stringify(H);throw new Error(`Entity reference ${Y} had missing or empty name`)}}else{const Y=JSON.stringify(H);throw new Error(`Entity reference ${Y} had missing or empty namespace`)}else{const Y=JSON.stringify(H);throw new Error(`Entity reference ${Y} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Pt,namespace:$t,name:Qt}}function dt(H){let N,ae,Ae;if("metadata"in H){N=H.kind;var Ze;ae=(Ze=H.metadata.namespace)!==null&&Ze!==void 0?Ze:r,Ae=H.metadata.name}else{N=H.kind;var qe;ae=(qe=H.namespace)!==null&&qe!==void 0?qe:r,Ae=H.name}return`${N.toLocaleLowerCase("en-US")}:${ae.toLocaleLowerCase("en-US")}/${Ae.toLocaleLowerCase("en-US")}`}var ut=n(87612);class St{async enforce(N){let ae=N;for(const Ae of this.policies){const Ze=await Ae.enforce(ae);if(!Ze)throw new Error(`Policy ${Ae.constructor.name} did not return a result`);ae=Ze}return ae}constructor(N){(0,ut._)(this,"policies",void 0),this.policies=N}}class lt{async enforce(N){for(const ae of this.policies){const Ae=await ae.enforce(N);if(Ae)return Ae}throw new Error("The entity did not match any known policy")}constructor(N){(0,ut._)(this,"policies",void 0),this.policies=N}}const Ut={allOf(H){return new St(H)},oneOf(H){return new lt(H)}};var Ht=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function Ce(H){let N;return{async check(ae){return N||(N=xe(H)),N(ae)===ae}}}const $e=Ce(Ht);var Ke=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const ht=Ce(Ke);var rt=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 et=Ce(rt);var vt=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 ot=Ce(vt);var Je=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 ft=Ce(Je),gt="ownedBy",Ct="ownerOf",gn="consumesApi",un="apiConsumedBy",ln="providesApi",bn="apiProvidedBy",hn="dependsOn",mn="dependencyOf",Sn="parentOf",on="childOf",pn="memberOf",Cn="hasMember",Xe="partOf",Jt="hasPart";var Vt=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 Ye=Ce(Vt);var An=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"SystemV1alpha1","description":"A system is a collection of resources and components. The system may expose or consume one or several APIs. It is viewed as abstraction level that provides potential consumers insights into exposed features without needing a too detailed view into the details of all components. This also gives the owning team the possibility to decide about published artifacts and APIs.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"System","metadata":{"name":"artist-engagement-portal","description":"Handy tools to keep artists in the loop"},"spec":{"owner":"artist-relations-team","domain":"artists"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["System"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"domain":{"type":"string","description":"An entity reference to the domain that the system belongs to.","examples":["artists"],"minLength":1}}}}}]}');const sn=Ce(An);var Bn=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"UserV1alpha1","description":"A user describes a person, such as an employee, a contractor, or similar. Users belong to Group entities in the catalog. These catalog user entries are connected to the way that authentication within the Backstage ecosystem works. See the auth section of the docs for a discussion of these concepts.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"User","metadata":{"name":"jdoe"},"spec":{"profile":{"displayName":"Jenny Doe","email":"jenny-doe@example.com","picture":"https://example.com/staff/jenny-with-party-hat.jpeg"},"memberOf":["team-b","employees"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["User"]},"spec":{"type":"object","required":["memberOf"],"properties":{"profile":{"type":"object","description":"Optional profile information about the user, mainly for display purposes. All fields of this structure are also optional. The email would be a primary email of some form, that the user may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the user, and that a browser could fetch and render on a profile page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Jenny Doe"],"minLength":1},"email":{"type":"string","description":"An email where this user can be reached.","examples":["jenny-doe@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this user.","examples":["https://example.com/staff/jenny-with-party-hat.jpeg"],"minLength":1}}},"memberOf":{"type":"array","description":"The list of groups that the user is a direct member of (i.e., no transitive memberships are listed here). The list must be present, but may be empty if the user is not member of any groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["team-b","employees"],"minLength":1}}}}}}]}`);const Tn=Ce(Bn),Rn="backstage.io/managed-by-location",Hn="backstage.io/managed-by-origin-location",Ln="backstage.io/source-location",Gn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function we(H){if(typeof H!="string")throw new TypeError(`Unable to parse location ref '${H}', unexpected argument ${typeof H}`);const N=H.indexOf(":");if(N<0)throw new TypeError(`Unable to parse location ref '${H}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ae=H.substring(0,N).trim(),Ae=H.substring(N+1).trim();if(!ae||!Ae)throw new TypeError(`Unable to parse location ref '${H}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ae==="http"||ae==="https")throw new TypeError(`Invalid location ref '${H}', please prefix it with 'url:', e.g. 'url:${H}'`);if(Gn.test(Ae))throw new TypeError(`Invalid location ref '${H}', target is a javascript: URL`);return{type:ae,target:Ae}}function pe(H){const{type:N,target:ae}=H;if(N){if(!ae)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(Gn.test(ae))throw new TypeError(`Invalid location ref '${N}:${ae}', target is a javascript: URL`);return`${N}:${ae}`}function Re(H){var N,ae,Ae,Ze,qe;const Pt=(qe=(ae=H.metadata)===null||ae===void 0||(N=ae.annotations)===null||N===void 0?void 0:N[Ln])!==null&&qe!==void 0?qe:(Ze=H.metadata)===null||Ze===void 0||(Ae=Ze.annotations)===null||Ae===void 0?void 0:Ae[Rn];if(!Pt)throw new Error(`Entity '${dt(H)}' is missing location`);return we(Pt)}},98864:function(It,Pe,n){"use strict";n.d(Pe,{rU:function(){return I}});var r=n(52322),p=n(60871),W=n(86689),f=n(79692),V=n(90436),m=n(72779),h=n.n(m),F=n(76635),ve=n.n(F),ce=n(2784),z=n(73557),de=n(71597);function $(){const[Z]=(0,z.is)((0,r.jsx)(z.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!Z.index}const A=(0,f.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),oe=Z=>/^([a-z+.-]+):/.test(Z),se=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,ee=window.open;if(ee&&!ee.__backstage){const Z=function(...Se){const B=String(Se[0]);if(se.test(B))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return ee.apply(this,Se)};Z.__backstage=!0,window.open=Z}const X=()=>{try{return(0,p.h_)(p.Ds).getOptionalString("app.baseUrl")}catch{return}},K=()=>{const Z="http://sample.dev";var xe;const Se=(xe=X())!==null&&xe!==void 0?xe:"/",{pathname:B}=new URL(Se,Z);return(0,F.trimEnd)(B,"/")},T=Z=>{let xe=String(Z);const Se=K(),B=oe(xe),Ge=xe.startsWith(Se);return!B&&!Ge&&(xe=Se.concat(xe)),xe},w=Z=>{if(Z instanceof Array)return Z.map(w).join(" ").trim();if(typeof Z=="object"&&Z){var xe,Se;return w((Se=Z)===null||Se===void 0||(xe=Se.props)===null||xe===void 0?void 0:xe.children)}return["string","number"].includes(typeof Z)?String(Z):""},I=ce.forwardRef(({onClick:Z,noTrack:xe,...Se},B)=>{const Ge=A(),xt=(0,p.z$)(),Nt=$()?T(Se.to):Se.to,zt=w(Se.children)||Nt,Tt=oe(Nt),Ft=Tt&&!!/^https?:/.exec(Nt);if(se.test(Nt))throw new Error("Link component rejected javascript: URL as a security precaution");const Yt=dt=>{var ut;(ut=Z)===null||ut===void 0||ut(dt),xe||xt.captureEvent("click",zt,{attributes:{to:Nt}})};return Tt?(0,r.jsxs)(W.Z,{...Ft?{target:"_blank",rel:"noopener"}:{},...Se,...Se["aria-label"]?{"aria-label":`${Se["aria-label"]}, Opens in a new window`}:{},ref:B,href:Nt,onClick:Yt,className:h()(Ge.externalLink,Se.className),children:[Se.children,(0,r.jsx)(V.Z,{component:"span",className:Ge.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(W.Z,{...Se,ref:B,component:de.rU,to:Nt,onClick:Yt})})},43909:function(It,Pe,n){"use strict";n.d(Pe,{r:function(){return r.rU}});var r=n(98864)},53974:function(It,Pe,n){"use strict";n.d(Pe,{Oi:function(){return xe},VY:function(){return Qs},yW:function(){return Dn},XF:function(){return xt},mn:function(){return mn},NX:function(){return St},ub:function(){return Gn},mf:function(){return Vr},yu:function(){return ct},h4:function(){return Ua},M6:function(){return Fr},i9:function(){return ll},aR:function(){return Ji},rJ:function(){return Mr},Oh:function(){return fl},hu:function(){return ul},rU:function(){return ce.r},Qj:function(){return de},nU:function(){return _e},SA:function(){return Kr},sk:function(){return qe},Or:function(){return Jr},T3:function(){return Ma},g9:function(){return vl},Ex:function(){return Ao},Gk:function(){return qt},tn:function(){return Xs},Ph:function(){return $o},YE:function(){return Di},v7:function(){return $a},R6:function(){return Ui},tR:function(){return zs},uw:function(){return _i},qt:function(){return Si},iA:function(){return Mt},GB:function(){return tt},po:function(){return Lr},mZ:function(){return hs},Pf:function(){return Uo}});var r=n(52322),p=n(60871),W=n(19928),f=n(2784);function V(e){const[o,l]=useState([]),d=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"},transientTimeoutMs:x}=e,R=x!=null?x:5e3;useEffect(()=>{const Q=d.alert$().subscribe(fe=>l(ge=>ge.concat(fe)));return()=>{Q.unsubscribe()}},[d]);const[k]=o;if(useEffect(()=>{if(k&&k.display==="transient"){const Q=setTimeout(()=>{l(fe=>{const ge=fe.filter(Fe=>Fe!==k);return ge.length===fe.length?fe:ge})},R);return()=>clearTimeout(Q)}},[k,R]),o.length===0)return null;const q=()=>{l(Q=>Q.filter(fe=>fe!==k))};return _jsx(Snackbar,{open:!0,anchorOrigin:g,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:q,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:k.severity,children:_jsxs(Typography,{component:"span",children:[String(k.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var m=n(79692);const h=(0,m.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function F(e){const{displayName:o,picture:l,customStyles:d}=e,g=h();let x={...d};const R={fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight};return l||(x={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:l,className:g.avatar,style:x,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:g.avatarText,style:R,children:extractInitials(o)})})}var ve=n(77277),ce=n(43909);const z=f.forwardRef((e,o)=>(0,r.jsx)(ce.r,{ref:o,...e,color:"initial"})),de=f.forwardRef((e,o)=>(0,r.jsx)(ve.Z,{ref:o,component:z,...e})),$=null;var A=n(95544),oe=n(60364),se=n(83229),ee=n(26639),X=n(39595),K=n(61837),T=n(80030),w=n(19353),I=n(95074);function Z(e){const{text:o,tooltipDelay:l=1e3,tooltipText:d="Text copied to clipboard","aria-label":g="Copy text"}=e,x=(0,p.h_)(p.VE),[R,k]=(0,f.useState)(!1),[{error:q},Q]=(0,I.Z)();(0,f.useEffect)(()=>{q&&x.post(q)},[q,x]);const fe=ge=>{ge.stopPropagation(),k(!0),Q(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(T.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:l,onClose:()=>k(!1),open:R,children:(0,r.jsx)(K.Z,{onClick:fe,"aria-label":g,children:(0,r.jsx)(w.Z,{})})})})}function xe(e){const{text:o,language:l,showLineNumbers:d=!1,highlightedNumbers:g,customStyle:x,showCopyCodeButton:R=!1}=e,k=(0,oe.Z)(),q=k.palette.type==="dark"?ee.Z:X.Z,Q=k.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(A.Z,{position:"relative",children:[(0,r.jsx)(se.Z,{customStyle:x,language:l,style:q,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:k.palette.textVerySubtle},lineProps:fe=>{var ge;return!((ge=g)===null||ge===void 0)&&ge.includes(fe)?{style:{backgroundColor:Q}}:{}},children:o}),R&&(0,r.jsx)(A.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(Z,{text:o})})]})}var Se=n(41156),B=n(71597),Ge=n(88188);function xt(e){const{title:o,to:l}=e,d=(0,Se.Z)(g=>g.breakpoints.down("xs"));return l?d?(0,r.jsx)(K.Z,{component:B.rU,color:"primary",title:o,size:"small",to:l,children:(0,r.jsx)(Ge.Z,{})}):(0,r.jsx)(ve.Z,{component:B.rU,variant:"contained",color:"primary",to:l,children:o}):null}var Nt=n(27397),zt=n(11105),Tt=n(97963),Ft=n(46506),Yt=n.n(Ft),dt=n(54073),ut=n.n(dt),St;(function(e){let o;(function(x){x.TOP_BOTTOM="TB",x.BOTTOM_TOP="BT",x.LEFT_RIGHT="LR",x.RIGHT_LEFT="RL"})(o=e.Direction||(e.Direction={}));let l;(function(x){x.UP_LEFT="UL",x.UP_RIGHT="UR",x.DOWN_LEFT="DL",x.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let d;(function(x){x.NETWORK_SIMPLEX="network-simplex",x.TIGHT_TREE="tight-tree",x.LONGEST_PATH="longest-path"})(d=e.Ranker||(e.Ranker={}));let g;(function(x){x.LEFT="l",x.RIGHT="r",x.CENTER="c"})(g=e.LabelPosition||(e.LabelPosition={}))})(St||(St={}));var lt=n(10368);const Ut=(0,m.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Ht({node:{id:e}}){const o=Ut(),[l,d]=f.useState(0),[g,x]=f.useState(0),R=f.useRef(null);f.useLayoutEffect(()=>{if(R.current){let{height:fe,width:ge}=R.current.getBBox();fe=Math.round(fe),ge=Math.round(ge),(fe!==g||ge!==l)&&(d(ge),x(fe))}},[l,g]);const k=10,q=l+k*2,Q=g+k*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:o.node,width:q,height:Q,rx:10}),(0,r.jsx)("text",{ref:R,className:o.text,y:Q/2,x:q/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Ce="arrow-marker",$e="node",Ke="edge",ht="label",rt=(0,lt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),et=e=>(0,r.jsx)(Ht,{...e});function vt({render:e=et,setNode:o,node:l}){const{width:d,height:g,x=0,y:R=0}=l,k=l,q=rt(),Q=f.useRef(null);return f.useLayoutEffect(()=>{if(Q.current){let{height:fe,width:ge}=Q.current.getBBox();fe=Math.round(fe),ge=Math.round(ge),(fe!==g||ge!==d)&&o(l.id,{...l,height:fe,width:ge})}},[l,d,g,o]),(0,r.jsx)("g",{ref:Q,"data-testid":$e,className:q.node,transform:`translate(${x-d/2},${R-g/2})`,children:e({node:k})})}var ot=n(76985),Je=n(39829),ft=n(19574),gt=n.n(ft);const Ct=(0,lt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function gn({edge:{label:e}}){const o=Ct();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const un=(0,lt.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),ln=e=>(0,r.jsx)(gn,{...e});function bn({render:e=ln,setEdge:o,id:l,edge:d,curve:g}){const{x=0,y:R=0,width:k,height:q,points:Q}=d,fe=d,ge=un(),Fe=f.useRef(null);f.useLayoutEffect(()=>{if(Fe.current){let{height:pt,width:at}=Fe.current.getBBox();pt=Math.round(pt),at=Math.round(at),(pt!==q||at!==k)&&o(l,{...d,height:pt,width:at})}},[d,q,k,o,l]);let Ie="";const Ve=f.useMemo(()=>ot.Z().x(pt=>pt.x).y(pt=>pt.y).curve(Je[g]),[g]);if(Q){const pt=Q.filter(at=>gt()(at.x)&&gt()(at.y));Ie=Ve(pt)||""}return(0,r.jsxs)(r.Fragment,{children:[Ie&&(0,r.jsx)("path",{"data-testid":Ke,className:ge.path,d:Ie}),fe.label?(0,r.jsx)("g",{ref:Fe,"data-testid":ht,className:ge.label,transform:`translate(${x},${R})`,children:e({edge:fe})}):null]})}const hn="workspace";function mn(e){var o,l;const{edges:d,nodes:g,renderNode:x,direction:R=St.Direction.TOP_BOTTOM,align:k,nodeMargin:q=50,edgeMargin:Q=10,rankMargin:fe=50,paddingX:ge=0,paddingY:Fe=0,acyclicer:Ie,ranker:Ve=St.Ranker.NETWORK_SIMPLEX,labelPosition:pt=St.LabelPosition.RIGHT,labelOffset:at=10,edgeRanks:Dt=1,edgeWeight:On=1,renderLabel:Wn,defs:kt,zoom:nn="enabled",curve:fn="curveMonotoneX",fit:Nn="grow",...Fn}=e,or=(0,Tt.Z)(),[jr,to]=f.useState(100),[Br,Cs]=f.useState(100),dn=f.useRef(new(Yt()).graphlib.Graph),[Ho,si]=f.useState(((o=dn.current.graph())===null||o===void 0?void 0:o.width)||0),[jo,ii]=f.useState(((l=dn.current.graph())===null||l===void 0?void 0:l.height)||0),[ai,ua]=f.useState([]),[Jn,Gr]=f.useState([]),$r=Math.max(Ho,jr),Er=Math.max(jo,Br),Vn=Math.min(jo,Br),sr=Nn==="grow"?Er:Vn,Go=f.useMemo(()=>ut()(kn=>{if(!kn)return;const Qn=zt.Z(kn),Pn=zt.Z(kn.getElementById(hn));function Dr(){Qn.call(Nt.sP().scaleExtent([1,10]).on("zoom",ro=>{ro.transform.x=Math.min(0,Math.max(ro.transform.x,$r-$r*ro.transform.k)),ro.transform.y=Math.min(0,Math.max(ro.transform.y,Er-Er*ro.transform.k)),Pn.attr("transform",ro.transform)}))}nn==="enabled"?Dr():nn==="enable-on-click"&&Qn.on("click",()=>Dr());const{width:Nr,height:li}=kn.getBoundingClientRect();jr!==Nr&&to(Nr),Br!==li&&Cs(li)},100),[Br,jr,$r,Er,nn]),fo=f.useCallback(()=>{const kn=dn.current.nodes(),Qn=dn.current.edges();kn.forEach(Pn=>{g.some(Nr=>Nr.id===Pn)||dn.current.removeNode(Pn)}),Qn.forEach(Pn=>{d.some(Nr=>Nr.from===Pn.v&&Nr.to===Pn.w)||dn.current.removeEdge(Pn.v,Pn.w)}),g.forEach(Pn=>{const Dr=dn.current.nodes().find(Nr=>Pn.id===Nr);if(Dr&&dn.current.node(Dr)){const{width:Nr,height:li,x:ro,y:Dl}=dn.current.node(Dr);dn.current.setNode(Dr,{...Pn,width:Nr,height:li,x:ro,y:Dl})}else dn.current.setNode(Pn.id,{...Pn,width:0,height:0})}),d.forEach(Pn=>{dn.current.setEdge(Pn.from,Pn.to,{...Pn,label:Pn.label,width:0,height:0,labelpos:pt,labeloffset:at,weight:On,minlen:Dt})})},[d,g,pt,at,On,Dt]),no=f.useMemo(()=>ut()(()=>{Yt().layout(dn.current);const{height:kn,width:Qn}=dn.current.graph(),Pn=Math.max(0,kn||0),Dr=Math.max(0,Qn||0);si(Dr),ii(Pn),ua(dn.current.nodes()),Gr(dn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(dn.current.setGraph({rankdir:R,align:k,nodesep:q,edgesep:Q,ranksep:fe,marginx:ge,marginy:Fe,acyclicer:Ie,ranker:Ve}),fo(),no(),no.cancel),[Ie,k,R,Q,ge,Fe,q,fe,Ve,fo,no]);function Bl(kn,Qn){return dn.current.setNode(kn,Qn),no(),dn.current}function $l(kn,Qn){return dn.current.setEdge(kn,Qn),no(),dn.current}return(0,r.jsxs)("svg",{ref:Go,...Fn,width:"100%",height:sr,viewBox:`0 0 ${$r} ${Er}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Ce,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:or.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),kt]}),(0,r.jsx)("g",{id:hn,children:(0,r.jsxs)("svg",{width:Ho,height:jo,y:Er/2-jo/2,x:$r/2-Ho/2,viewBox:`0 0 ${Ho} ${jo}`,children:[Jn.map(kn=>{const Qn=dn.current.edge(kn);return Qn?(0,r.jsx)(bn,{id:kn,setEdge:$l,render:Wn,edge:Qn,curve:fn},`${kn.v}-${kn.w}`):null}),ai.map(kn=>{const Qn=dn.current.node(kn);return Qn?(0,r.jsx)(vt,{setNode:Bl,render:x,node:Qn},kn):null})]})})]})}var Sn=n(72779),on=n.n(Sn),pn,Cn;const Xe=(0,m.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(pn=e.palette.banner.closeButtonColor)!==null&&pn!==void 0?pn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Cn=e.palette.banner.warning)!==null&&Cn!==void 0?Cn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),Jt=e=>{var o;const{variant:l,message:d,id:g,fixed:x=!1}=e,R=Xe(),q=useApi(storageApiRef).forBucket("notifications");var Q;const fe=(Q=q.snapshot("dismissedBanners").value)!==null&&Q!==void 0?Q:[],[ge,Fe]=useState(new Set(fe)),Ie=useObservable(q.observe$("dismissedBanners"));useEffect(()=>{var pt;if(!((pt=Ie)===null||pt===void 0)&&pt.value){var at,Dt;const On=(Dt=(at=Ie)===null||at===void 0?void 0:at.value)!==null&&Dt!==void 0?Dt:[];Fe(new Set(On))}},[(o=Ie)===null||o===void 0?void 0:o.value]);const Ve=()=>{q.set("dismissedBanners",[...ge,g])};return _jsx(Snackbar,{anchorOrigin:x?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ge.has(g),classes:{root:classNames(R.root,!x&&R.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(R.content,R[l]),message:R.message},message:d,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:R.button,onClick:Ve,children:_jsx(Close,{className:R.icon})},"dismiss")]})})};var Vt=n(60905),Ye=n(90436),An=n.p+"static/missingAnnotation.67f79e98..svg",sn=n.p+"static/noInformation.4b426325..svg",Bn=n.p+"static/createComponent.975d1e1e..svg",Tn=n.p+"static/noBuild.1715fa71..svg";const Rn=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Hn=({missing:e})=>{const o=Rn();switch(e){case"field":return(0,r.jsx)("img",{src:An,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:sn,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:Bn,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:Tn,alt:"no Build",className:o.generalImg});default:return null}},Ln=(0,m.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 Gn(e){const{title:o,description:l,missing:d,action:g}=e,x=Ln();return(0,r.jsxs)(Vt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:x.root,spacing:2,children:[(0,r.jsx)(Vt.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Vt.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Vt.Z,{item:!0,xs:!0,children:(0,r.jsx)(Ye.Z,{variant:"h5",children:o})}),(0,r.jsx)(Vt.Z,{item:!0,xs:!0,children:(0,r.jsx)(Ye.Z,{variant:"body1",children:l})}),(0,r.jsx)(Vt.Z,{item:!0,xs:!0,className:x.action,children:g})]})}),(0,r.jsx)(Vt.Z,{item:!0,xs:12,md:6,className:x.imageContainer,children:typeof d=="string"?(0,r.jsx)(Hn,{missing:d}):d.customImage})]})}const we=`apiVersion: backstage.io/v1alpha1
2
- kind: Component
3
- metadata:
4
- name: example
5
- description: example.com
6
- annotations:
7
- ANNOTATION: value
8
- spec:
9
- type: website
10
- lifecycle: production
11
- owner: user:guest`,pe=/^.*ANNOTATION.*$/m,Re=we.match(pe)[0],H=we.split(`
12
- `).findIndex(e=>pe.test(e)),N=(0,m.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function ae(e){return Array.from(Array(e+1).keys(),o=>o+H)}function Ae(e){const o=e.map(l=>Re.replace("ANNOTATION",l)).join(`
13
- `);return we.replace(Re,o)}function Ze(e){const o=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,r.jsx)("code",{children:l})).reduce((l,d)=>(0,r.jsxs)(r.Fragment,{children:[l,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function qe(e){const{annotation:o,readMoreUrl:l}=e,d=Array.isArray(o)?o:[o],g=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",x=N();return(0,r.jsx)(Gn,{missing:"field",title:"Missing Annotation",description:Ze(d),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ye.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(A.Z,{className:x.code,children:(0,r.jsx)(xe,{text:Ae(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:ae(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(ve.Z,{color:"primary",component:ce.r,to:g,children:"Read more"})]})})}var Pt=n(11776),$t=n(38402),Qt=n(49378),Xt=n(41128),an=n(27616),ne=n(8284),te=n(70660),Y=n(91750),v=n(38016);const O=(e,o)=>(o.palette.type==="light"?Xt._j:Xt.$n)(o.palette[e].light,.6),M=(e,o)=>(o.palette.type==="light"?Xt.$n:Xt._j)(o.palette[e].light,.9),G=(0,m.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>O(o,e)}})),ue=({severity:e})=>{const o=G({severity:e});return(0,r.jsx)(Y.Z,{classes:o})},be=({severity:e})=>{const o=G({severity:e});return(0,r.jsx)(v.Z,{classes:o})},ke=(0,m.Z)(e=>({panel:{backgroundColor:({severity:o})=>M(o,e),color:({severity:o})=>O(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>O(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>O(o,e),backgroundColor:({severity:o})=>M(o,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),Qe=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function tt(e){const{severity:o="warning",title:l,message:d,children:g,defaultExpanded:x}=e,R=ke({severity:o}),k=Qe(o)+(l?`: ${l}`:"");return(0,r.jsxs)(an.Z,{defaultExpanded:x!=null?x:!1,className:R.panel,role:"alert",children:[(0,r.jsxs)(ne.Z,{expandIcon:(0,r.jsx)(be,{severity:o}),className:R.summary,children:[(0,r.jsx)(ue,{severity:o}),(0,r.jsx)(Ye.Z,{className:R.summaryText,variant:"subtitle1",children:k})]}),(d||g)&&(0,r.jsx)(te.Z,{children:(0,r.jsxs)(Vt.Z,{container:!0,children:[d&&(0,r.jsx)(Vt.Z,{item:!0,xs:12,children:(0,r.jsx)(Ye.Z,{className:R.message,variant:"body1",children:d})}),g&&(0,r.jsx)(Vt.Z,{item:!0,xs:12,className:R.details,children:g})]})})]})}const yt=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),bt=({error:e,message:o,stack:l,children:d})=>{const g=yt();return(0,r.jsxs)(Pt.Z,{dense:!0,children:[(0,r.jsxs)($t.Z,{alignItems:"flex-start",children:[(0,r.jsx)(Qt.Z,{classes:{secondary:g.text},primary:"Error",secondary:e}),(0,r.jsx)(Z,{text:e})]}),(0,r.jsxs)($t.Z,{alignItems:"flex-start",children:[(0,r.jsx)(Qt.Z,{classes:{secondary:g.text},primary:"Message",secondary:o}),(0,r.jsx)(Z,{text:o})]}),l&&(0,r.jsxs)($t.Z,{alignItems:"flex-start",children:[(0,r.jsx)(Qt.Z,{classes:{secondary:g.text},primary:"Stack Trace",secondary:l}),(0,r.jsx)(Z,{text:l})]}),d]})};function ct(e){const{title:o,error:l,defaultExpanded:d,children:g}=e;return(0,r.jsx)(tt,{severity:"error",title:o!=null?o:l.message,defaultExpanded:d,children:(0,r.jsx)(bt,{error:l.name,message:l.message,stack:l.stack,children:g})})}var Oe=n(85256);const wt=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function qt(e){var o;const{title:l,error:d,defaultExpanded:g}=e,x=wt();if(d.name!=="ResponseError")return(0,r.jsx)(ct,{title:l!=null?l:d.message,defaultExpanded:g,error:d});const{body:R,cause:k}=d,{request:q,response:Q}=R,fe=`${Q.statusCode}: ${k.name}`,ge=q&&`${q.method} ${q.url}`,Fe=k.message.replace(/\\n/g,`
14
- `),Ie=(o=k.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
15
- `),Ve=JSON.stringify(R,void 0,2);return(0,r.jsxs)(ct,{title:l!=null?l:d.message,defaultExpanded:g,error:{name:fe,message:Fe,stack:Ie},children:[ge&&(0,r.jsxs)($t.Z,{alignItems:"flex-start",children:[(0,r.jsx)(Qt.Z,{classes:{secondary:x.text},primary:"Request",secondary:q?`${ge}`:void 0}),(0,r.jsx)(Z,{text:ge})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Oe.Z,{component:"li",className:x.divider}),(0,r.jsx)($t.Z,{alignItems:"flex-start",children:(0,r.jsx)(Qt.Z,{classes:{secondary:x.text},primary:"Full Error as JSON"})}),(0,r.jsx)(xe,{language:"json",text:Ve,showCopyCodeButton:!0})]})]})}var jt=n(28316);function Zt(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function _t(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function wn(e){const o=useRef(null);useEffect(function(){const g=document.querySelector(`#${e}`),x=g||Zt(e);return g||_t(x),x.appendChild(o.current),function(){o.current.remove(),x.childNodes.length===-1&&x.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var Bt=null;const mt="core.calloutSeen";function Lt(){const[e,o]=useState(()=>{const d=localStorage.getItem(mt);return d?JSON.parse(d):{}}),l=useCallback((d,g)=>{const x=localStorage.getItem(mt),k={...x?JSON.parse(x):{},[d]:g};o(k),localStorage.setItem(mt,JSON.stringify(k))},[]);return{states:e,setState:l}}function Wt(e){const{states:o,setState:l}=Lt(),d=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:d}}function en(e){const{seen:o,markSeen:l}=Wt(e);return{show:o===!1,hide:l}}const gr=(0,m.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function mr(e){var o,l,d,g,x,R,k,q;const{featureId:Q,title:fe,description:ge,children:Fe}=e,{show:Ie,hide:Ve}=useShowCallout(Q),pt=usePortal("core.callout"),at=useRef(null),[Dt,On]=useState(),Wn=gr(),kt=useCallback(()=>{if(at.current){const nn=at.current.getBoundingClientRect(),fn=Math.max(nn.width,nn.height),Nn=800,Fn=nn.x-(fn-nn.width)/2-Nn,or=nn.y-(fn-nn.height)/2-Nn,jr=fn+2*Nn,to=450,Br=nn.x+nn.width/2-to,Cs=nn.y-(fn-nn.height)/2+fn+20;On({dotLeft:Fn,dotTop:or,dotSize:jr,borderWidth:Nn,textTop:Cs,textLeft:Br,textWidth:to})}},[]);return useEffect(()=>(window.addEventListener("resize",kt),window.addEventListener("scroll",kt),()=>{window.removeEventListener("resize",kt),window.removeEventListener("scroll",kt)}),[kt]),useLayoutEffect(kt,[at.current,kt]),Ie?_jsxs(_Fragment,{children:[_jsx(Box,{className:Wn.featureWrapper,ref:at,children:Fe}),createPortal(_jsx(Box,{className:Wn.backdrop,children:_jsx(ClickAwayListener,{onClickAway:Ve,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:Wn.dot,"data-testid":"dot",style:{left:(o=Dt)===null||o===void 0?void 0:o.dotLeft,top:(l=Dt)===null||l===void 0?void 0:l.dotTop,width:(d=Dt)===null||d===void 0?void 0:d.dotSize,height:(g=Dt)===null||g===void 0?void 0:g.dotSize,borderWidth:(x=Dt)===null||x===void 0?void 0:x.borderWidth},onClick:Ve,onKeyDown:Ve,role:"button",tabIndex:0,children:_jsx(Box,{className:Wn.pulseCircle})}),_jsxs(Box,{className:Wn.text,"data-testid":"text",style:{left:(R=Dt)===null||R===void 0?void 0:R.textLeft,top:(k=Dt)===null||k===void 0?void 0:k.textTop,width:(q=Dt)===null||q===void 0?void 0:q.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:fe}),_jsx(Typography,{children:ge})]})]})})}),pt)]}):_jsx(_Fragment,{children:Fe})}var Xn=n(35292);const vn=(0,m.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function Un({color:e="primary",disabled:o=!1,href:l="#",icon:d=(0,r.jsx)(Xn.Z,{}),label:g,onClick:x,title:R}){const k=vn();return o?(0,r.jsxs)(A.Z,{title:R,className:on()(k.link,k.disabled),children:[d,(0,r.jsx)(Ye.Z,{variant:"caption",component:"span",className:k.label,children:g})]}):(0,r.jsxs)(ce.r,{title:R,className:on()(k.link,k[e]),to:l,onClick:x,children:[d,(0,r.jsx)(Ye.Z,{variant:"caption",component:"span",className:k.label,children:g})]})}const vr=(0,m.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Fr(e){const{links:o}=e,l=vr();return(0,r.jsx)("nav",{className:l.links,children:o.map((d,g)=>(0,r.jsx)(Un,{...d},g+1))})}const Mn=e=>{const o=e==="dark"?"16%":"97%";return`
16
- hsl(0, 0%, ${o}) 0%,
17
- hsla(0, 0%, ${o}, 0.987) 8.1%,
18
- hsla(0, 0%, ${o}, 0.951) 15.5%,
19
- hsla(0, 0%, ${o}, 0.896) 22.5%,
20
- hsla(0, 0%, ${o}, 0.825) 29%,
21
- hsla(0, 0%, ${o}, 0.741) 35.3%,
22
- hsla(0, 0%, ${o}, 0.648) 41.2%,
23
- hsla(0, 0%, ${o}, 0.55) 47.1%,
24
- hsla(0, 0%, ${o}, 0.45) 52.9%,
25
- hsla(0, 0%, ${o}, 0.352) 58.8%,
26
- hsla(0, 0%, ${o}, 0.259) 64.7%,
27
- hsla(0, 0%, ${o}, 0.175) 71%,
28
- hsla(0, 0%, ${o}, 0.104) 77.5%,
29
- hsla(0, 0%, ${o}, 0.049) 84.5%,
30
- hsla(0, 0%, ${o}, 0.013) 91.9%,
31
- hsla(0, 0%, ${o}, 0) 100%
32
- `},Zr=100,S=10,c=(0,m.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:Zr,height:`calc(100% + ${S}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-S,background:`linear-gradient(90deg, ${Mn(e.palette.type)})`},fadeRight:{right:-S,background:`linear-gradient(270deg, ${Mn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function b(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const g=e.current;if(!g){d([0,0]);return}const x=()=>{const R=g.scrollLeft,k=g.scrollWidth-g.offsetWidth-g.scrollLeft;d([R,k])};return x(),g.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{g.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e]),[o,l]}function E(e,o,l){const[d,g]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const x=window.performance.now(),R=requestAnimationFrame(k=>{if(!e.current)return;const q=k-x,Q=Math.abs(d)*q/o,ge=Math.max(l,Q)*Math.sign(d);e.current.scrollBy({left:ge});const Fe=d-ge;Math.sign(d)!==Math.sign(Fe)?g(0):g(Fe)});return()=>cancelAnimationFrame(R)},[e,d,o,l]),g}function J(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:g,...x}=e,R=c(e),k=React.useRef(),[q,Q]=b(k),fe=E(k,l,d),ge=Fe=>{k.current&&fe(Fe?o:-o)};return _jsxs(Box,{...x,className:R.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:R.container,ref:k,children:g}),_jsx(Box,{className:classNames(R.fade,R.fadeLeft,{[R.fadeHidden]:q===0})}),_jsx(Box,{className:classNames(R.fade,R.fadeRight,{[R.fadeHidden]:Q===0})}),q>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ge(!1),className:classNames(R.button,R.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Q>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ge(!0),className:classNames(R.button,R.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const ye=(0,m.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function je(e){const o=ye(e),{shorthand:l,alpha:d}=e;return l?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const De=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function _e(e){const{Progress:o}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(De,{...e})})}var Gt=n(28865),yn=n(60251);const qn=(0,m.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"}),yr=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(yr,e):e,Ar=({level:e,children:o})=>{const g=f.Children.toArray(o).reduce(yr,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:g},o)},xn={code:({inline:e,className:o,children:l,...d})=>{const g=String(l).replace(/\n+$/,""),x=/language-(\w+)/.exec(o||"");return!e&&x?(0,r.jsx)(xe,{language:x[1],text:g}):(0,r.jsx)("code",{className:o,...d,children:l})},h1:Ar,h2:Ar,h3:Ar,h4:Ar,h5:Ar,h6:Ar};function Kr(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:g,transformImageUri:x,className:R}=e,k=qn();return(0,r.jsx)(Gt.D,{remarkPlugins:l==="gfm"?[yn.Z]:[],className:`${k.markdown} ${R}`,children:o,components:xn,linkTarget:d,transformLinkUri:g,transformImageUri:x})}var go=n(23054);const Eo=(0,m.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),ws=({request:e,busy:o,setBusy:l})=>{const d=Eo(),[g,x]=useState(),R=async()=>{l(!0);try{await e.trigger()}catch(q){x(isError(q)?q.message:"An unspecified error occurred")}finally{l(!1)}},k=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(k,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:g&&_jsx(Typography,{color:"error",children:g})}),_jsx(Button,{color:"primary",variant:"contained",onClick:R,children:"Log in"})]})};var Yr=null;const Ko=(0,m.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 js(e){const o=Ko(),[l,d]=useState(!1),g=useApi(oauthRequestApiRef),x=useApi(configApiRef);var R;const k=(R=x.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&R!==void 0?R:!1,q=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),Q=()=>{q.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(q.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),k?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:q.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:d},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:Q,children:"Reject All"})})]})}var Yo=n(15277),Jo=n.n(Yo),Tr=n(29862);const ir=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Jr(e){const[o,l]=(0,f.useState)(!1),d=(0,Tr.t)(),g=ir(),x=k=>{d()&&l(k)};var R;return(0,r.jsx)(T.ZP,{title:(R=e.title)!==null&&R!==void 0?R:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)(Jo(),{text:e.text,line:e.line,onToggled:x,containerClassName:g.container})})}var oo=n(67358);function Ao(e){const o=(0,oe.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const g=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(g)},[o.transitions.duration.short]),l?(0,r.jsx)(oo.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(A.Z,{display:"none"})}var To=n(94339),Ur=n(14503),Qo=n(24579),Ro=n(32552),$n=n(15459),ar=n(27597);const Qr=(0,m.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 Xr(e){const{link:o,title:l,onClick:d}=e,g=Qr();return(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(Oe.Z,{}),(0,r.jsx)(ce.r,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(A.Z,{display:"flex",alignItems:"center",className:g.root,children:[(0,r.jsx)(A.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(Ye.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(ar.Z,{className:g.arrow})]})})]})}const Xo=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(Ye.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(Ye.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(de,{to:o.href,variant:"contained",children:o.name})},xr=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,r.jsx)(ct,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(Xo,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},Io=(0,m.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Po=(0,$n.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Ur.Z),Lo={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Mr(e){const{title:o,subheader:l,divider:d=!0,deepLink:g,slackChannel:x,errorBoundaryProps:R,variant:k,children:q,headerStyle:Q,headerProps:fe,icon:ge,action:Fe,actionsClassName:Ie,actions:Ve,cardClassName:pt,actionsTopRight:at,className:Dt,noPadding:On,titleTypographyProps:Wn}=e,kt=Io();let nn={},fn={};k&&k.split(/[\s]+/g).forEach(jr=>{nn={...nn,...Lo.card[jr]},fn={...fn,...Lo.cardContent[jr]}});const Nn=()=>!l&&!ge?null:(0,r.jsxs)("div",{className:kt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:kt.subheader,children:l}),ge]}),Fn=R||(x?{slackChannel:x}:{});return(0,r.jsx)(To.Z,{style:nn,className:Dt,children:(0,r.jsxs)(xr,{...Fn,children:[o&&(0,r.jsx)(Ro.Z,{classes:{root:kt.header,title:kt.headerTitle,subheader:kt.headerSubheader,avatar:kt.headerAvatar,action:kt.headerAction,content:kt.headerContent},title:o,subheader:Nn(),action:Fe,style:{...Q},titleTypographyProps:Wn,...fe}),at&&(0,r.jsx)(Po,{children:at}),d&&(0,r.jsx)(Oe.Z,{}),(0,r.jsx)(Qo.Z,{className:on()(pt,{[kt.noPadding]:On}),style:fn,children:q}),Ve&&(0,r.jsx)(Ur.Z,{className:Ie,children:Ve}),g&&(0,r.jsx)(Xr,{...g})]})})}var Oo=n(39307);const qo=(0,m.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),mo={fractional:!0,inverse:!1,unit:"%",max:100},ko=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const g=d||mo.max,x=l?g-o:o;return x<g/3?e.status.error:x<g*(2/3)?e.status.warning:e.status.ok};function Es(e){const[o,l]=useState(null),{getColor:d=ko}=e,g=qo(e),{palette:x}=useTheme(),{value:R,fractional:k,inverse:q,unit:Q,max:fe,description:ge}={...mo,...e},Fe=k?Math.round(R*fe):R,Ie=fe!==100?Math.round(R):Fe,[Ve,pt]=useState(!1);return useEffect(()=>{const at=o,Dt=()=>pt(!0),On=()=>pt(!1);return at&&ge?(at.addEventListener("mouseenter",Dt),at.addEventListener("mouseleave",On),()=>{at.removeEventListener("mouseenter",Dt),at.removeEventListener("mouseleave",On)}):()=>{pt(!1)}},[ge,o]),_jsxs(Box,{ref:l,className:g.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Fe,strokeWidth:12,trailWidth:12,strokeColor:d({palette:x,value:Ie,inverse:q,max:fe}),className:g.circle}),ge&&Ve?_jsx(Box,{className:g.description,children:ge}):_jsx(Box,{className:g.overlay,children:isNaN(R)?"N/A":`${Ie}${Q}`})]})}const Bo=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function lr(e){const o=Bo(e),{title:l,subheader:d,progress:g,inverse:x,deepLink:R,description:k,icon:q,variant:Q,getColor:fe}=e,ge={inverse:x,description:k,getColor:fe,value:g};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:R,variant:Q,icon:q,children:_jsx(Gauge,{...ge})})})}function ci(e){const{value:o,getColor:l=getProgressColor,width:d="thick"}=e,{palette:g}=useTheme();if(isNaN(o))return null;let x=Math.round(o*100*100)/100;x>100&&(x=100);const R=d==="thick"?4:1,k=l({palette:g,value:x,inverse:!1,max:100});return _jsx(Tooltip,{title:`${x}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:x,strokeWidth:R,trailWidth:R,strokeColor:k})})})}var _o=n(21324),As=n(7089),vo=n(42494),so=n(74603),io=n(56939),ao=n(12231),Rr=n(73698),_n=n(12420),yo=n(72379);const es=(0,m.Z)(e=>(0,_n.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var lo=()=>{const e=es();return(0,r.jsx)(yo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const ts=(0,m.Z)(e=>(0,_n.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var ns=()=>{const e=ts();return(0,r.jsx)(yo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const rs=(0,$n.Z)(e=>(0,_n.Z)({root:{"label + &":{marginTop:e.spacing(3)},"&.Mui-focused > div[role=button]":{borderColor:e.palette.primary.main}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(so.Z),xo=(0,m.Z)(e=>(0,_n.Z)({formControl:{margin:e.spacing(1,0),maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function $o(e){const{multiple:o,items:l,label:d,placeholder:g,selected:x,onChange:R,triggerReset:k,native:q=!1,disabled:Q=!1,margin:fe}=e,ge=xo(),[Fe,Ie]=(0,f.useState)(x||(o?[]:"")),[Ve,pt]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ie(o?[]:"")},[k,o]),(0,f.useEffect)(()=>{Ie(x||(o?[]:""))},[x,o]);const at=kt=>{Ie(kt.target.value),R(kt.target.value)},Dt=kt=>{if(Q){kt.preventDefault();return}pt(nn=>o&&!(kt.target instanceof HTMLElement)?!0:!nn)},On=()=>{pt(!1)},Wn=kt=>()=>{const nn=Fe.filter(fn=>fn!==kt);Ie(nn),R(nn)};return(0,r.jsx)(A.Z,{className:ge.root,children:(0,r.jsxs)(vo.Z,{className:ge.formControl,children:[(0,r.jsx)(io.Z,{className:ge.formLabel,children:d}),(0,r.jsxs)(Rr.Z,{"aria-label":d,value:Fe,native:q,disabled:Q,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:at,open:Ve,onOpen:Dt,onClose:On,input:(0,r.jsx)(rs,{}),label:d,renderValue:kt=>{var nn;return o&&Fe.length!==0?(0,r.jsx)(A.Z,{className:ge.chips,children:kt.map(fn=>{var Nn,Fn;return(0,r.jsx)(As.Z,{label:(Nn=l.find(or=>or.value===fn))===null||Nn===void 0?void 0:Nn.label,clickable:!0,onDelete:Wn(fn),className:ge.chip},(Fn=l.find(or=>or.value===fn))===null||Fn===void 0?void 0:Fn.value)})}):(0,r.jsx)(Ye.Z,{children:Fe.length===0?g||"":(nn=l.find(fn=>fn.value===kt))===null||nn===void 0?void 0:nn.label})},IconComponent:()=>Ve?(0,r.jsx)(ns,{}):(0,r.jsx)(lo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[g&&!o&&(0,r.jsx)(ao.Z,{value:[],children:g}),q?l&&l.map(kt=>(0,r.jsx)("option",{value:kt.value,children:kt.label},kt.value)):l&&l.map(kt=>(0,r.jsxs)(ao.Z,{value:kt.value,children:[o&&(0,r.jsx)(_o.Z,{color:"primary",checked:Fe.includes(kt.value)||!1,className:ge.checkbox}),kt.label]},kt.value))]})]})})}const bo=()=>{},Is=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:bo,stepHistory:[],setStepHistory:bo,onStepChange:bo});function di(e){const{children:o,elevated:l,onStepChange:d,activeStep:g=0}=e,[x,R]=useState(g),[k,q]=useState([0]);useEffect(()=>{R(g)},[g]);const Q=[];let fe;return Children.forEach(o,ge=>{isValidElement(ge)&&(ge.props.end?fe=ge:Q.push(ge))}),_jsxs(_Fragment,{children:[_jsx(Is.Provider,{value:{stepIndex:x,setStepIndex:R,stepHistory:k,setStepHistory:q,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:x,orientation:"vertical",elevation:l?2:0,children:Q})}),x>=Children.count(o)-1&&fe]})}const os=(0,m.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ss=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),cn=({text:e,handleClick:o,disabled:l,last:d,stepIndex:g})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${g}`,onClick:o,children:e||(d?"Finish":"Next")}),Ps=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),y=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),j=({actions:e={},children:o})=>{const l=os(),{stepperLength:d,stepIndex:g,setStepIndex:x,stepHistory:R,setStepHistory:k,onStepChange:q}=useContext(VerticalStepperContext),Q=(Ie,Ve)=>{Ve&&Ve(),q&&q(g,Ie),x(Ie)},fe=()=>{const Ie=e.nextStep?e.nextStep(g,d-1):g+1;Q(Ie,e.onNext),k([...R,Ie])},ge=()=>{R.pop(),Q(R[R.length-1],e.onBack),k([...R])},Fe=()=>{Q(0,e.onRestart),k([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&g!==0&&_jsx(y,{text:e.backText,handleClick:ge,disabled:g===0,stepIndex:g}),e.showSkip&&_jsx(Ps,{text:e.skipText,handleClick:fe,disabled:!!d&&g>=d||!!e.canSkip&&!e.canSkip(),stepIndex:g}),[void 0,!0].includes(e.showNext)&&_jsx(cn,{text:e.nextText,handleClick:fe,disabled:!!d&&g>=d||!!e.canNext&&!e.canNext(),stepIndex:g}),e.showRestart&&g!==0&&_jsx(ss,{text:e.restartText,handleClick:Fe,stepIndex:g}),o]})},L=(0,m.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function P(e){const{title:o,children:l,end:d,actions:g,...x}=e,R=L();return d?_jsxs(Box,{className:R.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...g||{},showNext:!1}})]}):_jsxs(MuiStep,{...x,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:g})]})]})}const ie=(0,m.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function re(e){const o=ie(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function _(e){const o=ie(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function he(e){const o=ie(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Te(e){const o=ie(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Le(e){const o=ie(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Me(e){const o=ie(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Ne=n(74600),ze=n(15584);const st=e=>(0,_n.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Et={root:{border:"0",verticalAlign:"top"}},Be=e=>(0,_n.Z)({root:{margin:e.spacing(0,0,-1,0)}}),He=e=>(0,_n.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),At=(0,$n.Z)(st,{name:"BackstageMetadataTableTitleCell"})(ze.Z),rn=(0,$n.Z)(Et,{name:"BackstageMetadataTableCell"})(ze.Z),jn=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Ot=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(At,{children:e}),_jsx(rn,{colSpan:e?1:2,...l,children:o})]}),Rt=(0,$n.Z)(Be,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(Pt.Z,{disablePadding:!0,className:e.root,children:o})),Kt=(0,$n.Z)(He,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)($t.Z,{className:e.root,children:o})),En=(0,_n.Z)({root:{margin:"0 0",listStyleType:"none"}}),cr=e=>(0,_n.Z)({root:{...En.root,paddingLeft:e.spacing(1)}}),Ir=(0,$n.Z)(En,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(Rt,{classes:e,children:o})),qr=(0,$n.Z)(cr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(Rt,{classes:e,children:o}));function zn(e,o){const l=e.map((d,g)=>_jsx(MetadataListItem,{children:Pr(d)},g));return o?_jsx(qr,{children:l}):_jsx(Ir,{children:l})}function Kn(e,o,l){const d=Object.keys(e).map(g=>{const x=Pr(e[g],!0),R=l&&l.titleFormat?l.titleFormat(g):startCase(g);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${R}: `}),x]},g)});return o?_jsx(qr,{children:d}):_jsx(Ir,{children:d})}function Pr(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?Kn(e,o,l):Array.isArray(e)?zn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const ui=({value:e,options:o})=>_jsx(Fragment,{children:Pr(e,o)}),hi=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(ui,{value:o,options:l})});function Ls(e,o){return Object.keys(e).map(l=>_jsx(hi,{title:l,value:e[l],options:o},l))}function pi(e){const{metadata:o,dense:l=!0,options:d}=e,g=Ls(o,d||{});return _jsx(MetadataTable,{dense:l,children:g})}var Do=n(49429),br=n(86136),Sr=n(50758),dr=n(79784),co=n(76635),fi=n(19126),Os=n.n(fi);function gi(e){return qs.stringify(e,{strictNullHandling:!0})}function is(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function uo(e,o){return is(e)[o]}function ks(e,o,l){const d={...is(e),[o]:l};return gi(d)}function mi(e,o=250){const[l,d]=useSearchParams(),g=l.toString(),[x,R]=useState(uo(g,e));return useEffect(()=>{const k=uo(g,e);R(q=>isEqual(k,q)?q:k)},[g,R,e]),useDebouncedEffect(()=>{const k=ks(g,e,x);g!==k&&d(k,{replace:!0})},[d,x,g,e],o),[x,R]}const ha={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 So(){var e;const d=(e=(0,p.I_)().get(p.Ds))===null||e===void 0?void 0:e.getOptionalConfig("app.support");if(!d)return ha;var g;return{url:d.getString("url"),items:d.getConfigArray("items").flatMap(x=>({title:x.getString("title"),icon:x.getOptionalString("icon"),links:((g=x.getOptionalConfigArray("links"))!==null&&g!==void 0?g:[]).flatMap(R=>({url:R.getString("url"),title:R.getString("title")}))}))}}var Bs=n(80079);function ur(e,o){const d=(0,p.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(Bs.Z,{...o})}function pa(e){return ur("brokenImage",e)}function fa(e){return ur("catalog",e)}function ga(e){return ur("chat",e)}function ma(e){return ur("dashboard",e)}function va(e){return ur("docs",e)}function ya(e){return ur("email",e)}function xa(e){return ur("github",e)}function vi(e){return ur("group",e)}function No(e){return ur("help",e)}function ba(e){return ur("user",e)}function yi(e){return ur("warning",e)}const Sa=(0,m.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Ca=({icon:e})=>{const o=(0,p.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:No;return(0,r.jsx)(d,{})};var as;const xi=({link:e})=>(0,r.jsx)(ce.r,{to:e.url,children:(as=e.title)!==null&&as!==void 0?as:e.url}),bi=({item:e})=>{var o;return(0,r.jsxs)(ao.Z,{children:[(0,r.jsx)(br.Z,{children:(0,r.jsx)(Ca,{icon:e.icon})}),(0,r.jsx)(Qt.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,g)=>[...l,g>0&&(0,r.jsx)("br",{},g),(0,r.jsx)(xi,{link:d},d.url)],[])})]})};function Si(e){const{title:o,items:l,children:d}=e,{items:g}=So(),[x,R]=(0,f.useState)(!1),[k,q]=(0,f.useState)(null),Q=Sa(),fe=(0,Se.Z)(Ie=>Ie.breakpoints.down("sm")),ge=Ie=>{q(Ie.currentTarget),R(!0)},Fe=()=>{R(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(K.Z,{color:"primary",size:"small",onClick:ge,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(No,{})}):(0,r.jsx)(ve.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:ge,startIcon:(0,r.jsx)(No,{}),children:"Support"})}),(0,r.jsxs)(dr.ZP,{"data-testid":"support-button-popover",open:x,anchorEl:k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Fe,children:[(0,r.jsxs)(Sr.Z,{className:Q.popoverList,autoFocusItem:Boolean(k),children:[o&&(0,r.jsx)(ao.Z,{alignItems:"flex-start",children:(0,r.jsx)(Ye.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Ie,Ve)=>(0,r.jsx)(ao.Z,{alignItems:"flex-start",children:Ie},`child-${Ve}`)),(l!=null?l:g).map((Ie,Ve)=>(0,r.jsx)(bi,{item:Ie},`item-${Ve}`))]}),(0,r.jsx)(Do.Z,{children:(0,r.jsx)(ve.Z,{color:"primary",onClick:Fe,"aria-label":"Close",children:"Close"})})]})]})}var ho=n(18671),hr=n(73557),ls=n(84800);const Fo=72,Ci=24,_r=18,Lr={drawerWidthClosed:Fo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Fo,iconSize:Fo-Ci*2,iconPadding:Ci,selectedIndicatorWidth:3,userBadgePadding:_r,userBadgeDiameter:Fo-_r*2,mobileSidebarHeight:56},Yn=e=>({...Lr,...e,iconContainerWidth:Lr.drawerWidthClosed,iconSize:Lr.drawerWidthClosed-Lr.iconPadding*2,userBadgeDiameter:Lr.drawerWidthClosed-Lr.userBadgePadding*2}),wi={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Lr.defaultOpenDelayMs+200},wa=e=>({...wi,...e}),Ya="@backstage/core/sidebar-intro-dismissed",Cr=(0,f.createContext)({sidebarConfig:Lr,submenuConfig:wi}),ji=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var ja=n(50023),cs=n(4190),Ei=n(87685),Zo=n(44882),eo=n(51837);const Co={isOpen:!1,setOpen:()=>{}},$s=(0,f.createContext)(Co),ds=(0,eo.CT)("sidebar-open-state-context");function us(e){const{children:o,value:l}=e;return(0,r.jsx)($s.Provider,{value:l,children:(0,r.jsx)(ds.Provider,{value:(0,eo.EI)({1:l}),children:o})})}const hs=()=>{const e=(0,f.useContext)(ds),o=(0,f.useContext)($s);if(e===void 0)return o||Co;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var Ai=n(57998),Ti=n(98864);const Ds={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ns=(0,f.createContext)(Ds),Ri=(0,eo.CT)("sidebar-pin-state-context");function Ii(e){const{children:o,value:l}=e;return(0,r.jsx)(Ns.Provider,{value:l,children:(0,r.jsx)(Ri.Provider,{value:(0,eo.EI)({1:l}),children:o})})}const Uo=()=>{const e=(0,f.useContext)(Ri),o=(0,f.useContext)(Ns);if(e===void 0)return o||Ds;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},ps=(0,m.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Pi=e=>{const{to:o,label:l,icon:d,value:g}=e,{sidebarConfig:x}=(0,f.useContext)(Cr),R=ps({sidebarConfig:x}),k=(0,hr.TH)(),{selectedMenuItemIndex:q,setSelectedMenuItemIndex:Q}=(0,f.useContext)(Zs),fe=(Fe,Ie)=>{Q(Ie===q?-1:Ie)},ge=g===q&&q>=0||g!==q&&!(q>=0)&&o===k.pathname;return(0,r.jsx)(Ai.Z,{"aria-label":l,label:l,icon:d,component:Ti.rU,to:o||k.pathname,onChange:fe,value:g,selected:ge,classes:R})},Fs=e=>{const{children:o,to:l,label:d,icon:g,value:x}=e,{isMobile:R}=Uo();return R?(0,r.jsx)(Pi,{to:l,label:d,icon:g,value:x}):(0,r.jsx)(r.Fragment,{children:o})},fs=(0,m.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","@media print":{display:"none"}},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),Li=e=>(0,co.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Oi=f.createElement(Fs).type,ki=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:g}=(0,f.useContext)(Cr),x=fs({sidebarConfig:g});return(0,r.jsxs)(cs.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:x.marginMobileSidebar}}},classes:{root:x.marginMobileSidebar,paperAnchorBottom:x.overlay},children:[(0,r.jsxs)(A.Z,{className:x.overlayHeader,children:[(0,r.jsx)(Ye.Z,{variant:"h3",children:o}),(0,r.jsx)(K.Z,{onClick:d,classes:{root:x.overlayHeaderClose},children:(0,r.jsx)(Ei.Z,{})})]}),(0,r.jsx)(A.Z,{component:"nav",children:e})]})},Zs=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Ea=e=>{const{sidebarConfig:o}=(0,f.useContext)(Cr),{children:l}=e,d=fs({sidebarConfig:o}),g=(0,hr.TH)(),[x,R]=(0,f.useState)(-1);(0,f.useEffect)(()=>{R(-1)},[g.pathname]);let k=(0,p.vJ)(l,Q=>Q.getElements().filter(fe=>fe.type===Oi));if(l)k.length?k=Li(k):k.push((0,r.jsx)(Fs,{icon:(0,r.jsx)(Zo.Z,{}),children:l},"default_menu"));else return null;const q=x>=0&&!k[x].props.to;return(0,r.jsx)(us,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Zs.Provider,{value:{selectedMenuItemIndex:x,setSelectedMenuItemIndex:R},children:[(0,r.jsx)(ki,{label:k[x]&&k[x].props.label,open:q,onClose:()=>R(-1),children:k[x]&&k[x].props.children}),(0,r.jsx)(ja.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:k})]})})};var Mo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Mo||(Mo={}));const Us={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Mo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Mo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Bi=(0,m.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),Ms=(0,f.createContext)({content:{contentRef:void 0}});function zs(e){const[o,l]=(0,f.useState)(()=>Us.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(Cr),g=(0,f.useRef)(null),x=(0,f.useMemo)(()=>({content:{contentRef:g}}),[g]);(0,f.useEffect)(()=>{Us.setSidebarPinState(o)},[o]);const R=(0,Se.Z)(Q=>Q.breakpoints.down("xs"),{noSsr:!0}),k=()=>l(!o),q=Bi({isPinned:o,sidebarConfig:d});return(0,r.jsx)(Ii,{value:{isPinned:o,toggleSidebarPinState:k,isMobile:R},children:(0,r.jsx)(Ms.Provider,{value:x,children:(0,r.jsx)(A.Z,{className:q.root,children:e.children})})})}function zo(){var e;const{content:o}=(0,f.useContext)(Ms);return{focusContent:(0,f.useCallback)(()=>{var d,g,x;(x=o)===null||x===void 0||(g=x.contentRef)===null||g===void 0||(d=g.current)===null||d===void 0||d.focus()},[o]),contentRef:(e=o)===null||e===void 0?void 0:e.contentRef}}const Ws=(0,m.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"@media print":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var er;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(er||(er={}));const $i=e=>{const{sidebarConfig:o}=(0,f.useContext)(Cr),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:g,children:x}=e,R=Ws({sidebarConfig:o}),k=(0,Se.Z)(Dt=>Dt.breakpoints.down("md"),{noSsr:!0}),[q,Q]=(0,f.useState)(er.Closed),fe=(0,f.useRef)(),{isPinned:ge,toggleSidebarPinState:Fe}=Uo(),Ie=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q!==er.Open&&!k&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(er.Open)},l),Q(er.Idle)))},Ve=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q===er.Idle?Q(er.Closed):q===er.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(er.Closed)},d)))},pt=q===er.Open&&!k||ge,at=Dt=>{Dt?(Q(er.Open),Fe()):(Q(er.Closed),Fe())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(Aa,{}),(0,r.jsx)(us,{value:{isOpen:pt,setOpen:at},children:(0,r.jsx)(A.Z,{className:R.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Ie,onFocus:g?()=>{}:Ie,onMouseLeave:g?()=>{}:Ve,onBlur:g?()=>{}:Ve,children:(0,r.jsx)(A.Z,{className:on()(R.drawer,R.drawerWidth,{[R.drawerOpen]:pt}),children:x})})})]})},Di=e=>{var o;const l=Yn((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const g=wa((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:x,disableExpandOnHover:R,openDelayMs:k,closeDelayMs:q}=e,{isMobile:Q}=Uo();return Q?(0,r.jsx)(Ea,{children:x}):(0,r.jsx)(Cr.Provider,{value:{sidebarConfig:l,submenuConfig:g},children:(0,r.jsx)($i,{openDelayMs:k,closeDelayMs:q,disableExpandOnHover:R,children:x})})};function Aa(){var e;const{sidebarConfig:o}=(0,f.useContext)(Cr),{focusContent:l,contentRef:d}=zo(),g=Ws({sidebarConfig:o});return!((e=d)===null||e===void 0)&&e.current?(0,r.jsx)(ve.Z,{onClick:l,variant:"contained",className:on()(g.visuallyHidden),children:"Skip to content"}):null}function po(e,o,l=!1){const d=new URLSearchParams(o.search).toString(),g=Os().parse(d),x=new URLSearchParams(e.search).toString(),R=Os().parse(x),k=l?co.isEqual:co.isMatch;return(0,co.isEqual)(o.pathname,e.pathname)&&k(R,g)}const Ta=(0,m.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),Ja=e=>{const{title:o,subtitle:l,to:d,icon:g,dropdownItems:x,exact:R}=e,k=Ta(),{setIsHoveredOn:q}=useContext(SidebarItemWithSubmenuContext),Q=()=>{q(!1)},fe=useResolvedPath(d!=null?d:""),ge=useLocation();let Fe=isLocationMatch(ge,fe,R);const[Ie,Ve]=useState(!1),pt=()=>{Ve(!Ie)};return x!==void 0?(x.some(at=>{const Dt=resolvePath(at.to);return Fe=isLocationMatch(ge,Dt,R),Fe}),_jsxs(Box,{className:k.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:pt,onTouchStart:at=>at.stopPropagation(),className:classnames(k.item,Fe?k.selected:void 0),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:k.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:k.subtitle,children:l})]}),Ie?_jsx(ArrowDropUpIcon,{className:k.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:k.dropdownArrow})]})}),x&&Ie&&_jsx(Box,{className:k.dropdown,children:x.map((at,Dt)=>_jsx(Tooltip,{title:at.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:at.to,underline:"none",className:k.dropdownItem,onClick:Q,onTouchStart:On=>On.stopPropagation(),children:_jsx(Typography,{component:"span",className:k.textContent,children:at.title})})},Dt))})]})):_jsx(Box,{className:k.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(k.item,Fe?k.selected:void 0),onClick:Q,onTouchStart:at=>at.stopPropagation(),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:k.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:k.subtitle,children:l})]})]})})})};var gs;const Ni=(0,m.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(gs=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&gs!==void 0?gs:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),Vs=e=>{const{isOpen:o}=hs(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(Cr),g=o?l.drawerWidthOpen:l.drawerWidthClosed,x=Ni({left:g,submenuConfig:d}),{isHoveredOn:R}=(0,f.useContext)(ji),[k,q]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{q(R)},[R]),(0,r.jsxs)(A.Z,{className:on()(x.drawer,{[x.drawerOpen]:k}),children:[(0,r.jsx)(Ye.Z,{variant:"h5",component:"span",className:x.title,children:e.title}),e.children]})};var Ra=n(26739),ms=n(76600),Hs=n(83543),Gs=n(59797),Ks=n(98989);const Fi=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),vs=()=>{const e=Fi();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var Qa=null;const Ia=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Xa=()=>{const e=Ia();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var qa=null,ys,Zn;const Pa=e=>(0,m.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(ys=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&ys!==void 0?ys:"#404040"}},highlighted:{background:(Zn=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Zn!==void 0?Zn:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function Wo(e){return(0,f.useMemo)(()=>Pa(e),[e])()}const La=(e,o)=>(0,p.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:g,dropdownItems:x}})=>{if(!d){var R;if(!((R=x)===null||R===void 0)&&R.length){x.forEach(({to:k})=>d=d||po(o,(0,ls.i3)(k)));return}g&&(d=po(o,(0,ls.i3)(g)))}}),d},[o.pathname]);function Ys(e){return e.to===void 0}const Oa=f.createElement(Vs).type,ka=f.forwardRef(function({to:o,end:l,style:d,className:g,activeStyle:x,caseSensitive:R,activeClassName:k="active","aria-current":q="page",...Q},fe){let{pathname:ge}=(0,hr.TH)(),{pathname:Fe}=(0,hr.WU)(o);R||(ge=ge.toLocaleLowerCase("en-US"),Fe=Fe.toLocaleLowerCase("en-US"));let Ie=ge===Fe;!Ie&&!l&&(Ie=ge.startsWith(`${Fe}/`));const Ve=Ie?q:void 0;return(0,r.jsx)(B.rU,{...Q,to:o,ref:fe,"aria-current":Ve,style:{...d,...Ie?x:void 0},className:on()([g,Ie?k:void 0])})}),Zi=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:g=!1,hasSubmenu:x=!1,disableHighlight:R=!1,onClick:k,noTrack:q,children:Q,className:fe,...ge}=e,{sidebarConfig:Fe}=(0,f.useContext)(Cr),Ie=Wo(Fe),{isOpen:Ve}=hs(),pt=!Ve&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},at=(0,r.jsxs)(A.Z,{style:pt,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ve&&x?(0,r.jsx)(Ks.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Dt=(0,r.jsx)(Ra.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:on()({[Ie.closedItemIcon]:!Ve}),children:at}),On=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{"data-testid":"login-button",className:Ie.iconContainer,children:Dt}),d&&(0,r.jsx)(Ye.Z,{variant:"subtitle2",component:"span",className:Ie.label,children:d}),(0,r.jsx)("div",{className:Ie.secondaryAction,children:Q})]}),Wn=Ve?On:Dt,kt={onClick:k,className:on()(fe,Ie.root,Ve?Ie.open:Ie.closed,Ys(e)&&Ie.buttonItem,{[Ie.highlightable]:!R})},nn=(0,p.z$)(),{pathname:fn}=(0,hr.WU)(!Ys(e)&&e.to?e.to:""),Nn=(0,f.useCallback)(Fn=>{var or;if(!q){const jr="click",to=d!=null?d:"Sidebar Item",Br=fn?{attributes:{to:fn}}:void 0;nn.captureEvent(jr,to,Br)}(or=k)===null||or===void 0||or(Fn)},[nn,d,fn,q,k]);return Ys(e)?(0,r.jsx)(ve.Z,{role:"button","aria-label":d,...kt,ref:o,onClick:Nn,children:Wn}):(0,r.jsx)(ka,{...kt,activeClassName:Ie.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...ge,onClick:Nn,children:Wn})}),Ba=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(Cr),d=Wo(l),[g,x]=(0,f.useState)(!1),R=(0,hr.TH)(),k=La(e,R),q=(0,Se.Z)(Fe=>Fe.breakpoints.down("sm")),Q=()=>{x(!0)},fe=()=>{x(!1)},ge=()=>q?g?(0,r.jsx)(Gs.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(Hs.Z,{fontSize:"small",className:d.submenuArrow}):!g&&(0,r.jsx)(Ks.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(ji.Provider,{value:{isHoveredOn:g,setIsHoveredOn:x},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:g?fe:Q,onMouseEnter:Q,className:on()(g&&d.highlighted),children:[(0,r.jsx)(Zi,{hasSubmenu:!0,className:k?d.selected:"",...o,children:ge()}),g&&e]})})},Ui=(0,f.forwardRef)((e,o)=>{const[l]=(0,p.vJ)(e.children,d=>d.getElements().filter(g=>g.type===Oa));return l?(0,r.jsx)(Ba,{...e,children:l}):(0,r.jsx)(Zi,{...e,ref:o})});function _a(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),g=Wo(o),x=e.icon?e.icon:SearchIcon,R=()=>{e.onSearch(l),d("")},k=ge=>{ge.key==="Enter"&&(ge.preventDefault(),R())},q=ge=>{d(ge.target.value)},Q=ge=>{ge.preventDefault(),ge.stopPropagation()},fe=ge=>{R(),ge.preventDefault()};return _jsx(Box,{className:g.searchRoot,children:_jsx(Ui,{icon:x,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:Q,onChange:q,onKeyDown:k,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})})})}const el=(0,ms.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),tl=(0,ms.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),$a=(0,ms.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Da=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),Mi=(0,ms.Z)("div")(({theme:e})=>{const o=Da(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),Na=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=Wo(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(R=>R.breakpoints.down("md"),{noSsr:!0}))return null;const x=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:x,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},zi=(0,m.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function Wi(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=zi({sidebarConfig:o}),{text:d,onClose:g}=e,x=()=>g();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:x,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Js=e=>{const{text:o,onDismiss:l}=e,[d,g]=useState(!1),x=()=>{g(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(Wi,{text:o,onClose:x})})},Vi=null,Hi="And your recently viewed plugins will pop up here!";function Fa(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:g}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:x,recentlyViewedItemsDismissed:R}=d!=null?d:{},k=()=>{g(Q=>({...l,...Q,starredItemsDismissed:!0}))},q=()=>{g(Q=>({...l,...Q,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!x&&_jsxs(_Fragment,{children:[_jsx(Js,{text:Vi,onDismiss:k}),_jsx(SidebarDivider,{})]}),!R&&_jsx(Js,{text:Hi,onDismiss:q})]}):null}const Gi=(0,m.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 Qs(e){const{className:o,stretch:l,noPadding:d,children:g,...x}=e,{contentRef:R}=zo(),k=Gi();return(0,r.jsx)("article",{ref:R,tabIndex:-1,...x,className:on()(k.root,o,{[k.stretch]:l,[k.noPadding]:d}),children:g})}var Za=n(6487),Ki=n(99152);const Yi=(0,m.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Ji(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[g,x]=(0,f.useState)(d!=null?d:0),R=Yi(),k=(0,f.useCallback)((q,Q)=>{d===void 0&&x(Q),l&&d!==Q&&l(Q)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&x(d)},[d]),(0,r.jsx)(A.Z,{className:R.tabsWrapper,children:(0,r.jsx)(Ki.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:k,value:g,children:o.map((q,Q)=>(0,f.createElement)(Za.Z,{...q.tabProps,"data-testid":`header-tab-${Q}`,label:q.label,key:q.id,value:Q,className:R.defaultTab,classes:{selected:R.selected,root:R.tabRoot}}))})})}function Qi(e){const o=(0,hr.UO)(),d=e.map(({path:Fe,children:Ie})=>({caseSensitive:!1,path:`${Fe}/*`,element:Ie})).sort((Fe,Ie)=>Ie.path.replace(/\/\*$/,"").localeCompare(Fe.path.replace(/\/\*$/,"")));var g;const x=(g=(0,hr.V$)(d))!==null&&g!==void 0?g:e[0].children;var R;let k=(R=o["*"])!==null&&R!==void 0?R:"";k.startsWith("/")||(k=`/${k}`);var q;const[Q]=(q=(0,ls.fp)(d,k))!==null&&q!==void 0?q:[],fe=Q?e.findIndex(Fe=>`${Fe.path}/*`===Q.route.path):0;var ge;return{index:fe===-1?0:fe,element:x,route:(ge=e[fe])!==null&&ge!==void 0?ge:e[0]}}function Xs(e){const{routes:o}=e,l=(0,hr.s0)(),{index:d,route:g,element:x}=Qi(o),R=(0,f.useMemo)(()=>o.map(q=>({id:q.path,label:q.title,tabProps:q.tabProps})),[o]),k=q=>{let{path:Q}=o[q];Q=Q.replace(/\/\*$/,""),Q=Q.replace(/^\//,""),l(Q)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ji,{tabs:R,selectedIndex:d,onChange:k}),(0,r.jsxs)(Qs,{children:[(0,r.jsx)(ho.q,{title:g.title}),x]})]})}const xs=()=>null;(0,p.R5)(xs,"core.gatherMountPoints",!0);function _s(e){const o=(0,r.jsx)(xs,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return _s(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:g,children:x,tabProps:R}=l.props;return[{path:d,title:g,children:x,tabProps:R}]})}function Xi(e){const o=_s(e.children);return(0,r.jsx)(Xs,{routes:o})}Xi.Route=xs;const qi=(0,m.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function _i(e){const{value:o,subvalue:l}=e,d=qi();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{className:d.value,children:o}),(0,r.jsx)(A.Z,{className:d.subvalue,children:l})]})}var tr=n(67222),ea=n(21070),ta=n(90324),na=n(98281),ei=n(48049),ti=n(51209),ni=n(33375),ra=n(44233),oa=n(27604),ri=n(36444),sa=n(37971),i=n(59709),t=n(17373),s=n(3702),a=n(93111);const u=(0,m.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),C=e=>{var o;const l=u(),{onChangeFilters:d}=e,[g,x]=(0,f.useState)({...e.selectedFilters}),[R,k]=(0,f.useState)(!1),q=()=>{x({}),k(Q=>!Q)};return(0,f.useEffect)(()=>{d(g)},[g,d]),(0,r.jsxs)(A.Z,{className:l.root,children:[(0,r.jsxs)(A.Z,{className:l.header,children:[(0,r.jsx)(A.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ve.Z,{color:"primary",onClick:q,children:"Clear all"})]}),(0,r.jsx)(A.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(Q=>(0,r.jsx)($o,{triggerReset:R,...Q.element,selected:g[Q.element.label],onChange:fe=>x({...g,[Q.element.label]:fe})},Q.element.label))})]})},D={Add:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ea.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,r.jsx)(na.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ni.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ra.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ti.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,r.jsx)(oa.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,r.jsx)(s.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ri.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(sa.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(i.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ti.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ni.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ri.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ta.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,r.jsx)(t.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,r.jsx)(a.Z,{...e,ref:o}))};function U(e,o){const l=o.split(".");let d=e[l[0]];for(let g=1;g<l.length;++g){if(d===void 0)return d;const x=l[g];d=d[x]}return d}const le=(0,$n.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}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(tr.W$),me=(0,$n.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(tr.UW),Ue=(0,m.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ee=(0,m.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function We(e,o){return e.map(l=>{var d;const g=(d=l.headerStyle)!==null&&d!==void 0?d:{};let x=l.cellStyle||{};if(l.highlight)if(g.color=o.palette.textContrast,typeof x=="object")x.fontWeight=o.typography.fontWeightBold;else{const R=x;x=(k,q,Q)=>({...R(k,q,Q),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:g,cellStyle:x}})}function nt(e,o){return(0,co.transform)(e,(l,d,g)=>{(0,co.isEqual)(d,o[g])||(l[g]=d)})}const it={search:"",filtersOpen:!1,filters:{}};function tn(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:g,toggleFilters:x}=e,R=Ue(),k=(0,f.useCallback)(q=>{e.onSearchChanged(q),l(q)},[e,l]);return d?(0,r.jsxs)(A.Z,{className:R.root,children:[(0,r.jsxs)(A.Z,{className:R.root,children:[(0,r.jsx)(K.Z,{onClick:x,"aria-label":"filter list",children:(0,r.jsx)(ri.Z,{})}),(0,r.jsxs)(Ye.Z,{className:R.title,children:["Filters (",g,")"]})]}),(0,r.jsx)(me,{...e,ref:o,onSearchChanged:k})]}):(0,r.jsx)(me,{...e,ref:o,onSearchChanged:k})}function Mt(e){var o,l;const{data:d,columns:g,options:x,title:R,subtitle:k,filters:q,initialState:Q,emptyContent:fe,onStateChange:ge,components:Fe,...Ie}=e,Ve=Ee(),pt=(0,oe.Z)(),at={...it,...Q},[Dt,On]=(0,f.useState)(at.filtersOpen),Wn=(0,f.useCallback)(()=>On(Jn=>!Jn),[On]),[kt,nn]=(0,f.useState)(0),[fn,Nn]=(0,f.useState)(d),[Fn,or]=(0,f.useState)(at.filters),jr=We(g,pt),[to,Br]=(0,f.useState)(at.search);(0,f.useEffect)(()=>{if(ge){const Jn=nt({search:to,filtersOpen:Dt,filters:Fn},it);ge(Jn)}},[to,Dt,Fn,ge]);const Cs={headerStyle:{textTransform:"uppercase"}},dn=(0,f.useCallback)(Jn=>{var Gr;return(Gr=g.find($r=>$r.title===Jn))===null||Gr===void 0?void 0:Gr.field},[g]);(0,f.useEffect)(()=>{if(typeof d=="function")return;if(!Fn){Nn(d);return}const Jn=Object.values(Fn);if(d&&Jn.flat().length){const Gr=d.filter($r=>!!Object.entries(Fn).filter(([,Er])=>!!Er.length).every(([Er,Vn])=>{const sr=U($r,dn(Er));return Array.isArray(sr)&&Array.isArray(Vn)?sr.some(Go=>Vn.includes(Go)):Array.isArray(sr)?sr.includes(Vn):Array.isArray(Vn)?Vn.includes(sr):sr===Vn}));Nn(Gr)}else Nn(d);nn(Jn.flat().length)},[d,Fn,dn]);const Ho=(Jn,Gr)=>{const $r=Vn=>{const sr=new Set,Go=fo=>{fo!=null&&sr.add(fo)};return Gr&&Gr.forEach(fo=>{const no=U(fo,dn(Vn));Array.isArray(no)?no.forEach(Go):Go(no)}),sr},Er=Vn=>({placeholder:"All results",label:Vn.column,multiple:Vn.type==="multiple-select",items:[...$r(Vn.column)].sort().map(sr=>({label:sr,value:sr}))});return Jn.map(Vn=>({type:Vn.type,element:Er(Vn)}))},si=!!(!((o=q)===null||o===void 0)&&o.length),jo=(0,f.useCallback)(Jn=>(0,r.jsx)(tn,{setSearch:Br,hasFilters:si,selectedFiltersLength:kt,toggleFilters:Wn,...Jn}),[Wn,si,kt,Br]),ii=typeof d!="function"&&d.length===0,ai=g.length,ua=(0,f.useCallback)(Jn=>fe&&ii?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:ai,children:fe})})}):(0,r.jsx)(tr.os,{...Jn}),[ii,fe,ai]);return(0,r.jsxs)(A.Z,{className:Ve.root,children:[Dt&&d&&typeof d!="function"&&((l=q)===null||l===void 0?void 0:l.length)&&(0,r.jsx)(C,{filters:Ho(q,d),selectedFilters:Fn,onChangeFilters:or}),(0,r.jsx)(tr.ZP,{components:{Header:le,Toolbar:jo,Body:ua,...Fe},options:{...Cs,...x},columns:jr,icons:D,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ye.Z,{variant:"h5",component:"h2",children:R}),k&&(0,r.jsx)(Ye.Z,{color:"textSecondary",variant:"body1",children:k})]}),data:typeof d=="function"?d:fn,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...Ie})]})}Mt.icons=Object.freeze(D);var nr=n(44311);function zr(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function wr(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:zr(e.data,o)})]})}const pr=e=>(0,m.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),fr=({title:e="Unknown page",className:o})=>(0,r.jsx)(Ye.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Dn(e){const{description:o,title:l,titleComponent:d=void 0,children:g,textAlign:x="left"}=e,R=pr({textAlign:x})(),k=d||(0,r.jsx)(fr,{title:l,className:R.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ho.q,{title:l}),(0,r.jsxs)(A.Z,{className:R.container,children:[(0,r.jsxs)(A.Z,{className:R.leftItemsBox,children:[k,o&&(0,r.jsx)(Ye.Z,{className:R.description,variant:"body2",children:o})]}),(0,r.jsx)(A.Z,{className:R.rightItemsBox,children:g})]})]})}var Or=n.p+"static/mic-drop.fe3ef4d0..svg";const Wr=(0,m.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),kr=()=>{const e=Wr();return(0,r.jsx)("img",{src:Or,className:e.micDrop,alt:"Girl dropping mic from her hands"})},In=(0,m.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Vr(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:g}=e,x=In(),R=(0,hr.s0)(),k=So();return(0,r.jsxs)(Vt.Z,{container:!0,spacing:0,className:x.container,children:[(0,r.jsxs)(Vt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(Ye.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",o,": ",l]}),(0,r.jsx)(Ye.Z,{variant:"body1",className:x.subtitle,children:d}),(0,r.jsx)(Ye.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(Ye.Z,{variant:"h6",children:[(0,r.jsx)(ce.r,{to:"#","data-testid":"go-back-link",onClick:()=>R(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(ce.r,{to:g||k.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(kr,{})]})}var wo=n(16173);const ia=(0,$n.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(Ye.Z),Hr=(0,$n.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(A.Z);function aa(e){const{children:o,...l}=e,[d,g]=f.useState(null),x=f.Children.toArray(o),[R,k,...q]=x,Q=q.length?q.pop():x[x.length-1],fe=x.length>3,ge=Ve=>{g(Ve.currentTarget)},Fe=()=>{g(null)},Ie=Boolean(d);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(wo.Z,{"aria-label":"breadcrumb",...l,children:[x.length>1&&(0,r.jsx)(Hr,{clone:!0,children:R}),x.length>2&&(0,r.jsx)(Hr,{clone:!0,children:k}),fe&&(0,r.jsx)(ia,{onClick:ge,children:"..."}),(0,r.jsx)(A.Z,{style:{fontStyle:"italic"},children:Q})]}),(0,r.jsx)(dr.ZP,{open:Ie,anchorEl:d,onClose:Fe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Pt.Z,{children:q.map((Ve,pt)=>(0,r.jsx)($t.Z,{button:!0,children:(0,r.jsx)(Hr,{clone:!0,children:Ve})},pt))})})]})}const oi=(0,m.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"}),nl=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,r.jsxs)(aa,{className:l.breadcrumb,children:[(0,r.jsx)(ce.r,{to:o,children:e}),(0,r.jsx)(Ye.Z,{children:d})]}):(0,r.jsx)(Ye.Z,{className:l.type,children:e}):null,rl=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,r.jsx)(Ye.Z,{className:o.title,variant:"h1",children:e});return l?(0,r.jsx)(T.ZP,{title:l,placement:"top-start",children:d}):d},ol=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(Ye.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function Ua(e){const{children:o,pageTitleOverride:l,style:d,subtitle:g,title:x,tooltip:R,type:k,typeLink:q}=e,Q=oi(),ge=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Fe=l||x,Ie=x||l,Ve=`${Fe} | %s | ${ge}`,pt=`${Fe} | ${ge}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ho.q,{titleTemplate:Ve,defaultTitle:pt}),(0,r.jsxs)("header",{style:d,className:Q.header,children:[(0,r.jsxs)(A.Z,{className:Q.leftItemsBox,children:[(0,r.jsx)(nl,{classes:Q,type:k,typeLink:q,pageTitle:Ie}),(0,r.jsx)(rl,{classes:Q,pageTitle:Ie,tooltip:R}),(0,r.jsx)(ol,{classes:Q,subtitle:g})]}),(0,r.jsx)(Vt.Z,{container:!0,className:Q.rightItemsBox,spacing:4,children:o})]})]})}const sl=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:g})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:x=>{g&&g(x)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function Nl(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,g]=React.useState(!1),x=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>g(!0),"data-testid":"header-action-menu",ref:x,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:x.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>g(!1),children:_jsx(List,{children:l.map((R,k)=>_jsx(sl,{...R},`header-action-menu-${k}`))})})]})}const il=(0,m.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,Xt.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),al=({value:e,className:o})=>(0,r.jsx)(Ye.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function ll(e){const{label:o,value:l,url:d}=e,g=il(),x=(0,r.jsx)(al,{className:g.value,value:l||"<Unknown>"});return(0,r.jsx)(Vt.Z,{item:!0,children:(0,r.jsxs)(Ye.Z,{component:"span",className:g.root,children:[(0,r.jsx)(Ye.Z,{className:g.label,children:o}),d?(0,r.jsx)(ce.r,{to:d,children:x}):x]})})}const cl=e=>(0,_n.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),dl=(0,m.Z)(cl,{name:"BackstageItemCardHeader"});function ul(e){const{title:o,subtitle:l,children:d}=e,g=dl(e);return(0,r.jsxs)(A.Z,{className:g.root,children:[l&&(0,r.jsx)(Ye.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,r.jsx)(Ye.Z,{variant:"h6",component:"h4",children:o}),d]})}function Fl(e){var o;const{description:l,tags:d,title:g,type:x,subtitle:R,label:k,onClick:q,href:Q}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:g,subtitle:R||x})}),_jsxs(CardContent,{children:[!((o=d)===null||o===void 0)&&o.length?_jsx(Box,{children:d.map((fe,ge)=>_jsx(Chip,{size:"small",label:fe},ge))}):null,l]}),_jsxs(CardActions,{children:[!Q&&_jsx(LinkButton,{to:"#",onClick:q,color:"primary",children:k}),Q&&_jsx(LinkButton,{to:Q,color:"primary",children:k})]})]})}const hl=e=>(0,_n.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),pl=(0,m.Z)(hl,{name:"BackstageItemCardGrid"});function fl(e){const{children:o,...l}=e,d=pl(l);return(0,r.jsx)(A.Z,{className:d.root,...l,children:o})}var gl=n(41547);const ml=(0,m.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function Ma(e){const{themeId:o,children:l}=e,d=ml();return(0,r.jsx)(gl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:d.root,children:l})})}function vl(e){const{themeId:o,children:l,...d}=e;return(0,r.jsxs)(Ma,{themeId:o,children:[(0,r.jsx)(Ua,{...d}),l]})}var rr=n(30195);const Zl=rr.z.object({providerInfo:rr.z.object({}).catchall(rr.z.unknown()).optional(),profile:rr.z.object({email:rr.z.string().optional(),displayName:rr.z.string().optional(),picture:rr.z.string().optional()}),backstageIdentity:rr.z.object({token:rr.z.string(),identity:rr.z.object({type:rr.z.literal("user"),userEntityRef:rr.z.string(),ownershipEntityRefs:rr.z.array(rr.z.string())})})}),za={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function yl(e){const o=new Date(Date.now()+za.defaultTokenExpiryMillis);if(!e)return o;const[l,d,g]=e.split("."),x=JSON.parse(window.atob(d));return typeof x.exp!="number"?o:new Date(x.exp*1e3-za.tokenExpiryMarginMillis)}class Ul{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!d)throw new TypeError(`Invalid user entity reference "${l}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:yl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const g=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!g.ok)throw await ResponseError.fromResponse(g);return proxiedSessionSchema.parse(await g.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Ml=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:g}]=useAsync(async()=>{const x=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await x.start(),e.onSignInSuccess(x)});return useMountEffect(g),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},xl=(0,m.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),la=({children:e})=>{const o=xl();return(0,r.jsx)(Vt.Z,{component:"li",item:!0,classes:o,children:e})};var bs=n(87612);class ca{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function bl(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class da{getUserId(){return this.result.userId}static fromResult(o){return new da(o)}async getIdToken(){var o,l;return(o=(l=this.result).getIdToken)===null||o===void 0?void 0:o.call(l)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const g=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:g,ownershipEntityRefs:[g]}}const{sub:l,ent:d}=bl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((o=(l=this.result).getIdToken)===null||o===void 0?void 0:o.call(l))}}async signOut(){var o,l;return(o=(l=this.result).signOut)===null||o===void 0?void 0:o.call(l)}constructor(o){(0,bs._)(this,"result",void 0),this.result=o}}class Ss{static createGuest(){return new ca}static fromLegacy(o){return da.fromResult(o)}static create(o){return new Ss(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,d){(0,bs._)(this,"identity",void 0),(0,bs._)(this,"authApi",void 0),(0,bs._)(this,"profile",void 0),(0,bs._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const Sl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:g,title:x,message:R}=e,k=(0,p.h_)(g),q=(0,p.h_)(p.VE),Q=async()=>{try{o();const fe=await k.getBackstageIdentity({instantPopup:!0});if(!fe)throw d(),new Error(`The ${x} provider is not configured to support sign-in`);const ge=await k.getProfile();l(Ss.create({identity:fe.identity,profile:ge,authApi:k}))}catch(fe){d(),q.post(new go.SP("Login failed",fe))}};return(0,r.jsx)(la,{children:(0,r.jsx)(Mr,{variant:"fullHeight",title:x,actions:(0,r.jsx)(ve.Z,{color:"primary",variant:"outlined",onClick:Q,children:"Sign In"}),children:(0,r.jsx)(Ye.Z,{variant:"body1",children:R})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const g=await l.getProfile();return Ss.create({identity:d.identity,profile:g,authApi:l})}},Cl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(la,{children:(0,r.jsx)(Mr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ve.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new ca)},children:"Enter"}),children:(0,r.jsxs)(Ye.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ca};var wl=n(63955),Wa=n(86619),Va=n(74828),jl=n(45455),El=n.n(jl);const Al=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Tl=(0,m.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ha=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},Rl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{var l;const d=Tl(),{register:g,handleSubmit:x,formState:R}=(0,wl.cI)({mode:"onChange"}),{errors:k}=R,q=({userId:Q,idToken:fe})=>{e(),o(Ss.fromLegacy({userId:Q,getIdToken:fe!==void 0?async()=>fe:void 0,profile:{email:`${Q}@example.com`}}))};return(0,r.jsx)(la,{children:(0,r.jsxs)(Mr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(Ye.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:d.form,onSubmit:x(q),children:[(0,r.jsxs)(vo.Z,{children:[(0,r.jsx)(Wa.Z,{...Ha(g("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(k.userId)}),k.userId&&(0,r.jsx)(Va.Z,{error:!0,children:k.userId.message})]}),(0,r.jsxs)(vo.Z,{children:[(0,r.jsx)(Wa.Z,{...Ha(g("idToken",{required:!1,validate:Q=>!Q||Al.test(Q)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(k.idToken)}),k.idToken&&(0,r.jsx)(Va.Z,{error:!0,children:k.idToken.message})]}),(0,r.jsx)(ve.Z,{type:"submit",color:"primary",variant:"outlined",className:d.button,disabled:!(!((l=R)===null||l===void 0)&&l.isDirty)||!El()(k),children:"Continue"})]})]})})},loader:async()=>{}},Vo="@backstage/core:SignInPage:provider",Ga={guest:Cl,custom:Rl,common:Sl};function Ka(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Yl(e){return e.reduce((l,d)=>{if(typeof d=="string")return Ka(d,l),l[d]={components:Ga[d],id:d},l;const{id:g}=d;return Ka(g,l),l[g]={components:Ga.common,id:g,config:d},l},{})}const Jl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[g,x]=useState(!0),R=useCallback(q=>{o(IdentityApiSignOutProxy.from({identityApi:q,signOut:async()=>{var Q,fe;localStorage.removeItem(Vo),await((Q=(fe=q).signOut)===null||Q===void 0?void 0:Q.call(fe))}}))},[o]);useLayoutEffect(()=>{var q;if(!g)return;const Q=localStorage.getItem(Vo);if(Q===null){x(!1);return}const fe=e[Q];if(!fe){x(!1);return}let ge=!1;return fe.components.loader(d,(q=fe.config)===null||q===void 0?void 0:q.apiRef).then(Fe=>{if(ge){localStorage.removeItem(Vo);return}Fe?R(Fe):x(!1)}).catch(Fe=>{localStorage.removeItem(Vo),!ge&&(l.post(Fe),x(!1))}),()=>{ge=!0}},[g,l,o,d,e,R]);const k=useMemo(()=>Object.keys(e).map(q=>{const Q=e[q],{Component:fe}=Q.components,ge=Ve=>{R(Ve)},Fe=()=>{var Ve,pt;localStorage.setItem(Vo,((pt=Q)===null||pt===void 0||(Ve=pt.config)===null||Ve===void 0?void 0:Ve.id)||Q.id)},Ie=()=>{localStorage.removeItem(Vo)};return _jsx(fe,{config:Q.config,onSignInStarted:Fe,onSignInSuccess:ge,onSignInFailure:Ie},Q.id)}),[e,R]);return[g,k]},Il=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const g=useApi(configApiRef),x=useStyles(),R=getSignInProviders(o),[k,q]=useSignInProviders(R,e);return k?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:g.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:x,children:q})]})]})},Pl=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),g=useApi(e.apiRef),x=useApi(configApiRef),[R,k]=useState(),[q,Q]=useState(!1),fe=async({checkExisting:ge,showPopup:Fe})=>{try{let Ie;if(ge&&(Ie=await g.getBackstageIdentity({optional:!0})),!Ie&&(Fe||o)&&(Q(!0),Ie=await g.getBackstageIdentity({instantPopup:!0}),!Ie))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ie){Q(!0);return}const Ve=await g.getProfile();l(UserIdentity.create({identity:Ie.identity,authApi:g,profile:Ve}))}catch(Ie){k(Ie),Q(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),q?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:x.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),R&&R.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:R.message})]})})})})]}):_jsx(Progress,{})};function Ql(e){return"provider"in e?_jsx(Pl,{...e}):_jsx(Il,{...e})}const Ll=(0,m.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"}),Ol=(0,$n.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Ro.Z);function Xl(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:g,deepLink:x,value:R,onChange:k}=e,q=Ll(),[Q,fe]=useState(0),ge=k||((Ve,pt)=>fe(pt));let Fe;R?React.Children.map(d,Ve=>{var pt;if(React.isValidElement(Ve)&&((pt=Ve)===null||pt===void 0?void 0:pt.props.value)===R){var at,Dt;Fe=(Dt=Ve)===null||Dt===void 0||(at=Dt.props)===null||at===void 0?void 0:at.children}}):React.Children.map(d,(Ve,pt)=>{if(React.isValidElement(Ve)&&pt===Q){var at;Fe=(at=Ve)===null||at===void 0?void 0:at.props.children}});const Ie=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ie,children:[g&&_jsx(Ol,{title:g}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:q,value:R||Q,onChange:ge,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Fe}),x&&_jsx(BottomLink,{...x})]})})}const kl=(0,m.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function ql(e){const{children:o,...l}=e,d=kl();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(It,Pe,n){"use strict";n.d(Pe,{fC:function(){return m},CL:function(){return Tt},sM:function(){return oe},$v:function(){return Se},v_:function(){return B},hg:function(){return Ge},uB:function(){return xe},R5:function(){return et},bq:function(){return I},Km:function(){return Z},Ds:function(){return xt},ni:function(){return A},T0:function(){return $},CO:function(){return sn},x8:function(){return pn},rx:function(){return Gn},YO:function(){return Bn},P4:function(){return An},NT:function(){return Ct},NW:function(){return Nt},VE:function(){return zt},W0:function(){return Ft},gP:function(){return Yt},IY:function(){return vt},F4:function(){return ee},ux:function(){return K},Kp:function(){return se},$4:function(){return dt},p_:function(){return T},ZM:function(){return ut},D:function(){return X},gW:function(){return w},E6:function(){return St},z$:function(){return $e},h_:function(){return ve},I_:function(){return F},qD:function(){return Ke},vJ:function(){return Hn},tg:function(){return Xe},Oi:function(){return Jt}});var r=n(52322),p=n(51837),W=n(2784);const f=(0,p.CT)("analytics-context"),V=()=>{const we=(0,W.useContext)(f);if(we===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const pe=we.atVersion(1);if(pe===void 0)throw new Error("No context found for version 1.");return pe},m=we=>{const{attributes:pe,children:Re}=we,N={...V(),...pe},ae=(0,p.EI)({1:N});return(0,r.jsx)(f.Provider,{value:ae,children:Re})};function h(we,pe){const Re=H=>_jsx(m,{attributes:pe,children:_jsx(we,{...H})});return Re.displayName=`WithAnalyticsContext(${we.displayName||we.name||"Component"})`,Re}function F(){const we=(0,p.Vt)("api-context");if(!we)throw new Error("API context is not available");const pe=we.atVersion(1);if(!pe)throw new Error("ApiContext v1 not available");return pe}function ve(we){const Re=F().get(we);if(!Re)throw new Error(`No implementation available for ${we}`);return Re}function ce(we){return function(Re){const H=ae=>{const Ae=F(),Ze={};for(const qe in we)if(we.hasOwnProperty(qe)){const Pt=we[qe],$t=Ae.get(Pt);if(!$t)throw new Error(`No implementation available for ${Pt}`);Ze[qe]=$t}return _jsx(Re,{...ae,...Ze})},N=Re.displayName||Re.name||"Component";return H.displayName=`withApis(${N})`,H}}var z=n(87612);class de{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(pe){if((0,z._)(this,"config",void 0),this.config=pe,!pe.id.split(".").flatMap(H=>H.split("-")).every(H=>H.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${pe.id}'`)}}function $(we){return new de(we)}function A(we,pe){return"id"in we?{api:we,deps:{},factory:()=>pe}:we}var oe;(function(we){we.SignedIn="SignedIn",we.SignedOut="SignedOut"})(oe||(oe={}));const se=$({id:"core.auth.google"}),ee=$({id:"core.auth.github"}),X=$({id:"core.auth.okta"}),K=$({id:"core.auth.gitlab"}),T=$({id:"core.auth.microsoft"}),w=$({id:"core.auth.onelogin"}),I=$({id:"core.auth.bitbucket"}),Z=$({id:"core.auth.bitbucket-server"}),xe=$({id:"core.auth.atlassian"}),Se=$({id:"core.alert"}),B=$({id:"core.analytics"}),Ge=$({id:"core.apptheme"}),xt=$({id:"core.config"}),Nt=$({id:"core.discovery"}),zt=$({id:"core.error"});var Tt;(function(we){we[we.None=0]="None",we[we.Active=1]="Active"})(Tt||(Tt={}));const Ft=$({id:"core.featureflags"}),Yt=$({id:"core.fetch"}),dt=$({id:"core.identity"}),ut=$({id:"core.oauthrequest"}),St=$({id:"core.storage"}),lt=(0,p.uW)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),Ut="_ROUTABLE-EXTENSION-RENDERED";class Ht{setContext(pe){this.context=pe}captureEvent(pe,Re,{value:H,attributes:N}={}){const{_routeNodeType:ae,...Ae}=this.context;if(pe===Ut){lt.mostRecentGatheredNavigation&&(lt.mostRecentRoutableExtensionRender={context:{...Ae,extension:"App"}});return}if(lt.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...lt.mostRecentGatheredNavigation,...lt.mostRecentRoutableExtensionRender})}catch(Ze){console.warn("Error during analytics event capture. %o",Ze)}lt.mostRecentGatheredNavigation=void 0,lt.mostRecentRoutableExtensionRender=void 0}if(pe==="navigate"&&ae==="gathered"&&Ae.pluginId==="root"){lt.mostRecentGatheredNavigation={action:pe,subject:Re,value:H,attributes:N,context:Ae};return}try{this.analyticsApi.captureEvent({action:pe,subject:Re,value:H,attributes:N,context:Ae})}catch(Ze){console.warn("Error during analytics event capture. %o",Ze)}}constructor(pe,Re={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,z._)(this,"analyticsApi",void 0),(0,z._)(this,"context",void 0),this.analyticsApi=pe,this.context=Re,lt.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{lt.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({...lt.mostRecentGatheredNavigation,...lt.mostRecentRoutableExtensionRender}),lt.mostRecentGatheredNavigation=void 0,lt.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),lt.beforeUnloadRegistered=!0)}}function Ce(){try{return ve(B)}catch{return{captureEvent:()=>{}}}}function $e(){const we=(0,W.useRef)(null),pe=V(),Re=Ce();function H(){return we.current===null&&(we.current=new Ht(Re)),we.current}const N=H();return N.setContext(pe),N}const Ke=()=>{const we=(0,p.Vt)("app-context");if(!we)throw new Error("App context is not available");const pe=we.atVersion(1);if(!pe)throw new Error("AppContext v1 not available");return pe},ht=(0,p.uW)("component-data-store",()=>new WeakMap),rt="__backstage_data";function et(we,pe,Re){const H=we;var N;let ae=(N=H[rt])!==null&&N!==void 0?N:ht.get(we);if(ae||(ae={map:new Map},Object.defineProperty(H,rt,{enumerable:!1,configurable:!0,writable:!1,value:ae}),ht.set(we,ae)),ae.map.has(pe)){const Ae=we.displayName||we.name;throw new Error(`Attempted to attach duplicate data "${pe}" to component "${Ae}"`)}ae.map.set(pe,Re)}function vt(we,pe){if(!we)return;const Re=we.type;if(!Re)return;var H;const N=(H=Re[rt])!==null&&H!==void 0?H:ht.get(Re);if(N)return N.map.get(pe)}const ot=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Je=ot,ft=Je;class gt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(pe,Re){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,ft,void 0),this.id=pe,this.params=Re,this[Je]="absolute"}}function Ct(we){var pe;return new gt(we.id,(pe=we.params)!==null&&pe!==void 0?pe:[])}const gn=/^\w+$/;let un=null,ln=null;class bn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(pe,Re,H,N){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,ln,void 0),this.id=pe,this.path=Re,this.parent=H,this.params=N,this[un]="sub"}}function hn(we){const{id:pe,path:Re,parent:H}=we,N=Re.split("/").filter(Ze=>Ze.startsWith(":")).map(Ze=>Ze.substring(1)),ae=[...H.params,...N];if(H.params.some(Ze=>N.includes(Ze)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Re.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Re}'`);if(Re.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Re}'`);for(const Ze of N)if(!gn.test(Ze))throw new Error(`SubRouteRef path has invalid param, got '${Ze}'`);return new bn(pe,Re,H,ae)}let mn=ot,Sn=mn;class on{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(pe,Re,H){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,"optional",void 0),(0,z._)(this,Sn,void 0),this.id=pe,this.params=Re,this.optional=H,this[mn]="external"}}function pn(we){var pe;return new on(we.id,(pe=we.params)!==null&&pe!==void 0?pe:[],Boolean(we.optional))}var Cn=n(73557);function Xe(we){const{pathname:pe}=(0,Cn.TH)(),Re=(0,p.Vt)("routing-context");if(!Re)throw new Error("Routing context is not available");const H=Re.atVersion(1),N=(0,W.useMemo)(()=>H&&H.resolve(we,{pathname:pe}),[H,we,pe]);if(!Re)throw new Error("useRouteRef used outside of routing context");if(!H)throw new Error("RoutingContext v1 not available");const ae="optional"in we&&we.optional;if(!N&&!ae)throw new Error(`No path for ${we}`);return N}function Jt(we){return(0,Cn.UO)()}class Vt extends W.Component{static getDerivedStateFromError(pe){return{error:pe}}render(){const{error:pe}=this.state,{app:Re,plugin:H}=this.props,{ErrorBoundaryFallback:N}=Re.getComponents();return pe?(0,r.jsx)(N,{error:pe,resetError:this.handleErrorReset,plugin:H}):this.props.children}constructor(...pe){super(...pe),(0,z._)(this,"state",{error:void 0}),(0,z._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var Ye=n(64355);function An(we){const{component:pe,mountPoint:Re,name:H}=we;return Bn({component:{lazy:()=>pe().then(N=>{const ae=Ze=>{const qe=$e();try{Xe(Re)}catch(Pt){if(typeof Pt=="object"&&Pt!==null){const{message:$t}=Pt;if(typeof $t=="string"&&$t.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Re} 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 Pt}return(0,W.useEffect)(()=>{qe.captureEvent(Ut,"")},[qe]),(0,r.jsx)(N,{...Ze})},Ae=H||N.displayName||N.name||"LazyComponent";return ae.displayName=`RoutableExtension(${Ae})`,ae},N=>Ae=>{const Ze=Ke(),{BootErrorPage:qe}=Ze.getComponents();return(0,r.jsx)(qe,{step:"load-chunk",error:N})})},data:{"core.mountPoint":Re},name:H})}function sn(we){const{component:pe,name:Re}=we;return Bn({component:pe,name:Re})}function Bn(we){const{data:pe={},name:Re}=we;Re||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let H;if("lazy"in we.component){const ae=we.component.lazy;H=(0,W.lazy)(()=>ae().then(Ae=>({default:Ae})))}else H=we.component.sync;const N=Re||H.displayName||H.name||"Component";return{expose(ae){const Ae=Ze=>{var qe;const Pt=Ke(),{Progress:$t}=Pt.getComponents(),Qt=(qe=pe)===null||qe===void 0?void 0:qe["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)($t,{}),children:(0,r.jsx)(Vt,{app:Pt,plugin:ae,children:(0,r.jsx)(m,{attributes:{pluginId:ae.getId(),...Re&&{extension:Re},...Qt&&{routeRef:Qt.id}},children:(0,r.jsx)(Ye.o,{plugin:ae,children:(0,r.jsx)(H,{...Ze})})})})})};et(Ae,"core.plugin",ae),et(Ae,"core.extensionName",Re);for(const[Ze,qe]of Object.entries(pe))et(Ae,Ze,qe);return Ae.displayName=`Extension(${N})`,Ae}}}function Tn(we,pe,Re,H){return W.Children.toArray(we).flatMap(N=>{if(!(0,W.isValidElement)(N))return[];if(N.type===W.Fragment)return Tn(N.props.children,pe,Re,H);if(vt(N,"core.featureFlagged")){const ae=N.props;return("with"in ae?pe.isActive(ae.with):!pe.isActive(ae.without))?Tn(N.props.children,pe,Re,H):[]}if(Re===void 0||Re(N))return[N];if(H)throw new Error(H);return Tn(N.props.children,pe,Re,H)})}class Rn{selectByComponentData(pe){const Re=Tn(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0,pe.withStrictError);return new Rn(Re,this.featureFlagsApi)}findComponentData(pe){return Tn(this.node,this.featureFlagsApi,H=>vt(H,pe.key)!==void 0).map(H=>vt(H,pe.key)).filter(H=>H!==void 0)}getElements(){return Tn(this.node,this.featureFlagsApi)}constructor(pe,Re){(0,z._)(this,"node",void 0),(0,z._)(this,"featureFlagsApi",void 0),this.node=pe,this.featureFlagsApi=Re}}function Hn(we,pe,Re=[]){const H=ve(Ft),N=new Rn(we,H);return(0,W.useMemo)(()=>pe(N),[we,...Re])}class Ln{getId(){return this.config.id}getApis(){var pe;return(pe=this.config.apis)!==null&&pe!==void 0?pe:[]}getFeatureFlags(){var pe,Re;return(Re=(pe=this.config.featureFlags)===null||pe===void 0?void 0:pe.slice())!==null&&Re!==void 0?Re:[]}get routes(){var pe;return(pe=this.config.routes)!==null&&pe!==void 0?pe:{}}get externalRoutes(){var pe;return(pe=this.config.externalRoutes)!==null&&pe!==void 0?pe:{}}provide(pe){return pe.expose(this)}__experimentalReconfigure(pe){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(pe))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var pe;return(pe=this.options)!==null&&pe!==void 0?pe:{}}toString(){return`plugin{${this.config.id}}`}constructor(pe){(0,z._)(this,"config",void 0),(0,z._)(this,"options",void 0),this.config=pe,this.options=void 0}}function Gn(we){return new Ln(we)}},64355:function(It,Pe,n){"use strict";n.d(Pe,{o:function(){return V},y:function(){return m}});var r=n(52322),p=n(51837),W=n(2784);const f="plugin-context",V=h=>{const{children:F,plugin:ve}=h,{Provider:ce}=(0,p.CT)(f);return(0,r.jsx)(ce,{value:(0,p.EI)({1:{plugin:ve}}),children:F})};function m(){const h=(0,p.Vt)(f);if(!h)throw new Error("Plugin Options context is not available");const F=h.atVersion(1);if(!F)throw new Error("Plugin Options v1 is not available");return F.plugin.getPluginOptions()}},23054:function(It,Pe,n){"use strict";n.d(Pe,{SP:function(){return ee},dR:function(){return de},VL:function(){return K},BD:function(){return p}});function r(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const w=T;return!(typeof w.name!="string"||w.name===""||typeof w.message!="string")}function p(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const w=T;if(typeof w.name!="string"||w.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof w.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=n(87612),f=n(24852);function V(T,w){var I;const xe={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return!((I=w)===null||I===void 0)&&I.includeStack||delete xe.stack,xe}function m(T){const w=(0,f.deserializeError)(T);return T.stack||(w.stack=void 0),w}function h(T){if(r(T)){const w=String(T);return w!=="[object Object]"?w:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class F extends Error{constructor(w,I){var Z,xe;let Se=w;if(I!==void 0){const B=h(I);Se?Se+=`; caused by ${B}`:Se=`caused by ${B}`}super(Se),(0,W._)(this,"cause",void 0),(Z=(xe=Error).captureStackTrace)===null||Z===void 0||Z.call(xe,this,this.constructor),(!this.name||this.name==="Error")&&this.constructor.name!=="Error"&&(this.name=this.constructor.name),this.cause=r(I)?I:void 0}}class ve extends null{constructor(...w){super(...w),_define_property(this,"name","InputError")}}class ce extends null{constructor(...w){super(...w),_define_property(this,"name","AuthenticationError")}}class z extends null{constructor(...w){super(...w),_define_property(this,"name","NotAllowedError")}}class de extends F{constructor(...w){super(...w),(0,W._)(this,"name","NotFoundError")}}class $ extends null{constructor(...w){super(...w),_define_property(this,"name","ConflictError")}}class A extends null{constructor(...w){super(...w),_define_property(this,"name","NotModifiedError")}}class oe extends null{constructor(...w){super(...w),_define_property(this,"name","NotImplementedError")}}class se extends null{}class ee extends F{constructor(w,I){super(w,I),this.name=r(I)?I.name:"Error"}}async function X(T){try{const I=await T.text();if(I){var w;if(!((w=T.headers.get("content-type"))===null||w===void 0)&&w.startsWith("application/json"))try{const Z=JSON.parse(I);if(Z.error&&Z.response)return Z}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${I}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class K extends Error{static async fromResponse(w){const I=await X(w),Z=I.response.statusCode||w.status,xe=I.error.name||w.statusText,Se=`Request failed with ${Z} ${xe}`,B=m(I.error);return new K({message:Se,response:w,data:I,cause:B})}constructor(w){super(w.message),(0,W._)(this,"response",void 0),(0,W._)(this,"body",void 0),(0,W._)(this,"cause",void 0),this.name="ResponseError",this.response=w.response,this.body=w.data,this.cause=w.cause}}},32838:function(It,Pe,n){"use strict";n.d(Pe,{nW:function(){return se},ae:function(){return z},q3:function(){return de}});var r=n(60871);const p=(0,r.T0)({id:"core.scmauth"});var W=new WeakMap;class f{async getCredentials(X){const K=new URL(X.url),T=_class_private_field_get(this,W).find(w=>w.isUrlSupported(K));if(!T)throw new Error(`No auth provider available for '${X.url}', see https://backstage.io/link?scm-auth`);return T.getCredentials(X)}constructor(X){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,X)}}var V=new WeakMap,m=new WeakMap,h=new WeakMap,F=new WeakMap;class ve{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:X,gitlab:K,azure:T,bitbucket:w})=>ve.merge(ve.forGithub(X),ve.forGitlab(K),ve.forAzure(T),ve.forBitbucket(w))})}static forAuthApi(X,K){return new ve("generic",X,K.host,K.scopeMapping)}static forGithub(X,K){var T,w;const I=(w=(T=K)===null||T===void 0?void 0:T.host)!==null&&w!==void 0?w:"github.com";return new ve("github",X,I,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(X,K){var T,w;const I=(w=(T=K)===null||T===void 0?void 0:T.host)!==null&&w!==void 0?w:"gitlab.com";return new ve("gitlab",X,I,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(X,K){var T,w;const I=(w=(T=K)===null||T===void 0?void 0:T.host)!==null&&w!==void 0?w:"dev.azure.com";return new ve("azure",X,I,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(X,K){var T,w;const I=(w=(T=K)===null||T===void 0?void 0:T.host)!==null&&w!==void 0?w:"bitbucket.org";return new ve("bitbucket",X,I,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...X){return new f(X)}isUrlSupported(X){return X.host===_class_private_field_get(this,m)}getAdditionalScopesForProvider(X){var K,T;if(!(!((K=X)===null||K===void 0)&&K.customScopes)||_class_private_field_get(this,F)==="generic")return[];var w;return(w=(T=X.customScopes)===null||T===void 0?void 0:T[_class_private_field_get(this,F)])!==null&&w!==void 0?w:[]}async getCredentials(X){var K;const{url:T,additionalScope:w,...I}=X,Z=_class_private_field_get(this,h).default.slice();!((K=w)===null||K===void 0)&&K.repoWrite&&Z.push(..._class_private_field_get(this,h).repoWrite);const xe=this.getAdditionalScopesForProvider(w);xe.length&&Z.push(...xe);const Se=[...new Set(Z)],B=await _class_private_field_get(this,V).getAccessToken(Se,I);return{token:B,headers:{Authorization:`Bearer ${B}`}}}constructor(X,K,T,w){_class_private_field_init(this,V,{writable:!0,value:void 0}),_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,h,{writable:!0,value:void 0}),_class_private_field_init(this,F,{writable:!0,value:void 0}),_class_private_field_set(this,V,K),_class_private_field_set(this,m,T),_class_private_field_set(this,h,w),_class_private_field_set(this,F,X)}}var ce=n(40556);class z{static fromConfig(X){return ce.Lx.fromConfig(X)}}const de=(0,r.T0)({id:"integration.scmintegrations"});var $=n(52322),A=n(73250),oe=n(2784);const se=ee=>{const{type:X}=ee,K=(0,r.qD)(),T=A.Z;var w;const I=X&&(w=K.getSystemIcon(X))!==null&&w!==void 0?w:T;return(0,$.jsx)(I,{})}},40556:function(It,Pe,n){"use strict";n.d(Pe,{Lx:function(){return Zr},BT:function(){return wt}});var r=n(87612),p=n(82717),W=n.n(p),f=n(76635);function V(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function m(S){try{return new URL(S),!0}catch{return!1}}function h(S,c){return{list(){return S},byUrl(b){try{const E=typeof b=="string"?new URL(b):b;return S.find(J=>c(J)===E.host)}catch{return}},byHost(b){return S.find(E=>c(E)===b)}}}function F(S){const{url:c,base:b,lineNumber:E}=S;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:ye}=W()(b);J=new URL(b);const je=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-ye.length),"/");J.pathname=`${je}${c}`}else J=new URL(c,b);return J.search=new URL(b).search,E&&(J.hash=`L${E}`),J.toString()}function ve(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const ce="amazonaws.com";function z(S){const c=S.getOptionalString("endpoint");var b;const E=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let J,ye;if(c){try{const yn=new URL(c);J=yn.host,ye=yn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(ye!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=ce;const je=S.getOptionalString("accessKeyId"),De=S.getOptionalString("secretAccessKey"),_e=S.getOptionalString("roleArn"),Gt=S.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:E,accessKeyId:je,secretAccessKey:De,roleArn:_e,externalId:Gt}}function de(S){const c=S.map(z);return c.some(b=>b.host===ce)||c.push({host:ce}),c}class ${get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)($,"factory",({config:S})=>{var c;const b=de((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return h(b.map(E=>new $(E)),E=>E.config.host)});var A=n(88412),oe=n(50629),se=n(80956);const ee="GB";var X=new WeakMap,K=new WeakMap,T=new WeakMap,w=new WeakMap,I=new WeakMap,Z=new WeakMap,xe=new WeakMap;class Se{static fromRepoUrl(c){const b=new URL(c);let E,J,ye;const je=b.pathname.split("/").map(qn=>decodeURIComponent(qn));if(je[2]==="_git"?(E=je[1],J=ye=je[3]):je[3]==="_git"?(E=je[1],J=je[2],ye=je[4]):je[4]==="_git"&&(E=`${je[1]}/${je[2]}`,J=je[3],ye=je[5]),!E||!J||!ye)throw new Error("Azure URL must point to a git repository");var De;const _e=(De=b.searchParams.get("path"))!==null&&De!==void 0?De:void 0;let Gt;const yn=b.searchParams.get("version");if(yn){if(yn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Gt=yn.slice(2)}return new Se(b.origin,E,J,ye,_e,Gt)}toRepoUrl(){let c;return(0,A._)(this,T)===(0,A._)(this,w)?c=(0,A._)(this,xe).call(this,(0,A._)(this,K),"_git",(0,A._)(this,w)):c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,T),"_git",(0,A._)(this,w)),(0,A._)(this,I)&&c.searchParams.set("path",(0,A._)(this,I)),(0,A._)(this,Z)&&c.searchParams.set("version",ee+(0,A._)(this,Z)),c.toString()}toFileUrl(){if(!(0,A._)(this,I))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,w),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,A._)(this,I)),(0,A._)(this,Z)&&c.searchParams.set("version",(0,A._)(this,Z)),c.toString()}toArchiveUrl(){const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,w),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,A._)(this,I)&&c.searchParams.set("scopePath",(0,A._)(this,I)),(0,A._)(this,Z)&&c.searchParams.set("version",(0,A._)(this,Z)),c.toString()}toCommitsUrl(){const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,w),"commits");return c.searchParams.set("api-version","6.0"),(0,A._)(this,Z)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,A._)(this,Z)),c.toString()}getOwner(){return(0,A._)(this,K)}getProject(){return(0,A._)(this,T)}getRepo(){return(0,A._)(this,w)}getPath(){return(0,A._)(this,I)}getRef(){return(0,A._)(this,Z)}constructor(c,b,E,J,ye,je){(0,oe._)(this,X,{writable:!0,value:void 0}),(0,oe._)(this,K,{writable:!0,value:void 0}),(0,oe._)(this,T,{writable:!0,value:void 0}),(0,oe._)(this,w,{writable:!0,value:void 0}),(0,oe._)(this,I,{writable:!0,value:void 0}),(0,oe._)(this,Z,{writable:!0,value:void 0}),(0,oe._)(this,xe,{writable:!0,value:(...De)=>{const _e=new URL((0,A._)(this,X));return _e.pathname=De.map(Gt=>encodeURIComponent(Gt)).join("/"),_e}}),(0,se._)(this,X,c),(0,se._)(this,K,b),(0,se._)(this,T,E),(0,se._)(this,w,J),(0,se._)(this,I,ye),(0,se._)(this,Z,je)}}const B="dev.azure.com",Ge=S=>{const c=S;return Object.keys(S).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},xt=S=>Object.keys(S).length===1&&S.clientId!==void 0;function Nt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:B,E=S.getOptionalString("token"),J=S.getOptional("credential")?{tenantId:S.getOptionalString("credential.tenantId"),clientId:S.getOptionalString("credential.clientId"),clientSecret:S.getOptionalString("credential.clientSecret")}:void 0;if(!V(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);if(J&&!Ge(J)&&!xt(J))throw new Error("Invalid Azure integration config, credential is not valid");if(J&&b!==B)throw new Error(`Invalid Azure integration config, credential can only be used with ${B}`);if(J&&E)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:b,token:E,credential:J}}function zt(S){const c=S.map(Nt);return c.some(b=>b.host===B)||c.push({host:B}),c}class Tt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E}=c;if(m(b))return b;try{const ye=Se.fromRepoUrl(E),je=new URL(E);var J;const De=new URL(`https://a.com${(J=ye.getPath())!==null&&J!==void 0?J:""}`),_e=new URL(b,De).pathname;return je.searchParams.set("path",_e),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(b,E).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Tt,"factory",({config:S})=>{var c;const b=zt((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return h(b.map(E=>new Tt(E)),E=>E.config.host)});var Ft=n(48834).lW;function Yt(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function dt(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function ut(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}async function St(S,c){const b="499b84ac-1321-427f-aa17-267ca6975798/.default",E=c?{...c}:{},{token:J,credential:ye}=S;if(ye){if(isAzureClientSecretCredential(ye)){const De=await new ClientSecretCredential(ye.tenantId,ye.clientId,ye.clientSecret).getToken(b);E.Authorization=`Bearer ${De.token}`}else if(isAzureManagedIdentityCredential(ye)){const De=await new ManagedIdentityCredential(ye.clientId).getToken(b);E.Authorization=`Bearer ${De.token}`}}else if(J){const je=Ft.from(`:${S.token}`,"utf8");E.Authorization=`Basic ${je.toString("base64")}`}return{headers:E}}const lt="bitbucket.org",Ut="https://api.bitbucket.org/2.0";function Ht(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:lt;let E=S.getOptionalString("apiBaseUrl");const J=S.getOptionalString("token"),ye=S.getOptionalString("username"),je=S.getOptionalString("appPassword");if(!V(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return E?E=(0,f.trimEnd)(E,"/"):b===lt?E=Ut:E=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:E,token:J,username:ye,appPassword:je}}function Ce(S){const c=S.map(Ht);return c.some(b=>b.host===lt)||c.push({host:lt,apiBaseUrl:Ut}),c}class $e{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(!c.lineNumber)return b;const E=new URL(b);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${c.lineNumber}`:E.hash=`${c.lineNumber}`,E.toString()}resolveEditUrl(c){const b=W()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)($e,"factory",({config:S})=>{var c,b,E;const J=Ce((E=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return h(J.map(ye=>new $e(ye)),ye=>ye.config.host)});var Ke=n(96279),ht=n(48834).lW;async function rt(S,c){const{name:b,owner:E,resource:J}=parseGitUrl(S),ye=J==="bitbucket.org";let je=ye?`${c.apiBaseUrl}/repositories/${E}/${b}`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,De=await fetch(je,ot(c));if(De.status===404&&!ye&&(je=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,De=await fetch(je,ot(c))),!De.ok){const Gt=`Failed to retrieve default branch from ${je}, ${De.status} ${De.statusText}`;throw new Error(Gt)}let _e;if(ye)_e=(await De.json()).mainbranch.name;else{const{displayId:Gt}=await De.json();_e=Gt}if(!_e)throw new Error(`Failed to read default branch from ${je}. Response ${De.status} ${De.json()}`);return _e}async function et(S,c){const{name:b,owner:E,ref:J,protocol:ye,resource:je,filepath:De}=parseGitUrl(S),_e=je==="bitbucket.org";let Gt=J;Gt||(Gt=await rt(S,c));const yn=De?`&path=${encodeURIComponent(decodeURIComponent(De))}`:"";return _e?`${ye}://${je}/${E}/${b}/get/${Gt}.tar.gz`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${Gt}&prefix=${E}-${b}${yn}`}function vt(S,c){try{const{owner:b,name:E,ref:J,filepathtype:ye,filepath:je}=parseGitUrl(S);if(!b||!E||ye!=="browse"&&ye!=="raw"&&ye!=="src")throw new Error("Invalid Bitbucket URL or file path");const De=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${J}/${De}`}return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${De}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function ot(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=ht.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const Je="bitbucket.org",ft="https://api.bitbucket.org/2.0";function gt(S){const c=Je,b=ft,E=S.getString("username"),J=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:E,appPassword:J}}function Ct(S){const c=S.map(gt);return c.length===0&&c.push({host:Je,apiBaseUrl:ft}),c}class gn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const E=new URL(b);return E.hash=`lines-${c.lineNumber}`,E.toString()}return b}resolveEditUrl(c){const b=W()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(gn,"factory",({config:S})=>{var c;const b=Ct((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return h(b.map(E=>new gn(E)),E=>E.config.host)});var un=n(48834).lW;async function ln(S,c){const{name:b,owner:E}=parseGitUrl(S),J=`${c.apiBaseUrl}/repositories/${E}/${b}`,ye=await fetch(J,mn(c));if(!ye.ok){const _e=`Failed to retrieve default branch from ${J}, ${ye.status} ${ye.statusText}`;throw new Error(_e)}const De=(await ye.json()).mainbranch.name;if(!De)throw new Error(`Failed to read default branch from ${J}. Response ${ye.status} ${ye.json()}`);return De}async function bn(S,c){const{name:b,owner:E,ref:J,protocol:ye,resource:je}=parseGitUrl(S);let De=J;return De||(De=await ln(S,c)),`${ye}://${je}/${E}/${b}/get/${De}.tar.gz`}function hn(S,c){try{const{owner:b,name:E,ref:J,filepathtype:ye,filepath:je}=parseGitUrl(S);if(!b||!E||ye!=="src"&&ye!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const De=je.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${J}/${De}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function mn(S){const c={};if(S.username&&S.appPassword){const b=un.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Sn(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token"),J=S.getOptionalString("username"),ye=S.getOptionalString("password");if(!V(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:E,username:J,password:ye}}function on(S){return S.map(Sn)}class pn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const E=new URL(b);return E.hash=c.lineNumber.toString(),E.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(pn,"factory",({config:S})=>{var c;const b=on((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return h(b.map(E=>new pn(E)),E=>E.config.host)});var Cn=n(48834).lW;async function Xe(S,c){const{name:b,owner:E}=parseGitUrl(S);let J=`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,ye=await fetch(J,Ye(c));if(ye.status===404&&(J=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,ye=await fetch(J,Ye(c))),!ye.ok){const _e=`Failed to retrieve default branch from ${J}, ${ye.status} ${ye.statusText}`;throw new Error(_e)}const{displayId:je}=await ye.json(),De=je;if(!De)throw new Error(`Failed to read default branch from ${J}. Response ${ye.status} ${ye.json()}`);return De}async function Jt(S,c){const{name:b,owner:E,ref:J,filepath:ye}=parseGitUrl(S);let je=J;je||(je=await Xe(S,c));const De=ye?`&path=${encodeURIComponent(decodeURIComponent(ye))}`:"";return`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${je}&prefix=${E}-${b}${De}`}function Vt(S,c){try{const{owner:b,name:E,ref:J,filepathtype:ye,filepath:je}=parseGitUrl(S);if(!b||!E||ye!=="browse"&&ye!=="raw"&&ye!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const De=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${De}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Ye(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=Cn.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function An(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),E=S.getOptionalString("cloneUrl"),J=S.getOptionalString("gitilesBaseUrl");const ye=S.getOptionalString("username"),je=S.getOptionalString("password");if(V(c)){if(b&&!m(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(E&&!m(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(J&&!m(J))throw new Error(`Invalid Gerrit integration config, '${J}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,E?E=(0,f.trimEnd)(E,"/"):E=b,{host:c,baseUrl:b,cloneUrl:E,gitilesBaseUrl:J,username:ye,password:je}}function sn(S){return S.map(An)}var Bn=n(48834).lW;const Tn=")]}'";function Rn(S,c){const E=c.replace(S.gitilesBaseUrl,"").split("/").filter(Gt=>!!Gt),J=E.indexOf("+");if(J<=0)throw new Error(`Unable to parse project from url: ${c}`);const ye=(0,f.trimStart)(E.slice(0,J).join("/"),"/"),je=E.indexOf("heads");if(je<=0)throw new Error(`Unable to parse branch from url: ${c}`);const De=E[je+1],_e=E.slice(je+2).join("/");return{branch:De,filePath:_e===""?"/":_e,project:ye}}function Hn(S,c,b,E){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(E,"/")}`}function Ln(S){return S.password?"/a/":"/"}function Gn(S,c){const{branch:b,project:E}=Rn(S,c);return`${S.baseUrl}${Ln(S)}projects/${encodeURIComponent(E)}/branches/${b}`}function we(S,c){const{project:b}=Rn(S,c);return`${S.cloneUrl}${Ln(S)}${b}`}function pe(S,c){const{branch:b,filePath:E,project:J}=Rn(S,c);return`${S.baseUrl}${Ln(S)}projects/${encodeURIComponent(J)}/branches/${b}/files/${encodeURIComponent(E)}/content`}function Re(S){return`${S.baseUrl}${Ln(S)}projects/`}function H(S){const c={};if(!S.password)return c;const b=Bn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function N(S){const c=await S.text();if(c.startsWith(Tn))try{return JSON.parse(c.slice(Tn.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class ae{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E,lineNumber:J}=c;let ye;if(b.startsWith("/")){const{branch:je,project:De}=Rn(this.config,E);return Hn(this.config,De,je,b)}return b?ye=new URL(b,E):ye=new URL(E),J&&(ye.hash=J.toString()),ye.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(ae,"factory",({config:S})=>{var c;const b=sn((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return h(b.map(E=>new ae(E)),E=>E.config.host)});function Ae(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const E=S.getOptionalString("username"),J=S.getOptionalString("password");if(!V(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:E,password:J}}var Ze=n(48834).lW;function qe(S,c){try{var b;const E=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[J,ye,je,De,_e,Gt,...yn]=c.replace(E,"").split("/"),qn=yn.join("/").replace(/^\//,"");return`${E}/${ye}/${je}/_edit/${Gt}/${qn}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function Pt(S,c){try{var b;const E=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[J,ye,je,De,_e,Gt,...yn]=c.replace(E,"").split("/"),qn=yn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${ye}/${je}/contents/${qn}?ref=${Gt}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function $t(S){const c={},{username:b,password:E}=S;return E?(b?c.Authorization=`basic ${Ze.from(`${b}:${E}`).toString("base64")}`:c.Authorization=`token ${E}`,{headers:c}):c}class Qt{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return F(c)}resolveEditUrl(c){return qe(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(Qt,"factory",({config:S})=>{var c;const E=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>Ae(J));return h(E.map(J=>new Qt(J)),J=>J.config.host)});const Xt="github.com",an="https://api.github.com",ne="https://raw.githubusercontent.com";function te(S){var c,b;const E=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Xt;let J=S.getOptionalString("apiBaseUrl"),ye=S.getOptionalString("rawBaseUrl");const je=S.getOptionalString("token"),De=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(_e=>({appId:_e.getNumber("appId"),clientId:_e.getString("clientId"),clientSecret:_e.getString("clientSecret"),webhookSecret:_e.getString("webhookSecret"),privateKey:_e.getString("privateKey"),allowedInstallationOwners:_e.getOptionalStringArray("allowedInstallationOwners")}));if(!V(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):E===Xt&&(J=an),ye?ye=(0,f.trimEnd)(ye,"/"):E===Xt&&(ye=ne),{host:E,apiBaseUrl:J,rawBaseUrl:ye,token:je,apps:De}}function Y(S){const c=S.map(te);return c.some(b=>b.host===Xt)||c.push({host:Xt,apiBaseUrl:an,rawBaseUrl:ne}),c}function v(S,c,b){try{const{owner:E,name:J,ref:ye,filepathtype:je,filepath:De}=parseGitUrl(S);if(!E||!J||!ye||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const _e=De.replace(/^\//,"");return M(c,b)==="api"?`${c.apiBaseUrl}/repos/${E}/${J}/contents/${_e}?ref=${ye}`:`${c.rawBaseUrl}/${E}/${J}/${ye}/${_e}`}catch(E){throw new Error(`Incorrect URL: ${S}, ${E}`)}}function O(S,c){const b={};return M(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function M(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var G=n(35355),ue=n(89393),be=n(26228);class ke{async getOrCreateToken(c,b,E){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await E(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:J.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>be.ou.local()>c)}}const Qe={Accept:"application/vnd.github.machine-man-preview+json"};class tt{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:J,suspended:ye}=await this.getInstallationData(c);if(ye)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:Qe});let De;if(je.data.repository_selection==="selected"){const Gt=new ue.v({baseUrl:this.baseUrl,auth:je.data.token}),yn=await Gt.paginate(Gt.apps.listReposAccessibleToInstallation);var _e;De=((_e=yn.repositories)!==null&&_e!==void 0?_e:yn).map(yr=>yr.name)}return{token:je.data.token,expiresAt:be.ou.fromISO(je.data.expires_at),repositories:De}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const E=(await this.getInstallations()).find(ye=>{var je;return ye.account&&"login"in ye.account&&((je=ye.account.login)===null||je===void 0?void 0:je.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new ke),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
33
- `)},this.appClient=new ue.v({baseUrl:b,headers:Qe,authStrategy:G.i,auth:this.baseAuthConfig})}}class yt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(De=>De.getInstallationCredentials(c,b).then(_e=>({credentials:_e,error:void 0}),_e=>({credentials:void 0,error:_e})))),J=E.find(De=>{var _e;return(_e=De.credentials)===null||_e===void 0?void 0:_e.accessToken});if(J)return J.credentials.accessToken;const je=E.map(De=>De.error).find(De=>{var _e;return((_e=De)===null||_e===void 0?void 0:_e.name)!=="NotFoundError"});if(je)throw je}constructor(c){var b;(0,r._)(this,"apps",void 0);var E;this.apps=(E=(b=c.apps)===null||b===void 0?void 0:b.map(J=>new tt(J,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class bt{async getCredentials(c){const b=W()(c.url),E=b.owner||b.name,J=b.owner?b.name:void 0;let ye="app",je=await this.githubAppCredentialsMux.getAppToken(E,J);return je||(ye="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:ye}}constructor(c,b){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,r._)(bt,"create",S=>new bt(new yt(S),S.token));class ct{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(E=>{const J=SingleInstanceGithubCredentialsProvider.create(E.config);b.set(E.config.host,J)}),new ct(b)}async getCredentials(c){const b=new URL(c.url),E=this.providers.get(b.host);if(!E)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Oe{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return wt(F(c),"tree")}resolveEditUrl(c){return wt(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Oe,"factory",({config:S})=>{var c;const b=Y((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return h(b.map(E=>new Oe(E)),E=>E.config.host)});function wt(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,E,J,ye)=>`//${E}/${J}/${ye}/${c}/`)}const qt=null;class jt extends Oe{get config(){return super.config}constructor(c){super(c)}}(0,r._)(jt,"factory",Oe.factory);const Zt=null,_t=null,wn=null,Bt="gitlab.com",mt="https://gitlab.com/api/v4";function Lt(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token");let J=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===Bt&&(b=mt),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,V(c)){if(!b||!m(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!m(J))throw new Error(`Invalid GitLab integration config, '${J}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:E,apiBaseUrl:b,baseUrl:J}}function Wt(S){const c=S.map(Lt);return c.some(b=>b.host===Bt)||c.push({host:Bt,apiBaseUrl:mt,baseUrl:`https://${Bt}`}),c}function en(S){let c="";return S.host!==Bt&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function gr(S,c){const b=await vn(S,c);return Xn(S,b,c).toString()}function mr(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Xn(S,c,b){try{const E=new URL(S),J=E.pathname.split("/blob/").slice(1).join("/blob/"),[ye,...je]=J.split("/"),De=getGitLabIntegrationRelativePath(b);return E.pathname=[...De?[De]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${ye}`,E}catch(E){throw new Error(`Incorrect url: ${S}, ${E}`)}}async function vn(S,c){const b=new URL(S);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(E=E.replace(J,""));const ye=new URL(`${b.origin}${J}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(ye.toString(),mr(c)),De=await je.json();if(!je.ok)throw new Error(`GitLab Error '${De.error}', ${De.error_description}`);return Number(De.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${S}, ${E}`)}}class Un{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return vr(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Un,"factory",({config:S})=>{var c;const b=Wt((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return h(b.map(E=>new Un(E)),E=>E.config.host)});function vr(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class Fr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,r._)(this,"token",void 0),this.token=c}}(0,r._)(Fr,"create",S=>new Fr(S.token));class Mn{static fromIntegrations(c){const b=new Map;return c.gitlab.list().forEach(E=>{const J=SingleInstanceGitlabCredentialsProvider.create(E.config);b.set(E.config.host,J)}),new Mn(b)}async getCredentials(c){const b=new URL(c.url),E=this.providers.get(b.host);if(!E)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Zr{static fromConfig(c){return new Zr({awsS3:$.factory({config:c}),azure:Tt.factory({config:c}),bitbucket:$e.factory({config:c}),bitbucketCloud:gn.factory({config:c}),bitbucketServer:pn.factory({config:c}),gerrit:ae.factory({config:c}),github:Oe.factory({config:c}),gitlab:Un.factory({config:c}),gitea:Qt.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(E=>E.byUrl(c)).filter(Boolean);if(b.length>1){const E=b.filter(J=>!(J instanceof $e));E.length!==0&&(b=E)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):F(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},30966:function(It,Pe,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return w.s4}});var p=n(52322),W=n(2784),f=n(28316),V=n(73557),m=n(60871);const h=(0,m.T0)({id:"plugin.techdocs.storageservice"}),F=(0,m.T0)({id:"plugin.techdocs.service"});var ve=n(92077),ce=n(95481),z=n(7476),de=n(93225),$=n(86317),A=n(65124),oe=n(22478),se=n(85478),ee=n(68435),X=n(3482),K=n(42081),T=n(48431),w=n(89258),I=n(52943),Z=n(61886),xe=n(13980),Se=n.n(xe),B=n(87612);class Ge{get(t){for(const s of this.holders){const a=s.get(t);if(a)return a}}constructor(...t){(0,B._)(this,"holders",void 0),this.holders=t}}var xt=n(51837);const Nt=(0,xt.CT)("api-context"),zt=i=>{var t;const{apis:s,children:a}=i,u=(t=(0,W.useContext)(Nt))===null||t===void 0?void 0:t.atVersion(1),C=u?new Ge(s,u):s;return(0,p.jsx)(Nt.Provider,{value:(0,xt.EI)({1:C}),children:a})};zt.propTypes={apis:Se().shape({get:Se().func.isRequired}).isRequired,children:Se().node};class Tt{static validateFactories(t,s){for(const a of s){const u=[a],C=new Set;for(;u.length;){const D=u.shift(),U=t.get(D);if(U)for(const le of Object.values(U.deps)){if(le.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);C.has(le)||(C.add(le),u.push(le))}}}}get(t){return this.load(t)}load(t,s=[]){const a=this.apis.get(t.id);if(a)return a;const u=this.factories.get(t);if(!u)return;if(s.includes(u.api))throw new Error(`Circular dependency of api factory for ${u.api}`);const C=this.loadDeps(t,u.deps,[...s,u.api]),D=u.factory(C);return this.apis.set(t.id,D),D}loadDeps(t,s,a){const u={};for(const C in s)if(s.hasOwnProperty(C)){const D=s[C],U=this.load(D,a);if(!U)throw new Error(`No API factory available for dependency ${D} of dependent ${t}`);u[C]=U}return u}constructor(t){(0,B._)(this,"factories",void 0),(0,B._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Ft;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Ft||(Ft={}));class Yt{register(t,s){const a=Ft[t],u=this.factories.get(s.api.id);return u&&u.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(t){const s=this.factories.get(t.id);if(s)return s.factory}getAllApis(){const t=new Set;for(const{factory:s}of this.factories.values())t.add(s.api);return t}constructor(){(0,B._)(this,"factories",new Map)}}function dt(i){return new Promise((t,s)=>{const a=i.width||500,u=i.height||700,C=window.screen.width/2-a/2,D=window.screen.height/2-u/2,U=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${u},top=${D},left=${C}`);let le="";if(!U||typeof U.closed=="undefined"||U.closed){const We=new Error("Failed to open auth popup.");We.name="PopupRejectedError",s(We);return}const me=We=>{if(We.source!==U||We.origin!==i.origin)return;const{data:nt}=We;if(nt.type==="config_info"){le=nt.targetOrigin;return}if(nt.type!=="authorization_response")return;const it=nt;if("error"in it){const tn=new Error(it.error.message);tn.name=it.error.name,s(tn)}else t(it.response);Ee()},Ue=setInterval(()=>{if(U.closed){const We=`Login failed, ${le&&le!==window.location.origin?`Incorrect app origin, expected ${le}`:"popup was closed"}`,nt=new Error(We);nt.name="PopupClosedError",s(nt),Ee()}},100);function Ee(){window.removeEventListener("message",me),clearInterval(Ue)}window.addEventListener("message",me)})}let ut=!1;function St(i){return[...i].join(" ")}class lt{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(u=>{throw new Error(`Auth refresh request failed, ${u}`)});if(!s.ok){const u=new Error(`Auth refresh request failed, ${s.statusText}`);throw u.status=s.status,u}const a=await s.json();if(a.error){const u=new Error(a.error.message);throw a.error.name&&(u.name=a.error.name),u}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!t.ok){const s=new Error(`Logout request failed, ${t.statusText}`);throw s.status=t.status,s}}async showPopup(t){const s=this.joinScopesFunc(t),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),u=await dt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(u)}async executeRedirect(t){const s=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,s){const a=await this.discoveryApi.getBaseUrl("auth"),u=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${t}${u}`}buildQueryString(t){if(!t)return"";const s=Object.entries(t).map(([a,u])=>{if(typeof u=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(u)}`;if(u)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(t){(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"environment",void 0),(0,B._)(this,"provider",void 0),(0,B._)(this,"joinScopesFunc",void 0),(0,B._)(this,"authRequester",void 0),(0,B._)(this,"sessionTransform",void 0),(0,B._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:u,provider:C,joinScopes:D=St,oauthRequestApi:U,sessionTransform:le=Ue=>Ue}=t;!ut&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),ut=!0);var me;this.enableExperimentalRedirectFlow=s&&(me=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&me!==void 0?me:!1,this.authRequester=U.createAuthRequester({provider:C,onAuthRequest:async Ue=>this.enableExperimentalRedirectFlow?this.executeRedirect(Ue):this.showPopup(Ue)}),this.discoveryApi=a,this.environment=u,this.provider=C,this.joinScopesFunc=D,this.sessionTransform=le}}function Ut(i,t){for(const s of t)if(!i.has(s))return!1;return!0}class Ht{sessionExistsAndHasScope(t,s){if(!t)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return Ut(a,s)}getExtendedScope(t,s){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const u=this.options.sessionScopes(t);for(const C of u)a.add(C)}if(s)for(const u of s)a.add(u);return a}constructor(t){(0,B._)(this,"options",void 0),this.options=t}}var Ce=n(82394),$e=n.n(Ce);let Ke=Symbol.observable;class ht{[Ke](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const u=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(u)}constructor(){(0,B._)(this,"isClosed",!1),(0,B._)(this,"terminatingError",void 0),(0,B._)(this,"observable",new($e())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,B._)(this,"subscribers",new Set)}}let rt=Symbol.observable;class et{[rt](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const u=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(u)}constructor(t){(0,B._)(this,"isClosed",void 0),(0,B._)(this,"currentValue",void 0),(0,B._)(this,"terminatingError",void 0),(0,B._)(this,"observable",void 0),(0,B._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new($e())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class vt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?m.sM.SignedIn:m.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,B._)(this,"subject",new et(m.sM.SignedOut)),(0,B._)(this,"signedIn",!1)}}class ot{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),u=this.sessionScopesFunc(this.currentSession),C=this.sessionScopesFunc(a);return Ut(C,u)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const s=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=s,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.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(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(t){(0,B._)(this,"connector",void 0),(0,B._)(this,"helper",void 0),(0,B._)(this,"sessionScopesFunc",void 0),(0,B._)(this,"sessionShouldRefreshFunc",void 0),(0,B._)(this,"stateTracker",new vt),(0,B._)(this,"refreshPromise",void 0),(0,B._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:u,sessionShouldRefresh:C}=t;this.connector=s,this.sessionScopesFunc=u,this.sessionShouldRefreshFunc=C,this.helper=new Ht({sessionScopes:u,defaultScopes:a})}}class Je{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:u}=t;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:u,defaultScopes:a})}}const ft={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class gt{static create(t){const{configApi:s,discoveryApi:a,environment:u="development",provider:C=ft,oauthRequestApi:D,defaultScopes:U=[],scopeTransform:le=Ee=>Ee}=t,me=new lt({configApi:s,discoveryApi:a,environment:u,provider:C,oauthRequestApi:D,sessionTransform(Ee){return{...Ee,providerInfo:{idToken:Ee.providerInfo.idToken,accessToken:Ee.providerInfo.accessToken,scopes:gt.normalizeScopes(le,Ee.providerInfo.scope),expiresAt:new Date(Date.now()+Ee.providerInfo.expiresInSeconds*1e3)}}}}),Ue=new ot({connector:me,defaultScopes:new Set(U),sessionScopes:Ee=>Ee.providerInfo.scopes,sessionShouldRefresh:Ee=>(Ee.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new gt({sessionManager:Ue,scopeTransform:le})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,s){var a;const u=gt.normalizeScopes(this.scopeTransform,t),C=await this.sessionManager.getSession({...s,scopes:u});var D;return(D=(a=C)===null||a===void 0?void 0:a.providerInfo.accessToken)!==null&&D!==void 0?D:""}async getIdToken(t={}){var s;const a=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var u;return(u=(s=a)===null||s===void 0?void 0:s.providerInfo.idToken)!==null&&u!==void 0?u:""}async getBackstageIdentity(t={}){var s;return(s=await this.sessionManager.getSession(t))===null||s===void 0?void 0:s.backstageIdentity}async getProfile(t={}){var s;return(s=await this.sessionManager.getSession(t))===null||s===void 0?void 0:s.profile}static normalizeScopes(t,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,B._)(this,"sessionManager",void 0),(0,B._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const Ct={id:"github",title:"GitHub",icon:()=>null};class gn{static create(t){const{configApi:s,discoveryApi:a,environment:u="development",provider:C=Ct,oauthRequestApi:D,defaultScopes:U=["read:user"]}=t;return gt.create({configApi:s,discoveryApi:a,oauthRequestApi:D,provider:C,environment:u,defaultScopes:U})}}const un={id:"gitlab",title:"GitLab",icon:()=>null};class ln{static create(t){const{configApi:s,discoveryApi:a,environment:u="development",provider:C=un,oauthRequestApi:D,defaultScopes:U=["read_user"]}=t;return gt.create({configApi:s,discoveryApi:a,oauthRequestApi:D,provider:C,environment:u,defaultScopes:U})}}const bn={id:"google",title:"Google",icon:()=>null},hn="https://www.googleapis.com/auth/";class mn{static create(t){const{configApi:s,discoveryApi:a,oauthRequestApi:u,environment:C="development",provider:D=bn,defaultScopes:U=["openid",`${hn}userinfo.email`,`${hn}userinfo.profile`]}=t;return gt.create({configApi:s,discoveryApi:a,oauthRequestApi:u,provider:D,environment:C,defaultScopes:U,scopeTransform(le){return le.map(me=>me==="openid"?me:me==="profile"||me==="email"?`${hn}userinfo.${me}`:me.startsWith(hn)?me:`${hn}${me}`)}})}}const Sn={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),pn="okta.";class Cn{static create(t){const{configApi:s,discoveryApi:a,environment:u="development",provider:C=Sn,oauthRequestApi:D,defaultScopes:U=["openid","email","profile","offline_access"]}=t;return gt.create({configApi:s,discoveryApi:a,oauthRequestApi:D,provider:C,environment:u,defaultScopes:U,scopeTransform(le){return le.map(me=>on.has(me)||me.startsWith(pn)?me:`${pn}${me}`)}})}}var Xe=n(30195);const Jt=Xe.z.object({profile:Xe.z.object({email:Xe.z.string().optional(),displayName:Xe.z.string().optional(),picture:Xe.z.string().optional()}),backstageIdentity:Xe.z.object({token:Xe.z.string(),identity:Xe.z.object({type:Xe.z.literal("user"),userEntityRef:Xe.z.string(),ownershipEntityRefs:Xe.z.array(Xe.z.string())})})}),Vt={id:"saml",title:"SAML",icon:()=>null};class Ye{static create(t){const{discoveryApi:s,environment:a="development",provider:u=Vt}=t,C=new DirectAuthConnector({discoveryApi:s,environment:a,provider:u}),D=new StaticAuthSessionManager({connector:C}),U=new AuthSessionStore({manager:D,storageKey:`${u.id}Session`,schema:samlSessionSchema});return new Ye(U)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){var s;return(s=await this.sessionManager.getSession(t))===null||s===void 0?void 0:s.backstageIdentity}async getProfile(t={}){var s;return(s=await this.sessionManager.getSession(t))===null||s===void 0?void 0:s.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const An={id:"microsoft",title:"Microsoft",icon:()=>null};class sn{static create(t){return new sn(t)}microsoftGraph(){return this.oauth2[sn.MicrosoftGraphID]}static resourceForScopes(t){const s=[...new Set(t.split(" ").map(sn.resourceForScope).filter(C=>C!=="openid"))];if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const u=(a=s[0])!==null&&a!==void 0?a:sn.MicrosoftGraphID;return Promise.resolve(u)}static resourceForScope(t){var s;const a=(s=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:u}=a;return u.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return sn.MicrosoftGraphID}}async getAccessToken(t,s){const a=t===void 0?sn.MicrosoftGraphID:await sn.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=gt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,s)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,B._)(this,"oauth2",void 0),(0,B._)(this,"configApi",void 0),(0,B._)(this,"environment",void 0),(0,B._)(this,"provider",void 0),(0,B._)(this,"oauthRequestApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:u=An,oauthRequestApi:C,discoveryApi:D,defaultScopes:U=["openid","offline_access","profile","email","User.Read"],scopeTransform:le=me=>me.concat("offline_access")}=t;this.configApi=s,this.environment=a,this.provider=u,this.oauthRequestApi=C,this.discoveryApi=D,this.scopeTransform=le,this.oauth2={[sn.MicrosoftGraphID]:gt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:U})}}}(0,B._)(sn,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Bn={id:"onelogin",title:"onelogin",icon:()=>null},Tn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Rn="onelogin.";class Hn{static create(t){const{configApi:s,discoveryApi:a,environment:u="development",provider:C=Bn,oauthRequestApi:D}=t;return gt.create({configApi:s,discoveryApi:a,oauthRequestApi:D,provider:C,environment:u,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(U){return U.map(le=>Tn.has(le)||le.startsWith(Rn)?le:`${Rn}${le}`)}})}}const Ln={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Gn{static create(t){const{configApi:s,discoveryApi:a,environment:u="development",provider:C=Ln,oauthRequestApi:D,defaultScopes:U=["team"]}=t;return gt.create({configApi:s,discoveryApi:a,oauthRequestApi:D,provider:C,environment:u,defaultScopes:U})}}const we={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class pe{static create(t){const{configApi:s,discoveryApi:a,environment:u="development",provider:C=we,oauthRequestApi:D,defaultScopes:U=["PROJECT_ADMIN"]}=t;return gt.create({configApi:s,discoveryApi:a,oauthRequestApi:D,provider:C,environment:u,defaultScopes:U})}}const Re={id:"atlassian",title:"Atlassian",icon:()=>null};class H{static create(t){const{configApi:s,discoveryApi:a,environment:u="development",provider:C=Re,oauthRequestApi:D}=t;return gt.create({configApi:s,discoveryApi:a,oauthRequestApi:D,provider:C,environment:u})}}class N{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,B._)(this,"subject",new ht)}}class ae{captureEvent(t){}}const Ae="theme";class Ze{static createWithStorage(t){const s=new Ze(t);if(!window.localStorage)return s;var a;const u=(a=window.localStorage.getItem(Ae))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(u),s.activeThemeId$().subscribe(C=>{C?window.localStorage.setItem(Ae,C):window.localStorage.removeItem(Ae)}),window.addEventListener("storage",C=>{if(C.key===Ae){var D;const U=(D=localStorage.getItem(Ae))!==null&&D!==void 0?D:void 0;s.setActiveThemeId(U)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,B._)(this,"themes",void 0),(0,B._)(this,"activeThemeId",void 0),(0,B._)(this,"subject",void 0),this.themes=t,this.subject=new et(void 0)}}var qe=n(9850),Pt=n.n(qe),$t=n(12782),Qt=n.n($t);const Xt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function an(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ne(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const te={type(i,t,s,a){return`Invalid type in config for key '${i}' in '${t}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,s){return`Unable to convert config value for key '${i}' in '${t}' to a ${s}`}};class Y{static fromConfigs(t){return t.length===0?new Y(void 0):t.reduce((s,{data:a,context:u,filteredKeys:C,deprecatedKeys:D})=>{const U=new Y(a,u,s);if(U.filteredKeys=C,D)for(const{key:le,description:me}of D)console.warn(`The configuration key '${le}' of ${u} is deprecated and may be removed soon. ${me||""}`);return U},void 0)}has(t){var s;if(this.readValue(t)!==void 0)return!0;var u;return(u=(s=this.fallback)===null||s===void 0?void 0:s.has(t))!==null&&u!==void 0?u:!1}keys(){var t;const s=this.data?Object.keys(this.data):[];var a;const u=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...u])]}get(t){const s=this.getOptional(t);if(s===void 0)throw new Error(te.missing(this.fullKey(t!=null?t:"")));return s}getOptional(t){var s;const a=Pt()(this.readValue(t)),u=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(t);if(a===void 0){if(!1)var C;return u}else if(u===void 0)return a;return Qt()({},{value:u},{value:a},(D,U)=>!an(U)||!an(D)?U:void 0).value}getConfig(t){const s=this.getOptionalConfig(t);if(s===void 0)throw new Error(te.missing(this.fullKey(t)));return s}getOptionalConfig(t){var s;const a=this.readValue(t),u=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(t);if(an(a))return this.copy(a,t,u);if(a!==void 0)throw new TypeError(te.type(this.fullKey(t),this.context,ne(a),"object"));return u}getConfigArray(t){const s=this.getOptionalConfigArray(t);if(s===void 0)throw new Error(te.missing(this.fullKey(t)));return s}getOptionalConfigArray(t){const s=this.readConfigValue(t,u=>{if(!Array.isArray(u))return{expected:"object-array"};for(const[C,D]of u.entries())if(!an(D))return{expected:"object-array",value:D,key:`${t}[${C}]`};return!0});if(!s){if(!1)var a;return}return s.map((u,C)=>this.copy(u,`${t}[${C}]`))}getNumber(t){const s=this.getOptionalNumber(t);if(s===void 0)throw new Error(te.missing(this.fullKey(t)));return s}getOptionalNumber(t){const s=this.readConfigValue(t,u=>typeof u=="number"||typeof u=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(te.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const s=this.getOptionalBoolean(t);if(s===void 0)throw new Error(te.missing(this.fullKey(t)));return s}getOptionalBoolean(t){const s=this.readConfigValue(t,u=>typeof u=="boolean"||typeof u=="number"||typeof u=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(te.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const s=this.getOptionalString(t);if(s===void 0)throw new Error(te.missing(this.fullKey(t)));return s}getOptionalString(t){return this.readConfigValue(t,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(t){const s=this.getOptionalStringArray(t);if(s===void 0)throw new Error(te.missing(this.fullKey(t)));return s}getOptionalStringArray(t){return this.readConfigValue(t,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,u]of s.entries())if(typeof u!="string"||u==="")return{expected:"string-array",value:u,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,s,a){const u=new Y(t,this.context,a,this.fullKey(s));return u.filteredKeys=this.filteredKeys,u}readConfigValue(t,s){const a=this.readValue(t);if(a===void 0){var u;if(!1)var C;return(u=this.fallback)===null||u===void 0?void 0:u.readConfigValue(t,s)}const D=s(a);if(D!==!0){const{key:U=t,value:le=a,expected:me}=D;throw new TypeError(te.type(this.fullKey(U),this.context,ne(le),me))}return a}readValue(t){const s=t?t.split("."):[];for(const u of s)if(!Xt.test(u))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[u,C]of s.entries())if(an(a))a=a[C];else if(a!==void 0){const D=this.fullKey(s.slice(0,u).join("."));throw new TypeError(te.type(D,this.context,ne(a),"object"))}return a}constructor(t,s="mock-config",a,u=""){(0,B._)(this,"data",void 0),(0,B._)(this,"context",void 0),(0,B._)(this,"fallback",void 0),(0,B._)(this,"prefix",void 0),(0,B._)(this,"filteredKeys",void 0),(0,B._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=s,this.fallback=a,this.prefix=u,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class O{static compile(t){const s=t.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let u;try{u=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(u.hash)throw new Error(`${v} URL must not have a hash`);if(u.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new O(s)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,B._)(this,"parts",void 0),this.parts=t}}class M{post(t,s){var a;return!((a=s)===null||a===void 0)&&a.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,s)}error$(){return this.errorApi.error$()}constructor(t,s){(0,B._)(this,"alertApi",void 0),(0,B._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=s}}class G{post(t,s){this.subject.next({error:t,context:s})}error$(){return this.subject}constructor(){(0,B._)(this,"subject",new ht)}}class ue{static forward(t,s){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,s)})}}function be(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class ke{registerFlag(t){be(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===m.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,u]of Object.entries(t.states))this.flags.set(a,u);const s=Array.from(this.flags.entries()).filter(([,a])=>a===m.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const s=JSON.parse(t);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([u,C])=>(be(u),C===m.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,B._)(this,"registeredFeatureFlags",[]),(0,B._)(this,"flags",void 0)}}function Qe(i){let t=i.baseImplementation||n.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const u of a)t=u.apply(t);return{fetch:t}}class tt{static create(t){var s,a;const u=yt(t),C=((s=t.header)===null||s===void 0?void 0:s.name)||"authorization",D=((a=t.header)===null||a===void 0?void 0:a.value)||(U=>`Bearer ${U}`);return new tt(t.identityApi,u,C,D)}apply(t){return async(s,a)=>{const u=new Request(s,a),{token:C}=await this.identityApi.getCredentials();return u.headers.get(this.headerName)||typeof C!="string"||!C||!this.allowUrl(u.url)?t(s,a):(u.headers.set(this.headerName,this.headerValue(C)),t(u))}}constructor(t,s,a,u){(0,B._)(this,"identityApi",void 0),(0,B._)(this,"allowUrl",void 0),(0,B._)(this,"headerName",void 0),(0,B._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=s,this.headerName=a,this.headerValue=u}}function yt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?bt(i.urlPrefixAllowlist):i.config?bt([i.config.getString("backend.baseUrl")]):()=>!1}function bt(i){const t=i.map(s=>s.replace(/\/$/,""));return s=>t.some(a=>s===a||s.startsWith(`${a}/`))}function ct(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Oe{apply(t){return async(s,a)=>{const u=new Request(s,a),C="plugin://";if(!u.url.startsWith(C))return t(s,a);const{hostname:D,pathname:U,search:le,hash:me,username:Ue,password:Ee}=new URL(`http://${u.url.substring(C.length)}`);let We=await this.discoveryApi.getBaseUrl(D);if(Ue||Ee){const it=new URL(We),tn=`${Ue}${Ee?`:${Ee}`:""}@`;We=`${it.protocol}//${tn}${it.host}${it.pathname}`}const nt=`${ct(We,U)}${le}${me}`;return t(nt,typeof s=="string"||wt(s)?a:s)}}constructor(t){(0,B._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function wt(i){var t;return typeof i=="object"&&((t=i)===null||t===void 0?void 0:t.constructor)===URL}class qt{static resolvePluginProtocol(t){return new Oe(t.discoveryApi)}static injectIdentityAuth(t){return tt.create(t)}constructor(){}}function jt(i,t){for(const s of t)if(!i.has(s))return!1;return!0}function Zt(i,...t){const s=new Set(i);for(const a of t)for(const u of a)s.add(u);return s}class _t{request(t){return new Promise((s,a)=>{this.requests.push({scopes:t,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,s){this.requests=this.requests.filter(a=>jt(t,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(s=>s.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>Zt(s,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:s=>{t&&this.resolve(t,s)},reject:s=>{t&&this.reject(s)}}}constructor(){(0,B._)(this,"requests",[]),(0,B._)(this,"subject",new et(this.getCurrentPending()))}}class wn{createAuthRequester(t){const s=new _t,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:u=>{const C=this.currentRequests.slice(),D=this.makeAuthRequest(u,t);D?C[a]=D:delete C[a],this.currentRequests=C,this.subject.next(C.filter(Boolean))}}),u=>s.request(u)}makeAuthRequest(t,s){const{scopes:a}=t;if(a)return{provider:s.provider,trigger:async()=>{const u=await s.onAuthRequest(a);t.resolve(u)},reject:()=>{const u=new Error("Login failed, rejected by user");u.name="RejectedError",t.reject(u)}}}authRequest$(){return this.subject}constructor(){(0,B._)(this,"subject",new et([])),(0,B._)(this,"currentRequests",[]),(0,B._)(this,"handlerCount",0)}}const Bt=new Map;class mt{static create(t){var s;return new mt((s=t.namespace)!==null&&s!==void 0?s:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,u]of Bt.entries()){var s;!((s=t.key)===null||s===void 0)&&s.startsWith(a)&&u.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let s,a="absent";try{const u=localStorage.getItem(this.getKeyName(t));u&&(s=JSON.parse(u,(C,D)=>(typeof D=="object"&&D!==null&&Object.freeze(D),D)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:s,presence:a}}forBucket(t){const s=`${this.namespace}/${t}`;return Bt.has(s)||Bt.set(s,new mt(s,this.errorApi)),Bt.get(s)}async set(t,s){localStorage.setItem(this.getKeyName(t),JSON.stringify(s)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return mt.hasSubscribed||(mt.addStorageEventListener(),mt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===t)}handleStorageChange(t){var s,a;if(!(!((s=t)===null||s===void 0)&&s.startsWith(this.namespace)))return;const u=(a=t)===null||a===void 0?void 0:a.slice(`${this.namespace}/`.length);u.includes("/")||this.notifyChanges(decodeURIComponent(u))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const s=this.snapshot(t);for(const a of this.subscribers)a.next(s)}constructor(t,s){(0,B._)(this,"namespace",void 0),(0,B._)(this,"errorApi",void 0),(0,B._)(this,"subscribers",void 0),(0,B._)(this,"observable",void 0),this.namespace=t,this.errorApi=s,this.subscribers=new Set,this.observable=new($e())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,B._)(mt,"hasSubscribed",!1);const Lt=(0,W.createContext)(void 0);function Wt(){const[i]=(0,V.is)((0,p.jsx)(V.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var en=n(84800);const gr=(i,t)=>{try{var s,a,u,C;const U=(s=(0,en.fp)(t,{pathname:i}))===null||s===void 0?void 0:s.filter(We=>{var nt,it;return((it=We)===null||it===void 0||(nt=it.route.routeRefs)===null||nt===void 0?void 0:nt.size)>0}).pop(),le=(a=U)===null||a===void 0?void 0:a.route;if(!le)return;let me;le.routeRefs.size===1&&(me=le.routeRefs.values().next().value);let Ue;le.plugins.size===1&&(Ue=le.plugins.values().next().value);const Ee=Object.entries(((u=U)===null||u===void 0?void 0:u.params)||{}).reduce((We,[nt,it])=>(it!==void 0&&(We[nt]=it),We),{});return{extension:"App",pluginId:((C=Ue)===null||C===void 0?void 0:C.getId())||"root",...me?{routeRef:me.id}:{},_routeNodeType:le.element,params:Ee}}catch{return}},mr=({pathname:i,search:t,hash:s,attributes:a})=>{const u=(0,m.z$)();return(0,W.useEffect)(()=>{u.captureEvent("navigate",`${i}${t}${s}`,{attributes:a})},[u,i,t,s,a]),null},Xn=({routeObjects:i})=>{const{pathname:t,search:s,hash:a}=(0,V.TH)(),{params:u,...C}=gr(t,i)||{params:{}};return(0,p.jsx)(m.fC,{attributes:C,children:(0,p.jsx)(mr,{pathname:t,search:s,hash:a,attributes:u})})};function vn(i){return Wt()?Un(i):""}function Un(i){var t;let{pathname:s}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function vr({component:i,appIdentityProxy:t,children:s}){const[a,u]=(0,W.useState)(),C=(0,m.h_)(m.Ds),D=vn(C);return a?(t.setTarget(a,{signOutTargetUrl:D||"/"}),(0,p.jsx)(p.Fragment,{children:s})):(0,p.jsx)(i,{onSignInSuccess:u})}function Fr(i){const{Router:t,SignInPage:s}=(0,m.qD)().getComponents(),a=(0,m.h_)(m.Ds),u=Un(a),C=`${u}/*`,D=(0,W.useContext)(Lt);if(!D)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:U,appIdentityProxy:le}=D;return s?Wt()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Xn,{routeObjects:U}),(0,p.jsx)(vr,{component:s,appIdentityProxy:le,children:(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:C,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:u,children:[(0,p.jsx)(Xn,{routeObjects:U}),(0,p.jsx)(vr,{component:s,appIdentityProxy:le,children:i.children})]}):(le.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||"/"}),Wt()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Xn,{routeObjects:U}),(0,p.jsx)(V.Z5,{children:(0,p.jsx)(V.AW,{path:C,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:u,children:[(0,p.jsx)(Xn,{routeObjects:U}),i.children]}))}var Mn=n(88412),Zr=n(50629),S=n(80956),c=n(64279);function b(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const s=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:u,contexts:C}=s.shift();W.Children.forEach(a,D=>{if(!(0,W.isValidElement)(D))return;const U={};for(const le in t)if(t.hasOwnProperty(le)){const me=t[le];U[le]=me.visit(me.accumulator,D,u,C[le])}for(const le of i.discoverers){const me=le(D);me&&s.push({node:me,parent:D,contexts:U})}})}return Object.fromEntries(Object.entries(t).map(([a,u])=>[a,u.accumulator]))}function E(i,t){return()=>({accumulator:i(),visit:t})}function J(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function ye(i){var t,s;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const je=E(()=>new Set,(i,t)=>{const s=(0,m.IY)(t,"core.plugin");s&&i.add(s)}),De=i=>{const{children:t}=i,s=(0,m.h_)(m.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,m.R5)(De,"core.featureFlagged",!0);const _e={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function Gt(i){var t;const s=i;if(!((t=s)===null||t===void 0)&&t.type){var a,u;return(u=(a=s.type.displayName)!==null&&a!==void 0?a:s.type.name)!==null&&u!==void 0?u:String(s.type)}return String(s)}const yn=i=>{const t=new Set;return i&&t.add(i),t};function qn(i,t=new Array){return W.Children.forEach(i,s=>{if(!(0,W.isValidElement)(s))return;const a=(0,m.IY)(s,"core.mountPoint");if(a){const u=(0,m.IY)(s,"core.plugin");t.push({routeRef:a,plugin:u})}qn(s.props.children,t)}),t}const yr=E(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var u,C,D,U,le;if(!((u=a)===null||u===void 0)&&u.isElementAncestor)return a;if(((C=s)===null||C===void 0?void 0:C.props.element)===t)return{...a,isElementAncestor:!0};const me=(D=t.props)===null||D===void 0?void 0:D.path,Ue=(0,m.IY)(t,"core.mountPoint");if(Ue&&me)throw new Error(`Path property may not be set directly on a routable extension "${Gt(t)}"`);var Ee;const We=(Ee=(le=a)===null||le===void 0||(U=le.obj)===null||U===void 0?void 0:U.children)!==null&&Ee!==void 0?Ee:i.objects;if(me!==void 0){if(typeof me!="string")throw new Error(`Element path must be a string at "${Gt(t)}"`);const In=me.startsWith("/")?me.slice(1):me,Vr=t.props.element;if((0,m.IY)(t,"core.gatherMountPoints")){var nt,it,tn;if(Vr)throw new Error(`Mount point gatherers may not have an element prop "${Gt(t)}"`);const wo={path:In,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((nt=t.props)===null||nt===void 0?void 0:nt.caseSensitive),children:[_e],plugins:new Set};return We.push(wo),{obj:wo,gatherPath:In,routeRef:(it=a)===null||it===void 0?void 0:it.routeRef,gatherRouteRef:(tn=a)===null||tn===void 0?void 0:tn.routeRef}}if(Vr){var Mt,nr,zr,wr;const[wo,...ia]=qn(Vr);if(ia.length>0)throw new Error(`Route element with path "${me}" may not contain multiple routable extensions`);if(!wo)return a;const{routeRef:Hr,plugin:aa}=wo,oi={path:In,element:"mounted",routeRefs:new Set([Hr]),caseSensitive:Boolean((Mt=t.props)===null||Mt===void 0?void 0:Mt.caseSensitive),children:[_e],plugins:yn(aa)};return We.push(oi),i.paths.set(Hr,In),i.parents.set(Hr,(nr=a)===null||nr===void 0?void 0:nr.routeRef),{obj:oi,routeRef:Hr!=null?Hr:(zr=a)===null||zr===void 0?void 0:zr.routeRef,gatherPath:In,gatherRouteRef:(wr=a)===null||wr===void 0?void 0:wr.gatherRouteRef}}}if(Ue){var pr,fr,Dn,Or;if(((pr=a)===null||pr===void 0?void 0:pr.gatherPath)===void 0)throw new Error(`Routable extension "${Gt(t)}" with mount point "${Ue}" must be assigned a path`);(Dn=a)===null||Dn===void 0||(fr=Dn.obj)===null||fr===void 0||fr.routeRefs.add(Ue);const In=(0,m.IY)(t,"core.plugin");if(In){var Wr,kr;(kr=a)===null||kr===void 0||(Wr=kr.obj)===null||Wr===void 0||Wr.plugins.add(In)}return i.paths.set(Ue,a.gatherPath),i.parents.set(Ue,(Or=a)===null||Or===void 0?void 0:Or.gatherRouteRef),{...a,routeRef:Ue}}return a}),Ar=E(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var u,C,D,U,le,me,Ue,Ee,We;if(((u=s)===null||u===void 0?void 0:u.props.element)===t)return a;let nt=(C=a)===null||C===void 0?void 0:C.obj,it=(D=a)===null||D===void 0?void 0:D.routeRef,tn=(U=a)===null||U===void 0?void 0:U.sticky;const Mt=(le=t.props)===null||le===void 0?void 0:le.path;var nr;const zr=(nr=(me=nt)===null||me===void 0?void 0:me.children)!==null&&nr!==void 0?nr:i.objects,wr=Boolean((Ue=t.props)===null||Ue===void 0?void 0:Ue.caseSensitive);let pr=(Ee=a)===null||Ee===void 0?void 0:Ee.path;if((0,m.IY)(t,"core.gatherMountPoints")){if(!Mt)throw new Error("Mount point gatherer must have a path");pr=Mt}const fr=(We=t.props)===null||We===void 0?void 0:We.element;let Dn=(0,m.IY)(t,"core.mountPoint");if(!Dn&&(0,W.isValidElement)(fr)&&(Dn=(0,m.IY)(fr,"core.mountPoint")),Dn){let Vr=Mt;if(pr&&(Vr?pr=void 0:Vr=pr),!Vr)throw new Error("Mounted routable extension must have a path");if(i.paths.set(Dn,Vr),it&&tn?(i.parents.set(Dn,it),Mt&&(it=Dn,tn=!1)):(i.parents.set(Dn,it),it=Dn),Mt)nt={caseSensitive:wr,path:Mt,element:"mounted",routeRefs:new Set([Dn]),children:[_e],plugins:yn((0,m.IY)(t.props.element,"core.plugin"))},zr.push(nt);else{var Or;(Or=nt)===null||Or===void 0||Or.routeRefs.add(Dn)}}if((0,m.IY)(t,"core.gatherMountPoints")&&(tn=!0),(0,m.IY)(t,"core.gatherMountPoints")){if(!Mt)throw new Error("Mount point gatherer must have a path");if(!Dn){var kr,In;nt={caseSensitive:wr,path:Mt,element:"gathered",routeRefs:new Set,children:[_e],plugins:((In=a)===null||In===void 0||(kr=In.obj)===null||kr===void 0?void 0:kr.plugins)||new Set},zr.push(nt)}}return{obj:nt,path:pr,routeRef:it,sticky:tn}}),xn=E(()=>new Set,(i,t)=>{if(t.type===De){const s=t.props;i.add("with"in s?s.with:s.without)}}),Kr=(0,xt.uW)("route-ref-type",()=>Symbol("route-ref-type"));function go(i){return i[Kr]==="absolute"}function Eo(i){return i[Kr]==="sub"}function ws(i){return i[Kr]==="external"}function Yr(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Ko(i,t,s){let a,u="";if(go(i))a=i;else if(Eo(i))a=i.parent,u=i.path;else if(ws(i)){const U=s.get(i);if(!U)return[void 0,""];if(go(U))a=U;else if(Eo(U))a=U.parent,u=U.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${U}`)}else throw i[Kr]?new Error(`Unknown or invalid route ref type, ${i[Kr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const C=t.get(a);if(C===void 0)return[void 0,""];const D=Yr(C,u);return[a,D]}function js(i,t,s,a,u){var C;const D=(C=(0,en.fp)(u,t))!==null&&C!==void 0?C:[],U=Array();let le=-1;for(let Ee=i;Ee&&(le=D.findIndex(We=>We.route.routeRefs.has(Ee)),le===-1);Ee=a.get(Ee))U.unshift(Ee);U.length===0&&(le-=1);const me=le===-1?"":D[le].pathname,Ue=U.slice(0,-1).map(Ee=>{const We=s.get(Ee);if(We===void 0)throw new Error(`No path for ${Ee}`);if(We.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Ee} as it has parameters`);return We});return`${Yr(me,...Ue)}/`}class Yo{resolve(t,s){const[a,u]=Ko(t,this.routePaths,this.routeBindings);if(!a)return;let C;typeof s=="string"?C=this.trimPath(s):s.pathname?C={...s,pathname:this.trimPath(s.pathname)}:C=s;const D=this.appBasePath+js(a,C,this.routePaths,this.routeParents,this.routeObjects);return(...[le])=>Yr(D,(0,en.Gn)(u,le))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,s,a,u,C){(0,B._)(this,"routePaths",void 0),(0,B._)(this,"routeParents",void 0),(0,B._)(this,"routeObjects",void 0),(0,B._)(this,"routeBindings",void 0),(0,B._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=s,this.routeObjects=a,this.routeBindings=u,this.appBasePath=C}}const Jo=(0,xt.CT)("routing-context"),Tr=({routePaths:i,routeParents:t,routeObjects:s,routeBindings:a,basePath:u="",children:C})=>{const D=new Yo(i,t,s,a,u),U=(0,xt.EI)({1:D});return(0,p.jsx)(Jo.Provider,{value:U,children:C})};function ir(i,t){const s=new Set(t.values());s.delete(void 0);for(const a of t.keys()){if(s.has(a))continue;let u=a,C="";for(;u;){const U=i.get(u);if(U===void 0)throw new Error(`No path for ${u}`);C=Yr(U,C),u=t.get(u)}const D=C.match(/:(\w+)/g);if(D){for(let U=0;U<D.length;U++)for(let le=U+1;le<D.length;le++)if(D[le]===D[U])throw new Error(`Parameter ${D[le]} is duplicated in path ${C}`)}}}function Jr(i,t){for(const s of t)if(s.externalRoutes){for(const[a,u]of Object.entries(s.externalRoutes))if(!u.optional&&!i.has(u))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const oo=(0,xt.CT)("app-context"),Ao=({appContext:i,children:t})=>{const s=(0,xt.EI)({1:i});return(0,p.jsx)(oo.Provider,{value:s,children:t})};function To(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Ur(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Qo{setTarget(t,s){this.target=t,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw To("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Ur("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw To("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Ur("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(s=>s.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Ur("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,B._)(this,"target",void 0),(0,B._)(this,"waitForTarget",void 0),(0,B._)(this,"resolveTarget",()=>{}),(0,B._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Ro=n(72164);function $n(i,t,s){if(i!==void 0){const u=s.find(C=>C.id===i);if(u)return u}if(t){const u=s.find(C=>C.variant==="dark");if(u)return u}const a=s.find(u=>u.variant==="light");return a||s[0]}const ar=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,s]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const a=u=>{s(u.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Qr({children:i}){const t=(0,m.h_)(m.hg),s=(0,Ro.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?ar():!1,u=$n(s,a,t.getInstalledThemes());if(!u)throw new Error("App has no themes");return(0,p.jsx)(u.Provider,{children:i})}const Xr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const s=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const u=JSON.parse(i);Array.isArray(u)?s.push(...u):s.push({data:u,context:"env"})}catch(u){throw new Error(`Failed to load runtime configuration, ${u}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class Xo{add(t,s){return this.apis.push([t.id,s]),s}build(){return new xr(new Map(this.apis))}constructor(){(0,B._)(this,"apis",[])}}class xr{static builder(){return new Xo}static from(t){return new xr(new Map(t.map(([s,a])=>[s.id,a])))}static with(t,s){return new xr(new Map([[t.id,s]]))}with(t,s){return new xr(new Map([...this.apis,[t.id,s]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,B._)(this,"apis",void 0),this.apis=t}}function Io(i){const t=new Map;return i&&i({bind:(a,u)=>{for(const[C,D]of Object.entries(u)){const U=a[C];if(!U)throw new Error(`Key ${C} is not an existing external route`);if(!D&&!U.optional)throw new Error(`External route ${C} is required but was undefined`);D&&t.set(U,D)}}}),t}function Po(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Lo(i,t,s){var a;const u=Boolean(i),C=(0,c.default)(i||(()=>Promise.resolve([])));let D;if(u&&C.loading){const{Progress:me}=t;D=(0,p.jsx)(me,{})}else if(C.error){const{BootErrorPage:me}=t;D=(0,p.jsx)(me,{step:"load-config",error:C.error})}const{ThemeProvider:U=Qr}=t;if(D)return{node:(0,p.jsx)(zt,{apis:xr.with(m.hg,s),children:(0,p.jsx)(U,{children:D})})};let le;if(!((a=C.value)===null||a===void 0)&&a.length){const me=Y.fromConfigs(C.value),Ue=me.getOptionalString("app.baseUrl"),Ee=me.getOptionalString("backend.baseUrl");let We=C.value;const nt={data:{},context:"relative-resolver"};if(Ue&&Ee){const it=new URL(Ue).origin,tn=new URL(Ee).origin;if(it===tn){const Mt=Po(Ee);Ee!==Mt&&(nt.data.backend={baseUrl:Mt})}}if(Ue){const it=Po(Ue);Ue!==it&&(nt.data.app={baseUrl:it})}Object.keys(nt.data).length&&(We=We.concat([nt])),le=Y.fromConfigs(We)}else le=Y.fromConfigs([]);return{api:le}}class Mr{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,B._)(this,"app",void 0),this.app=t}}var Oo=new WeakMap;class qo{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const s=this.getProvider();return()=>(0,p.jsx)(s,{children:t})}getProvider(){if((0,Mn._)(this,Oo))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,S._)(this,Oo,!0);const t=new Mr(this);let s=!1;return({children:u})=>{const C=(0,W.useRef)(!0),D=(0,W.useMemo)(()=>Ze.createWithStorage(this.themes),[]),{routing:U,featureFlags:le,routeBindings:me}=(0,W.useMemo)(()=>{const nt=b({root:u,discoverers:[J,ye],collectors:{routing:Wt()?Ar:yr,collectedPlugins:je,featureFlags:xn}});return nt.collectedPlugins.forEach(it=>this.plugins.add(it)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...nt,routeBindings:Io(this.bindRoutes)}},[u]);s||(s=!0,ir(U.paths,U.parents),Jr(me,this.plugins));const Ue=Lo(this.configLoader,this.components,D),Ee="api"in Ue;if(Ee){const{api:nt}=Ue;this.configApi=nt}if("node"in Ue)return Ue.node;if(Ee&&C.current){C.current=!1;const nt=this.getApiHolder().get(m.W0);if(nt){for(const Mt of this.featureFlags)nt.registerFlag({...Mt,pluginId:""});for(const Mt of this.plugins.values())if("getFeatureFlags"in Mt)for(const nr of Mt.getFeatureFlags())nt.registerFlag({name:nr.name,pluginId:Mt.getId()});else for(const nr of Mt.output())nr.type==="feature-flag"&&nt.registerFlag({name:nr.name,pluginId:Mt.getId()});const it=nt.getRegisteredFlags(),tn=new Set(it.map(Mt=>Mt.name));for(const Mt of le)tn.has(Mt)||nt.registerFlag({name:Mt,pluginId:""})}}const{ThemeProvider:We=Qr}=this.components;return(0,p.jsx)(zt,{apis:this.getApiHolder(),children:(0,p.jsx)(Ao,{appContext:t,children:(0,p.jsx)(We,{children:(0,p.jsx)(Tr,{routePaths:U.paths,routeParents:U.parents,routeObjects:U.objects,routeBindings:me,basePath:vn(Ue.api),children:(0,p.jsx)(Lt.Provider,{value:{routeObjects:U.objects,appIdentityProxy:this.appIdentityProxy},children:u})})})})})}}getRouter(){return Fr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const s of t.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Tt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:m.hg,deps:{},factory:()=>Ze.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:m.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:m.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:m.W0,deps:{},factory:()=>new ke});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const s of t.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return Tt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Tt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const s=new Set;for(const a of t){const u=a.getId();if(s.has(u))throw new Error(`Duplicate plugin found '${u}'`);s.add(u)}}constructor(t){(0,B._)(this,"apiHolder",void 0),(0,B._)(this,"configApi",void 0),(0,B._)(this,"apis",void 0),(0,B._)(this,"icons",void 0),(0,B._)(this,"plugins",void 0),(0,B._)(this,"featureFlags",void 0),(0,B._)(this,"components",void 0),(0,B._)(this,"themes",void 0),(0,B._)(this,"configLoader",void 0),(0,B._)(this,"defaultApis",void 0),(0,B._)(this,"bindRoutes",void 0),(0,B._)(this,"appIdentityProxy",new Qo),(0,B._)(this,"apiFactoryRegistry",void 0),(0,Zr._)(this,Oo,{writable:!0,value:!1});var s;this.apis=(s=t.apis)!==null&&s!==void 0?s:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var u;this.featureFlags=(u=t.featureFlags)!==null&&u!==void 0?u:[],this.components=t.components,this.themes=t.themes;var C;this.configLoader=(C=t.configLoader)!==null&&C!==void 0?C:Xr;var D;this.defaultApis=(D=t.defaultApis)!==null&&D!==void 0?D:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Yt}}function mo(i){return new qo(i)}let ko=!1;const Es=i=>{const t=(0,m.qD)(),{NotFoundErrorPage:s}=t.getComponents(),a=(0,W.useMemo)(()=>Wt(),[]),C=[...(0,m.vJ)(i.children,D=>D.getElements().flatMap(U=>{var le;let me=U.props.path;if(me==="")return[];var Ue;me=(Ue=(le=me)===null||le===void 0?void 0:le.replace(/\/\*$/,""))!==null&&Ue!==void 0?Ue:"/";let Ee=a?U:U.props.element;return!a&&!Ee&&(Ee=U,ko||(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] />} />."),ko=!0)),[{path:me,element:Ee,children:U.props.children?[{path:me==="/"?"/":"*",element:U.props.children}]:void 0}]}).sort((U,le)=>le.path.localeCompare(U.path)).map(U=>({...U,path:U.path==="/"?"/":`${U.path}/*`}))),{path:"*",element:(0,p.jsx)(s,{})}];return(0,V.V$)(C)},Bo=(0,m.T0)({id:"plugin.permission.api"});var lr;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(lr||(lr={}));function ci(i,t){return i.name===t.name}function _o(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function As(i){return i.attributes.action==="create"}function vo(i){return i.attributes.action==="read"}function so(i){return i.attributes.action==="update"}function io(i){return i.attributes.action==="delete"}function ao(i){return{authorize:async(t,s)=>await i.authorize(t,s),authorizeConditional(t,s){const a=t;return i.authorize(a,s)}}}function Rr({name:i,attributes:t,resourceType:s}){return s?{type:"resource",name:i,attributes:t,resourceType:s}:{type:"basic",name:i,attributes:t}}var _n=n(23054),yo=n(96279),es=n.n(yo),Ts=n(9571);const lo=Xe.z.lazy(()=>Xe.z.object({rule:Xe.z.string(),resourceType:Xe.z.string(),params:Xe.z.record(Xe.z.any()).optional()}).or(Xe.z.object({anyOf:Xe.z.array(lo).nonempty()})).or(Xe.z.object({allOf:Xe.z.array(lo).nonempty()})).or(Xe.z.object({not:lo}))),ts=Xe.z.object({result:Xe.z.literal(lr.ALLOW).or(Xe.z.literal(lr.DENY))}),Rs=Xe.z.union([Xe.z.object({result:Xe.z.literal(lr.ALLOW).or(Xe.z.literal(lr.DENY))}),Xe.z.object({result:Xe.z.literal(lr.CONDITIONAL),pluginId:Xe.z.string(),resourceType:Xe.z.string(),conditions:lo})]),ns=(i,t)=>Xe.z.object({items:Xe.z.array(Xe.z.intersection(Xe.z.object({id:Xe.z.string()}),i)).refine(s=>s.length===t.size&&s.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class rs{async authorize(t,s){return this.makeRequest(t,ts,s)}async authorizeConditional(t,s){return this.makeRequest(t,Rs,s)}async makeRequest(t,s,a){var u;if(!this.enabled)return t.map(Ee=>({result:lr.ALLOW}));const C={items:t.map(Ee=>({id:Ts.Z(),...Ee}))},D=await this.discovery.getBaseUrl("permission"),U=await es()(`${D}/authorize`,{method:"POST",body:JSON.stringify(C),headers:{...this.getAuthorizationHeader((u=a)===null||u===void 0?void 0:u.token),"content-type":"application/json"}});if(!U.ok)throw await _n.VL.fromResponse(U);const le=await U.json(),Ue=ns(s,new Set(C.items.map(({id:Ee})=>Ee))).parse(le).items.reduce((Ee,We)=>(Ee[We.id]=We,Ee),{});return C.items.map(Ee=>Ue[Ee.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,B._)(this,"enabled",void 0),(0,B._)(this,"discovery",void 0),this.discovery=t.discovery;var s;this.enabled=(s=t.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class xo{static create(t){const{config:s,discovery:a,identity:u}=t,C=new rs({discovery:a,config:s});return new xo(C,u)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,s){(0,B._)(this,"permissionClient",void 0),(0,B._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=s}}var $o=n(69984);function bo(i){const t=(0,m.h_)(Bo),{data:s,error:a}=(0,$o.ZP)(i,async u=>{if(_o(u.permission)&&!u.resourceRef)return lr.DENY;const{result:C}=await t.authorize(u);return C});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===lr.ALLOW}}const Is=i=>{const{permission:t,resourceRef:s,errorComponent:a,...u}=i,C=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),D=useApp(),{NotFoundErrorPage:U}=D.getComponents();let le=a===void 0?_jsx(U,{}):a;return C.loading?le=null:C.allowed&&(le=i.element),_jsx(Route,{...u,element:le})};function di(i){const{permission:t,resourceRef:s}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),u=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:C}=u.getComponents();return _jsx(C,{})}const os=[(0,m.ni)({api:m.NW,deps:{configApi:m.Ds},factory:({configApi:i})=>O.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,m.ni)({api:m.$v,deps:{},factory:()=>new N}),(0,m.ni)({api:m.v_,deps:{},factory:()=>new ae}),(0,m.ni)({api:m.VE,deps:{alertApi:m.$v},factory:({alertApi:i})=>{const t=new M(i,new G);return ue.forward(t,{hidden:!1}),t}}),(0,m.ni)({api:m.E6,deps:{errorApi:m.VE},factory:({errorApi:i})=>mt.create({errorApi:i})}),(0,m.ni)({api:m.gP,deps:{configApi:m.Ds,identityApi:m.$4,discoveryApi:m.NW},factory:({configApi:i,identityApi:t,discoveryApi:s})=>Qe({middleware:[qt.resolvePluginProtocol({discoveryApi:s}),qt.injectIdentityAuth({identityApi:t,config:i})]})}),(0,m.ni)({api:m.ZM,deps:{},factory:()=>new wn}),(0,m.ni)({api:m.Kp,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>mn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.p_,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>sn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.F4,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>gn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.D,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Cn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.ux,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>ln.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.gW,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Hn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.bq,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Gn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.Km,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>pe.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,m.ni)({api:m.uB,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>H.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,m.ni)({api:Bo,deps:{discovery:m.NW,identity:m.$4,config:m.Ds},factory:({config:i,discovery:t,identity:s})=>xo.create({config:i,discovery:t,identity:s})})];var ss=n(77277),cn=n(53974),Ps=n(71597);function y({children:i}){return(0,V.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(V.VA,{children:i})}const j=()=>(0,p.jsx)(cn.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),L=({step:i,error:t})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(y,{children:(0,p.jsx)(cn.mf,{status:"501",statusMessage:s})})},P=({error:i,resetError:t,plugin:s})=>{var a;return(0,p.jsx)(cn.yu,{title:`Error in ${(a=s)===null||a===void 0?void 0:a.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(ss.Z,{variant:"outlined",onClick:t,children:"Retry"})})},ie={Progress:cn.Ex,Router:Ps.VK,NotFoundErrorPage:j,BootErrorPage:L,ErrorBoundaryFallback:P};var re=n(43642),_=n(80079),he=n(90941),Te=n(32915),Le=n(40562),Me=n(21853),Ne=n(60744),ze=n(66569),st=n(30254),Et=n(13384),Be=n(15933),He=n(58838),At=n(86737),rn=n(4989),jn=n(44407),Ot=n(18628),Rt=n(84219),Kt=n(98685),En=n(39781),cr=n(39412);const Ir={brokenImage:_.Z,catalog:Ot.Z,scaffolder:Te.Z,techdocs:Le.Z,search:Me.Z,chat:Ne.Z,dashboard:ze.Z,docs:st.Z,email:Et.Z,github:He.Z,group:Rt.Z,help:At.Z,"kind:api":Be.Z,"kind:component":jn.Z,"kind:domain":re.Z,"kind:group":Rt.Z,"kind:location":rn.Z,"kind:system":he.Z,"kind:user":Kt.Z,"kind:resource":cr.Z,user:Kt.Z,warning:En.Z};var qr=n(73689),zn=n(4707);function Kn(i,t){if(!t||typeof t=="string")return;const s=typeof t=="function"?t(i):t;if(s)return{"@global":s}}function Pr(i,t){if(!(!t||typeof t=="string"))return typeof t=="object"?Object.fromEntries(Object.entries(t).map(([s,a])=>typeof a=="function"?[s,a({theme:i})]:[s,a])):t}const ui=/^&.Mui-([\w-]+)$/;function hi(i){let t=i;if(!i||typeof i!="object")return t;for(const s of Object.keys(i)){const a=i[s];if(!(!a||typeof a!="object"))for(const u of Object.keys(a)){const C=u,D=C.match(ui);if(D){const[,U]=D,{[C]:le,...me}=a;le&&(t={...t,[s]:me,[U]:le})}}}return t}function Ls(i,t={}){const s={},a={};for(const u of Object.keys(t)){const C=t[u];C&&("styleOverrides"in C&&(u==="MuiCssBaseline"?s[u]=Kn(i,C.styleOverrides):s[u]=hi(Pr(i,C.styleOverrides))),"defaultProps"in C&&(a[u]=C.defaultProps))}return{overrides:s,props:a}}var pi=n(47591);const Do={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,pi._j)(i.palette.link,.3),background:(0,pi.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]}),outlined:({theme:i})=>({color:i.palette.text.primary}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({color:i.palette.grey[500],width:i.spacing(3),height:i.spacing(3),margin:`0 ${i.spacing(.75)} 0 -${i.spacing(.75)}`}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:`0 ${i.spacing(.5)} 0 -${i.spacing(.5)}`})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}}},br={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},Sr={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function dr(i){var t;const{colors:s,shape:a,options:u}=i,D=`linear-gradient(90deg, ${(s.length===1?[s[0],s[0]]:s).join(", ")})`,U=`${a}, ${D}`;var le;const me=(le=(t=u)===null||t===void 0?void 0:t.fontColor)!==null&&le!==void 0?le:"#FFFFFF";return{colors:s,shape:a,backgroundImage:U,fontColor:me}}const co={home:dr({colors:Sr.teal,shape:br.wave}),documentation:dr({colors:Sr.pinkSea,shape:br.wave2}),tool:dr({colors:Sr.purpleSky,shape:br.round}),service:dr({colors:Sr.marineBlue,shape:br.wave}),website:dr({colors:Sr.veryBlue,shape:br.wave}),library:dr({colors:Sr.rubyRed,shape:br.wave}),other:dr({colors:Sr.darkGrey,shape:br.wave}),app:dr({colors:Sr.toastyOrange,shape:br.wave}),apis:dr({colors:Sr.teal,shape:br.wave2}),card:dr({colors:Sr.greens,shape:br.wave})},fi=16,Os='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',gi="home";function is(i){const{palette:t,htmlFontSize:s=fi,fontFamily:a=Os,defaultPageTheme:u=gi,pageTheme:C=co}=i;if(!C[u])throw new Error(`${u} is not defined in pageTheme.`);var D;return{palette:t,typography:{htmlFontSize:s,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}},page:C[u],getPageTheme:({themeId:U})=>(D=C[U])!==null&&D!==void 0?D:C[u]}}var uo=new WeakMap;class ks{getTheme(t){return(0,Mn._)(this,uo).get(t)}constructor(t,s){(0,Zr._)(this,uo,{writable:!0,value:new Map}),(0,S._)(this,uo,new Map),t&&(0,Mn._)(this,uo).set("v4",t),s&&(0,Mn._)(this,uo).set("v5",s)}}function mi(i){const t=is(i),s={...Do,...i.components},a=(0,zn.Z)({...t,components:s}),u=Ls(a,s),C={...(0,qr.Z)(t),...u};return new ks(C,a)}function ha(i){const t=adaptV4Theme(i),s=createTheme(i);return new ks(s,t)}const So={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},Bs={light:mi({palette:So.light}),dark:mi({palette:So.dark})};var ur=n(68542);ur.Z.configure(i=>`v5-${i}`);var pa=n(12536),fa=n(19219),ga=n(41547),ma=n(3493),va=n(76919),ya=n(91994);const xa=(0,pa.Z)({productionPrefix:"jss4-"});function vi(i){const{children:t,theme:s,noCssBaseline:a=!1}=i,u=s.getTheme("v4"),C=s.getTheme("v5");let D;a||(D=(0,p.jsx)(ya.ZP,{}));let U=(0,p.jsxs)(p.Fragment,{children:[D,t]});return u&&(U=(0,p.jsx)(fa.ZP,{generateClassName:xa,children:(0,p.jsx)(ga.Z,{theme:u,children:U})})),C&&(U=(0,p.jsx)(ma.Z,{injectFirst:!0,children:(0,p.jsx)(va.Z,{theme:C,children:U})})),U}function No(i){var t,s,a,u;return{props:{MuiGrid:(s=Do)===null||s===void 0||(t=s.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:(u=Do)===null||u===void 0||(a=u.MuiSwitch)===null||a===void 0?void 0:a.defaultProps},...is(i)}}function ba(i){return Ls(i,Do).overrides}function yi(i){const t=No(i),s=(0,qr.Z)(t),a=ba(s);return{...s,overrides:a}}const Sa=yi({palette:So.light}),Ca=yi({palette:So.dark});var as=n(98192),xi=n(15222);const bi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(xi.Z,{}),Provider:({children:i})=>(0,p.jsx)(vi,{theme:Bs.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(as.Z,{}),Provider:({children:i})=>(0,p.jsx)(vi,{theme:Bs.dark,children:i})}];function Si(i){var t,s,a,u,C,D,U,le,me,Ue,Ee,We;return mo({...i,apis:(me=(t=i)===null||t===void 0?void 0:t.apis)!==null&&me!==void 0?me:[],bindRoutes:(s=i)===null||s===void 0?void 0:s.bindRoutes,components:{...ie,...(a=i)===null||a===void 0?void 0:a.components},configLoader:(u=i)===null||u===void 0?void 0:u.configLoader,defaultApis:os,icons:{...Ir,...(C=i)===null||C===void 0?void 0:C.icons},plugins:(Ue=(D=i)===null||D===void 0?void 0:D.plugins)!==null&&Ue!==void 0?Ue:[],featureFlags:(Ee=(U=i)===null||U===void 0?void 0:U.featureFlags)!==null&&Ee!==void 0?Ee:[],themes:(We=(le=i)===null||le===void 0?void 0:le.themes)!==null&&We!==void 0?We:bi})}var ho=n(25271),hr=n(76635);async function ls({storageApi:i}){const t=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,hr.isArray)(a))return;var u;const C=new Set((u=s.snapshot("entityRefs").value)!==null&&u!==void 0?u:[]);a.filter(hr.isString).map(D=>D.split(":")).filter(D=>D.length===4&&D[0]==="entity").map(([D,U,le,me])=>(0,ho.eE)({kind:U,namespace:le,name:me})).forEach(D=>C.add(D)),await s.set("entityRefs",Array.from(C)),await t.remove("starredEntities")}class Fo{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,B._)(this,"settingsStore",void 0),(0,B._)(this,"starredEntities",void 0),(0,B._)(this,"subscribers",new Set),(0,B._)(this,"observable",new($e())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),ls(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var u;this.starredEntities=new Set((u=a.value)!==null&&u!==void 0?u:[]),this.notifyChanges()}})}}var Ci=n(8799),_r=n(79692),Lr=n(12420),Yn=n(39709),wi=n(19928);function wa(){const i=useApi(catalogApiRef),{error:t,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(C=>{var D;return((D=C.facets.kind)===null||D===void 0?void 0:D.map(U=>U.value).sort())||[]}),[i]);return{loading:s,error:t,allKinds:a!=null?a:[]}}function Ya(i,t,s){let a=i;return t&&(a=a.filter(C=>t.some(D=>D.toLocaleLowerCase("en-US")===C.toLocaleLowerCase("en-US")))),s&&!i.some(C=>C.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((C,D)=>(C[D.toLocaleLowerCase("en-US")]=D,C),{})}const Cr=(0,_r.Z)(i=>(0,Lr.Z)({root:{...i.typography.h4}}));function ji(i){var t;const{initialFilter:s="component",allowedKinds:a}=i,u=Cr(),{allKinds:C}=useAllKinds(),{filters:D,updateFilters:U,queryParameters:{kind:le}}=useEntityList(),me=useMemo(()=>[le].flat()[0],[le]);var Ue;const[Ee,We]=useState((Ue=me!=null?me:(t=D.kind)===null||t===void 0?void 0:t.value)!==null&&Ue!==void 0?Ue:s);useEffect(()=>{me&&We(me)},[me]),useEffect(()=>{var it;if(!((it=D.kind)===null||it===void 0)&&it.value){var tn;We((tn=D.kind)===null||tn===void 0?void 0:tn.value)}},[D.kind]),useEffect(()=>{U({kind:Ee?new EntityKindFilter(Ee):void 0})},[Ee,U]);const nt=filterKinds(C,a,Ee);return _jsx(Select,{input:_jsx(InputBase,{}),value:Ee.toLocaleLowerCase("en-US"),onChange:it=>We(it.target.value),classes:u,children:Object.keys(nt).map(it=>_jsx(MenuItem,{value:it,children:`${pluralize(nt[it])}`},it))})}var ja=n(86359),cs=n(95544),Ei=n(99688),Zo=n(12231),eo=n(86136),Co=n(49378),$s=n(85256),ds=n(80030),us=n(61837),hs=n(79784),Ai=n(50758),Ti=n(31654),Ds=n(43054),Ns=n(65759),Ri=n(49280),Ii=n(96641);function Uo(i){const{entity:t,loading:s,error:a}=(0,Ii.ce)(),{allowed:u,loading:C,error:D}=bo({permission:i,resourceRef:t?(0,ho.eE)(t):void 0});return s||C?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:u,error:D}}const ps="catalog-entity",Pi=Rr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:ps}),Fs=Rr({name:"catalog.entity.create",attributes:{action:"create"}}),fs=Rr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:ps}),Li=Rr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:ps}),Oi=Rr({name:"catalog.location.read",attributes:{action:"read"}}),ki=Rr({name:"catalog.location.create",attributes:{action:"create"}}),Zs=Rr({name:"catalog.location.delete",attributes:{action:"delete"}}),Ea=[Pi,Fs,fs,Li,Oi,ki,Zs];var Mo=n(49166);function Us(i){var t,s,a,u;const{unregisterEntityOptions:C,isUnregisterAllowed:D,onUnregisterEntity:U,onClose:le}=i,me=typeof((t=C)===null||t===void 0?void 0:t.disableUnregister)=="boolean";var Ue;const Ee=(Ue=!D||(me?!!(!((s=C)===null||s===void 0)&&s.disableUnregister):((a=C)===null||a===void 0?void 0:a.disableUnregister)==="disable"))!==null&&Ue!==void 0?Ue:!1;let We=(0,p.jsx)(p.Fragment,{});return((u=C)===null||u===void 0?void 0:u.disableUnregister)!=="hidden"&&(We=(0,p.jsxs)(Zo.Z,{onClick:()=>{le(),U()},disabled:Ee,children:[(0,p.jsx)(eo.Z,{children:(0,p.jsx)(Mo.Z,{fontSize:"small"})}),(0,p.jsx)(Co.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:We})}const Bi=(0,_r.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ms(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:u}=i,[C,D]=(0,W.useState)(),U=Bi(),me=Uo(fs).allowed,Ue=tn=>{D(tn.currentTarget)},Ee=()=>{D(void 0)},We=(0,m.h_)(m.$v),nt=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>We.post({message:"Copied!",severity:"info",display:"transient"}))},[We]),it=t&&[...t.map(tn=>(0,p.jsxs)(Zo.Z,{onClick:()=>{Ee(),tn.onClick()},children:[(0,p.jsx)(eo.Z,{children:(0,p.jsx)(tn.Icon,{fontSize:"small"})}),(0,p.jsx)(Co.Z,{primary:tn.title})]},tn.title)),(0,p.jsx)($s.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ds.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(us.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!C,role:"button",onClick:Ue,"data-testid":"menu-button",className:U.button,id:"long-menu",children:(0,p.jsx)(Ds.Z,{})})}),(0,p.jsx)(hs.ZP,{open:Boolean(C),onClose:Ee,anchorEl:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Ai.Z,{autoFocusItem:Boolean(C),children:[it,(0,p.jsx)(Us,{unregisterEntityOptions:s,isUnregisterAllowed:me,onUnregisterEntity:a,onClose:Ee}),(0,p.jsxs)(Zo.Z,{onClick:()=>{Ee(),u()},children:[(0,p.jsx)(eo.Z,{children:(0,p.jsx)(Ti.Z,{fontSize:"small"})}),(0,p.jsx)(Co.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(Zo.Z,{onClick:()=>{Ee(),nt()},children:[(0,p.jsx)(eo.Z,{children:(0,p.jsx)(Ns.Z,{fontSize:"small"})}),(0,p.jsx)(Co.Z,{primary:"Copy entity URL"})]})]})})]})}const zs="plugin.catalog.entityLayoutRoute",zo=()=>null;(0,m.R5)(zo,zs,!0),(0,m.R5)(zo,"core.gatherMountPoints",!0);function Ws(i){const{entity:t,title:s}=i;return(0,p.jsxs)(cs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(cs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),t&&(0,p.jsx)(Yn.LH,{entity:t})]})}function er(i,t,s,a){var u,C,D,U,le;const me=(le=i!=null?i:(u=a)===null||u===void 0?void 0:u.kind)!==null&&le!==void 0?le:"";var Ue;const Ee=(Ue=t!=null?t:(C=a)===null||C===void 0?void 0:C.metadata.namespace)!==null&&Ue!==void 0?Ue:"";var We,nt,it;return{headerTitle:`${(it=(nt=(We=(D=a)===null||D===void 0?void 0:D.metadata.title)!==null&&We!==void 0?We:s)!==null&&nt!==void 0?nt:(U=a)===null||U===void 0?void 0:U.metadata.name)!==null&&it!==void 0?it:""}${Ee&&Ee!==ho.zG?` in ${Ee}`:""}`,headerType:(()=>{let Mt=me.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(Mt+=" \u2014 ",Mt+=a.spec.type.toLocaleLowerCase("en-US")),Mt})()}}function $i(i){var t;const{entity:s}=i,a=(0,Yn.hF)(s,ho.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(cn.i9,{label:"Owner",value:(0,p.jsx)(Yn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=s.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(cn.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Di=i=>{var t,s,a;const{UNSTABLE_extraContextMenuItems:u,UNSTABLE_contextMenuOptions:C,children:D,NotFoundComponent:U}=i,{kind:le,namespace:me,name:Ue}=(0,m.Oi)(Yn.wi),{entity:Ee,loading:We,error:nt}=(0,Yn.ce)(),it=(0,V.TH)(),tn=(0,m.vJ)(D,kr=>kr.selectByComponentData({key:zs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:In})=>{if(Ee){if(In.if&&!In.if(Ee))return[]}else return[];return[{path:In.path,title:In.title,children:In.children,tabProps:In.tabProps}]}),[Ee]),{headerTitle:Mt,headerType:nr}=er(le,me,Ue,Ee),[zr,wr]=(0,W.useState)(!1),[pr,fr]=(0,W.useState)(!1),Dn=(0,V.s0)(),Or=async()=>{wr(!1),fr(!1),Dn("/")};(0,W.useEffect)(()=>{wr(!1),fr(!1)},[it.pathname]);var Wr;return(0,p.jsxs)(cn.T3,{themeId:(Wr=(a=Ee)===null||a===void 0||(s=a.spec)===null||s===void 0||(t=s.type)===null||t===void 0?void 0:t.toString())!==null&&Wr!==void 0?Wr:"home",children:[(0,p.jsx)(cn.h4,{title:(0,p.jsx)(Ws,{title:Mt,entity:Ee}),pageTitleOverride:Mt,type:nr,children:Ee&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($i,{entity:Ee}),(0,p.jsx)(Ms,{UNSTABLE_extraContextMenuItems:u,UNSTABLE_contextMenuOptions:C,onUnregisterEntity:()=>wr(!0),onInspectEntity:()=>fr(!0)})]})}),We&&(0,p.jsx)(cn.Ex,{}),Ee&&(0,p.jsx)(cn.tn,{routes:tn}),nt&&(0,p.jsx)(cn.VY,{children:(0,p.jsx)(Ei.Z,{severity:"error",children:nt.toString()})}),!We&&!nt&&!Ee&&(0,p.jsx)(cn.VY,{children:U||(0,p.jsxs)(cn.GB,{title:"Entity not found",children:["There is no ",le," with the requested"," ",(0,p.jsx)(cn.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Yn.pp,{open:zr,entity:Ee,onConfirm:Or,onClose:()=>wr(!1)}),(0,p.jsx)(Yn.U_,{open:pr,entity:Ee,onClose:()=>fr(!1)})]})};Di.Route=zo;function Aa(i){const{open:t,onClose:s,onConfirm:a,entity:u}=i,[C,D]=useState(!1),U=useApi(catalogApiRef),le=useApi(alertApiRef),me=async()=>{D(!0);try{const Ue=u.metadata.uid;await U.removeEntityByUid(Ue),a()}catch(Ue){assertError(Ue),le.post({message:Ue.message})}finally{D(!1)}};return _jsxs(Dialog,{open:t,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:C,onClick:me,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var po=n(19625);function Ta(i){var t,s,a;return((a=i)===null||a===void 0||(s=a.metadata)===null||s===void 0||(t=s.annotations)===null||t===void 0?void 0:t["backstage.io/orphan"])==="true"}function Ja(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:u}=useEntity(),C=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:u,onConfirm:C,onClose:()=>a(!1)})]})}var gs=n(4791);const Ni=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Vs(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(u=>{var C,D;return{errors:((D=(C=u.entity.status)===null||C===void 0?void 0:C.items)!==null&&D!==void 0?D:[]).filter(Ni).map(me=>me.error).filter(me=>Boolean(me)),entity:u.entity}}).filter(u=>u.errors.length>0)}}async function Ra(i,t){const s=t.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Vs(stringifyEntityRef(i),s)).items.length>0}function ms(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:u,value:C}=useAsync(async()=>Vs(t,s),[t,s]);return u?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:u})}):a||!C?null:_jsx(_Fragment,{children:C.items.map((D,U)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(D.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:D.entity})]}),D.errors.map((le,me)=>_jsx(ResponseErrorPanel,{error:le},me))]},U))})}const Hs="core.backstage.entitySwitch",Gs=i=>null;(0,m.R5)(Gs,Hs,!0);const Ks=i=>{var t;const{entity:s,loading:a}=(0,Yn.ce)(),u=(0,m.I_)(),C=(0,m.vJ)(i.children,le=>le.selectByComponentData({key:Hs,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(me=>{var Ue;if(a)return[];const{if:Ee,children:We}=me.props;return s?[{if:(Ue=Ee)===null||Ue===void 0?void 0:Ue(s,{apis:u}),children:We}]:[{if:Ee===void 0,children:We}]}),[u,s,a]);if(C.some(le=>typeof le.if=="object"&&"then"in le.if))return(0,p.jsx)(Fi,{results:C,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const le=C.filter(me=>me.if).map(me=>me.children);return le.length===0?vs(C):(0,p.jsx)(p.Fragment,{children:le})}var U;return(U=(t=C.find(le=>le.if))===null||t===void 0?void 0:t.children)!==null&&U!==void 0?U:vs(C)};function Fi({results:i,renderMultipleMatches:t}){const{loading:s,value:a}=(0,c.default)(async()=>{const u=i.map(async({if:D,children:U})=>{try{if(await D)return U}catch{}return null});if(t==="all"){const D=(await Promise.all(u)).filter(Boolean);return D.length===0?vs(i):(0,p.jsx)(p.Fragment,{children:D})}var C;return(C=(await Promise.all(u)).find(Boolean))!==null&&C!==void 0?C:vs(i)},[i]);return s||!a?null:a}function vs(i){var t,s;return(s=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&s!==void 0?s:null}Ks.Case=Gs;const Qa=null,Ia=Yn._i.Filters,Xa=Yn._i.Content;var qa=n(85877),ys=n(15096);const Zn=(0,m.rx)({id:"catalog",apis:[(0,m.ni)({api:Yn.Ah,deps:{discoveryApi:m.NW,fetchApi:m.gP},factory:({discoveryApi:i,fetchApi:t})=>new gs.MS({discoveryApi:i,fetchApi:t})}),(0,m.ni)({api:Yn.p3,deps:{storageApi:m.E6},factory:({storageApi:i})=>new Fo({storageApi:i})})],routes:{catalogIndex:po._Z,catalogEntity:Yn.wi},externalRoutes:{createComponent:po.yw,viewTechDoc:po.jU,createFromTemplate:po.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Pa=Zn.provide((0,m.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:po._Z})),Wo=Zn.provide((0,m.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Yn.wi})),La=Zn.provide((0,m.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),Ys=Zn.provide((0,m.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),Oa=Zn.provide((0,m.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),ka=Zn.provide((0,m.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Zi=Zn.provide((0,m.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Ba=Zn.provide((0,m.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Ui=Zn.provide((0,m.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),_a=Zn.provide((0,m.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),el=Zn.provide((0,m.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),tl=Zn.provide((0,m.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),$a=Zn.provide((0,m.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),Da=Zn.provide((0,ys.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Mi=n(32838);class Na{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(t,s){const u=`${await this.getApiOrigin()}/${s}`,C=await fetch(`${u.endsWith("/")?u:`${u}/`}index.html`);if(C.status===404)throw new Error("Page not found");return C.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,s,a){const u=await this.getApiOrigin();return new URL(t,`${u}/${a}`).toString()}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,B._)(this,"configApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}class zi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,B._)(this,"configApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}const Wi=[(0,m.ni)({api:Z.Dl,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Na({configApi:i,discoveryApi:t,identityApi:s})}),(0,m.ni)({api:Z.gT,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new zi({configApi:i,discoveryApi:t,identityApi:s})}),(0,m.ni)({api:Mi.q3,deps:{configApi:m.Ds},factory:({configApi:i})=>Mi.ae.fromConfig(i)})],Js={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Vi={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Hi(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Fa(){const i=await Xr(),t=await Hi();return[...i,{context:"detected",data:t?Js:Vi}]}var Gi=n(58845);const Qs=(0,_r.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Ki=()=>{const i=Qs();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Yi=(0,_r.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Qi=()=>{const i=Yi();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const Xs=(0,_r.Z)({root:{width:cn.po.drawerWidthClosed,height:3*cn.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:cn.po.drawerWidthClosed,marginLeft:24}}),xs=()=>{const i=Xs(),{isOpen:t}=(0,cn.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(cn.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(Ki,{}):(0,p.jsx)(Qi,{})})})},_s=({children:i})=>(0,p.jsxs)(cn.tR,{children:[(0,p.jsxs)(cn.YE,{children:[(0,p.jsx)(xs,{}),(0,p.jsx)(cn.v7,{}),(0,p.jsx)(cn.R6,{icon:Gi.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var Xi=n(32388),qi=n(4142);const _i=(0,_r.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var tr;(function(i){i.LIGHT="light",i.DARK="dark"})(tr||(tr={}));const ea=()=>{const i=(0,m.h_)(m.hg),t=_i(),[s,a]=(0,W.useState)(i.getActiveThemeId()===tr.DARK?tr.DARK:tr.LIGHT),u={[tr.LIGHT]:{icon:qi.Z,title:"Dark theme"},[tr.DARK]:{icon:Xi.Z,title:"Light theme"}},{title:C,icon:D}=u[s],U=()=>{a(le=>{const me=le===tr.LIGHT?tr.DARK:tr.LIGHT;return i.setActiveThemeId(me),me})};return(0,p.jsx)(cs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(ds.ZP,{title:C,arrow:!0,children:(0,p.jsx)(us.Z,{size:"small",onClick:U,children:(0,p.jsx)(D,{className:t.headerIcon})})})})},ta=()=>(0,p.jsxs)(w.I6,{children:[(0,p.jsx)(de.S,{}),(0,p.jsx)($.F,{withSearch:!1})]}),na=(0,p.jsx)(ta,{}),ei=Si({apis:Wi,configLoader:Fa,plugins:Object.values(r)}),ti=ei.getProvider(),ni=ei.getRouter(),ra=w.s4.provide((0,Z.KY)({name:"ThemeToggleAddon",component:ea,location:Z.oZ.Header})),oa=(0,p.jsxs)(Es,{children:[(0,p.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(Wo,{})}),(0,p.jsx)(V.AW,{path:"/docs",element:(0,p.jsx)(w.Jl,{}),children:(0,p.jsx)(X.u,{})}),(0,p.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(w.I6,{}),children:[na,(0,p.jsx)(Z.DR,{children:(0,p.jsx)(ra,{})})]})]});var sa=()=>(0,p.jsx)(ti,{children:(0,p.jsx)(ni,{children:(0,p.jsx)(_s,{children:oa})})});f.render((0,p.jsx)(sa,{}),document.getElementById("root"))},51837:function(It,Pe,n){"use strict";n.d(Pe,{CT:function(){return m},EI:function(){return ve},uW:function(){return f},Vt:function(){return h}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=r(),W=ce=>`__@backstage/${ce}__`;function f(ce,z){const de=W(ce);let $=p[de];return $||($=z(),p[de]=$,$)}var V=n(2784);function m(ce){return f(ce,()=>(0,V.createContext)(void 0))}function h(ce){return(0,V.useContext)(m(ce))}function F(ce){return{set(z){globalThis[`__@backstage/${ce}__`]=createContext(createVersionedValueMap(z))},reset(){delete globalThis[`__@backstage/${ce}__`]}}}function ve(ce){Object.freeze(ce);const z={atVersion(de){return ce[de]}};return Object.defineProperty(z,"$map",{configurable:!0,enumerable:!0,get(){return ce}}),z}},96641:function(It,Pe,n){"use strict";n.d(Pe,{X2:function(){return ve},ce:function(){return ce},h$:function(){return h}});var r=n(52322),p=n(25271),W=n(60871),f=n(51837),V=n(2784);const m=(0,f.CT)("entity-context"),h=z=>{const{children:de,entity:$,loading:A,error:oe,refresh:se}=z,ee={entity:$,loading:A,error:oe,refresh:se};return(0,r.jsx)(m.Provider,{value:(0,f.EI)({1:ee}),children:(0,r.jsx)(W.fC,{attributes:{...$?{entityRef:(0,p.eE)($)}:void 0},children:de})})},F=z=>_jsx(h,{entity:z.entity,loading:!Boolean(z.entity),error:void 0,refresh:void 0,children:z.children});function ve(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");if(!de.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:de.entity}}function ce(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");const{entity:$,loading:A,error:oe,refresh:se}=de;return{entity:$,loading:A,error:oe,refresh:se}}},39709:function(It,Pe,n){"use strict";n.d(Pe,{h$:function(){return dt.h$},n3:function(){return r.n3},_i:function(){return K},tW:function(){return Xe},df:function(){return Ze},UO:function(){return ht},ph:function(){return cn},dq:function(){return bt},nl:function(){return os},dx:function(){return jt},rI:function(){return _t},u3:function(){return Mn},xE:function(){return S},sL:function(){return c},LH:function(){return De},U_:function(){return ao},pp:function(){return lo},EW:function(){return $o},Ah:function(){return W},wi:function(){return Oe},hF:function(){return Z.hF},CV:function(){return Z.CV},$3:function(){return an},p3:function(){return f},ce:function(){return dt.ce},X2:function(){return dt.X2},wp:function(){return rt},ZW:function(){return Sn},eK:function(){return Ct},CR:function(){return ln}});var r=n(4791),p=n(60871);const W=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var V=n(82394);class m{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(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)})))}}var h=n(52322),F=n(2784),ve=n(41156),ce=n(60364),z=n(77277),de=n(4190),$=n(95544),A=n(90436),oe=n(60905),se=n(36444);const ee=y=>{const j=(0,ve.Z)(re=>re.breakpoints.down("md")),L=(0,ce.Z)(),[P,ie]=(0,F.useState)(!1);return j?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{style:{marginTop:L.spacing(1),marginLeft:L.spacing(1)},onClick:()=>ie(!0),startIcon:(0,h.jsx)(se.Z,{}),children:"Filters"}),(0,h.jsx)(de.ZP,{open:P,onClose:()=>ie(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,h.jsxs)($.Z,{m:2,children:[(0,h.jsx)(A.Z,{variant:"h6",component:"h2",style:{marginBottom:L.spacing(1)},children:"Filters"}),y.children]})})]}):(0,h.jsx)(oe.Z,{item:!0,lg:2,children:y.children})},X=y=>(0,h.jsx)(oe.Z,{item:!0,xs:12,lg:10,children:y.children}),K=y=>(0,h.jsx)(oe.Z,{container:!0,style:{position:"relative"},children:y.children});K.Filters=ee,K.Content=X;var T=n(53974),w=n(87612),I=n(25271),Z=n(49280);class xe{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Se{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class B{filterEntity(j){var L;return this.values.every(P=>((L=j.metadata.tags)!==null&&L!==void 0?L:[]).includes(P))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Ge{filterEntity(j){const L=this.toUpperArray(this.value.split(/\s/)),P=this.toUpperArray([j.metadata.tags]),ie=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const re of L)if(P.every(_=>_!==re)&&ie.every(_=>!_.includes(re)))return!1;return!0}toUpperArray(j){return j.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class xt{filterEntity(j){return this.values.some(L=>(0,Z.hF)(j,I.S4).some(P=>(0,I.eE)(P)===L))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j.reduce((L,P)=>{try{return L.push((0,I.eE)((0,I.of)(P,{defaultKind:"Group"}))),L}catch{return L}},[])}}class Nt{filterEntity(j){return this.values.some(L=>{var P;return((P=j.spec)===null||P===void 0?void 0:P.lifecycle)===L})}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class zt{filterEntity(j){return this.values.some(L=>j.metadata.namespace===L)}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Tt{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,P){(0,w._)(this,"value",void 0),(0,w._)(this,"isOwnedEntity",void 0),(0,w._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=L,this.isStarredEntity=P}}class Ft{filterEntity(j){var L;const P=(L=j.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return P!==void 0&&this.value.toString()===P}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Yt{filterEntity(j){var L,P,ie;const re=((ie=j)===null||ie===void 0||(P=ie.status)===null||P===void 0||(L=P.items)===null||L===void 0?void 0:L.length)>0;return re!==void 0&&this.value===re}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}var dt=n(96641),ut=n(76635),St=n(19126),lt=n.n(St),Ut=n(73557),Ht=n(69294),Ce=n(48760),$e=n(90736);const Ke=(0,F.createContext)(void 0),ht=y=>{const j=(0,$e.default)(),L=(0,p.h_)(W),[P,ie]=(0,F.useState)({}),re=(0,Ut.TH)();var _;const he=(0,F.useMemo)(()=>(_=lt().parse(re.search,{ignoreQueryPrefix:!0}).filters)!==null&&_!==void 0?_:{},[re]),[Te,Le]=(0,F.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Me,error:Ne},ze]=(0,Ht.default)(async()=>{const Be=(0,ut.compact)(Object.values(P)),He=(0,Z.Gz)(Be),At=(0,Z.wq)(Be),rn=(0,Z.wq)((0,ut.compact)(Object.values(Te.appliedFilters))),jn=Object.keys(P).reduce((Rt,Kt)=>{var En;const cr=P[Kt];return!((En=cr)===null||En===void 0)&&En.toQueryValue&&(Rt[Kt]=cr.toQueryValue()),Rt},{});if((0,ut.isEqual)(rn,At))Le({appliedFilters:P,backendEntities:Te.backendEntities,entities:Te.backendEntities.filter(He)});else{const Rt=await L.getEntities({filter:At});Le({appliedFilters:P,backendEntities:Rt.items,entities:Rt.items.filter(He)})}if(j()){var Ot;const Rt=lt().parse(re.search,{ignoreQueryPrefix:!0}),Kt=lt().stringify({...Rt,filters:jn},{addQueryPrefix:!0,arrayFormat:"repeat"}),En=`${window.location.pathname}${Kt}`;(Ot=window.history)===null||Ot===void 0||Ot.replaceState(null,document.title,En)}},[L,he,P,Te],{loading:!0});(0,Ce.Z)(ze,10,[P]);const st=(0,F.useCallback)(Be=>{ie(He=>{const At=typeof Be=="function"?Be(He):Be;return{...He,...At}})},[]),Et=(0,F.useMemo)(()=>({filters:Te.appliedFilters,entities:Te.entities,backendEntities:Te.backendEntities,updateFilters:st,queryParameters:he,loading:Me,error:Ne}),[Te,st,he,Me,Ne]);return(0,h.jsx)(Ke.Provider,{value:Et,children:y.children})};function rt(){const y=(0,F.useContext)(Ke);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var et=n(64279),vt=n(18149),ot=n.n(vt),Je=n(829),ft=n.n(Je);function gt(){var y;const j=(0,p.h_)(W),{filters:{kind:L,type:P},queryParameters:{type:ie},updateFilters:re}=rt(),_=(0,F.useMemo)(()=>[ie].flat().filter(Boolean),[ie]);var he;const[Te,Le]=(0,F.useState)(_.length?_:(he=(y=P)===null||y===void 0?void 0:y.getTypes())!==null&&he!==void 0?he:[]);(0,F.useEffect)(()=>{_.length&&Le(_)},[_]);const[Me,Ne]=(0,F.useState)([]),ze=(0,F.useMemo)(()=>{var At;return(At=L)===null||At===void 0?void 0:At.value},[L]),{error:st,loading:Et,value:Be}=(0,et.default)(async()=>ze?await j.getEntityFacets({filter:{kind:ze},facets:["spec.type"]}).then(rn=>rn.facets["spec.type"]||[]):[],[ze,j]),He=(0,F.useRef)(Be);return(0,F.useEffect)(()=>{const At=He.current;if(He.current=Be,Et||!ze||At===Be||!Be)return;const rn=[...new Set(ft()(Be,Ot=>-Ot.count).map(Ot=>Ot.value.toLocaleLowerCase("en-US")))];Ne(rn);const jn=Te.filter(Ot=>rn.includes(Ot));ot()(Te,jn)||Le(jn)},[Et,ze,Te,Le,Be]),(0,F.useEffect)(()=>{re({type:Te.length?new Se(Te):void 0})},[Te,re]),{loading:Et,error:st,availableTypes:Me,selectedTypes:Te,setSelectedTypes:Le}}function Ct(y,j){var L,P,ie,re;const _=(P=j)===null||P===void 0||(L=P.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),he=(re=j)===null||re===void 0||(ie=re.kind)===null||ie===void 0?void 0:ie.toLocaleLowerCase("en-US"),Te=(0,p.h_)(W),{loading:Le,value:Me,error:Ne}=(0,et.default)(async()=>{var ze,st;const Et=(ze=y.relations)===null||ze===void 0?void 0:ze.filter(He=>(!_||He.type.toLocaleLowerCase("en-US")===_)&&(!he||(0,I.of)(He.targetRef).kind===he));if(!(!((st=Et)===null||st===void 0)&&st.length))return[];const{items:Be}=await Te.getEntitiesByRefs({entityRefs:Et.map(He=>He.targetRef)});return Be.filter(He=>Boolean(He))},[y,_,he]);return{entities:Me,loading:Le,error:Ne}}var gn=n(72164);function un(y){return typeof y=="string"?y:(0,I.eE)(y)}function ln(){const y=(0,p.h_)(f),j=(0,gn.Z)(y.starredEntitie$(),new Set),L=(0,F.useCallback)(ie=>j.has(un(ie)),[j]),P=(0,F.useCallback)(ie=>y.toggleStarred(un(ie)).then(),[y]);return{starredEntities:j,toggleStarredEntity:P,isStarredEntity:L}}function bn(y){return typeof y=="string"?y:(0,I.eE)(y)}function hn(y){const j=(0,p.h_)(f),[L,P]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{const re=j.starredEntitie$().subscribe({next(_){P(_.has(bn(y)))}});return()=>{re.unsubscribe()}},[y,j]),{toggleStarredEntity:(0,F.useCallback)(()=>j.toggleStarred(bn(y)).then(),[y,j]),isStarredEntity:L}}var mn=n(75435);function Sn(){const y=(0,p.h_)(p.$4),{loading:j,value:L}=(0,et.default)(async()=>{const{ownershipEntityRefs:ie}=await y.getBackstageIdentity();return ie},[]),P=(0,F.useMemo)(()=>{const ie=new Set(L!=null?L:[]);return re=>{const _=(0,mn.h)(re,I.S4).map(I.eE);for(const he of _)if(ie.has(he))return!0;return!1}},[L]);return(0,F.useMemo)(()=>({loading:j,isOwnedEntity:P}),[j,P])}function on(){const y=(0,p.h_)(W),{error:j,loading:L,value:P}=(0,et.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(re=>{var _;return((_=re.facets.kind)===null||_===void 0?void 0:_.map(he=>he.value).sort())||[]}),[y]);return{loading:L,error:j,allKinds:P!=null?P:[]}}function pn(y,j,L){let P=y;return j&&(P=P.filter(re=>j.some(_=>_.toLocaleLowerCase("en-US")===re.toLocaleLowerCase("en-US")))),L&&!y.some(re=>re.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US"))&&(P=P.concat([L])),P.sort().reduce((re,_)=>(re[_.toLocaleLowerCase("en-US")]=_,re),{})}function Cn(y){var j;const{filters:L,queryParameters:{kind:P},updateFilters:ie}=rt(),re=(0,F.useMemo)(()=>[P].flat()[0],[P]);var _;const[he,Te]=(0,F.useState)((_=re!=null?re:(j=L.kind)===null||j===void 0?void 0:j.value)!==null&&_!==void 0?_:y.initialFilter);(0,F.useEffect)(()=>{re&&Te(re)},[re]),(0,F.useEffect)(()=>{var ze;if(!((ze=L.kind)===null||ze===void 0)&&ze.value){var st;Te((st=L.kind)===null||st===void 0?void 0:st.value)}},[L.kind]),(0,F.useEffect)(()=>{ie({kind:he?new xe(he):void 0})},[he,ie]);const{allKinds:Le,loading:Me,error:Ne}=on();return{loading:Me,error:Ne,allKinds:Le!=null?Le:[],selectedKind:he,setSelectedKind:Te}}const Xe=y=>{const{allowedKinds:j,hidden:L,initialFilter:P="component"}=y,ie=(0,p.h_)(p.$v),{error:re,allKinds:_,selectedKind:he,setSelectedKind:Te}=Cn({initialFilter:P});if((0,F.useEffect)(()=>{re&&ie.post({message:"Failed to load entity kinds",severity:"error"})},[re,ie]),re)return null;const Le=pn(_,j,he),Me=Object.keys(Le).map(Ne=>({value:Ne,label:Le[Ne]}));return L?null:(0,h.jsx)($.Z,{pb:1,pt:1,children:(0,h.jsx)(T.Ph,{label:"Kind",items:Me,selected:he.toLocaleLowerCase("en-US"),onChange:Ne=>Te(String(Ne))})})};var Jt=n(79692),Vt=n(38016),Ye=n(88013),An=n(21324),sn=n(5806),Bn=n(19996),Tn=n(25505);const Rn=(0,h.jsx)(Tn.Z,{fontSize:"small"}),Hn=(0,h.jsx)(Bn.Z,{fontSize:"small"});function Ln({selected:y}){return(0,h.jsx)(An.Z,{icon:Rn,checkedIcon:Hn,checked:y})}const Gn=(0,F.memo)(y=>{var j;const{selected:L,value:P,availableOptions:ie,showCounts:re}=y,_=re?`${P} (${(j=ie)===null||j===void 0?void 0:j[P]})`:P;return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(Ln,{selected:L}),label:_,onClick:he=>he.preventDefault()})});var we=n(86619),pe=n(72779),Re=n.n(pe);const H=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function N(y){const j=H();return(0,h.jsx)(we.Z,{variant:"outlined",...y,className:Re()(j.input,y.className)})}function ae(y){var j;const{label:L,name:P,path:ie,showCounts:re,Filter:_,InputProps:he,initialSelectedOptions:Te=[]}=y,{updateFilters:Le,filters:Me,queryParameters:{[P]:Ne}}=rt(),ze=(0,p.h_)(W),{value:st}=(0,et.default)(async()=>{var Rt;const Kt=ie,{facets:En}=await ze.getEntityFacets({facets:[Kt],filter:(Rt=Me.kind)===null||Rt===void 0?void 0:Rt.getCatalogFilters()});return Object.fromEntries(En[Kt].map(({value:cr,count:Ir})=>[cr,Ir]))},[Me.kind]),Et=(0,F.useMemo)(()=>[Ne].flat().filter(Boolean),[Ne]);var Be;const[He,At]=(0,F.useState)(Et.length?Et:(Be=(j=Me[P])===null||j===void 0?void 0:j.values)!==null&&Be!==void 0?Be:Te);(0,F.useEffect)(()=>{Et.length&&At(Et)},[Et]);const rn=Object.keys(st!=null?st:{}),jn=He.length&&rn.length;(0,F.useEffect)(()=>{Le({[P]:jn?new _(He):void 0})},[P,jn,He,_,Le]);const Ot=Me[P];return Ot&&typeof Ot=="object"&&!("values"in Ot)||!rn.length||rn.length<=1?null:(0,h.jsx)($.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:[L,(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rn,value:He,onChange:(Rt,Kt)=>At(Kt),renderOption:(Rt,{selected:Kt})=>(0,h.jsx)(Gn,{selected:Kt,value:Rt,availableOptions:st,showCounts:!!re}),size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":`${String(P)}-picker-expand`}),renderInput:Rt=>(0,h.jsx)(N,{...Rt,...he})})]})})}const Ae=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ze=y=>{const{initialFilter:j=[]}=y,L=Ae();return(0,h.jsx)(ae,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:Nt,InputProps:{className:L.input},initialSelectedOptions:j})};var qe=n(6232),Pt=n(98685),$t=n(62367),Qt=n(72579),Xt=n.n(Qt);function an(y,j){var L,P;const ie=(L=j)===null||L===void 0?void 0:L.defaultKind;let re,_,he;if("metadata"in y?(re=y.kind,_=y.metadata.namespace,he=y.metadata.name):(re=y.kind,_=y.namespace,he=y.name),(_===void 0||_==="")&&(_=I.zG),((P=j)===null||P===void 0?void 0:P.defaultNamespace)!==void 0){var Te;((Te=j)===null||Te===void 0?void 0:Te.defaultNamespace)===_&&(_=void 0)}else _===I.zG&&(_=void 0);return re=re.toLocaleLowerCase("en-US"),re=ie&&ie.toLocaleLowerCase("en-US")===re?void 0:re,`${re?`${re}:`:""}${_?`${_}/`:""}${he}`}function ne(y,j){for(const L of["spec.profile.displayName","metadata.title"]){const P=Xt()(y,L);if(P&&typeof P=="string")return P}return j}function te({enabled:y}){const j=(0,p.h_)(W),[L]=(0,F.useState)(async()=>{if(!y)return[];const P="relations.ownedBy";return j.getEntityFacets({facets:[P]}).then(ie=>ie.facets[P].map(re=>re.value).map(re=>{const{kind:_,name:he,namespace:Te}=(0,I.of)(re);return{apiVersion:"backstage.io/v1beta1",kind:_,metadata:{name:he,namespace:Te}}}).sort((re,_)=>(re.metadata.namespace||"").localeCompare(_.metadata.namespace||"","en-US")||re.metadata.name.localeCompare(_.metadata.name,"en-US")||re.kind.localeCompare(_.kind,"en-US"))).catch(()=>[])});return(0,Ht.default)(async(P,ie)=>{var re;const _=await L;if(!_)return{items:[]};var he;const Te=(he=(re=ie)===null||re===void 0?void 0:re.limit)!==null&&he!==void 0?he:20,{text:Le,start:Me}=Y(P),Ne=_.filter(st=>M(Le,st)),ze=Me+Te;return{items:Ne.slice(0,ze),...O({entities:Ne,limit:ze,payload:{text:Le,start:ze}})}},[L],{loading:!0,value:{items:[]}})}function Y(y){return v(y)&&y.cursor?JSON.parse(atob(y.cursor)):{text:y.text||"",start:0}}function v(y){return!!y.cursor}function O({entities:y,limit:j,payload:L}){return y.length>j?{cursor:btoa(JSON.stringify(L))}:{}}function M(y,j){var L;const P=y.trim();return j.kind.includes(P)||((L=j.metadata.namespace)===null||L===void 0?void 0:L.includes(P))||j.metadata.name.includes(P)}function G(){const y=(0,p.h_)(W);return(0,Ht.default)(async(j,L)=>{var P;const ie=j,re=j;var _;const he=(_=(P=L)===null||P===void 0?void 0:P.limit)!==null&&_!==void 0?_:20;if(re.cursor){const Le=await y.queryEntities({cursor:re.cursor,limit:he});return{cursor:Le.pageInfo.nextCursor,items:[...re.items,...Le.items]}}const Te=await y.queryEntities({fullTextFilter:{term:ie.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:he});return{cursor:Te.pageInfo.nextCursor,items:Te.items}},[],{loading:!0})}var ue=n(21638);function be({mode:y,initialSelectedOwnersRefs:j}){const L=y==="owners-only",P=G(),ie=te({enabled:L}),[re,_]=L?ie:P;return[re,_,ke({enabled:!L,initialSelectedOwnersRefs:j})]}function ke({enabled:y,initialSelectedOwnersRefs:j}){const L=(0,F.useRef)({}),P=(0,p.h_)(W),[,ie]=(0,Ht.default)(async()=>{(await P.getEntitiesByRefs({entityRefs:j})).items.forEach(_=>{_&&(L.current[(0,I.eE)(_)]=_)})},[]);return(0,ue.n)(()=>{y&&j.length>0&&ie()}),{getEntity:re=>L.current[re],setEntity:re=>{L.current[(0,I.eE)(re)]=re}}}const Qe=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),tt=(0,h.jsx)(Tn.Z,{fontSize:"small"}),yt=(0,h.jsx)(Bn.Z,{fontSize:"small"}),bt=y=>{var j,L,P;const ie=Qe(),{mode:re="owners-only"}=y||{},{updateFilters:_,filters:he,queryParameters:{owners:Te}}=rt(),[Le,Me]=(0,F.useState)(""),Ne=(0,F.useMemo)(()=>[Te].flat().filter(Boolean),[Te]);var ze;const[st,Et]=(0,F.useState)(Ne.length?Ne:(ze=(j=he.owners)===null||j===void 0?void 0:j.values)!==null&&ze!==void 0?ze:[]),[{value:Be,loading:He},At,rn]=be({mode:re,initialSelectedOwnersRefs:st});(0,qe.b)(()=>At({text:Le}),[Le,At],250);const jn=((L=Be)===null||L===void 0?void 0:L.items)||[];return(0,F.useEffect)(()=>{if(Ne.length){const Ot=new xt(Ne);Et(Ot.values)}},[Ne]),(0,F.useEffect)(()=>{_({owners:st.length?new xt(st):void 0})},[st,_]),["user","group"].includes(((P=he.kind)===null||P===void 0?void 0:P.value.toLocaleLowerCase("en-US"))||"")?null:(0,h.jsx)($.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:["Owner",(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:He,options:jn,value:st,getOptionSelected:(Ot,Rt)=>typeof Rt=="string"?(0,I.eE)(Ot)===Rt:Ot===Rt,getOptionLabel:Ot=>{const Rt=typeof Ot=="string"?rn.getEntity(Ot)||(0,I.of)(Ot,{defaultKind:"group",defaultNamespace:"default"}):Ot;return ne(Rt,an(Rt))},onChange:(Ot,Rt)=>{Me(""),Et(Rt.map(Kt=>{const En=typeof Kt=="string"?Kt:(0,I.eE)(Kt);return typeof Kt!="string"&&rn.setEntity(Kt),En}))},filterOptions:Ot=>Ot,renderOption:(Ot,{selected:Rt})=>{const Kt=Ot.kind.toLocaleLowerCase("en-US")==="group";return(0,h.jsx)(sn.Z,{control:(0,h.jsx)(An.Z,{icon:tt,checkedIcon:yt,checked:Rt}),onClick:En=>En.preventDefault(),label:(0,h.jsxs)($.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Kt?(0,h.jsx)($t.Z,{fontSize:"small"}):(0,h.jsx)(Pt.Z,{fontSize:"small"}),"\xA0",ne(Ot,an(Ot,{defaultKind:Ot.kind}))]})})},size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Ot=>(0,h.jsx)(we.Z,{...Ot,className:ie.input,onChange:Rt=>{Me(Rt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Ot=>{var Rt;const Kt=Ot.currentTarget;Math.abs(Kt.scrollHeight-Kt.clientHeight-Kt.scrollTop)<1&&(!((Rt=Be)===null||Rt===void 0)&&Rt.cursor)&&At({items:Be.items,cursor:Be.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var ct=n(51837);const Oe=(0,ct.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function wt(y){var j,L;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(L=(j=y.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:y.metadata.name}}var qt=n(80030);const jt=(0,F.forwardRef)((y,j)=>{var L;const{entityRef:P,defaultKind:ie,title:re,children:_,...he}=y,Te=(0,p.tg)(Oe);let Le,Me,Ne;if(typeof P=="string"){const He=(0,I.of)(P);Le=He.kind,Me=He.namespace,Ne=He.name}else"metadata"in P?(Le=P.kind,Me=P.metadata.namespace,Ne=P.metadata.name):(Le=P.kind,Me=P.namespace,Ne=P.name);Le=Le.toLocaleLowerCase("en-US");var ze;Me=(ze=(L=Me)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"))!==null&&ze!==void 0?ze:I.zG;const st={kind:Le,namespace:Me,name:Ne},Et=an({kind:Le,namespace:Me,name:Ne},{defaultKind:ie}),Be=(0,h.jsxs)(T.rU,{...he,ref:j,to:Te(st),children:[_,!_&&(re!=null?re:Et)]});return re?(0,h.jsx)(qt.ZP,{title:Et,children:Be}):Be});function Zt(y){const{entityRefs:j,defaultKind:L,getTitle:P,...ie}=y,re=(0,p.h_)(W),{value:_=new Array,loading:he,error:Te}=(0,et.default)(async()=>{const Le=j.reduce((Ne,ze)=>typeof ze=="object"&&"metadata"in ze?Ne:[...Ne,(0,I.of)(ze)],new Array),Me=j.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return Le.length>0?[...(await re.getEntities({filter:Le.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...Me]:Me},[j]);return he?(0,h.jsx)(T.Ex,{}):Te?(0,h.jsx)(T.yu,{error:Te}):(0,h.jsx)(h.Fragment,{children:_.map((Le,Me)=>(0,h.jsxs)(F.Fragment,{children:[Me>0&&", ",(0,h.jsx)(jt,{...ie,defaultKind:L,entityRef:Le,title:P(Le)})]},Me))})}function _t(y){const{entityRefs:j,defaultKind:L,fetchEntities:P,getTitle:ie,...re}=y;return P?(0,h.jsx)(Zt,{...re,defaultKind:L,entityRefs:j,getTitle:ie}):(0,h.jsx)(h.Fragment,{children:j.map((_,he)=>(0,h.jsxs)(F.Fragment,{children:[he>0&&", ",(0,h.jsx)(jt,{...re,defaultKind:L,entityRef:_,title:ie?ie(_):void 0})]},he))})}const wn=y=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(y.entity)),children:_jsx(InfoIcon,{})})},Bt=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),mt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Lt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Wt=(0,Jt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),en=4,gr=y=>{var j,L,P;const{entityRef:ie,children:re,delayTime:_=500}=y,he=Wt(),Te=useApiHolder(),Le=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Me,Ne]=useState(!1),ze=useMemo(()=>debounce(()=>Ne(!0),_),[_]),[{loading:st,error:Et,value:Be},He]=useAsyncFn(async()=>{const rn=Te.get(catalogApiRef);if(rn){const jn=await rn.getEntityByRef(ie);if(!jn)throw new Error(`${ie} not found`);return jn}},[Te,ie]),At=()=>{Ne(!1),ze.cancel()};return useEffect(()=>{Le.isOpen&&!Be&&!Et&&!st&&He()},[Le.isOpen,He,Be,Et,st]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:ze,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Le),children:re})}),Me&&_jsx(HoverPopover,{PaperProps:{className:he.popoverPaper},...bindPopover(Le),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:At,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Et&&_jsx(ResponseErrorPanel,{error:Et}),st&&_jsx(Progress,{}),Be&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Be.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Be.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Be.kind}),Be.metadata.description&&_jsx(Typography,{className:he.descriptionTypography,paragraph:!0,children:Be.metadata.description}),_jsx(Typography,{children:(j=Be.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Be.metadata.tags||[]).slice(0,en).map(rn=>_jsx(Chip,{size:"small",label:rn},rn)),((L=Be.metadata.tags)===null||L===void 0?void 0:L.length)&&((P=Be.metadata.tags)===null||P===void 0?void 0:P.length)>en&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Et&&Be&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Be)&&_jsx(UserCardActions,{entity:Be}),isGroupEntity(Be)&&_jsx(GroupCardActions,{entity:Be}),_jsx(EntityCardActions,{entity:Be})]})})]})})]})},mr=(0,Jt.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Xn=()=>{var y;const j=mr(),{filters:L,updateFilters:P}=useEntityList();var ie;const[re,_]=useState((ie=(y=L.text)===null||y===void 0?void 0:y.value)!==null&&ie!==void 0?ie:"");return useDebounce(()=>{P({text:re.length?new EntityTextFilter(re):void 0})},250,[re,P]),_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:he=>_(he.target.value),value:re,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>_(""),edge:"end",disabled:re.length===0,children:_jsx(Clear,{})})})})})})},vn=Object.freeze({createEntityRefColumn(y){const{defaultKind:j}=y;function L(P){var ie;return((ie=P.metadata)===null||ie===void 0?void 0:ie.title)||an(P,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(P,ie){return L(ie).includes(P)},customSort(P,ie){return L(P).localeCompare(L(ie))},render:P=>{var ie;return(0,h.jsx)(jt,{entityRef:P,defaultKind:j,title:(ie=P.metadata)===null||ie===void 0?void 0:ie.title})}}},createEntityRelationColumn(y){const{title:j,relation:L,defaultKind:P,filter:ie}=y;function re(he){return(0,Z.hF)(he,L,ie)}function _(he){return re(he).map(Te=>an(Te,{defaultKind:P})).join(", ")}return{title:j,customFilterAndSearch(he,Te){return _(Te).includes(he)},customSort(he,Te){return _(he).localeCompare(_(Te))},render:he=>(0,h.jsx)(_t,{entityRefs:re(he),defaultKind:P})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:I.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:I.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:I.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,h.jsx)(T.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Un=[vn.createEntityRefColumn({defaultKind:"system"}),vn.createDomainColumn(),vn.createOwnerColumn(),vn.createMetadataDescriptionColumn()],vr=[vn.createEntityRefColumn({defaultKind:"component"}),vn.createSystemColumn(),vn.createOwnerColumn(),vn.createSpecTypeColumn(),vn.createSpecLifecycleColumn(),vn.createMetadataDescriptionColumn()],Fr=(0,Jt.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),Mn=y=>{const{entities:j,title:L,emptyContent:P,variant:ie="gridItem",columns:re}=y,_=Fr(),he={minWidth:"0",width:"100%"};return ie==="gridItem"&&(he.height="calc(100% - 10px)"),(0,h.jsx)(T.iA,{columns:re,title:L,style:he,emptyContent:P&&(0,h.jsx)("div",{className:_.empty,children:P}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:j})};Mn.columns=vn,Mn.systemEntityColumns=Un,Mn.componentEntityColumns=vr;const Zr=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),S=y=>{const j=Zr();return(0,h.jsx)(ae,{label:"Tags",name:"tags",path:"metadata.tags",Filter:B,showCounts:y.showCounts,InputProps:{className:j.input}})},c=y=>{const{hidden:j,initialFilter:L}=y,P=(0,p.h_)(p.$v),{error:ie,availableTypes:re,selectedTypes:_,setSelectedTypes:he}=gt();if((0,F.useEffect)(()=>{ie&&P.post({message:"Failed to load entity types",severity:"error"}),L&&he([L])},[ie,P,L,he]),re.length===0||ie)return null;const Te=[{value:"all",label:"all"},...re.map(Me=>({value:Me,label:Me}))];var Le;return j?null:(0,h.jsx)($.Z,{pb:1,pt:1,children:(0,h.jsx)(T.Ph,{label:"Type",items:Te,selected:(Le=Te.length>1?_[0]:void 0)!==null&&Le!==void 0?Le:"all",onChange:Me=>he(Me==="all"?[]:[String(Me)])})})};var b=n(15459),E=n(61837),J=n(11640),ye=n(28347);const je=(0,b.Z)({root:{color:"#f3ba37"}})(J.Z),De=y=>{const{toggleStarredEntity:j,isStarredEntity:L}=hn(y.entity);return(0,h.jsx)(E.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>j(),children:(0,h.jsx)(qt.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,h.jsx)(je,{}):(0,h.jsx)(ye.Z,{})})})};var _e=n(8629),Gt=n(79249),yn=n(38724),qn=n(99152),yr=n(6487),Ar=n(49429),xn=n(55999),Kr=n(39412);const go=Kr.Z;function Eo(y,j){if(y)return y.toLocaleLowerCase("en-US");if(j)try{return(0,I.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function ws(y,j){const L=(0,p.qD)(),P=Eo(y,j);return P&&L.getSystemIcon(`kind:${P}`)||go}function Yr(y){const{kind:j,entityRef:L,...P}=y,ie=ws(j,L);return(0,h.jsx)(ie,{...P})}const Ko=(0,Jt.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function js(y){var j,L;const P=(0,p.h_)(W),ie=(0,I.eE)(y),{loading:re,error:_,value:he}=(0,et.default)(async()=>{const Te=await P.getEntityAncestors({entityRef:ie}),Le=new Array,Me=new Array;for(const Ne of Te.items){const ze=(0,I.eE)(Ne.entity),st=ze===Te.rootEntityRef;Le.push({id:ze,root:st,...Ne.entity});for(const Et of Ne.parentEntityRefs)Me.push({from:ze,to:Et})}return{nodes:Le,edges:Me}},[ie]);return{loading:re,error:_,nodes:((j=he)===null||j===void 0?void 0:j.nodes)||[],edges:((L=he)===null||L===void 0?void 0:L.edges)||[]}}function Yo({node:y}){const j=Ko(),L=(0,Ut.s0)(),P=(0,p.tg)(Oe),[ie,re]=(0,F.useState)(0),[_,he]=(0,F.useState)(0),Te=(0,F.useRef)(null);(0,F.useLayoutEffect)(()=>{if(Te.current){let{height:He,width:At}=Te.current.getBBox();He=Math.round(He),At=Math.round(At),(He!==_||At!==ie)&&(re(At),he(He))}},[ie,_]);const Le=10,Me=_,Ne=Me+Le,ze=Ne+ie+Le*2,st=_+Le*2,Et=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?an({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),Be=()=>{L(P({kind:y.kind,namespace:y.metadata.namespace||I.zG,name:y.metadata.name}))};return(0,h.jsxs)("g",{onClick:Be,className:j.clickable,children:[(0,h.jsx)("rect",{className:Re()(j.node,y.root?"secondary":"primary"),width:ze,height:st,rx:10}),(0,h.jsx)(Yr,{kind:y.kind,y:Le,x:Le,width:Me,height:Me,className:Re()(j.text,y.root?"secondary":"primary")}),(0,h.jsx)("text",{ref:Te,className:Re()(j.text,y.root?"secondary":"primary"),y:st/2,x:Ne+(ie+Le*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Et})]})}function Jo(y){const{loading:j,error:L,nodes:P,edges:ie}=js(y.entity);return j?(0,h.jsx)(T.Ex,{}):L?(0,h.jsx)(T.Gk,{error:L}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xn.Z,{variant:"h2",children:"Ancestry"}),(0,h.jsxs)(xn.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,h.jsx)(T.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,h.jsx)($.Z,{mt:4,children:(0,h.jsx)(T.mn,{nodes:P,edges:ie,renderNode:Yo,direction:T.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Tr=n(11776),ir=n(38402),Jr=n(86136),oo=n(99688),Ao=n(49378),To=n(54506),Ur=n(94339),Qo=n(24579),Ro=n(27685);const $n=(0,Jt.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function ar(y){const j=$n();return(0,h.jsx)(Ao.Z,{...y,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Qr(y){const j=$n();return(0,h.jsx)(To.Z,{className:j.monospace,children:y.children})}function Xr(y){return(0,h.jsx)($.Z,{mt:2,children:(0,h.jsx)(Ur.Z,{variant:"outlined",children:(0,h.jsxs)(Qo.Z,{children:[(0,h.jsxs)(A.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,h.jsx)(Io,{to:y.helpLink})]}),y.children]})})})}function Xo(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function xr(y){const[j,L]=y.entry,P=Xo(L);return(0,h.jsxs)(ir.Z,{children:[y.indent&&(0,h.jsx)(Jr.Z,{}),(0,h.jsx)(ar,{primary:j,secondary:P?(0,h.jsx)(T.rU,{to:P,children:L}):L})]})}function Io(y){const j=$n();return(0,h.jsx)(T.rU,{to:y.to,className:j.helpIcon,children:(0,h.jsx)(Ro.Z,{fontSize:"inherit"})})}const Po=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function Lo(y){var j,L,P;const ie=(0,p.h_)(W),re=(0,I.eE)(y),_=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.P1],he=(L=y.metadata.annotations)===null||L===void 0?void 0:L[I.q1],{loading:Te,error:Le,value:Me}=(0,et.default)(async()=>!_&&!he?[]:(await ie.getEntities({filter:[..._?[{[`metadata.annotations.${I.P1}`]:_}]:[],...he?[{[`metadata.annotations.${I.q1}`]:he}]:[]]})).items,[_,he]);return{loading:Te,error:Le,location:_,originLocation:he,colocatedEntities:(P=Me)===null||P===void 0?void 0:P.filter(Ne=>(0,I.eE)(Ne)!==re)}}function Mr(y){return(0,h.jsxs)(Tr.Z,{dense:!0,children:[y.header&&(0,h.jsx)(xr,{entry:y.header},"header"),y.entities.map(j=>(0,h.jsxs)(ir.Z,{children:[(0,h.jsx)(Jr.Z,{children:(0,h.jsx)(Yr,{kind:j.kind})}),(0,h.jsx)(ar,{primary:(0,h.jsx)(jt,{entityRef:j})})]},(0,I.eE)(j)))]})}function Oo(y){var j;const{entity:L}=y,{loading:P,error:ie,location:re,originLocation:_,colocatedEntities:he}=Lo(L);if(P)return(0,h.jsx)(T.Ex,{});if(ie)return(0,h.jsx)(T.Gk,{error:ie});if(!re&&!_)return(0,h.jsx)(oo.Z,{severity:"warning",children:"Entity had no location information."});if(!(!((j=he)===null||j===void 0)&&j.length))return(0,h.jsx)(oo.Z,{severity:"info",children:"There were no other entities on this location."});if(re===_)return(0,h.jsx)(Mr,{entities:he});const Te=he.filter(Me=>{var Ne;return((Ne=Me.metadata.annotations)===null||Ne===void 0?void 0:Ne[I.P1])===re}),Le=he.filter(Me=>{var Ne;return((Ne=Me.metadata.annotations)===null||Ne===void 0?void 0:Ne[I.q1])===_});return(0,h.jsxs)(h.Fragment,{children:[Te.length>0&&(0,h.jsx)(Mr,{entities:Te,header:["At the same location",re]}),Le.length>0&&(0,h.jsx)(Mr,{entities:Le,header:["At the same origin",_]})]})}function qo(y){const j=Po();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xn.Z,{variant:"h2",children:"Colocated"}),(0,h.jsx)(xn.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,h.jsx)("div",{className:j.root,children:(0,h.jsx)(Oo,{entity:y.entity})})]})}function mo(y){return Object.fromEntries([...Object.entries(y)].sort((j,L)=>j[0]<L[0]?-1:1))}function ko(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xn.Z,{variant:"h2",children:"Entity as JSON"}),(0,h.jsx)(xn.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,h.jsx)(xn.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(T.Oi,{text:JSON.stringify(mo(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Es=n(3440),Bo=n.n(Es);const lr=(0,Jt.Z)({root:{display:"flex",flexDirection:"column"}});function ci(y){var j,L,P;const ie=lr(),{apiVersion:re,kind:_,metadata:he,spec:Te,relations:Le=[],status:Me={}}=y.entity,Ne=Bo()(ft()(Le,ze=>ze.targetRef),"type");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xn.Z,{variant:"h2",children:"Overview"}),(0,h.jsxs)("div",{className:ie.root,children:[(0,h.jsx)(Xr,{title:"Identity",children:(0,h.jsxs)(Tr.Z,{dense:!0,children:[(0,h.jsx)(ir.Z,{children:(0,h.jsx)(ar,{primary:"apiVersion",secondary:re})}),(0,h.jsx)(ir.Z,{children:(0,h.jsx)(ar,{primary:"kind",secondary:_})}),((j=Te)===null||j===void 0?void 0:j.type)&&(0,h.jsx)(ir.Z,{children:(0,h.jsx)(ar,{primary:"spec.type",secondary:Te.type})}),he.uid&&(0,h.jsx)(ir.Z,{children:(0,h.jsx)(ar,{primary:"uid",secondary:he.uid})}),he.etag&&(0,h.jsx)(ir.Z,{children:(0,h.jsx)(ar,{primary:"etag",secondary:he.etag})})]})}),(0,h.jsxs)(Xr,{title:"Metadata",children:[!!Object.keys(he.annotations||{}).length&&(0,h.jsx)(Tr.Z,{dense:!0,subheader:(0,h.jsxs)(Qr,{children:["Annotations",(0,h.jsx)(Io,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(he.annotations).map(ze=>(0,h.jsx)(xr,{indent:!0,entry:ze},ze[0]))}),!!Object.keys(he.labels||{}).length&&(0,h.jsx)(Tr.Z,{dense:!0,subheader:(0,h.jsx)(Qr,{children:"Labels"}),children:Object.entries(he.labels).map(ze=>(0,h.jsx)(xr,{indent:!0,entry:ze},ze[0]))}),!!(!((L=he.tags)===null||L===void 0)&&L.length)&&(0,h.jsx)(Tr.Z,{dense:!0,subheader:(0,h.jsx)(Qr,{children:"Tags"}),children:he.tags.map((ze,st)=>(0,h.jsxs)(ir.Z,{children:[(0,h.jsx)(Jr.Z,{}),(0,h.jsx)(ar,{primary:ze})]},`${ze}-${st}`))})]}),!!Le.length&&(0,h.jsx)(Xr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ne).map(([ze,st],Et)=>(0,h.jsx)("div",{children:(0,h.jsx)(Tr.Z,{dense:!0,subheader:(0,h.jsx)(Qr,{children:ze}),children:st.map(Be=>(0,h.jsxs)(ir.Z,{children:[(0,h.jsx)(Jr.Z,{children:(0,h.jsx)(Yr,{entityRef:Be.targetRef})}),(0,h.jsx)(ar,{primary:(0,h.jsx)(jt,{entityRef:Be.targetRef})})]},Be.targetRef))})},Et))}),!!(!((P=Me.items)===null||P===void 0)&&P.length)&&(0,h.jsx)(Xr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Me.items.map((ze,st)=>(0,h.jsxs)("div",{children:[(0,h.jsxs)(A.Z,{children:[ze.level,": ",ze.type]}),(0,h.jsx)($.Z,{ml:2,children:ze.message})]},st))})]})]})}var _o=n(72847);function As(y){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xn.Z,{variant:"h2",children:"Entity as YAML"}),(0,h.jsx)(xn.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,h.jsx)(xn.Z,{children:(0,h.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,h.jsx)(T.Oi,{text:_o.ZP.stringify(mo(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const vo=(0,Jt.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function so(y){const{children:j,value:L,index:P,...ie}=y,re=vo();return(0,h.jsx)("div",{role:"tabpanel",hidden:L!==P,id:`vertical-tabpanel-${P}`,"aria-labelledby":`vertical-tab-${P}`,className:re.tabContents,...ie,children:L===P&&(0,h.jsx)($.Z,{pl:3,pr:3,children:j})})}function io(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function ao(y){const j=vo(),[L,P]=F.useState(0);return(0,F.useEffect)(()=>{P(0)},[y.open]),y.entity?(0,h.jsxs)(_e.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,h.jsx)(Gt.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,h.jsx)(yn.Z,{dividers:!0,children:(0,h.jsxs)("div",{className:j.root,children:[(0,h.jsxs)(qn.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(ie,re)=>P(re),"aria-label":"Inspector options",className:j.tabs,children:[(0,h.jsx)(yr.Z,{label:"Overview",...io(0)}),(0,h.jsx)(yr.Z,{label:"Ancestry",...io(1)}),(0,h.jsx)(yr.Z,{label:"Colocated",...io(2)}),(0,h.jsx)(yr.Z,{label:"Raw JSON",...io(3)}),(0,h.jsx)(yr.Z,{label:"Raw YAML",...io(4)})]}),(0,h.jsx)(so,{value:L,index:0,children:(0,h.jsx)(ci,{entity:y.entity})}),(0,h.jsx)(so,{value:L,index:1,children:(0,h.jsx)(Jo,{entity:y.entity})}),(0,h.jsx)(so,{value:L,index:2,children:(0,h.jsx)(qo,{entity:y.entity})}),(0,h.jsx)(so,{value:L,index:3,children:(0,h.jsx)(ko,{entity:y.entity})}),(0,h.jsx)(so,{value:L,index:4,children:(0,h.jsx)(As,{entity:y.entity})})]})}),(0,h.jsx)(Ar.Z,{children:(0,h.jsx)(z.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Rr=n(85256);function _n(y){var j;const L=(0,p.h_)(W),P=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.q1],ie=y.metadata.uid,re=P==="bootstrap:bootstrap",_=(0,et.default)(async()=>{const Et=L.getLocationByRef(P);let Be;if(!P)Be=Promise.resolve([]);else{const He=`metadata.annotations.${I.q1}`;Be=L.getEntities({filter:{[He]:P},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(At=>At.items)}return Promise.all([Et,Be]).then(([He,At])=>({location:He,colocatedEntities:At}))},[L,y]),he=(0,F.useCallback)(async function(){const{location:Be}=_.value;await L.removeLocationById(Be.id)},[L,_]),Te=(0,F.useCallback)(async function(){await L.removeEntityByUid(ie)},[L,ie]);if(re)return{type:"bootstrap",location:P,deleteEntity:Te};const{loading:Le,error:Me,value:Ne}=_;if(Le)return{type:"loading"};if(Me)return{type:"error",error:Me};const{location:ze,colocatedEntities:st}=Ne;return ze?{type:"unregister",location:P,colocatedEntities:st.map(I.iB),unregisterLocation:he,deleteEntity:Te}:{type:"only-delete",deleteEntity:Te}}var yo=n(23054);const es=(0,Jt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),Ts=({entity:y,onConfirm:j,onClose:L})=>{const P=(0,p.h_)(p.$v),ie=(0,p.h_)(p.Ds),re=es(),_=_n(y),[he,Te]=(0,F.useState)(!1),[Le,Me]=(0,F.useState)(!1);var Ne;const ze=(Ne=ie.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",st=(0,F.useCallback)(async function(){if("unregisterLocation"in _){Me(!0);try{await _.unregisterLocation(),j()}catch(At){(0,yo.BD)(At),P.post({message:At.message})}finally{Me(!1)}}},[P,j,_]),Et=(0,F.useCallback)(async function(){if("deleteEntity"in _){Me(!0);try{await _.deleteEntity(),j()}catch(At){(0,yo.BD)(At),P.post({message:At.message})}finally{Me(!1)}}},[P,j,_]),Be=()=>(0,h.jsx)(Ar.Z,{className:re.dialogActions,children:(0,h.jsx)(z.Z,{onClick:L,color:"primary",children:"Cancel"})});return _.type==="loading"?(0,h.jsx)(T.Ex,{}):_.type==="error"?(0,h.jsx)(T.Gk,{error:_.error}):_.type==="bootstrap"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(oo.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',_.location,'"). If you believe this is in error, please contact the ',ze," ","integrator."]}),(0,h.jsxs)($.Z,{marginTop:2,children:[!he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Te(!0),children:"Advanced Options"}),(0,h.jsx)(Be,{})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(Be,{})]})]})]}):_.type==="only-delete"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"}),(0,h.jsx)(Be,{})]}):_.type==="unregister"?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(xn.Z,{children:"This action will unregister the following entities:"}),(0,h.jsx)(xn.Z,{component:"ul",children:_.colocatedEntities.map(He=>(0,h.jsx)("li",{children:(0,h.jsx)(jt,{entityRef:He})},`${He.kind}:${He.namespace}/${He.name}`))}),(0,h.jsx)(xn.Z,{children:"Located at the following location:"}),(0,h.jsx)(xn.Z,{component:"ul",children:(0,h.jsx)("li",{children:_.location})}),(0,h.jsxs)(xn.Z,{children:["To undo, just re-register the entity in ",ze,"."]}),(0,h.jsxs)($.Z,{marginTop:2,children:[(0,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:st,children:"Unregister Location"}),!he&&(0,h.jsx)($.Z,{component:"span",marginLeft:2,children:(0,h.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:re.advancedButton,onClick:()=>Te(!0),children:"Advanced Options"})})]}),he&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)($.Z,{paddingTop:4,paddingBottom:4,children:(0,h.jsx)(Rr.Z,{})}),(0,h.jsx)(xn.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,h.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Le,onClick:Et,children:"Delete Entity"})]})]}):(0,h.jsx)(oo.Z,{severity:"error",children:"Internal error: Unknown state"})},lo=y=>{const{open:j,onConfirm:L,onClose:P,entity:ie}=y;return(0,h.jsxs)(_e.Z,{open:j,onClose:P,children:[(0,h.jsx)(Gt.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,h.jsx)(yn.Z,{children:(0,h.jsx)(Ts,{entity:ie,onConfirm:L,onClose:P})})]})};var ts=n(12231),Rs=n(9520),ns=n(47603);const rs=(0,Jt.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function xo(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:ns.Z},{id:"starred",label:"Starred",icon:J.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const $o=y=>{const{initialFilter:j,availableFilters:L}=y,P=rs(),ie=(0,p.h_)(p.Ds);var re;const _=(re=ie.getOptionalString("organization.name"))!==null&&re!==void 0?re:"Company",{filters:he,updateFilters:Te,backendEntities:Le,queryParameters:{kind:Me,user:Ne},loading:ze}=rt(),st=["starred","all"],Et=xo(_).map(zn=>({...zn,items:zn.items.filter(({id:Kn})=>["group","user"].some(Pr=>Pr===Me)?st.includes(Kn):!L||L.includes(Kn))})).filter(({items:zn})=>!!zn.length),{isStarredEntity:Be}=ln(),{isOwnedEntity:He,loading:At}=Sn(),rn=ze||At,jn=(0,F.useMemo)(()=>new Tt("owned",He,Be),[He,Be]),Ot=(0,F.useMemo)(()=>new Tt("starred",He,Be),[He,Be]),Rt=(0,F.useMemo)(()=>[Ne].flat()[0],[Ne]),[Kt,En]=(0,F.useState)(Rt!=null?Rt:j),cr=(0,F.useMemo)(()=>Le.filter((0,Z.Gz)((0,ut.compact)(Object.values({...he,user:void 0})))),[he,Le]),Ir=(0,F.useMemo)(()=>({all:cr.length,starred:cr.filter(zn=>Ot.filterEntity(zn)).length,owned:cr.filter(zn=>jn.filterEntity(zn)).length}),[cr,Ot,jn]);(0,F.useEffect)(()=>{Rt&&En(Rt)},[Rt]),(0,F.useEffect)(()=>{!rn&&Kt&&Kt!=="all"&&Ir[Kt]===0&&En("all")},[rn,Ir,Kt,En]),(0,F.useEffect)(()=>{Te({user:Kt?new Tt(Kt,He,Be):void 0})},[Kt,He,Be,Te]);var qr;return(0,h.jsx)(Ur.Z,{className:P.root,children:Et.map(zn=>(0,h.jsxs)(F.Fragment,{children:[(0,h.jsx)(A.Z,{variant:"subtitle2",component:"span",className:P.title,children:zn.name}),(0,h.jsx)(Ur.Z,{className:P.groupWrapper,children:(0,h.jsx)(Tr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":zn.name,children:zn.items.map(Kn=>{var Pr;return(0,h.jsxs)(ts.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>En(Kn.id),selected:Kn.id===((Pr=he.user)===null||Pr===void 0?void 0:Pr.value),className:P.menuItem,disabled:Ir[Kn.id]===0,"data-testid":`user-picker-${Kn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Kn.icon&&(0,h.jsx)(Jr.Z,{className:P.listIcon,children:(0,h.jsx)(Kn.icon,{fontSize:"small"})}),(0,h.jsx)(Ao.Z,{children:(0,h.jsxs)(A.Z,{variant:"body1",children:[Kn.label," "]})}),(0,h.jsx)(Rs.Z,{children:(qr=Ir[Kn.id])!==null&&qr!==void 0?qr:"-"})]},Kn.id)})})})]},zn.name))})},bo=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Is=(0,h.jsx)(Tn.Z,{fontSize:"small"}),di=(0,h.jsx)(Bn.Z,{fontSize:"small"}),os=()=>{const y=bo(),{updateFilters:j}=rt(),[L,P]=(0,F.useState)([]);function ie(he){j({orphan:he?new Ft(he):void 0})}function re(he){j({error:he?new Yt(he):void 0})}const _=["Is Orphan","Has Error"];return(0,h.jsx)($.Z,{pb:1,pt:1,children:(0,h.jsxs)(A.Z,{variant:"button",component:"label",children:["Processing Status",(0,h.jsx)(Ye.ZP,{multiple:!0,disableCloseOnSelect:!0,options:_,value:L,onChange:(he,Te)=>{P(Te),ie(Te.includes("Is Orphan")),re(Te.includes("Has Error"))},renderOption:(he,{selected:Te})=>(0,h.jsx)(sn.Z,{control:(0,h.jsx)(An.Z,{icon:Is,checkedIcon:di,checked:Te}),onClick:Le=>Le.preventDefault(),label:he}),size:"small",popupIcon:(0,h.jsx)(Vt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:he=>(0,h.jsx)(we.Z,{...he,className:y.input,variant:"outlined"})})]})})},ss=(0,Jt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),cn=()=>{const y=ss();return(0,h.jsx)(ae,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:zt,InputProps:{className:y.input}})};function Ps(y){var j;const{children:L,value:P}=y;var ie;const[re,_]=useState((ie=(j=P)===null||j===void 0?void 0:j.filters)!==null&&ie!==void 0?ie:{}),he=useCallback(Be=>{_(He=>{const At=typeof Be=="function"?Be(He):Be;return{...He,...At}})},[]),Te=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Le,Me,Ne,ze,st;const Et=useMemo(()=>{var Be,He,At,rn,jn,Ot;return{entities:(Le=(Be=P)===null||Be===void 0?void 0:Be.entities)!==null&&Le!==void 0?Le:Te.entities,backendEntities:(Me=(He=P)===null||He===void 0?void 0:He.backendEntities)!==null&&Me!==void 0?Me:Te.backendEntities,updateFilters:(Ne=(At=P)===null||At===void 0?void 0:At.updateFilters)!==null&&Ne!==void 0?Ne:he,filters:re,loading:(ze=(rn=P)===null||rn===void 0?void 0:rn.loading)!==null&&ze!==void 0?ze:!1,queryParameters:(st=(jn=P)===null||jn===void 0?void 0:jn.queryParameters)!==null&&st!==void 0?st:Te.queryParameters,error:(Ot=P)===null||Ot===void 0?void 0:Ot.error}},[P,Te,re,he]);return _jsx(EntityListContext.Provider,{value:Et,children:L})}},75435:function(It,Pe,n){"use strict";n.d(Pe,{h:function(){return p}});var r=n(25271);function p(W,f,V){var m,h,F;let ve=((h=W)===null||h===void 0||(m=h.relations)===null||m===void 0?void 0:m.filter(ce=>ce.type===f).map(ce=>(0,r.of)(ce.targetRef)))||[];return!((F=V)===null||F===void 0)&&F.kind&&(ve=ve.filter(ce=>ce.kind.toLocaleLowerCase("en-US")===V.kind.toLocaleLowerCase("en-US"))),ve}},49280:function(It,Pe,n){"use strict";n.d(Pe,{hF:function(){return W.h},CV:function(){return V},wq:function(){return r},Gz:function(){return p}});function r(h){return h.reduce((F,ve)=>({...F,...ve.getCatalogFilters?ve.getCatalogFilters():{}}),{})}function p(h){return F=>h.every(ve=>!ve.filterEntity||ve.filterEntity(F))}var W=n(75435),f=n(25271);function V(h,F){var ve;const ce=(ve=h.metadata.annotations)===null||ve===void 0?void 0:ve[f.M6];if(ce)try{var z;const de=(0,f.Ou)(ce),$=F.byUrl(de.target);return{locationTargetUrl:de.target,integrationType:(z=$)===null||z===void 0?void 0:z.type}}catch{return}}function m(h,F){const ve=new Set([...getEntityRelations(h,RELATION_MEMBER_OF,{kind:"group"}),...h?[getCompoundEntityRef(h)]:[]].map(stringifyEntityRef)),ce=getEntityRelations(F,RELATION_OWNED_BY).map(stringifyEntityRef);for(const z of ce)if(ve.has(z))return!0;return!1}},8799:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{AboutCard:function(){return Yt},AboutContent:function(){return Tt},AboutField:function(){return Ge}});var r=n(52322),p=n(25271),W=n(53974),f=n(60871),V=n(32838),m=n(39709),h=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const F=(0,p.wI)(h),ve={async check(dt){return F(dt)===dt}},ce=dt=>dt.apiVersion==="scaffolder.backstage.io/v1beta3"&&dt.kind==="Template";var z=n(79692),de=n(94339),$=n(32552),A=n(61837),oe=n(85256),se=n(24579),ee=n(88188),X=n(52866),K=n(30254),T=n(27604),w=n(2784),I=n(19625),Z=n(60905),xe=n(7089),Se=n(90436);const B=(0,z.Z)(dt=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:dt.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Ge(dt){const{label:ut,value:St,gridSizes:lt,children:Ut}=dt,Ht=B(),Ce=(0,f.vJ)(Ut,Ke=>Ke.getElements()),$e=Ce.length>0?Ce:(0,r.jsx)(Se.Z,{variant:"body2",className:Ht.value,children:St||"unknown"});return(0,r.jsxs)(Z.Z,{item:!0,...lt,children:[(0,r.jsx)(Se.Z,{variant:"h2",className:Ht.label,children:ut}),$e]})}var xt=n(24851);const Nt=(0,z.Z)({description:{wordBreak:"break-word"}});function zt(dt,ut,St){if(ut==="url"||dt.includes("://"))return dt;const lt=St.type==="file"?`file://${St.target}`:St.target;return ut==="file"||St.type==="file"?new URL(dt,lt).href:lt}function Tt(dt){var ut,St,lt,Ut,Ht,Ce,$e,Ke,ht,rt,et,vt,ot,Je,ft,gt;const{entity:Ct}=dt,gn=Nt(),un=Ct.kind.toLocaleLowerCase("en-US")==="system",ln=Ct.kind.toLocaleLowerCase("en-US")==="resource",bn=Ct.kind.toLocaleLowerCase("en-US")==="component",hn=Ct.kind.toLocaleLowerCase("en-US")==="api",mn=Ct.kind.toLocaleLowerCase("en-US")==="template",Sn=Ct.kind.toLocaleLowerCase("en-US")==="location",on=Ct.kind.toLocaleLowerCase("en-US")==="group",pn=(0,m.hF)(Ct,p.cz,{kind:"system"}),Cn=(0,m.hF)(Ct,p.cz,{kind:"component"}),Xe=(0,m.hF)(Ct,p.cz,{kind:"domain"}),Jt=(0,m.hF)(Ct,p.S4);let Vt;try{Vt=(0,p.CV)(Ct)}catch{Vt=void 0}return(0,r.jsxs)(Z.Z,{container:!0,children:[(0,r.jsx)(Ge,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(W.SA,{className:gn.description,content:((St=Ct)===null||St===void 0||(ut=St.metadata)===null||ut===void 0?void 0:ut.description)||"No description"})}),(0,r.jsx)(Ge,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,r.jsx)(m.rI,{entityRefs:Jt,defaultKind:"group"})}),(un||Xe.length>0)&&(0,r.jsx)(Ge,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Xe.length>0&&(0,r.jsx)(m.rI,{entityRefs:Xe,defaultKind:"domain"})}),(hn||bn||ln||pn.length>0)&&(0,r.jsx)(Ge,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:pn.length>0&&(0,r.jsx)(m.rI,{entityRefs:pn,defaultKind:"system"})}),bn&&Cn.length>0&&(0,r.jsx)(Ge,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(m.rI,{entityRefs:Cn,defaultKind:"component"})}),(hn||bn||ln||mn||on||Sn||typeof((Ut=Ct)===null||Ut===void 0||(lt=Ut.spec)===null||lt===void 0?void 0:lt.type)=="string")&&(0,r.jsx)(Ge,{label:"Type",value:(Ce=Ct)===null||Ce===void 0||(Ht=Ce.spec)===null||Ht===void 0?void 0:Ht.type,gridSizes:{xs:12,sm:6,lg:4}}),(hn||bn||typeof((Ke=Ct)===null||Ke===void 0||($e=Ke.spec)===null||$e===void 0?void 0:$e.lifecycle)=="string")&&(0,r.jsx)(Ge,{label:"Lifecycle",value:(rt=Ct)===null||rt===void 0||(ht=rt.spec)===null||ht===void 0?void 0:ht.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(Ge,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:(((vt=Ct)===null||vt===void 0||(et=vt.metadata)===null||et===void 0?void 0:et.tags)||[]).map(Ye=>(0,r.jsx)(xe.Z,{size:"small",label:Ye},Ye))}),Sn&&(((Je=Ct)===null||Je===void 0||(ot=Je.spec)===null||ot===void 0?void 0:ot.targets)||((gt=Ct)===null||gt===void 0||(ft=gt.spec)===null||ft===void 0?void 0:ft.target))&&(0,r.jsx)(Ge,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(xt.s,{cols:1,items:(Ct.spec.targets||[Ct.spec.target]).map(Ye=>Ye).map(Ye=>{var An,sn;return{text:Ye,href:zt(Ye,((sn=Ct)===null||sn===void 0||(An=sn.spec)===null||An===void 0?void 0:An.type)||"unknown",Vt)}})})})]})}const Ft=(0,z.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 Yt(dt){var ut,St,lt,Ut,Ht,Ce,$e;const{variant:Ke}=dt,ht=(0,f.qD)(),rt=Ft(),{entity:et}=(0,m.X2)(),vt=(0,f.h_)(V.q3),ot=(0,f.h_)(m.Ah),Je=(0,f.h_)(f.$v),ft=(0,f.h_)(f.VE),gt=(0,f.tg)(I.jU),Ct=(0,f.tg)(I.ql),gn=(0,m.CV)(et,vt),un=(ut=et.metadata.annotations)===null||ut===void 0?void 0:ut[p.Tf],ln={label:"View Source",disabled:!gn,icon:(0,r.jsx)(V.nW,{type:(St=gn)===null||St===void 0?void 0:St.integrationType}),href:(lt=gn)===null||lt===void 0?void 0:lt.locationTargetUrl},bn={label:"View TechDocs",disabled:!(!((Ut=et.metadata.annotations)===null||Ut===void 0)&&Ut["backstage.io/techdocs-ref"])||!gt,icon:(0,r.jsx)(K.Z,{}),href:gt&&gt({namespace:et.metadata.namespace||p.zG,kind:et.kind,name:et.metadata.name})},hn=[ln,bn];if(ce(et)){var mn;const Jt=(mn=ht.getSystemIcon("scaffolder"))!==null&&mn!==void 0?mn:ee.Z,Vt={label:"Launch Template",icon:(0,r.jsx)(Jt,{}),disabled:!Ct,href:Ct&&Ct({templateName:et.metadata.name,namespace:et.metadata.namespace||p.zG})};hn.push(Vt)}let Sn="";Ke==="gridItem"?Sn=rt.gridItemCard:Ke==="fullHeight"&&(Sn=rt.fullHeightCard);let on="";Ke==="gridItem"?on=rt.gridItemCardContent:Ke==="fullHeight"&&(on=rt.fullHeightCardContent);const pn=(Ht=et.metadata.annotations)===null||Ht===void 0?void 0:Ht[p.P1],Cn=((Ce=pn)===null||Ce===void 0?void 0:Ce.startsWith("url:"))||(($e=pn)===null||$e===void 0?void 0:$e.startsWith("file:")),Xe=(0,w.useCallback)(async()=>{try{await ot.refreshEntity((0,p.eE)(et)),Je.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(Jt){ft.post(Jt)}},[ot,Je,ft,et]);return(0,r.jsxs)(de.Z,{className:Sn,children:[(0,r.jsx)($.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[Cn&&(0,r.jsx)(A.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Xe,children:(0,r.jsx)(X.Z,{})}),(0,r.jsx)(A.Z,{component:W.rU,"aria-label":"Edit",disabled:!un,title:"Edit Metadata",to:un!=null?un:"#",children:(0,r.jsx)(T.Z,{})})]}),subheader:(0,r.jsx)(W.M6,{links:hn})}),(0,r.jsx)(oe.Z,{}),(0,r.jsx)(se.Z,{className:on,children:(0,r.jsx)(Tt,{entity:et})})]})}},86359:function(It,Pe,n){"use strict";n.d(Pe,{E:function(){return K}});var r=n(52322),p=n(25271),W=n(53974),f=n(39709),V=n(90436),m=n(15459),h=n(27604),F=n(2997),ve=n(11640),ce=n(28347),z=n(76635),de=n(2784),$=n(7089);const A=Object.freeze({createNameColumn(T){function w(I){var Z,xe;return((Z=I.metadata)===null||Z===void 0?void 0:Z.title)||(0,f.$3)(I,{defaultKind:(xe=T)===null||xe===void 0?void 0:xe.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:I},{entity:Z}){return w(I).localeCompare(w(Z))},render:({entity:I})=>{var Z,xe;return(0,r.jsx)(f.dx,{entityRef:I,defaultKind:((Z=T)===null||Z===void 0?void 0:Z.defaultKind)||"Component",title:(xe=I.metadata)===null||xe===void 0?void 0:xe.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,r.jsx)(f.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,r.jsx)(f.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var w,I,Z,xe;return(0,r.jsx)(r.Fragment,{children:(((I=T)===null||I===void 0||(w=I.spec)===null||w===void 0?void 0:w.targets)||((xe=T)===null||xe===void 0||(Z=xe.spec)===null||Z===void 0?void 0:Z.target))&&(0,r.jsx)(W.Or,{text:(T.spec.targets||[T.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:T})=>(0,r.jsx)(W.Or,{text:T.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:T})=>(0,r.jsx)(r.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(w=>(0,r.jsx)($.Z,{label:w,size:"small",variant:"outlined",style:{marginBottom:"0px"}},w))}),width:"auto"}},createTitleColumn(T){var w;return{title:"Title",field:"entity.metadata.title",hidden:(w=T)===null||w===void 0?void 0:w.hidden,searchable:!0}},createLabelColumn(T,w){var I;return{title:((I=w)===null||I===void 0?void 0:I.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:Z})=>{var xe,Se;const B=(xe=Z.metadata)===null||xe===void 0?void 0:xe.labels,Ge=B&&B[T]||((Se=w)===null||Se===void 0?void 0:Se.defaultValue);return(0,r.jsx)(r.Fragment,{children:Ge&&(0,r.jsx)($.Z,{label:Ge,size:"small",variant:"outlined"},Ge)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var oe=n(19928),se=n.n(oe);const ee=(0,m.Z)({root:{color:"#f3ba37"}})(ve.Z),X=(T,w)=>{const I=Z=>Z.metadata.title||(0,f.$3)(Z,{defaultKind:"Component"});return I(T).localeCompare(I(w))},K=T=>{var w,I,Z,xe;const{columns:Se,actions:B,tableOptions:Ge,subtitle:xt,emptyContent:Nt}=T,{isStarredEntity:zt,toggleStarredEntity:Tt}=(0,f.CR)(),{loading:Ft,error:Yt,entities:dt,filters:ut}=(0,f.wp)(),St=(0,de.useMemo)(()=>{var ot;return[A.createTitleColumn({hidden:!0}),A.createNameColumn({defaultKind:(ot=ut.kind)===null||ot===void 0?void 0:ot.value}),...Je(),A.createMetadataDescriptionColumn(),A.createTagsColumn()];function Je(){var ft;const gt=[A.createSystemColumn(),A.createOwnerColumn(),A.createSpecTypeColumn(),A.createSpecLifecycleColumn()];switch((ft=ut.kind)===null||ft===void 0?void 0:ft.value){case"user":return[];case"domain":case"system":return[A.createOwnerColumn()];case"group":case"template":return[A.createSpecTypeColumn()];case"location":return[A.createSpecTypeColumn(),A.createSpecTargetsColumn()];default:return dt.every(Ct=>Ct.metadata.namespace==="default")?gt:[...gt,A.createNamespaceColumn()]}}},[(w=ut.kind)===null||w===void 0?void 0:w.value,dt]),lt=ut.type===void 0;var Ut;const Ht=(0,z.capitalize)((Ut=(I=ut.user)===null||I===void 0?void 0:I.value)!==null&&Ut!==void 0?Ut:"all");if(Yt)return(0,r.jsx)("div",{children:(0,r.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(W.Oi,{language:"text",text:Yt.toString()})})});const Ce=[({entity:ot})=>{var Je;const ft=(Je=ot.metadata.annotations)===null||Je===void 0?void 0:Je[p.l2],gt="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:gt}),(0,r.jsx)(F.Z,{fontSize:"small"})]}),tooltip:gt,disabled:!ft,onClick:()=>{ft&&window.open(ft,"_blank")}}},({entity:ot})=>{var Je;const ft=(Je=ot.metadata.annotations)===null||Je===void 0?void 0:Je[p.Tf],gt="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:gt}),(0,r.jsx)(h.Z,{fontSize:"small"})]}),tooltip:gt,disabled:!ft,onClick:()=>{ft&&window.open(ft,"_blank")}}},({entity:ot})=>{const Je=zt(ot),ft=Je?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:ft}),Je?(0,r.jsx)(ee,{}):(0,r.jsx)(ce.Z,{})]}),tooltip:ft,onClick:()=>Tt(ot)}}],$e=dt.sort(X).map(ot=>{const Je=(0,f.hF)(ot,p.cz,{kind:"system"}),ft=(0,f.hF)(ot,p.S4);return{entity:ot,resolved:{name:(0,f.$3)(ot,{defaultKind:"Component"}),ownedByRelationsTitle:ft.map(gt=>(0,f.$3)(gt,{defaultKind:"group"})).join(", "),ownedByRelations:ft,partOfSystemRelationTitle:Je.map(gt=>(0,f.$3)(gt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Je}}}),Ke=(Se||St).find(ot=>ot.title==="Type");Ke&&(Ke.hidden=!lt);const ht=$e.length>20,rt=((Z=ut.kind)===null||Z===void 0?void 0:Z.value)||"",et=((xe=ut.type)===null||xe===void 0?void 0:xe.value)||"",vt=[Ht,et,se()(rt)].filter(ot=>ot).join(" ");return(0,r.jsx)(W.iA,{isLoading:Ft,columns:Se||St,options:{paging:ht,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Ft,padding:"dense",pageSizeOptions:[20,50,100],...Ge},title:`${vt} (${dt.length})`,data:$e,actions:B||Ce,subtitle:xt,emptyContent:Nt})};K.columns=A},85877:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{EntityLabelsCard:function(){return de},hasLabels:function(){return $}});var r=n(52322),p=n(39709),W=n(2784),f=n(53974),V=n(79692),m=n(90436),h=n(77277);const F=`metadata:
34
- name: example
35
- labels:
36
- javaVersion: 1.2.3`,ve=(0,V.Z)(A=>({code:{borderRadius:6,margin:`${A.spacing(2)}px 0px`,background:A.palette.type==="dark"?"#444":A.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ce(){const A=ve();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,r.jsx)("div",{className:A.code,children:(0,r.jsx)(f.Oi,{text:F,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(h.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const z=(0,V.Z)(A=>({key:{fontWeight:"bold"}})),de=A=>{var oe,se;const{variant:ee,title:X}=A,{entity:K}=(0,p.X2)(),T=z(),w=[{render:Z=>(0,r.jsx)(m.Z,{className:T.key,variant:"body2",children:Z.key})},{field:"value"}],I=(se=K)===null||se===void 0||(oe=se.metadata)===null||oe===void 0?void 0:oe.labels;return(0,r.jsx)(f.rJ,{title:X||"Labels",variant:ee,children:!I||Object.keys(I).length===0?(0,r.jsx)(ce,{}):(0,r.jsx)(f.iA,{columns:w,data:Object.keys(I).map(Z=>({key:Z,value:I[Z]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(I).length>5}})})};function $(A){var oe,se,ee,X;return!((se=A)===null||se===void 0||(oe=se.metadata)===null||oe===void 0)&&oe.labels?Object.keys((X=A)===null||X===void 0||(ee=X.metadata)===null||ee===void 0?void 0:ee.labels).some(Boolean):!1}},24851:function(It,Pe,n){"use strict";n.d(Pe,{s:function(){return oe}});var r=n(52322),p=n(90348),W=n(11861),f=n(2784),V=n(79692),m=n(95544),h=n(90436),F=n(52160),ve=n(53974);const ce=(0,V.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function z(se){const{href:ee,text:X,Icon:K}=se,T=ce();return(0,r.jsxs)(m.Z,{display:"flex",children:[(0,r.jsx)(m.Z,{mr:1,className:T.svgIcon,children:(0,r.jsx)(h.Z,{component:"div",children:K?(0,r.jsx)(K,{}):(0,r.jsx)(F.Z,{})})}),(0,r.jsx)(m.Z,{flexGrow:"1",children:(0,r.jsx)(ve.rU,{to:ee,target:"_blank",rel:"noopener",children:X||ee})})]})}var de=n(41156);const $={xs:1,sm:1,md:1,lg:2,xl:3};function A(se){const ee=[(0,de.Z)(I=>I.breakpoints.up("xl"))?"xl":null,(0,de.Z)(I=>I.breakpoints.up("lg"))?"lg":null,(0,de.Z)(I=>I.breakpoints.up("md"))?"md":null,(0,de.Z)(I=>I.breakpoints.up("sm"))?"sm":null,(0,de.Z)(I=>I.breakpoints.up("xs"))?"xs":null];let X=1;if(typeof se=="number")X=se;else{var K,T;const I=(T=ee.find(Z=>Z!==null))!==null&&T!==void 0?T:"xs";var w;X=(w=(K=se)===null||K===void 0?void 0:K[I])!==null&&w!==void 0?w:$[I]}return X}function oe(se){const{items:ee,cols:X=void 0}=se,K=A(X);return(0,r.jsx)(p.Z,{rowHeight:"auto",cols:K,children:ee.map(({text:T,href:w,Icon:I},Z)=>(0,r.jsx)(W.Z,{children:(0,r.jsx)(z,{href:w,text:T!=null?T:w,Icon:I})},Z))})}},19625:function(It,Pe,n){"use strict";n.d(Pe,{_Z:function(){return V},jU:function(){return W},ql:function(){return f},yw:function(){return p}});var r=n(60871);const p=(0,r.x8)({id:"create-component",optional:!0}),W=(0,r.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,r.x8)({id:"create-from-template",optional:!0,params:["namespace","templateName"]}),V=(0,r.NT)({id:"catalog"})},15096:function(It,Pe,n){"use strict";n.d(Pe,{FA:function(){return ve},qO:function(){return St},Nd:function(){return B},E5:function(){return Qt},Rx:function(){return w}});var r=n(60871);const p=(0,r.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(te){_define_property(this,"mockedResults",void 0),this.mockedResults=te}}var f=n(52322),V=n(2784),m=n(38402),h=n(79692);const F=(0,h.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ve=ne=>{const{text:te,preTag:Y,postTag:v}=ne,O=F(),M=(0,V.useMemo)(()=>te.split(new RegExp(`(${Y}.+?${v})`)),[v,Y,te]);return(0,f.jsx)(f.Fragment,{children:M.map((G,ue)=>G.includes(Y)?(0,f.jsx)("mark",{className:O.highlight,children:G.replace(new RegExp(`${Y}|${v}`,"g"),"")},ue):G)})};var ce=n(50581),z=n(61837),de=n(86619),$=n(77277),A=n(21853),oe=n(48760),se=n(76635),ee=n(64279),X=n(1849),K=n(51837);const T=(0,K.CT)("search-context"),w=()=>{const ne=(0,V.useContext)(T);if(!ne)throw new Error("useSearch must be used within a SearchContextProvider");const te=ne.atVersion(1);if(!te)throw new Error("No SearchContext v1 found");return te},I=()=>(0,V.useContext)(T)!==void 0,Z={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},xe=(ne=Z)=>{var te,Y,v,O;const M=(0,r.h_)(p),[G,ue]=(0,V.useState)(ne.term),[be,ke]=(0,V.useState)(ne.types),[Qe,tt]=(0,V.useState)(ne.filters),[yt,bt]=(0,V.useState)(ne.pageLimit),[ct,Oe]=(0,V.useState)(ne.pageCursor),wt=(0,X.Z)(G),qt=(0,X.Z)(Qe),jt=(0,ee.default)(()=>M.query({term:G,types:be,filters:Qe,pageLimit:yt,pageCursor:ct}),[G,be,Qe,yt,ct]),Zt=!jt.loading&&!jt.error&&((te=jt.value)===null||te===void 0?void 0:te.nextPageCursor),_t=!jt.loading&&!jt.error&&((Y=jt.value)===null||Y===void 0?void 0:Y.previousPageCursor),wn=(0,V.useCallback)(()=>{var Lt;Oe((Lt=jt.value)===null||Lt===void 0?void 0:Lt.nextPageCursor)},[(v=jt.value)===null||v===void 0?void 0:v.nextPageCursor]),Bt=(0,V.useCallback)(()=>{var Lt;Oe((Lt=jt.value)===null||Lt===void 0?void 0:Lt.previousPageCursor)},[(O=jt.value)===null||O===void 0?void 0:O.previousPageCursor]);return(0,V.useEffect)(()=>{wt!==void 0&&G!==wt&&Oe(void 0)},[G,wt,Oe]),(0,V.useEffect)(()=>{qt!==void 0&&!(0,se.isEqual)(Qe,qt)&&Oe(void 0)},[Qe,qt,Oe]),{result:jt,term:G,setTerm:ue,types:be,setTypes:ke,filters:Qe,setFilters:tt,pageLimit:yt,setPageLimit:bt,pageCursor:ct,setPageCursor:Oe,fetchNextPage:Zt?wn:void 0,fetchPreviousPage:_t?Bt:void 0}},Se=ne=>{const{initialState:te,children:Y}=ne,v=xe(te);return(0,f.jsx)(r.fC,{attributes:{searchTypes:v.types.sort().join(",")},children:(0,f.jsx)(T.Provider,{value:(0,K.EI)({1:v}),children:Y})})},B=ne=>{const{initialState:te,inheritParentContextIfAvailable:Y,children:v}=ne;return I()&&Y?(0,f.jsx)(f.Fragment,{children:v}):(0,f.jsx)(Se,{initialState:te,children:v})},Ge=({children:ne})=>{var te;const Y=Qe=>(0,X.Z)(Qe)!==Qe,v=(0,r.z$)(),{term:O,result:M}=w();var G;const ue=(G=(te=M.value)===null||te===void 0?void 0:te.numberOfResults)!==null&&G!==void 0?G:void 0,ke=Y(M.loading)&&!M.loading;return(0,V.useEffect)(()=>{O&&ke&&v.captureEvent("search",O,{value:ue})},[v,O,ue,ke]),(0,f.jsx)(f.Fragment,{children:ne})};function xt(ne){return(0,V.forwardRef)((te,Y)=>(0,f.jsx)(B,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(ne,{...te,ref:Y})}))}const Nt=xt((0,V.forwardRef)((ne,te)=>{const{onChange:Y,onKeyDown:v=()=>{},onClear:O=()=>{},onSubmit:M=()=>{},debounceTime:G=200,clearButton:ue=!0,fullWidth:be=!0,value:ke,label:Qe,placeholder:tt,inputProps:yt={},InputProps:bt={},endAdornment:ct,...Oe}=ne,wt=(0,r.h_)(r.Ds),[qt,jt]=(0,V.useState)("");(0,V.useEffect)(()=>{jt(en=>en!==ke?String(ke):en)},[ke]),(0,oe.Z)(()=>Y(qt),G,[qt]);const Zt=(0,V.useCallback)(en=>{jt(en.target.value)},[jt]),_t=(0,V.useCallback)(en=>{v&&v(en),M&&en.key==="Enter"&&M()},[v,M]),wn=(0,V.useCallback)(()=>{Y(""),O&&O()},[Y,O]),Bt=Qe?void 0:"Search",mt=tt!=null?tt:`Search in ${wt.getOptionalString("app.title")||"Backstage"}`,Lt=(0,f.jsx)(ce.Z,{position:"start",children:(0,f.jsx)(z.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(A.Z,{})})}),Wt=(0,f.jsx)(ce.Z,{position:"end",children:(0,f.jsx)($.Z,{"aria-label":"Clear",size:"small",onClick:wn,onKeyDown:en=>{en.key==="Enter"&&en.stopPropagation()},children:"Clear"})});return(0,f.jsx)(Ge,{children:(0,f.jsx)(de.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:te,value:qt,label:Qe,placeholder:mt,InputProps:{startAdornment:Lt,endAdornment:ue?Wt:ct,...bt},inputProps:{"aria-label":Bt,...yt},fullWidth:be,onChange:Zt,onKeyDown:_t,...Oe})})})),zt=xt((0,V.forwardRef)((ne,te)=>{const{value:Y="",onChange:v,...O}=ne,{term:M,setTerm:G}=w();(0,V.useEffect)(()=>{Y&&G(String(Y))},[Y,G]);const ue=(0,V.useCallback)(be=>{v?v(be):G(be)},[v,G]);return(0,f.jsx)(r.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Nt,{...O,ref:te,value:M,onChange:ue})})}));var Tt=n(4614),Ft=n(88013);const Yt=(0,h.Z)(ne=>({loading:{right:ne.spacing(1),position:"absolute"}})),dt=ne=>te=>(0,f.jsx)(B,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(ne,{...te})}),ut=()=>{const ne=Yt();return(0,f.jsx)(Tt.Z,{className:ne.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},St=dt(function(te){const{loading:Y,value:v,onChange:O=()=>{},options:M=[],getOptionLabel:G=Zt=>String(Zt),inputPlaceholder:ue,inputDebounceTime:be,freeSolo:ke=!0,fullWidth:Qe=!0,clearOnBlur:tt=!1,"data-testid":yt="search-autocomplete",...bt}=te,{setTerm:ct}=w(),Oe=(0,V.useCallback)(Zt=>Zt?typeof Zt=="string"?Zt:G(Zt):"",[G]),wt=(0,V.useMemo)(()=>Oe(v),[v,Oe]),qt=(0,V.useCallback)((Zt,_t,wn,Bt)=>{ct(Oe(_t)),O(Zt,_t,wn,Bt)},[Oe,ct,O]),jt=(0,V.useCallback)(({InputProps:{ref:Zt,className:_t,endAdornment:wn},InputLabelProps:Bt,...mt})=>(0,f.jsx)(zt,{...mt,ref:Zt,clearButton:!1,value:wt,placeholder:ue,debounceTime:be,endAdornment:Y?(0,f.jsx)(ut,{}):wn,InputProps:{className:_t}}),[Y,wt,ue,be]);return(0,f.jsx)(Ft.ZP,{...bt,"data-testid":yt,value:v,onChange:qt,options:M,getOptionLabel:G,renderInput:jt,freeSolo:ke,fullWidth:Qe,clearOnBlur:tt})}),lt=ne=>{const{icon:te,primaryText:Y,primaryTextTypographyProps:v,secondaryText:O,secondaryTextTypographyProps:M,disableTextTypography:G}=ne;return _jsxs(_Fragment,{children:[te?_jsx(ListItemIcon,{children:te}):null,_jsx(ListItemText,{primary:Y,primaryTypographyProps:v,secondary:O,secondaryTypographyProps:M,disableTypography:G})]})};var Ut=n(42494),Ht=n(84899),Ce=n(5806),$e=n(21324),Ke=n(56939),ht=n(73698),rt=n(12231),et=n(90436),vt=n(7089),ot=n(69294);const Je=(ne,te,Y=[],v=250)=>{const O=(0,V.useRef)({}),M=ne||(()=>Promise.resolve([])),[G,ue]=(0,ot.default)(M,[te],{loading:!0});if((0,oe.Z)(()=>{O.current[te]===void 0&&(O.current[te]=ue(te).then(ke=>(O.current[te]=ke,ke)))},v,[ue,te]),Y.length)return{loading:!1,value:Y};const be=O.current[te];return Array.isArray(be)?{loading:!1,value:be}:G},ft=(ne,te)=>{const{setFilters:Y}=w();(0,V.useEffect)(()=>{te&&[te].flat().length>0&&Y(v=>({...v,[ne]:te}))},[])},gt=ne=>{const{className:te,defaultValue:Y,name:v,values:O,valuesDebounceMs:M,label:G,filterSelectedOptions:ue,limitTags:be,multiple:ke}=ne,[Qe,tt]=(0,V.useState)("");ft(v,Y);const yt=typeof O=="function"?O:void 0,bt=typeof O=="function"?void 0:O,{value:ct,loading:Oe}=Je(yt,Qe,bt,M),{filters:wt,setFilters:qt}=w(),jt=wt[v]||(ke?[]:null),Zt=(Bt,mt)=>{qt(Lt=>{const{[v]:Wt,...en}=Lt;return mt?{...en,[v]:mt}:{...en}})},_t=Bt=>(0,f.jsx)(de.Z,{...Bt,name:"search",variant:"outlined",label:G,fullWidth:!0}),wn=(Bt,mt)=>Bt.map((Lt,Wt)=>(0,f.jsx)(vt.Z,{label:Lt,color:"primary",...mt({index:Wt})}));return(0,f.jsx)(Ft.ZP,{filterSelectedOptions:ue,limitTags:be,multiple:ke,className:te,id:`${ke?"multi-":""}select-filter-${v}--select`,options:ct||[],loading:Oe,value:jt,onChange:Zt,onInputChange:(Bt,mt)=>tt(mt),renderInput:_t,renderTags:wn})},Ct=(0,h.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),gn=ne=>{const{className:te,defaultValue:Y,label:v,name:O,values:M=[],valuesDebounceMs:G}=ne,ue=Ct(),{filters:be,setFilters:ke}=w();ft(O,Y);const Qe=typeof M=="function"?M:void 0,tt=typeof M=="function"?void 0:M,{value:yt=[],loading:bt}=Je(Qe,"",tt,G),ct=wt=>{const{target:{value:qt,checked:jt}}=wt;ke(Zt=>{const{[O]:_t,...wn}=Zt,Bt=(_t||[]).filter(Lt=>Lt!==qt),mt=jt?[...Bt,qt]:Bt;return mt.length?{...wn,[O]:mt}:wn})};var Oe;return(0,f.jsxs)(Ut.Z,{className:te,disabled:bt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[v?(0,f.jsx)(Ht.Z,{className:ue.label,children:v}):null,yt.map(wt=>(0,f.jsx)(Ce.Z,{classes:{root:ue.checkboxWrapper,label:ue.textWrapper},label:wt,control:(0,f.jsx)($e.Z,{color:"primary",inputProps:{"aria-labelledby":wt},value:wt,name:wt,onChange:ct,checked:((Oe=be[O])!==null&&Oe!==void 0?Oe:[]).includes(wt)})},wt))]})},un=ne=>{const{className:te,defaultValue:Y,label:v,name:O,values:M,valuesDebounceMs:G}=ne,ue=Ct();ft(O,Y);const be=typeof M=="function"?M:void 0,ke=typeof M=="function"?void 0:M,{value:Qe=[],loading:tt}=Je(be,"",ke,G),{filters:yt,setFilters:bt}=w(),ct=Oe=>{const{target:{value:wt}}=Oe;bt(qt=>{const{[O]:jt,...Zt}=qt;return wt?{...Zt,[O]:wt}:Zt})};return(0,f.jsxs)(Ut.Z,{disabled:tt,className:te,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[v?(0,f.jsx)(Ke.Z,{className:ue.label,margin:"dense",children:v}):null,(0,f.jsxs)(ht.Z,{variant:"outlined",value:yt[O]||"",onChange:ct,children:[(0,f.jsx)(rt.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Qe.map(Oe=>(0,f.jsx)(rt.Z,{value:Oe,children:(0,f.jsx)(et.Z,{variant:"inherit",noWrap:!0,children:Oe})},Oe))]})]})},ln=ne=>{const{component:te,...Y}=ne;return(0,f.jsx)(te,{...Y})};ln.Checkbox=ne=>(0,f.jsx)(ln,{...ne,component:gn}),ln.Select=ne=>(0,f.jsx)(ln,{...ne,component:un}),ln.Autocomplete=ne=>(0,f.jsx)(ln,{...ne,component:gt});var bn=n(48834).lW;const hn=ne=>bn.from(ne.toString(),"utf-8").toString("base64"),mn=ne=>ne?Number(bn.from(ne,"base64").toString("utf-8")):0,Sn=ne=>{const{total:te=-1,cursor:Y,hasNextPage:v,onCursorChange:O,limit:M=25,limitLabel:G="Results per page:",limitText:ue=({from:ct,to:Oe})=>te>0?`of ${te}`:`${ct}-${Oe}`,limitOptions:be,onLimitChange:ke,...Qe}=ne,tt=useMemo(()=>mn(Y),[Y]),yt=useCallback((ct,Oe)=>{var wt;(wt=O)===null||wt===void 0||wt(hn(Oe))},[O]),bt=useCallback(ct=>{var Oe;const wt=ct.target.value;(Oe=ke)===null||Oe===void 0||Oe(parseInt(wt,10))},[ke]);return _jsx(TablePagination,{...Qe,component:"div",count:te,page:tt,nextIconButtonProps:{...v!==void 0&&{disabled:!v}},onPageChange:yt,rowsPerPage:M,labelRowsPerPage:G,labelDisplayedRows:ue,rowsPerPageOptions:be,onRowsPerPageChange:bt})},on=ne=>{const{pageLimit:te,setPageLimit:Y,pageCursor:v,setPageCursor:O,fetchNextPage:M}=useSearch(),G=useCallback(ue=>{Y(ue),O(void 0)},[Y,O]);return _jsx(Sn,{...ne,hasNextPage:!!M,limit:te,onLimitChange:G,cursor:v,onCursorChange:O})};var pn=n(53974);const Cn=ne=>{const{children:te}=ne,Y=useSearch(),{result:v,...O}=Y;return te(v,O)},Xe=ne=>{const{query:te,children:Y}=ne,v=useApi(searchApiRef),O=useAsync(()=>{const{term:M="",types:G=[],filters:ue={},...be}=te;return v.query({...be,term:M,types:G,filters:ue})},[te]);return Y(O,te)},Jt=ne=>{const{query:te,children:Y}=ne;return te?_jsx(Xe,{query:te,children:Y}):_jsx(Cn,{children:Y})},Vt=ne=>{const{query:te,children:Y,noResultsComponent:v=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...O}=ne;return _jsx(Jt,{query:te,children:({loading:M,error:G,value:ue})=>{var be;return M?_jsx(Progress,{}):G?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:G}):!((be=ue)===null||be===void 0)&&be.results.length?isFunction(Y)?Y(ue):_jsx(SearchResultListItemExtensions,{...O,results:ue.results,children:Y}):v}})},Ye=ne=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Vt,{...ne})}),An=({result:ne,highlight:te,icon:Y,secondaryAction:v,lineClamp:O=5})=>{var M,G,ue,be,ke;return ne?_jsxs(_Fragment,{children:[Y&&_jsx(ListItemIcon,{children:Y}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:ne.location,children:!((M=te)===null||M===void 0)&&M.fields.title?_jsx(HighlightedSearchResultText,{text:((G=te)===null||G===void 0?void 0:G.fields.title)||"",preTag:((ue=te)===null||ue===void 0?void 0:ue.preTag)||"",postTag:((be=te)===null||be===void 0?void 0:be.postTag)||""}):ne.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:O,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((ke=te)===null||ke===void 0)&&ke.fields.text?_jsx(HighlightedSearchResultText,{text:te.fields.text,preTag:te.preTag,postTag:te.postTag}):ne.text})}),v&&_jsx(Box,{alignItems:"flex-end",children:v})]}):null},sn=ne=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(An,{...ne})}),Bn=ne=>{var te;const{error:Y,loading:v,resultItems:O,renderResultItem:M=ke=>_jsx(DefaultResultListItem,{result:ke.document},ke.document.location),disableRenderingWithNoResults:G,noResultsComponent:ue=G?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...be}=ne;return v?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):!((te=O)===null||te===void 0)&&te.length?_jsx(List,{...be,children:O.map(M)}):_jsx(_Fragment,{children:ue})},Tn=ne=>{const{query:te,renderResultItem:Y,children:v,...O}=ne,M=useSearchResultListItemExtensions(v);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:te,children:({loading:G,error:ue,value:be})=>{var ke;return _jsx(Bn,{...O,error:ue,loading:G,resultItems:(ke=be)===null||ke===void 0?void 0:ke.results,renderResultItem:Y!=null?Y:M})}})})};var Rn=n(19126);const Hn=(0,h.Z)(ne=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:ne.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:ne.palette.text.secondary,margin:ne.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:ne.palette.text.secondary,margin:ne.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:ne.spacing(.5)}})),Ln=ne=>{const te=Hn(),{label:Y,children:v,...O}=ne;return _jsx(Chip,{...O,className:te.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[Y,": ",v]})})},Gn=()=>null,we=(0,h.Z)(ne=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:ne.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:ne.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),pe=ne=>{const te=we(),{label:Y,value:v="None",onChange:O,onDelete:M}=ne,G=useCallback(ue=>{O(ue.target.value)},[O]);return _jsx(Ln,{label:Y,onDelete:M,children:_jsx(Typography,{role:"textbox",component:"span",className:te.root,onChange:G,contentEditable:!0,suppressContentEditableWarning:!0,children:v})})},Re=(0,h.Z)(ne=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:ne.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),H=ne=>{const te=Re(),{label:Y,value:v="none",onChange:O,onDelete:M,children:G}=ne,ue=useCallback(be=>{O(be.target.value)},[O]);return _jsx(Ln,{label:Y,onDelete:M,children:_jsxs(Select,{className:te.root,value:v,onChange:ue,input:_jsx(InputBase,{}),IconComponent:Gn,children:[_jsx(MenuItem,{value:"none",children:"None"}),G]})})};function N(ne){var te,Y;const v=Hn(),[O,M]=useState(null),{error:G,loading:ue,icon:be,title:ke,titleProps:Qe={},link:tt=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:v.listSubheaderLinkIcon})]}),linkProps:yt={},filterOptions:bt,renderFilterOption:ct=Wt=>_jsx(MenuItem,{value:String(Wt),children:Wt},String(Wt)),filterFields:Oe,renderFilterField:wt,resultItems:qt,renderResultItem:jt=Wt=>_jsx(DefaultResultListItem,{result:Wt.document},Wt.document.location),disableRenderingWithNoResults:Zt,noResultsComponent:_t=Zt?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...wn}=ne,Bt=useCallback(Wt=>{M(Wt.currentTarget)},[]),mt=useCallback(()=>{M(null)},[]);if(ue)return _jsx(Progress,{});if(G)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:G});if(!(!((te=qt)===null||te===void 0)&&te.length))return _jsx(_Fragment,{children:_t});var Lt;return _jsxs(List,{...wn,children:[_jsxs(ListSubheader,{className:v.listSubheader,children:[be,_jsx(Typography,{className:v.listSubheaderName,component:"strong",...Qe,children:ke}),bt?_jsx(Chip,{className:v.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Bt}):null,bt?_jsx(Menu,{id:"filters-menu",anchorEl:O,open:Boolean(O),onClose:mt,onClick:mt,keepMounted:!0,children:bt.map(ct)}):null,(Y=Oe)===null||Y===void 0?void 0:Y.map(Wt=>{var en;return(Lt=(en=wt)===null||en===void 0?void 0:en(Wt))!==null&&Lt!==void 0?Lt:null}),_jsx(Link,{className:v.listSubheaderLink,to:"/search",...yt,children:tt})]}),qt.map(jt)]})}function ae(ne){const{query:te,children:Y,renderResultItem:v,linkProps:O={},...M}=ne,G=useSearchResultListItemExtensions(Y);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:te,children:({loading:ue,error:be,value:ke},{term:Qe,types:tt,pageCursor:yt,filters:bt={}})=>{var ct;const Oe=`/search?${qs.stringify({term:Qe,types:tt,filters:bt,pageCursor:yt,query:Qe},{arrayFormat:"brackets"})}`;return _jsx(N,{...M,error:be,loading:ue,linkProps:{to:Oe,...O},filterFields:Object.keys(bt),resultItems:(ct=ke)===null||ct===void 0?void 0:ct.results,renderResultItem:v!=null?v:G})}})})}const Ae=(0,h.Z)(ne=>({root:{display:"flex",justifyContent:"space-between",gap:ne.spacing(2),margin:ne.spacing(2,0)}})),Ze=()=>{const{fetchNextPage:ne,fetchPreviousPage:te}=useSearch(),Y=Ae();return!ne&&!te?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:Y.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!te,onClick:te,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!ne,onClick:ne,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},qe="search.results.list.items.extensions.v1",Pt=(ne,te)=>{for(const v of ne){var Y;if(!(!isValidElement(v)||!(!((Y=getComponentData(v,qe))===null||Y===void 0)&&Y(te))))return cloneElement(v,{rank:te.rank,highlight:te.highlight,result:te.document,...v.props})}return null},$t=ne=>{const{rank:te,result:Y,noTrack:v,children:O,alignItems:M="flex-start",...G}=ne,ue=(0,r.z$)(),be=(0,V.useCallback)(()=>{v||Y&&ue.captureEvent("discover",Y.title,{attributes:{to:Y.location},value:te})},[te,Y,v,ue]);return(0,f.jsx)(m.Z,{divider:!0,alignItems:M,onClickCapture:be,...G,children:O})},Qt=ne=>{const{name:te,component:Y,predicate:v=()=>!0}=ne;return(0,r.YO)({name:te,component:{lazy:()=>Y().then(O=>M=>(0,f.jsx)($t,{rank:M.rank,result:M.result,noTrack:M.noTrack,children:(0,V.createElement)(O,M)}))},data:{[qe]:v}})},Xt=ne=>{const te=useElementFilter(ne,Y=>Y.selectByComponentData({key:qe}).getElements(),[ne]);return useCallback((Y,v)=>{const O=Pt(te,Y);return _jsx(Fragment,{children:O!=null?O:_jsx($t,{rank:Y.rank,result:Y.document,children:_jsx(DefaultResultListItem,{rank:Y.rank,highlight:Y.highlight,result:Y.document})})},v)},[te])},an=ne=>{const{results:te,children:Y,...v}=ne,O=Xt(Y);return _jsx(List,{...v,children:te.map(O)})}},61886:function(It,Pe,n){"use strict";n.d(Pe,{Ox:function(){return Tt},jM:function(){return V},Zz:function(){return m},oZ:function(){return B},DR:function(){return h},ZS:function(){return xe},VA:function(){return dt},KY:function(){return ve},gT:function(){return A},Dl:function(){return oe},ux:function(){return Yt},$L:function(){return $},x1:function(){return Se}});var r=n(52322),p=n(2784),W=n(73557),f=n(60871);const V="techdocs.addons.addon.v1",m="techdocs.addons.wrapper.v1",h=()=>null;(0,f.R5)(h,m,!0);const F=Ce=>`${V}.${Ce.toLocaleLowerCase("en-US")}`;function ve(Ce){const{name:$e,component:Ke}=Ce;return(0,f.YO)({name:$e,component:{sync:ht=>(0,r.jsx)(Ke,{...ht})},data:{[V]:Ce,[F($e)]:!0}})}const ce=(Ce,$e)=>Ce.selectByComponentData({key:$e}).getElements()[0],z=Ce=>Ce.selectByComponentData({key:m}).selectByComponentData({key:V}),de=Ce=>Ce.selectByComponentData({key:m}).findComponentData({key:V}),$=()=>{const Ce=(0,W.pC)(),$e=(0,f.vJ)(Ce,z),Ke=(0,f.vJ)(Ce,de),ht=(0,p.useCallback)(vt=>{if(!$e||!vt)return null;const ot=F(vt.name);var Je;return(Je=ce($e,ot))!==null&&Je!==void 0?Je:null},[$e]),rt=(0,p.useCallback)(vt=>{const ot=Ke.find(Je=>Je.name===vt);return ot?ht(ot):null},[Ke,ht]),et=(0,p.useCallback)(vt=>{const ot=Ke.filter(Je=>Je.location===vt);return ot.length?ot.map(ht):null},[Ke,ht]);return{renderComponentByName:rt,renderComponentsByLocation:et}},A=(0,f.T0)({id:"plugin.techdocs.service"}),oe=(0,f.T0)({id:"plugin.techdocs.storageservice"});var se=n(64279),ee=n(77446),X=n(25271),K=n(51837);function T(Ce,$e){return $e.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(Ce.kind=Ce.kind.toLocaleLowerCase(),Ce.name=Ce.name.toLocaleLowerCase(),Ce.namespace=Ce.namespace.toLocaleLowerCase()),Ce}const w=(Ce,$e)=>(0,X.eE)(Ce)===(0,X.eE)($e),I={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},Z=(0,K.CT)("techdocs-reader-page-context"),xe=(0,p.memo)(Ce=>{const{entityRef:$e,children:Ke}=Ce,ht=(0,f.h_)(A),rt=(0,f.h_)(f.Ds),et=(0,se.default)(async()=>ht.getEntityMetadata($e),[$e]),vt=(0,ee.Z)(async()=>ht.getTechDocsMetadata($e),[$e]),[ot,Je]=(0,p.useState)(I.title),[ft,gt]=(0,p.useState)(I.subtitle),[Ct,gn]=(0,p.useState)(I.shadowRoot);(0,p.useEffect)(()=>{Ct&&!vt.value&&!vt.loading&&vt.retry()},[vt.value,vt.loading,Ct,vt.retry,vt]);const un={metadata:vt,entityRef:T($e,rt),entityMetadata:et,shadowRoot:Ct,setShadowRoot:gn,title:ot,setTitle:Je,subtitle:ft,setSubtitle:gt},ln=(0,K.EI)({1:un});return(0,r.jsx)(f.fC,{attributes:{entityRef:(0,X.eE)($e)},children:(0,r.jsx)(Z.Provider,{value:ln,children:Ke instanceof Function?Ke(un):Ke})})},(Ce,$e)=>w(Ce.entityRef,$e.entityRef)),Se=()=>{const Ce=(0,p.useContext)(Z);if(Ce===void 0)return I;const $e=Ce.atVersion(1);if($e===void 0)throw new Error("No context found for version 1.");return $e},B=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Ge=n(70882),xt=n(50236),Nt=n(19219),zt=n(53974);const Tt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Ft=Ce=>{(0,p.useEffect)(()=>{var $e,Ke;if(!Ce)return()=>{};const ht=Ce.querySelectorAll('head > link[rel="stylesheet"]');var rt;let et=(rt=($e=ht)===null||$e===void 0?void 0:$e.length)!==null&&rt!==void 0?rt:0;const vt=new CustomEvent(Tt);if(!et)return Ce.dispatchEvent(vt),()=>{};const ot=()=>{--et===0&&Ce.dispatchEvent(vt)};return(Ke=ht)===null||Ke===void 0||Ke.forEach(Je=>{Je.addEventListener("load",ot)}),()=>{var Je;(Je=ht)===null||Je===void 0||Je.forEach(ft=>{ft.removeEventListener("load",ot)})}},[Ce])},Yt=Ce=>{const[$e,Ke]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!Ce)return()=>{};Ke(!0);const ht=Ce.style;ht.setProperty("opacity","0");const rt=()=>{Ke(!1),ht.setProperty("opacity","1")};return Ce.addEventListener(Tt,rt),()=>{Ce.removeEventListener(Tt,rt)}},[Ce]),$e},dt=Ce=>{const{element:$e,onAppend:Ke,children:ht}=Ce,[rt,et]=(0,p.useState)((0,Ge.Ue)({...(0,xt.Z)(),insertionPoint:void 0}));Ft($e);const vt=Yt($e),ot=(0,p.useCallback)(Je=>{if(!$e||!Je)return;et((0,Ge.Ue)({...(0,xt.Z)(),insertionPoint:$e.querySelector("head")||void 0}));let ft=Je.shadowRoot;ft||(ft=Je.attachShadow({mode:"open"})),ft.replaceChildren($e),typeof Ke=="function"&&Ke(ft)},[$e,Ke]);return(0,r.jsxs)(r.Fragment,{children:[vt&&(0,r.jsx)(zt.Ex,{}),(0,r.jsxs)(Nt.ZP,{jss:rt,sheetsManager:new Map,children:[(0,r.jsx)("div",{ref:ot,"data-testid":"techdocs-native-shadowroot"}),ht]})]})};var ut=n(54073);const St=()=>{const{shadowRoot:Ce}=useTechDocsReaderPage();return Ce},lt=Ce=>{const $e=St();return $e?Ce.map(Ke=>{var ht;return(ht=$e)===null||ht===void 0?void 0:ht.querySelectorAll(Ke)}).filter(Ke=>Ke.length).map(Ke=>Array.from(Ke)).flat():[]},Ut=Ce=>Ce.toString()&&Ce.rangeCount&&Ce.getRangeAt(0).getBoundingClientRect().top,Ht=(Ce=0)=>{const $e=St(),[Ke,ht]=useState(null),rt=useMemo(()=>debounce(()=>{const et=$e,vt=et.getSelection?et.getSelection():document.getSelection();vt&&Ut(vt)?ht(vt):ht(null)},Ce),[$e,ht,Ce]);return useEffect(()=>(window.document.addEventListener("selectionchange",rt),()=>{rt.cancel(),window.document.removeEventListener("selectionchange",rt)}),[rt]),Ke}},52943:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{EmbeddedDocsRouter:function(){return se},Router:function(){return oe},isTechDocsAvailable:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(39709),V=n(53974),m=n(25271),h=n(89258),F=n(65124),ve=n(86317);const ce=({entity:ee})=>{const X=(0,m.iB)(ee);return(0,r.jsxs)(h.I6,{entityRef:X,children:[(0,r.jsx)(F.b,{}),(0,r.jsx)(ve.F,{withSearch:!1})]})};var z=n(18662),de=n(7476);const $="backstage.io/techdocs-ref",A=ee=>{var X,K,T;return Boolean((T=ee)===null||T===void 0||(K=T.metadata)===null||K===void 0||(X=K.annotations)===null||X===void 0?void 0:X[$])},oe=()=>(0,r.jsxs)(W.Z5,{children:[(0,r.jsx)(W.AW,{path:"/",element:(0,r.jsx)(z.TechDocsIndexPage,{})}),(0,r.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,r.jsx)(de.TechDocsReaderPage,{})})]}),se=ee=>{var X;const{children:K}=ee,{entity:T}=(0,f.X2)(),w=(0,W.V$)([{path:"/*",element:(0,r.jsx)(ce,{entity:T}),children:[{path:"*",element:K}]}]);return((X=T.metadata.annotations)===null||X===void 0?void 0:X[$])?w:(0,r.jsx)(V.sk,{annotation:$})}},92077:function(It,Pe,n){"use strict";n.d(Pe,{k:function(){return m},p:function(){return V}});var r=n(87612),p=n(23054),W=n(54847),f=n.n(W);class V{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(F){const{kind:ve,namespace:ce,name:z}=F,$=`${await this.getApiOrigin()}/metadata/techdocs/${ce}/${ve}/${z}`,A=await this.fetchApi.fetch(`${$}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}async getEntityMetadata(F){const{kind:ve,namespace:ce,name:z}=F,$=`${await this.getApiOrigin()}/metadata/entity/${ce}/${ve}/${z}`,A=await this.fetchApi.fetch(`${$}`);if(!A.ok)throw await p.VL.fromResponse(A);return await A.json()}constructor(F){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=F.configApi,this.discoveryApi=F.discoveryApi,this.fetchApi=F.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var F;return(F=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&F!==void 0?F:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(F,ve){const{kind:ce,namespace:z,name:de}=F,A=`${await this.getStorageUrl()}/${z}/${ce}/${de}/${ve}`,oe=await this.fetchApi.fetch(`${A.endsWith("/")?A:`${A}/`}index.html`);let se="";switch(oe.status){case 404:throw se="Page not found. ",ve||(se+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(se);case 500:throw se="Could not generate documentation or an error in the TechDocs backend. ",new Error(se);default:break}return oe.text()}async syncEntityDocs(F,ve=()=>{}){const{kind:ce,namespace:z,name:de}=F,A=`${await this.getApiOrigin()}/sync/${z}/${ce}/${de}`,{token:oe}=await this.identityApi.getCredentials();return new Promise((se,ee)=>{const X=new W.EventSourcePolyfill(A,{withCredentials:!0,headers:oe?{Authorization:`Bearer ${oe}`}:{}});X.addEventListener("log",K=>{K.data&&ve(JSON.parse(K.data))}),X.addEventListener("finish",K=>{let T=!1;K.data&&({updated:T}=JSON.parse(K.data)),se(T?"updated":"cached")}),X.onerror=K=>{switch(X.close(),K.status){case 404:ee(new p.dR(K.message));return;default:ee(new Error(K.data));return}}})}async getBaseUrl(F,ve,ce){const{kind:z,namespace:de,name:$}=ve,oe=`${await this.getApiOrigin()}/static/docs/${de}/${z}/${$}/${ce}`;return new URL(F,oe.endsWith("/")?oe:`${oe}/`).toString()}constructor(F){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"identityApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=F.configApi,this.discoveryApi=F.discoveryApi,this.identityApi=F.identityApi,this.fetchApi=F.fetchApi}}},51953:function(It,Pe,n){"use strict";n.d(Pe,{D:function(){return r}});function r(p,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(It,Pe,n){"use strict";n.d(Pe,{u:function(){return F}});var r=n(52322),p=n(2784),W=n(53974),f=n(39709),V=n(42081),m=n(48431),h=n(68435);const F=ve=>{const{initialFilter:ce="owned",columns:z,actions:de}=ve;return(0,r.jsx)(V.j,{children:(0,r.jsxs)(W.VY,{children:[(0,r.jsx)(W.yW,{title:"",children:(0,r.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,r.jsx)(f.UO,{children:(0,r.jsxs)(f._i,{children:[(0,r.jsxs)(f._i.Filters,{children:[(0,r.jsx)(m.f,{}),(0,r.jsx)(f.EW,{initialFilter:ce}),(0,r.jsx)(f.dq,{}),(0,r.jsx)(f.xE,{})]}),(0,r.jsx)(f._i.Content,{children:(0,r.jsx)(h.n,{actions:de,columns:z})})]})})]})})}},85478:function(It,Pe,n){"use strict";n.d(Pe,{f:function(){return z}});var r=n(52322),p=n(95573),W=n(51953),f=n(60871),V=n(53974),m=n(94339),h=n(16111),F=n(24579),ve=n(14503),ce=n(2784);const z=se=>{var ee;const{entities:X}=se,K=(0,f.tg)(p.Fw),T=(0,f.h_)(f.Ds);if(!X)return null;var w,I;return(0,r.jsx)(V.Oh,{"data-testid":"docs-explore",children:!((ee=X)===null||ee===void 0)&&ee.length?X.map((Z,xe)=>(0,r.jsxs)(m.Z,{children:[(0,r.jsx)(h.Z,{children:(0,r.jsx)(V.hu,{title:(w=Z.metadata.title)!==null&&w!==void 0?w:Z.metadata.name})}),(0,r.jsx)(F.Z,{children:Z.metadata.description}),(0,r.jsx)(ve.Z,{children:(0,r.jsx)(V.Qj,{to:K({namespace:(0,W.D)((I=Z.metadata.namespace)!==null&&I!==void 0?I:"default",T),kind:(0,W.D)(Z.kind,T),name:(0,W.D)(Z.metadata.name,T)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},xe)):null})};var de=n(39709);const $={title:"All Documentation",filterPredicate:()=>!0},A=se=>{const{entities:ee,group:X}=se,{loading:K,isOwnedEntity:T}=useEntityOwnership(),w=ee.filter(Z=>X.filterPredicate==="ownedByUser"?K?!1:T(Z):typeof X.filterPredicate=="function"&&X.filterPredicate(Z)),I=(()=>typeof X.title=="string"?_jsx(ContentHeader,{title:X.title}):X.title)();return w.length===0?null:_jsxs(Content,{children:[I,_jsx(DocsCardGrid,{entities:w})]})},oe=se=>{const{loading:ee,error:X,entities:K}=useEntityList();if(X)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:X.toString()})});if(ee)return _jsx(Progress,{});if(K.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var T,w;return K.sort((I,Z)=>((T=I.metadata.title)!==null&&T!==void 0?T:I.metadata.name).localeCompare((w=Z.metadata.title)!==null&&w!==void 0?w:Z.metadata.name)),_jsx(Content,{children:(se.groups||[$]).map((I,Z)=>_jsx(A,{entities:K,group:I},`${I.title}-${Z}`))})}},68435:function(It,Pe,n){"use strict";n.d(Pe,{H:function(){return K},n:function(){return T}});var r=n(52322),p=n(2784),W=n(95074),f=n(76635),V=n(53974),m=n(39709),h=n(60871),F=n(25271),ve=n(95573),ce=n(39981),z=n(2337),de=n(11640),$=n(28347);const A=(0,z.Z)({root:{color:"#f3ba37"}})(de.Z),oe={createCopyDocsUrlAction(w){return I=>({icon:()=>(0,r.jsx)(ce.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>w(`${window.location.origin}${I.resolved.docsUrl}`)})},createStarEntityAction(w,I){return Z=>{const xe=Z.entity,Se=w(xe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Se?(0,r.jsx)(A,{}):(0,r.jsx)($.Z,{}),tooltip:Se?"Remove from favorites":"Add to favorites",onClick:()=>I(xe)}}}};function se(w){return w.metadata.title||w.metadata.name}const ee={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:w=>(0,r.jsx)(V.uw,{value:(0,r.jsx)(V.rU,{to:w.resolved.docsUrl,children:se(w.entity)}),subvalue:w.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:w})=>(0,r.jsx)(m.rI,{entityRefs:w.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var X=n(51953);const K=w=>{const{entities:I,title:Z,loading:xe,columns:Se,actions:B,options:Ge}=w,[,xt]=(0,W.Z)(),Nt=(0,h.tg)(ve.Fw),zt=(0,h.h_)(h.Ds);if(!I)return null;const Tt=I.map(dt=>{const ut=(0,m.hF)(dt,F.S4);var St;return{entity:dt,resolved:{docsUrl:Nt({namespace:(0,X.D)((St=dt.metadata.namespace)!==null&&St!==void 0?St:"default",zt),kind:(0,X.D)(dt.kind,zt),name:(0,X.D)(dt.metadata.name,zt)}),ownedByRelations:ut,ownedByRelationsTitle:ut.map(lt=>(0,m.$3)(lt,{defaultKind:"group"})).join(", ")}}}),Ft=[ee.createNameColumn(),ee.createOwnerColumn(),ee.createTypeColumn()],Yt=[oe.createCopyDocsUrlAction(xt)];return(0,r.jsx)(r.Fragment,{children:xe||Tt&&Tt.length>0?(0,r.jsx)(V.iA,{isLoading:xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Ge},data:Tt,columns:Se||Ft,actions:B||Yt,title:Z?`${Z} (${Tt.length})`:`All (${Tt.length})`}):(0,r.jsx)(V.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,r.jsx)(V.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};K.columns=ee,K.actions=oe;const T=w=>{var I;const{columns:Z,actions:xe,options:Se}=w,{loading:B,error:Ge,entities:xt,filters:Nt}=(0,m.wp)(),{isStarredEntity:zt,toggleStarredEntity:Tt}=(0,m.CR)(),[,Ft]=(0,W.Z)();var Yt;const dt=(0,f.capitalize)((Yt=(I=Nt.user)===null||I===void 0?void 0:I.value)!==null&&Yt!==void 0?Yt:"all"),ut=[oe.createCopyDocsUrlAction(Ft),oe.createStarEntityAction(zt,Tt)];return Ge?(0,r.jsx)(V.GB,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(V.Oi,{language:"text",text:Ge.toString()})}):(0,r.jsx)(K,{title:dt,entities:xt,loading:B,actions:xe||ut,columns:Z,options:Se})};T.columns=ee,T.actions=oe},18662:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{TechDocsIndexPage:function(){return V}});var r=n(52322),p=n(2784),W=n(73557),f=n(3482);const V=m=>(0,W.pC)()||(0,r.jsx)(f.u,{...m})},42081:function(It,Pe,n){"use strict";n.d(Pe,{j:function(){return V}});var r=n(52322),p=n(2784),W=n(53974),f=n(60871);const V=m=>{const{children:h}=m,F=(0,f.h_)(f.Ds);var ve;const ce=`Documentation available in ${(ve=F.getOptionalString("organization.name"))!==null&&ve!==void 0?ve:"Backstage"}`;return(0,r.jsx)(W.g9,{title:"Documentation",subtitle:ce,themeId:"documentation",children:h})}},48431:function(It,Pe,n){"use strict";n.d(Pe,{f:function(){return f}});var r=n(2784),p=n(39709);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:V}=(0,p.wp)();return(0,r.useEffect)(()=>{V({techdocs:new W})},[V]),null}},89258:function(It,Pe,n){"use strict";n.d(Pe,{I6:function(){return z},Jl:function(){return ce},s4:function(){return m}});var r=n(61886),p=n(92077),W=n(95573),f=n(60871),V=n(15096);const m=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:r.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:$,discoveryApi:A,identityApi:oe,fetchApi:se})=>new p.k({configApi:$,discoveryApi:A,identityApi:oe,fetchApi:se})}),(0,f.ni)({api:r.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:$,discoveryApi:A,fetchApi:oe})=>new p.p({configApi:$,discoveryApi:A,fetchApi:oe})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),h=m.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then($=>$.Router),mountPoint:W._Z})),F=m.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then($=>$.EmbeddedDocsRouter),mountPoint:W.pd})),ve=m.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then($=>$.TechDocsCustomHome),mountPoint:W._Z})),ce=m.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then($=>$.TechDocsIndexPage),mountPoint:W._Z})),z=m.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then($=>$.TechDocsReaderPage),mountPoint:W.Fw})),de=m.provide((0,V.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then($=>$.TechDocsSearchResultListItem),predicate:$=>$.type==="techdocs"}))},7476:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{TechDocsReaderLayout:function(){return z},TechDocsReaderPage:function(){return de}});var r=n(52322),p=n(2784),W=n(73557),f=n(53974),V=n(61886),m=n(86317),h=n(93225),F=n(65124),ve=n(95573),ce=n(60871);const z=$=>{const{withSearch:A,withHeader:oe=!0}=$;return(0,r.jsxs)(f.T3,{themeId:"documentation",children:[oe&&(0,r.jsx)(h.S,{}),(0,r.jsx)(F.b,{}),(0,r.jsx)(m.F,{withSearch:A})]})},de=$=>{const{kind:A,name:oe,namespace:se}=(0,ce.Oi)(ve.Fw),{children:ee,entityRef:X={kind:A,name:oe,namespace:se}}=$,K=(0,W.pC)();if(!ee){const w=K?p.Children.toArray(K.props.children):[];var T;const Z=w.flatMap(xe=>{var Se,B;return(T=(B=xe)===null||B===void 0||(Se=B.props)===null||Se===void 0?void 0:Se.children)!==null&&T!==void 0?T:[]}).find(xe=>!(0,ce.IY)(xe,V.Zz)&&!(0,ce.IY)(xe,V.jM));return(0,r.jsx)(V.ZS,{entityRef:X,children:Z||(0,r.jsx)(z,{})})}return(0,r.jsx)(V.ZS,{entityRef:X,children:({metadata:w,entityMetadata:I,onReady:Z})=>(0,r.jsx)("div",{className:"techdocs-reader-page",children:(0,r.jsx)(f.T3,{themeId:"documentation",children:ee instanceof Function?ee({entityRef:X,techdocsMetadataValue:w.value,entityMetadataValue:I.value,onReady:Z}):ee})})})}},86317:function(It,Pe,n){"use strict";n.d(Pe,{F:function(){return te}});var r=n(52322),p=n(2784),W=n(79692),f=n(60905),V=n(61886),m=n(53974),h=n(22478),F=n(4614),ve=n(77277),ce=n(99688),z=n(12420),de=n(90436),$=n(61837),A=n(4190),oe=n(87685);const se=(0,W.Z)(v=>(0,z.Z)({paper:{width:"100%",[v.breakpoints.up("sm")]:{width:"75%"},[v.breakpoints.up("md")]:{width:"50%"},padding:v.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:v.palette.background.default}})),ee=({buildLog:v,onClose:O})=>{const M=se(),G=v.length===0?"Waiting for logs...":v.join(`
37
- `);return(0,r.jsxs)(f.Z,{container:!0,direction:"column",className:M.root,spacing:0,wrap:"nowrap",children:[(0,r.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,r.jsx)(de.Z,{variant:"h5",children:"Build Details"}),(0,r.jsx)($.Z,{title:"Close the drawer",onClick:O,color:"inherit",children:(0,r.jsx)(oe.Z,{})},"dismiss")]}),(0,r.jsx)(f.Z,{item:!0,xs:!0,children:(0,r.jsx)(m.nU,{text:G,classes:{root:M.logs}})})]})},X=({buildLog:v})=>{const O=se(),[M,G]=(0,p.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ve.Z,{color:"inherit",onClick:()=>G(!0),children:"Show Build Logs"}),(0,r.jsx)(A.ZP,{classes:{paper:O.paper},anchor:"right",open:M,onClose:()=>G(!1),children:(0,r.jsx)(ee,{buildLog:v,onClose:()=>G(!1)})})]})};var K=n(60871);const T=({errorMessage:v})=>{const O=(0,K.h_)(K.Ds).getOptionalString("techdocs.builder");let M="";return O!=="local"&&(M="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,r.jsx)(m.mf,{status:"404",statusMessage:v||"Documentation not found",additionalInfo:M})};var w=n(95481);const I=(0,W.Z)(v=>({root:{marginBottom:v.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Z=()=>{let v=null;const O=I(),{state:M,contentReload:G,contentErrorMessage:ue,syncErrorMessage:be,buildLog:ke}=(0,w.DK)();return M==="INITIAL_BUILD"&&(v=(0,r.jsx)(ce.Z,{classes:{root:O.root},variant:"outlined",severity:"info",icon:(0,r.jsx)(F.Z,{size:"24px"}),action:(0,r.jsx)(X,{buildLog:ke}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),M==="CONTENT_STALE_REFRESHING"&&(v=(0,r.jsx)(ce.Z,{variant:"outlined",severity:"info",icon:(0,r.jsx)(F.Z,{size:"24px"}),action:(0,r.jsx)(X,{buildLog:ke}),classes:{root:O.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),M==="CONTENT_STALE_READY"&&(v=(0,r.jsx)(ce.Z,{variant:"outlined",severity:"success",action:(0,r.jsx)(ve.Z,{color:"inherit",onClick:()=>G(),children:"Refresh"}),classes:{root:O.root},children:"A newer version of this documentation is now available, please refresh to view."})),M==="CONTENT_STALE_ERROR"&&(v=(0,r.jsxs)(ce.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(X,{buildLog:ke}),classes:{root:O.root,message:O.message},children:["Building a newer version of this documentation failed."," ",be]})),M==="CONTENT_NOT_FOUND"&&(v=(0,r.jsxs)(r.Fragment,{children:[be&&(0,r.jsxs)(ce.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(X,{buildLog:ke}),classes:{root:O.root,message:O.message},children:["Building a newer version of this documentation failed."," ",be]}),(0,r.jsx)(T,{errorMessage:ue})]})),v};var xe=n(60364),Se=n(41156),B=n(32838),Ge=n(35368),xt=n.n(Ge);const Nt=/main\.[A-Fa-f0-9]{8}\.min\.css$/,zt=/^https:\/\/fonts\.googleapis\.com/,Tt=/^https:\/\/fonts\.gstatic\.com/,Ft=v=>v.nodeName==="LINK",Yt=v=>{var O;const M=((O=v)===null||O===void 0?void 0:O.getAttribute("href"))||"",G=M.match(Nt),ue=M.match(zt),be=M.match(Tt);return G||ue||be},dt=v=>(Ft(v)&&!Yt(v)&&v.remove(),v),ut=v=>v.nodeName==="IFRAME",St=(v,O)=>{const M=v.getAttribute("src")||"";try{const{host:G}=new URL(M);return O.includes(G)}catch{return!1}},lt=v=>O=>(ut(O)&&!St(O,v)&&O.remove(),O),Ut=()=>{const v=(0,K.h_)(K.Ds);return(0,p.useMemo)(()=>v.getOptionalConfig("techdocs.sanitizer"),[v])},Ht=()=>{const v=Ut();return(0,p.useCallback)(async O=>{var M;const G=(M=v)===null||M===void 0?void 0:M.getOptionalStringArray("allowedIframeHosts");xt().addHook("beforeSanitizeElements",dt);const ue=["link"];return G&&(ue.push("iframe"),xt().addHook("beforeSanitizeElements",lt(G))),xt().sanitize(O.outerHTML,{ADD_TAGS:ue,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[v])};var Ce=n(41128),$e=({theme:v})=>`
38
- /*================== Variables ==================*/
39
- /*
40
- As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
41
- As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
42
- */
43
-
44
- :host {
45
- /* FONT */
46
- --md-default-fg-color: ${v.palette.text.primary};
47
- --md-default-fg-color--light: ${v.palette.text.secondary};
48
- --md-default-fg-color--lighter: ${(0,Ce.$n)(v.palette.text.secondary,.7)};
49
- --md-default-fg-color--lightest: ${(0,Ce.$n)(v.palette.text.secondary,.3)};
50
-
51
- /* BACKGROUND */
52
- --md-default-bg-color:${v.palette.background.default};
53
- --md-default-bg-color--light: ${v.palette.background.paper};
54
- --md-default-bg-color--lighter: ${(0,Ce.$n)(v.palette.background.paper,.7)};
55
- --md-default-bg-color--lightest: ${(0,Ce.$n)(v.palette.background.paper,.3)};
56
-
57
- /* PRIMARY */
58
- --md-primary-fg-color: ${v.palette.primary.main};
59
- --md-primary-fg-color--light: ${v.palette.primary.light};
60
- --md-primary-fg-color--dark: ${v.palette.primary.dark};
61
- --md-primary-bg-color: ${v.palette.primary.contrastText};
62
- --md-primary-bg-color--light: ${(0,Ce.$n)(v.palette.primary.contrastText,.7)};
63
-
64
- /* ACCENT */
65
- --md-accent-fg-color: var(--md-primary-fg-color);
66
-
67
- /* SHADOW */
68
- --md-shadow-z1: ${v.shadows[1]};
69
- --md-shadow-z2: ${v.shadows[2]};
70
- --md-shadow-z3: ${v.shadows[3]};
71
-
72
- /* EXTENSIONS */
73
- --md-admonition-fg-color: var(--md-default-fg-color);
74
- --md-admonition-bg-color: var(--md-default-bg-color);
75
- /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
76
- --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
77
- --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
78
- --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
79
- --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
80
- --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
81
- --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
82
- --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
83
- --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
84
- --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
85
- --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
86
- --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
87
- --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
88
- --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
89
- --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
90
- --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
91
- --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
92
- --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
93
- --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
94
- --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
95
- --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
96
- --md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
97
- --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
98
- --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
99
- --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
100
- --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
101
- --md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
102
- }
103
-
104
- :host > * {
105
- /* CODE */
106
- --md-code-fg-color: ${v.palette.text.primary};
107
- --md-code-bg-color: ${v.palette.background.paper};
108
- --md-code-hl-color: ${(0,Ce.Fq)(v.palette.warning.main,.5)};
109
- --md-code-hl-keyword-color: ${v.palette.type==="dark"?v.palette.primary.light:v.palette.primary.dark};
110
- --md-code-hl-function-color: ${v.palette.type==="dark"?v.palette.secondary.light:v.palette.secondary.dark};
111
- --md-code-hl-string-color: ${v.palette.type==="dark"?v.palette.success.light:v.palette.success.dark};
112
- --md-code-hl-number-color: ${v.palette.type==="dark"?v.palette.error.light:v.palette.error.dark};
113
- --md-code-hl-constant-color: var(--md-code-hl-function-color);
114
- --md-code-hl-special-color: var(--md-code-hl-function-color);
115
- --md-code-hl-name-color: var(--md-code-fg-color);
116
- --md-code-hl-comment-color: var(--md-default-fg-color--light);
117
- --md-code-hl-generic-color: var(--md-default-fg-color--light);
118
- --md-code-hl-variable-color: var(--md-default-fg-color--light);
119
- --md-code-hl-operator-color: var(--md-default-fg-color--light);
120
- --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
121
-
122
- /* TYPESET */
123
- --md-typeset-font-size: 1rem;
124
- --md-typeset-color: var(--md-default-fg-color);
125
- --md-typeset-a-color: ${v.palette.link};
126
- --md-typeset-table-color: ${v.palette.text.primary};
127
- --md-typeset-del-color: ${v.palette.type==="dark"?(0,Ce.Fq)(v.palette.error.dark,.5):(0,Ce.Fq)(v.palette.error.light,.5)};
128
- --md-typeset-ins-color: ${v.palette.type==="dark"?(0,Ce.Fq)(v.palette.success.dark,.5):(0,Ce.Fq)(v.palette.success.light,.5)};
129
- --md-typeset-mark-color: ${v.palette.type==="dark"?(0,Ce.Fq)(v.palette.warning.dark,.5):(0,Ce.Fq)(v.palette.warning.light,.5)};
130
- }
131
-
132
- @media screen and (max-width: 76.1875em) {
133
- :host > * {
134
- /* TYPESET */
135
- --md-typeset-font-size: .9rem;
136
- }
137
- }
138
-
139
- @media screen and (max-width: 600px) {
140
- :host > * {
141
- /* TYPESET */
142
- --md-typeset-font-size: .7rem;
143
- }
144
- }
145
- `,Ke=({theme:v})=>`
146
- /*================== Reset ==================*/
147
-
148
- body {
149
- --md-text-color: var(--md-default-fg-color);
150
- --md-text-link-color: var(--md-accent-fg-color);
151
- --md-text-font-family: ${v.typography.fontFamily};
152
- font-family: var(--md-text-font-family);
153
- background-color: unset;
154
- }
155
- `;const ht="224px";var rt=({theme:v,sidebar:O})=>`
156
- /*================== Layout ==================*/
157
-
158
- /* mkdocs material v9 compat */
159
- .md-nav__title {
160
- color: var(--md-default-fg-color);
161
- }
162
-
163
- .md-grid {
164
- max-width: 100%;
165
- margin: 0;
166
- }
167
-
168
- .md-nav {
169
- font-size: calc(var(--md-typeset-font-size) * 0.9);
170
- }
171
- .md-nav__link {
172
- display: flex;
173
- align-items: center;
174
- justify-content: space-between;
175
- }
176
- .md-nav__icon {
177
- height: 20px !important;
178
- width: 20px !important;
179
- margin-left:${v.spacing(1)}px;
180
- }
181
- .md-nav__icon svg {
182
- margin: 0;
183
- width: 20px !important;
184
- height: 20px !important;
185
- }
186
- .md-nav__icon:after {
187
- width: 20px !important;
188
- height: 20px !important;
189
- }
190
-
191
- .md-nav__item--active > .md-nav__link, a.md-nav__link--active {
192
- text-decoration: underline;
193
- color: var(--md-typeset-a-color);
194
- }
195
-
196
- .md-main__inner {
197
- margin-top: 0;
198
- }
199
-
200
- .md-sidebar {
201
- bottom: 75px;
202
- position: fixed;
203
- width: 16rem;
204
- overflow-y: auto;
205
- overflow-x: hidden;
206
- scrollbar-color: rgb(193, 193, 193) #eee;
207
- scrollbar-width: thin;
208
- }
209
- .md-sidebar .md-sidebar__scrollwrap {
210
- width: calc(12.1rem);
211
- }
212
- .md-sidebar--secondary {
213
- right: ${v.spacing(3)}px;
214
- }
215
- .md-sidebar::-webkit-scrollbar {
216
- width: 5px;
217
- }
218
- .md-sidebar::-webkit-scrollbar-button {
219
- width: 5px;
220
- height: 5px;
221
- }
222
- .md-sidebar::-webkit-scrollbar-track {
223
- background: #eee;
224
- border: 1 px solid rgb(250, 250, 250);
225
- box-shadow: 0px 0px 3px #dfdfdf inset;
226
- border-radius: 3px;
227
- }
228
- .md-sidebar::-webkit-scrollbar-thumb {
229
- width: 5px;
230
- background: rgb(193, 193, 193);
231
- border: transparent;
232
- border-radius: 3px;
233
- }
234
- .md-sidebar::-webkit-scrollbar-thumb:hover {
235
- background: rgb(125, 125, 125);
236
- }
237
-
238
- .md-content {
239
- max-width: calc(100% - 16rem * 2);
240
- margin-left: 16rem;
241
- margin-bottom: 50px;
242
- }
243
-
244
- .md-footer {
245
- position: fixed;
246
- bottom: 0px;
247
- pointer-events: none;
248
- }
249
-
250
- .md-footer-nav__link, .md-footer__link {
251
- pointer-events: all;
252
- }
253
-
254
- .md-footer__title {
255
- background-color: unset;
256
- }
257
- .md-footer-nav__link {
258
- width: 16rem;
259
- }
260
-
261
- .md-dialog {
262
- background-color: unset;
263
- }
264
-
265
- @media screen and (min-width: 76.25em) {
266
- .md-sidebar {
267
- height: auto;
268
- }
269
- }
270
-
271
- @media screen and (max-width: 76.1875em) {
272
- .md-nav {
273
- transition: none !important;
274
- background-color: var(--md-default-bg-color)
275
- }
276
- .md-nav--primary .md-nav__title {
277
- cursor: auto;
278
- color: var(--md-default-fg-color);
279
- font-weight: 700;
280
- white-space: normal;
281
- line-height: 1rem;
282
- height: auto;
283
- display: flex;
284
- flex-flow: column;
285
- row-gap: 1.6rem;
286
- padding: 1.2rem .8rem .8rem;
287
- background-color: var(--md-default-bg-color);
288
- }
289
- .md-nav--primary .md-nav__title~.md-nav__list {
290
- box-shadow: none;
291
- }
292
- .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
293
- border-top: none;
294
- }
295
- .md-nav--primary .md-nav__title .md-nav__button {
296
- display: none;
297
- }
298
- .md-nav--primary .md-nav__title .md-nav__icon {
299
- color: var(--md-default-fg-color);
300
- position: static;
301
- height: auto;
302
- margin: 0 0 0 -0.2rem;
303
- }
304
- .md-nav--primary > .md-nav__title [for="none"] {
305
- padding-top: 0;
306
- }
307
- .md-nav--primary .md-nav__item {
308
- border-top: none;
309
- }
310
- .md-nav--primary :is(.md-nav__title,.md-nav__item) {
311
- font-size : var(--md-typeset-font-size);
312
- }
313
- .md-nav .md-source {
314
- display: none;
315
- }
316
-
317
- .md-sidebar {
318
- height: 100%;
319
- }
320
- .md-sidebar--primary {
321
- width: 12.1rem !important;
322
- z-index: 200;
323
- left: ${O.isPinned?`calc(-12.1rem + ${ht})`:"calc(-12.1rem + 72px)"} !important;
324
- }
325
- .md-sidebar--secondary:not([hidden]) {
326
- display: none;
327
- }
328
-
329
- .md-content {
330
- max-width: 100%;
331
- margin-left: 0;
332
- }
333
-
334
- .md-header__button {
335
- margin: 0.4rem 0;
336
- margin-left: 0.4rem;
337
- padding: 0;
338
- }
339
-
340
- .md-overlay {
341
- left: 0;
342
- }
343
-
344
- .md-footer {
345
- position: static;
346
- padding-left: 0;
347
- }
348
- .md-footer-nav__link {
349
- /* footer links begin to overlap at small sizes without setting width */
350
- width: 50%;
351
- }
352
- }
353
-
354
- @media screen and (max-width: 600px) {
355
- .md-sidebar--primary {
356
- left: -12.1rem !important;
357
- width: 12.1rem;
358
- }
359
- }
360
-
361
-
362
- @media print {
363
- .md-sidebar,
364
- #toggle-sidebar {
365
- display: none;
366
- }
367
-
368
- .md-content {
369
- margin: 0;
370
- width: 100%;
371
- max-width: 100%;
372
- }
373
- }
374
- `;const et=["h1","h2","h3","h4","h5","h6"];var vt=({theme:v})=>`
375
- /*================== Typeset ==================*/
376
-
377
- .md-typeset {
378
- font-size: var(--md-typeset-font-size);
379
- }
380
-
381
- ${et.reduce((O,M)=>{var G;const ue=(G=v.typography.htmlFontSize)!==null&&G!==void 0?G:16,be=v.typography[M],{lineHeight:ke,fontFamily:Qe,fontWeight:tt,fontSize:yt}=be,bt=ct=>{let Oe=1;return typeof ct=="number"&&(Oe=ct/ue*.6),typeof ct=="string"&&(Oe=ct.replace("rem","")),`calc(${Oe} * var(--md-typeset-font-size))`};return O.concat(`
382
- .md-typeset ${M} {
383
- color: var(--md-default-fg-color);
384
- line-height: ${ke};
385
- font-family: ${Qe};
386
- font-weight: ${tt};
387
- font-size: ${bt(yt)};
388
- }
389
- `)},"")}
390
-
391
- .md-typeset .md-content__button {
392
- color: var(--md-default-fg-color);
393
- }
394
-
395
- .md-typeset hr {
396
- border-bottom: 0.05rem dotted ${v.palette.divider};
397
- }
398
-
399
- .md-typeset details {
400
- font-size: var(--md-typeset-font-size) !important;
401
- }
402
- .md-typeset details summary {
403
- padding-left: 2.5rem !important;
404
- }
405
- .md-typeset details summary:before,
406
- .md-typeset details summary:after {
407
- top: 50% !important;
408
- width: 20px !important;
409
- height: 20px !important;
410
- transform: rotate(0deg) translateY(-50%) !important;
411
- }
412
- .md-typeset details[open] > summary:after {
413
- transform: rotate(90deg) translateX(-50%) !important;
414
- }
415
-
416
- .md-typeset blockquote {
417
- color: var(--md-default-fg-color--light);
418
- border-left: 0.2rem solid var(--md-default-fg-color--light);
419
- }
420
-
421
- .md-typeset table:not([class]) {
422
- font-size: var(--md-typeset-font-size);
423
- border: 1px solid var(--md-default-fg-color);
424
- border-bottom: none;
425
- border-collapse: collapse;
426
- }
427
- .md-typeset table:not([class]) th {
428
- font-weight: bold;
429
- }
430
- .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
431
- border-bottom: 1px solid var(--md-default-fg-color);
432
- }
433
-
434
- .md-typeset pre > code::-webkit-scrollbar-thumb {
435
- background-color: hsla(0, 0%, 0%, 0.32);
436
- }
437
- .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
438
- background-color: hsla(0, 0%, 0%, 0.87);
439
- }
440
- `,ot=()=>`
441
- /*================== Animations ==================*/
442
- /*
443
- Disable CSS animations on link colors as they lead to issues in dark mode.
444
- The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
445
- */
446
- .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
447
- transition: none;
448
- }
449
- `,Je=({theme:v})=>`
450
- /*================== Extensions ==================*/
451
-
452
- /* HIGHLIGHT */
453
- .highlight .md-clipboard:after {
454
- content: unset;
455
- }
456
-
457
- .highlight .nx {
458
- color: ${v.palette.type==="dark"?"#ff53a3":"#ec407a"};
459
- }
460
-
461
- /* CODE HILITE */
462
- .codehilite .gd {
463
- background-color: ${v.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
464
- }
465
-
466
- .codehilite .gi {
467
- background-color: ${v.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
468
- }
469
-
470
- /* TABBED */
471
- .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
472
- .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
473
- .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
474
- .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
475
- .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
476
- .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
477
- .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
478
- .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
479
- .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
480
- .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
481
- .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
482
- .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
483
- .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
484
- .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
485
- .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
486
- .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
487
- .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
488
- .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
489
- .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
490
- .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
491
- color: var(--md-accent-fg-color);
492
- border-color: var(--md-accent-fg-color);
493
- }
494
-
495
- /* TASK-LIST */
496
- .task-list-control .task-list-indicator::before {
497
- background-color: ${v.palette.action.disabledBackground};
498
- }
499
- .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
500
- background-color: ${v.palette.success.main};
501
- }
502
-
503
- /* ADMONITION */
504
- .admonition {
505
- font-size: var(--md-typeset-font-size) !important;
506
- }
507
- .admonition .admonition-title {
508
- padding-left: 2.5rem !important;
509
- }
510
-
511
- .admonition .admonition-title:before {
512
- top: 50% !important;
513
- width: 20px !important;
514
- height: 20px !important;
515
- transform: translateY(-50%) !important;
516
- }
517
- `;const ft=[$e,Ke,rt,vt,ot,Je],gt=()=>(0,m.Pf)(),Ct=()=>{const v=gt(),O=(0,xe.Z)();return(0,p.useMemo)(()=>{const M={theme:O,sidebar:v};return ft.reduce((G,ue)=>G+ue(M),"")},[O,v])},gn=()=>{const v=Ct();return(0,p.useCallback)(O=>(O.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${v}</style>`),O),[v])},un=(v,O,M)=>{const G=v==="src"&&O.endsWith(".svg"),ue=!O.match(/^([a-z]*:)?\/\//i),be=O.startsWith(M);return G&&(ue||be)},ln=({techdocsStorageApi:v,entityId:O,path:M})=>async G=>{const ue=await v.getApiOrigin(),be=async(ke,Qe)=>{for(const tt of ke)if(tt.hasAttribute(Qe)){const yt=tt.getAttribute(Qe);if(!yt)return;const bt=await v.getBaseUrl(yt,O,M);if(un(Qe,yt,ue))try{const Oe=await(await fetch(bt,{credentials:"include"})).text();tt.setAttribute(Qe,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Oe)))}`)}catch{tt.setAttribute("alt",`Error: ${yt}`)}else tt.setAttribute(Qe,bt)}};return await Promise.all([be(G.querySelectorAll("img"),"src"),be(G.querySelectorAll("script"),"src"),be(G.querySelectorAll("source"),"src"),be(G.querySelectorAll("link"),"href"),be(G.querySelectorAll("a[download]"),"href")]),G};var bn=n(40556),hn=n(67097),mn=n(28316),Sn=n(82717),on=n.n(Sn);const pn=v=>O=>{var M,G,ue,be,ke,Qe;const tt=O.querySelector('[title="Edit this page"]');if(!tt||!tt.href)return O;const yt=new URL(tt.href),bt=v.byUrl(yt);if(((M=bt)===null||M===void 0?void 0:M.type)!=="github"&&((G=bt)===null||G===void 0?void 0:G.type)!=="gitlab")return O;const ct=((ue=O.querySelector("article>h1"))===null||ue===void 0?void 0:ue.childNodes[0].textContent)||"",Oe=encodeURIComponent(`Documentation Feedback: ${ct}`),wt=encodeURIComponent(`Page source:
518
- ${tt.href}
519
-
520
- Feedback:`),qt=((be=bt)===null||be===void 0?void 0:be.type)==="github"?(0,bn.BT)(yt.href,"blob"):yt.href,jt=on()(qt),Zt=`/${jt.organization}/${jt.name}`,_t=tt.cloneNode();switch((ke=bt)===null||ke===void 0?void 0:ke.type){case"gitlab":_t.href=`${yt.origin}${Zt}/issues/new?issue[title]=${Oe}&issue[description]=${wt}`;break;case"github":_t.href=`${yt.origin}${Zt}/issues/new?title=${Oe}&body=${wt}`;break;default:return O}return mn.render(p.createElement(hn.Z),_t),_t.style.paddingLeft="5px",_t.title="Leave feedback for this page",_t.id="git-feedback-link",(Qe=tt)===null||Qe===void 0||Qe.insertAdjacentElement("beforebegin",_t),O};var Cn=n(44882);const Xe=()=>v=>{var O;const M=v.querySelector('.md-header label[for="__drawer"]'),G=v.querySelector("article");if(!M||!G)return v;const ue=M.cloneNode();return mn.render(p.createElement(Cn.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),(O=G)===null||O===void 0||O.prepend(ue),v},Jt=()=>v=>(((M,G)=>{Array.from(M).filter(ue=>ue.hasAttribute(G)).forEach(ue=>{const be=ue.getAttribute(G);if(be){be.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const ke=Vt(window.location.href);ue.setAttribute(G,new URL(be,ke).toString())}catch{ue.replaceWith(ue.textContent||be)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Vt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const Ye=({baseUrl:v,onClick:O})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(G=>{G.addEventListener("click",ue=>{const ke=G.getAttribute("href");ke&&ke.startsWith(v)&&!G.hasAttribute("download")&&(ue.preventDefault(),O(ue,ke))})}),M);var An=n(15459),sn=n(80030),Bn=n(72379),Tn=n(41547),Rn=n(95074);const Hn=(0,An.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(sn.ZP),Ln=()=>(0,r.jsx)(Bn.Z,{children:(0,r.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"})}),Gn=({text:v})=>{const[O,M]=(0,p.useState)(!1),[,G]=(0,Rn.Z)(),ue=(0,p.useCallback)(()=>{G(v),M(!0)},[v,G]),be=(0,p.useCallback)(()=>{M(!1)},[M]);return(0,r.jsx)(Hn,{title:"Copied to clipboard",placement:"left",open:O,onClose:be,leaveDelay:1e3,children:(0,r.jsx)($.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)(Ln,{})})})},we=v=>O=>{const M=O.querySelectorAll("pre > code");for(const be of M){var G,ue;const ke=be.textContent||"",Qe=document.createElement("div");(ue=be)===null||ue===void 0||(G=ue.parentElement)===null||G===void 0||G.prepend(Qe),mn.render((0,r.jsx)(Tn.Z,{theme:v,children:(0,r.jsx)(Gn,{text:ke})}),Qe)}return O},pe=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Re=()=>v=>{var O,M;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(M=v.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),v},H=({onLoading:v,onLoaded:O})=>M=>(v(),M.addEventListener(V.Ox,function G(){O(),M.removeEventListener(V.Ox,G)}),M),N=()=>v=>(v.addEventListener(V.Ox,function O(){if(window.location.hash){var M,G;const ue=window.location.hash.slice(1);(G=v)===null||G===void 0||(M=G.querySelector(`[id="${ue}"]`))===null||M===void 0||M.scrollIntoView()}v.removeEventListener(V.Ox,O)}),v),ae=()=>v=>(setTimeout(()=>{var O;const M=(O=v)===null||O===void 0?void 0:O.querySelectorAll("li.md-nav__item--active");M.length!==0&&(M.forEach(ue=>{var be,ke;const Qe=(be=ue)===null||be===void 0?void 0:be.querySelector("input");if(!(!((ke=Qe)===null||ke===void 0)&&ke.checked)){var tt;(tt=Qe)===null||tt===void 0||tt.click()}}),M[M.length-1].scrollIntoView())},200),v),Ae=async(v,O)=>{let M;if(typeof v=="string")M=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)M=v;else throw new Error("dom is not a recognized type");for(const G of O)M=await G(M);return M};var Ze=n(73557);function qe(v,O){const M=new URL(O),G=`${M.origin}${M.pathname.replace(/\/$/,"")}`,ue=v.replace(G,"").replace(/^\/+/,""),be=new URL(`http://localhost/${ue}`);return`${be.pathname}${be.search}${be.hash}`}function Pt(){const v=(0,Ze.s0)(),M=(0,K.h_)(K.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let be=ue;if(M)try{be=qe(ue,M)}catch{}v(be)},[v,M])}const $t="screen and (max-width: 76.1875em)",Qt=v=>{const O=Pt(),M=(0,xe.Z)(),G=(0,Se.Z)($t),ue=Ht(),be=gn(),ke=(0,K.z$)(),Qe=(0,K.h_)(V.Dl),tt=(0,K.h_)(B.q3),{state:yt,path:bt,content:ct}=(0,w.DK)(),[Oe,wt]=(0,p.useState)(null),qt=(0,V.ux)(Oe),jt=(0,p.useCallback)(()=>{if(!Oe)return;Oe.querySelectorAll(".md-sidebar").forEach(mt=>{if(G)mt.style.top="0px";else{var Lt,Wt,en;const vn=(Lt=document)===null||Lt===void 0?void 0:Lt.querySelector(".techdocs-reader-page");var gr;const Un=(gr=(Wt=vn)===null||Wt===void 0?void 0:Wt.getBoundingClientRect().top)!==null&&gr!==void 0?gr:0;var mr;let vr=(mr=Oe.getBoundingClientRect().top)!==null&&mr!==void 0?mr:0;const Fr=Oe.querySelector(".md-container > .md-tabs");var Xn;const Mn=(Xn=(en=Fr)===null||en===void 0?void 0:en.getBoundingClientRect().height)!==null&&Xn!==void 0?Xn:0;vr<Un&&(vr=Un),mt.style.top=`${Math.max(vr,0)+Mn}px`}mt.style.setProperty("opacity","1")})},[Oe,G]);(0,p.useEffect)(()=>(window.addEventListener("resize",jt),window.addEventListener("scroll",jt,!0),()=>{window.removeEventListener("resize",jt),window.removeEventListener("scroll",jt,!0)}),[Oe,jt]);const Zt=(0,p.useCallback)(()=>{if(!Oe)return;const Bt=Oe.querySelector(".md-footer");Bt&&(Bt.style.width=`${Oe.getBoundingClientRect().width}px`)},[Oe]);(0,p.useEffect)(()=>(window.addEventListener("resize",Zt),()=>{window.removeEventListener("resize",Zt)}),[Oe,Zt]),(0,p.useEffect)(()=>{qt||(Zt(),jt())},[yt,qt,Zt,jt]);const _t=(0,p.useCallback)((Bt,mt)=>Ae(Bt,[ue,ln({techdocsStorageApi:Qe,entityId:v,path:mt}),Jt(),Xe(),pe(),Re(),pn(tt),be]),[v,tt,Qe,ue,be]),wn=(0,p.useCallback)(async Bt=>Ae(Bt,[N(),ae(),we(M),Ye({baseUrl:window.location.origin,onClick:(mt,Lt)=>{var Wt;const en=mt.ctrlKey||mt.metaKey,gr=new URL(Lt),mr=((Wt=mt.target)===null||Wt===void 0?void 0:Wt.innerText)||Lt,Xn=Lt.replace(window.location.origin,"");if(ke.captureEvent("click",mr,{attributes:{to:Xn}}),gr.hash)if(en)window.open(Lt,"_blank");else{var vn,Un;O(Lt),(Un=Bt)===null||Un===void 0||(vn=Un.querySelector(`[id="${gr.hash.slice(1)}"]`))===null||vn===void 0||vn.scrollIntoView()}else en?window.open(Lt,"_blank"):O(Lt)}}),H({onLoading:()=>{},onLoaded:()=>{var mt;(mt=Bt.querySelector(".md-nav__title"))===null||mt===void 0||mt.removeAttribute("for")}}),H({onLoading:()=>{Array.from(Bt.querySelectorAll(".md-sidebar")).forEach(Lt=>{Lt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,O,ke]);return(0,p.useEffect)(()=>{if(!ct)return()=>{};let Bt=!0;return _t(ct,bt).then(async mt=>{var Lt;if(!(!((Lt=mt)===null||Lt===void 0)&&Lt.innerHTML)||!Bt)return;window.scroll({top:0});const Wt=await wn(mt);wt(Wt)}),()=>{Bt=!1}},[ct,bt,_t,wn]),Oe};var Xt=n(8560);const an=()=>{var v,O,M,G,ue;const be=(0,V.$L)(),{shadowRoot:ke}=(0,V.x1)(),Qe=(v=ke)===null||v===void 0?void 0:v.querySelector('[data-md-component="content"]'),tt=(O=ke)===null||O===void 0?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let yt=(M=tt)===null||M===void 0?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');if(!yt){var bt;yt=document.createElement("div"),yt.setAttribute("data-techdocs-addons-location","primary sidebar"),(bt=tt)===null||bt===void 0||bt.prepend(yt)}const ct=(G=ke)===null||G===void 0?void 0:G.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Oe=(ue=ct)===null||ue===void 0?void 0:ue.querySelector('[data-techdocs-addons-location="secondary sidebar"]');if(!Oe){var wt;Oe=document.createElement("div"),Oe.setAttribute("data-techdocs-addons-location","secondary sidebar"),(wt=ct)===null||wt===void 0||wt.prepend(Oe)}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xt.Z,{container:yt,children:be.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,r.jsx)(Xt.Z,{container:Qe,children:be.renderComponentsByLocation(V.oZ.Content)}),(0,r.jsx)(Xt.Z,{container:Oe,children:be.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},ne=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),te=(0,w.m1)(v=>{var O,M;const{withSearch:G=!0,onReady:ue}=v,be=ne(),{entityMetadata:{value:ke,loading:Qe},entityRef:tt,setShadowRoot:yt}=(0,V.x1)(),bt=Qt(tt),ct=(0,p.useCallback)(Oe=>{yt(Oe),ue instanceof Function&&ue()},[yt,ue]);return Qe===!1&&!ke?(0,r.jsx)(m.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):bt?(0,r.jsx)(m.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(Z,{})}),G&&(0,r.jsx)(f.Z,{className:be.search,xs:"auto",item:!0,children:(0,r.jsx)(h.S,{entityId:tt,entityTitle:(M=ke)===null||M===void 0||(O=M.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(V.VA,{element:bt,onAppend:ct,children:(0,r.jsx)(an,{})})})]})}):(0,r.jsx)(m.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(Z,{})})})})}),Y=null},93225:function(It,Pe,n){"use strict";n.d(Pe,{S:function(){return se}});var r=n(52322),p=n(2784),W=n(18671),f=n(60905),V=n(98069),m=n(60364),h=n(73250),F=n(61886),ve=n(39709),ce=n(25271),z=n(53974),de=n(60871),$=n(76635),A=n(95573);const oe=(0,r.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),se=ee=>{var X,K,T;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:I}=ee,Z=(0,F.$L)(),xe=(0,de.h_)(de.Ds),{title:Se,setTitle:B,subtitle:Ge,setSubtitle:xt,entityRef:Nt,metadata:{value:zt,loading:Tt},entityMetadata:{value:Ft,loading:Yt}}=(0,F.x1)();(0,p.useEffect)(()=>{zt&&(B(zt.site_name),xt(()=>{let{site_description:rt}=zt;return(!rt||rt==="None")&&(rt=""),rt}))},[zt,B,xt]);const dt=xe.getOptional("app.title")||"Backstage",ut=[Se,Ge,dt].filter(Boolean).join(" | "),{locationMetadata:St,spec:lt}=Ft||{},Ut=(X=lt)===null||X===void 0?void 0:X.lifecycle,Ht=Ft?(0,ve.hF)(Ft,ce.S4):[],Ce=(0,de.tg)(A._Z)(),$e=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.i9,{label:(0,$.capitalize)(((K=Ft)===null||K===void 0?void 0:K.kind)||"entity"),value:(0,r.jsx)(ve.dx,{color:"inherit",entityRef:Nt,title:(T=Ft)===null||T===void 0?void 0:T.metadata.title,defaultKind:"Component"})}),Ht.length>0&&(0,r.jsx)(z.i9,{label:"Owner",value:(0,r.jsx)(ve.rI,{color:"inherit",entityRefs:Ht,defaultKind:"group"})}),Ut?(0,r.jsx)(z.i9,{label:"Lifecycle",value:Ut}):null,St&&St.type!=="dir"&&St.type!=="file"?(0,r.jsx)(z.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:w},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(h.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:St.target}):null]});return!Yt&&Ft===void 0||!Tt&&zt===void 0?null:(0,r.jsxs)(z.h4,{type:"Documentation",typeLink:Ce,title:Se||oe,subtitle:Ge===""?void 0:Ge||oe,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:ut})}),$e,I,Z.renderComponentsByLocation(F.oZ.Header)]})}},65124:function(It,Pe,n){"use strict";n.d(Pe,{b:function(){return de}});var r=n(52322),p=n(2784),W=n(79692),f=n(15223),V=n(95544),m=n(80030),h=n(61837),F=n(48348),ve=n(47603),ce=n(61886);const z=(0,W.Z)($=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:$.spacing(3,3,0),"@media print":{display:"none"}}})),de=$=>{const A=z(),[oe,se]=(0,p.useState)(null),ee=(0,p.useCallback)(xe=>{se(xe.currentTarget)},[]),X=(0,p.useCallback)(()=>{se(null)},[]),{entityMetadata:{value:K,loading:T}}=(0,ce.x1)(),w=(0,ce.$L)(),I=w.renderComponentsByLocation(ce.oZ.Subheader),Z=w.renderComponentsByLocation(ce.oZ.Settings);return!I&&!Z||T===!1&&!K?null:(0,r.jsx)(f.Z,{classes:A,...$.toolbarProps,children:(0,r.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[I,Z?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{title:"Settings",children:(0,r.jsx)(h.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ee,children:(0,r.jsx)(ve.Z,{})})}),(0,r.jsx)(F.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:oe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(oe),onClose:X,keepMounted:!0,children:(0,r.jsx)("div",{children:Z})})]}):null]})})}},95481:function(It,Pe,n){"use strict";n.d(Pe,{DK:function(){return de},m1:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(61886),V=n(60871),m=n(64279),h=n(77446);function F({contentLoading:oe,content:se,activeSyncState:ee}){return oe||ee==="BUILD_READY_RELOAD"||!se&&ee==="CHECKING"?"CHECKING":!se&&ee==="BUILDING"?"INITIAL_BUILD":se?ee==="BUILDING"?"CONTENT_STALE_REFRESHING":ee==="BUILD_READY"?"CONTENT_STALE_READY":ee==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ve(oe,se){const ee={...oe};switch(se.type){case"sync":se.state==="CHECKING"&&(ee.buildLog=[]),ee.activeSyncState=se.state,ee.syncError=se.syncError;break;case"contentLoading":ee.contentLoading=!0,ee.contentError=void 0;break;case"content":typeof se.path=="string"&&(ee.path=se.path),ee.contentLoading=!1,ee.content=se.content,ee.contentError=se.contentError;break;case"buildLog":ee.buildLog=ee.buildLog.concat(se.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ee.activeSyncState)&&["contentLoading","content"].includes(se.type)&&(ee.activeSyncState="UP_TO_DATE",ee.buildLog=[]),ee}function ce(oe,se,ee,X){var K,T;const[w,I]=(0,p.useReducer)(ve,{activeSyncState:"CHECKING",path:X,contentLoading:!0,buildLog:[]}),Z=(0,V.h_)(f.Dl),{retry:xe}=(0,h.Z)(async()=>{I({type:"contentLoading"});try{const Ge=await Z.getEntityDocs({kind:oe,namespace:se,name:ee},X);return I({type:"content",content:Ge,path:X}),Ge}catch(Ge){I({type:"content",contentError:Ge,path:X})}},[Z,oe,se,ee,X]),Se=(0,p.useRef)({content:void 0,reload:()=>{}});return Se.current={content:w.content,reload:xe},(0,m.default)(async()=>{I({type:"sync",state:"CHECKING"});const Ge=setTimeout(()=>{I({type:"sync",state:"BUILDING"})},1e3);try{switch(await Z.syncEntityDocs({kind:oe,namespace:se,name:ee},Nt=>{I({type:"buildLog",log:Nt})})){case"updated":Se.current.content?I({type:"sync",state:"BUILD_READY"}):(Se.current.reload(),I({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":I({type:"sync",state:"UP_TO_DATE"});break;default:I({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(xt){I({type:"sync",state:"ERROR",syncError:xt})}finally{clearTimeout(Ge)}},[oe,ee,se,Z,I,Se]),{state:(0,p.useMemo)(()=>F({activeSyncState:w.activeSyncState,contentLoading:w.contentLoading,content:w.content}),[w.activeSyncState,w.content,w.contentLoading]),contentReload:xe,path:w.path,content:w.content,contentErrorMessage:(K=w.contentError)===null||K===void 0?void 0:K.toString(),syncErrorMessage:(T=w.syncError)===null||T===void 0?void 0:T.toString(),buildLog:w.buildLog}}const z=(0,p.createContext)({}),de=()=>(0,p.useContext)(z),$=oe=>{const{children:se}=oe,{"*":ee=""}=(0,W.UO)(),{entityRef:X}=(0,f.x1)(),{kind:K,namespace:T,name:w}=X,I=ce(K,T,w,ee);return(0,r.jsx)(z.Provider,{value:I,children:se instanceof Function?se(I):se})},A=oe=>se=>(0,r.jsx)($,{children:(0,r.jsx)(oe,{...se})})},95573:function(It,Pe,n){"use strict";n.d(Pe,{Fw:function(){return W},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),W=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{TechDocsSearchResultListItem:function(){return ce}});var r=n(52322),p=n(2784),W=n(79692),f=n(49378),V=n(86136),m=n(90436),h=n(53974),F=n(15096);const ve=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ce=z=>{const{result:de,highlight:$,lineClamp:A=5,asListItem:oe=!0,asLink:se=!0,title:ee,icon:X}=z,K=ve(),T=({children:Z})=>se?(0,r.jsx)(h.rU,{noTrack:!0,to:de.location,children:Z}):(0,r.jsx)(r.Fragment,{children:Z}),w=()=>{var Z,xe,Se,B;const Ge=!((Z=$)===null||Z===void 0)&&Z.fields.title?(0,r.jsx)(F.FA,{text:$.fields.title,preTag:$.preTag,postTag:$.postTag}):de.title,xt=!((xe=$)===null||xe===void 0)&&xe.fields.entityTitle?(0,r.jsx)(F.FA,{text:$.fields.entityTitle,preTag:$.preTag,postTag:$.postTag}):de.entityTitle,Nt=!((Se=$)===null||Se===void 0)&&Se.fields.name?(0,r.jsx)(F.FA,{text:$.fields.name,preTag:$.preTag,postTag:$.postTag}):de.name;return de?(0,r.jsx)(f.Z,{className:K.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(T,{children:ee||(0,r.jsxs)(r.Fragment,{children:[Ge," | ",xt!=null?xt:Nt," docs"]})}),secondary:(0,r.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((B=$)===null||B===void 0)&&B.fields.text?(0,r.jsx)(F.FA,{text:$.fields.text,preTag:$.preTag,postTag:$.postTag}):de.text})}):null},I=({children:Z})=>oe?(0,r.jsxs)(r.Fragment,{children:[X&&(0,r.jsx)(V.Z,{children:typeof X=="function"?X(de):X}),(0,r.jsx)("div",{className:K.flexContainer,children:Z})]}):(0,r.jsx)(r.Fragment,{children:Z});return(0,r.jsx)(I,{children:(0,r.jsx)(w,{})})}},22478:function(It,Pe,n){"use strict";n.d(Pe,{S:function(){return F}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),V=n(55511);const m=ve=>{var ce;return(ce=ve)===null||ce===void 0?void 0:ce.document},h=ve=>{const{entityId:ce,entityTitle:z,debounceTime:de=150}=ve,[$,A]=(0,W.useState)(!1),oe=(0,f.s0)(),{setFilters:se,result:{loading:ee,value:X}}=(0,p.Rx)(),[K,T]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Se=!0;if(Se&&X){const B=X.results.slice(0,10);T(B)}return()=>{Se=!1}},[ee,X]);const{kind:w,name:I,namespace:Z}=ce;(0,W.useEffect)(()=>{se(Se=>({...Se,kind:w,namespace:Z,name:I}))},[w,Z,I,se]);const xe=(Se,B)=>{if(m(B)){const{location:Ge}=B.document;oe(Ge)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:$,getOptionLabel:()=>"",filterOptions:Se=>Se,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:xe,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:K,renderOption:({document:Se,highlight:B})=>(0,r.jsx)(V.TechDocsSearchResultListItem,{result:Se,lineClamp:3,asListItem:!1,asLink:!1,title:Se.title,highlight:B}),loading:ee,inputDebounceTime:de,inputPlaceholder:`Search ${z||ce.name} docs`,freeSolo:!1})},F=ve=>{const ce={term:"",types:["techdocs"],pageCursor:"",filters:ve.entityId};return(0,r.jsx)(p.Nd,{initialState:ce,children:(0,r.jsx)(h,{...ve})})}},53260:function(){}},function(It){var Pe=function(r){return It(It.s=r)};It.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Pe(30966)});var n=It.O()}]);})();
521
-
522
- //# sourceMappingURL=main.9303dbab.js.map