@techdocs/cli 1.4.2 → 1.4.3-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/embedded-app/.config-schema.json +15 -5
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.8b636047.chunk.js → 1032.7ce0a1c1.chunk.js} +1 -1
- package/dist/embedded-app/static/1032.7ce0a1c1.chunk.js.map +1 -0
- package/dist/embedded-app/static/1049.fc74e20d.chunk.js +7 -0
- package/dist/embedded-app/static/1049.fc74e20d.chunk.js.map +1 -0
- package/dist/embedded-app/static/{1105.82a0fd7f.chunk.js → 1105.4188674a.chunk.js} +1 -1
- package/dist/embedded-app/static/{2440.5e8d7e92.chunk.js.map → 1105.4188674a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.44692312.chunk.js → 184.0dc35b3d.chunk.js} +1 -1
- package/dist/embedded-app/static/{1105.82a0fd7f.chunk.js.map → 184.0dc35b3d.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.5e8d7e92.chunk.js → 2440.31c0e92f.chunk.js} +1 -1
- package/dist/embedded-app/static/2440.31c0e92f.chunk.js.map +1 -0
- package/dist/embedded-app/static/{5458.b84b2f47.chunk.js → 5458.93917a3c.chunk.js} +1 -1
- package/dist/embedded-app/static/5458.93917a3c.chunk.js.map +1 -0
- package/dist/embedded-app/static/{6051.56a76749.chunk.js → 6051.098a0af9.chunk.js} +1 -1
- package/dist/embedded-app/static/6051.098a0af9.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.1e19510d.chunk.js → 732.68398828.chunk.js} +1 -1
- package/dist/embedded-app/static/732.68398828.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7560.785ca5bd.chunk.js → 7560.83ca9e57.chunk.js} +1 -1
- package/dist/embedded-app/static/7560.83ca9e57.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7670.ae73207b.chunk.js → 7670.f17f89be.chunk.js} +1 -1
- package/dist/embedded-app/static/7670.f17f89be.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7750.7eb92a3e.chunk.js → 7750.b4122abf.chunk.js} +1 -1
- package/dist/embedded-app/static/{7750.7eb92a3e.chunk.js.map → 7750.b4122abf.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.ad64462a.chunk.js → 8951.180aa2e1.chunk.js} +1 -1
- package/dist/embedded-app/static/8951.180aa2e1.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9323.b8f35b31.chunk.js → 9323.8831e792.chunk.js} +1 -1
- package/dist/embedded-app/static/9323.8831e792.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9545.262ef793.chunk.js → 9545.0bb9bc30.chunk.js} +1 -1
- package/dist/embedded-app/static/9545.0bb9bc30.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9770.86ef0a38.chunk.js → 9770.3576f25a.chunk.js} +1 -1
- package/dist/embedded-app/static/9770.3576f25a.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.935a0154.js +508 -0
- package/dist/embedded-app/static/main.935a0154.js.map +1 -0
- package/dist/embedded-app/static/{module-luxon.ee277e4b.js → module-luxon.a1854eb9.js} +1 -1
- package/dist/embedded-app/static/{module-luxon.ee277e4b.js.map → module-luxon.a1854eb9.js.map} +1 -1
- package/dist/embedded-app/static/{module-material-table.15353952.js → module-material-table.e97c8359.js} +2 -2
- package/dist/embedded-app/static/{module-material-table.15353952.js.map → module-material-table.e97c8359.js.map} +1 -1
- package/dist/embedded-app/static/module-material-ui.09dab505.js +51 -0
- package/dist/embedded-app/static/module-material-ui.09dab505.js.map +1 -0
- package/dist/embedded-app/static/module-octokit.cbbb7401.js +5 -0
- package/dist/embedded-app/static/module-octokit.cbbb7401.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.cf49e816.js +21 -0
- package/dist/embedded-app/static/module-react-router-dom.cf49e816.js.map +1 -0
- package/dist/embedded-app/static/{module-react-router.3fa3d41e.js → module-react-router.a589137b.js} +4 -4
- package/dist/embedded-app/static/module-react-router.a589137b.js.map +1 -0
- package/dist/embedded-app/static/{module-yaml.639cc746.js → module-yaml.af9b4f42.js} +1 -1
- package/dist/embedded-app/static/{module-yaml.639cc746.js.map → module-yaml.af9b4f42.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.7a6c2e51.js → runtime.935a0154.js} +2 -2
- package/dist/embedded-app/static/{runtime.7a6c2e51.js.map → runtime.935a0154.js.map} +1 -1
- package/dist/embedded-app/static/vendor.935a0154.js +212 -0
- package/dist/embedded-app/static/vendor.935a0154.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/1032.8b636047.chunk.js.map +0 -1
- package/dist/embedded-app/static/1049.dd1f0d99.chunk.js +0 -7
- package/dist/embedded-app/static/1049.dd1f0d99.chunk.js.map +0 -1
- package/dist/embedded-app/static/184.44692312.chunk.js.map +0 -1
- package/dist/embedded-app/static/5458.b84b2f47.chunk.js.map +0 -1
- package/dist/embedded-app/static/6051.56a76749.chunk.js.map +0 -1
- package/dist/embedded-app/static/732.1e19510d.chunk.js.map +0 -1
- package/dist/embedded-app/static/7560.785ca5bd.chunk.js.map +0 -1
- package/dist/embedded-app/static/7670.ae73207b.chunk.js.map +0 -1
- package/dist/embedded-app/static/8951.ad64462a.chunk.js.map +0 -1
- package/dist/embedded-app/static/9323.b8f35b31.chunk.js.map +0 -1
- package/dist/embedded-app/static/9545.262ef793.chunk.js.map +0 -1
- package/dist/embedded-app/static/9770.86ef0a38.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.7a6c2e51.js +0 -508
- package/dist/embedded-app/static/main.7a6c2e51.js.map +0 -1
- package/dist/embedded-app/static/module-material-ui.e267eac9.js +0 -51
- package/dist/embedded-app/static/module-material-ui.e267eac9.js.map +0 -1
- package/dist/embedded-app/static/module-octokit.10809b9e.js +0 -5
- package/dist/embedded-app/static/module-octokit.10809b9e.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.87e15add.js +0 -21
- package/dist/embedded-app/static/module-react-router-dom.87e15add.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.3fa3d41e.js.map +0 -1
- package/dist/embedded-app/static/vendor.7a6c2e51.js +0 -252
- package/dist/embedded-app/static/vendor.7a6c2e51.js.map +0 -1
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(Ct,$e,r){"use strict";r.d($e,{n3:function(){return g},MS:function(){return ve}});var t=r(87612),h=r(25271),H=r(23054),f=r(96279),W=r.n(f);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function u(ue){return!ue.cursor}function B(ue){return!u(ue)}class ve{async getEntityAncestors(V,K){const{kind:I,namespace:w,name:ie}=(0,h.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(ie)}/ancestry`,K)}async getLocationById(V,K){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,K)}async getEntities(V,K){const{filter:I=[],fields:w=[],order:ie,offset:ee,limit:ne,after:$}=V!=null?V:{},T=this.getParams(I);if(w.length&&T.push(`fields=${w.map(encodeURIComponent).join(",")}`),ie)for(const oe of[ie].flat())oe&&T.push(`order=${encodeURIComponent(oe.order)}:${encodeURIComponent(oe.field)}`);ee!==void 0&&T.push(`offset=${ee}`),ne!==void 0&&T.push(`limit=${ne}`),$!==void 0&&T.push(`after=${encodeURIComponent($)}`);const P=T.length?`?${T.join("&")}`:"",L=await this.requestRequired("GET",`/entities${P}`,K),O=(oe,Le)=>{var ze,z;if(((ze=oe.metadata)===null||ze===void 0?void 0:ze.name)===void 0||oe.kind===void 0||((z=Le.metadata)===null||z===void 0?void 0:z.name)===void 0||Le.kind===void 0)return 0;const yt=(0,h.eE)(oe),ot=(0,h.eE)(Le);return yt<ot?-1:yt>ot?1:0};return{items:L.sort(O)}}async getEntitiesByRefs(V,K){var I;const w={entityRefs:V.entityRefs};!((I=V.fields)===null||I===void 0)&&I.length&&(w.fields=V.fields);const ee=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,ne=await this.fetchApi.fetch(ee,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify(w)});if(!ne.ok)throw await H.VL.fromResponse(ne);const{items:$}=await ne.json();return{items:$.map(T=>T!=null?T:void 0)}}async queryEntities(V={},K){const I=[];if(u(V)){var w,ie;const{fields:ne=[],filter:$,limit:T,orderFields:P,fullTextFilter:L}=V;I.push(...this.getParams($)),T!==void 0&&I.push(`limit=${T}`),P!==void 0&&(Array.isArray(P)?P:[P]).forEach(({field:oe,order:Le})=>I.push(`orderField=${oe},${Le}`)),ne.length&&I.push(`fields=${ne.map(encodeURIComponent).join(",")}`);const O=L==null||(w=L.term)===null||w===void 0?void 0:w.trim();O&&I.push(`fullTextFilterTerm=${O}`),!(L==null||(ie=L.fields)===null||ie===void 0)&&ie.length&&I.push(`fullTextFilterFields=${L.fields.join(",")}`)}else{const{fields:ne=[],limit:$,cursor:T}=V;I.push(`cursor=${T}`),$!==void 0&&I.push(`limit=${$}`),ne.length&&I.push(`fields=${ne.map(encodeURIComponent).join(",")}`)}const ee=I.length?`?${I.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${ee}`,K)}async getEntityByRef(V,K){const{kind:I,namespace:w,name:ie}=(0,h.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(ie)}`,K)}async getEntityByName(V,K){const{kind:I,namespace:w="default",name:ie}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(w)}/${encodeURIComponent(ie)}`,K)}async refreshEntity(V,K){const I=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify({entityRef:V})});if(I.status!==200)throw new Error(await I.text())}async getEntityFacets(V,K){const{filter:I=[],facets:w}=V,ie=this.getParams(I);for(const ne of w)ie.push(`facet=${encodeURIComponent(ne)}`);const ee=ie.length?`?${ie.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${ee}`,K)}async addLocation(V,K){const{type:I="url",target:w,dryRun:ie}=V,ee=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${ie?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(K==null?void 0:K.token)&&{Authorization:`Bearer ${K==null?void 0:K.token}`}},method:"POST",body:JSON.stringify({type:I,target:w})});if(ee.status!==201)throw new Error(await ee.text());const{location:ne,entities:$,exists:T}=await ee.json();if(!ne)throw new Error(`Location wasn't added: ${w}`);return{location:ne,entities:$,exists:T}}async getLocationByRef(V,K){return(await this.requestRequired("GET","/locations",K)).map(w=>w.data).find(w=>V===(0,h.NZ)(w))}async removeLocationById(V,K){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,K)}async removeEntityByUid(V,K){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,K)}async validateEntity(V,K,I){const w=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(I==null?void 0:I.token)&&{Authorization:`Bearer ${I==null?void 0:I.token}`}},method:"POST",body:JSON.stringify({entity:V,location:K})});if(w.ok)return{valid:!0};if(w.status!==400)throw await H.VL.fromResponse(w);const{errors:ie=[]}=await w.json();return{valid:!1,errors:ie}}async requestIgnored(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,ie=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(w,{method:V,headers:ie});if(!ee.ok)throw await H.VL.fromResponse(ee)}async requestRequired(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,ie=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(w,{method:V,headers:ie});if(!ee.ok)throw await H.VL.fromResponse(ee);return ee.json()}async requestOptional(V,K,I){const w=`${await this.discoveryApi.getBaseUrl("catalog")}${K}`,ie=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(w,{method:V,headers:ie});if(!ee.ok){if(ee.status===404)return;throw await H.VL.fromResponse(ee)}return await ee.json()}getParams(V=[]){const K=[];for(const I of[V].flat()){const w=[];for(const[ie,ee]of Object.entries(I))for(const ne of[ee].flat())ne===g?w.push(encodeURIComponent(ie)):typeof ne=="string"&&w.push(`${encodeURIComponent(ie)}=${encodeURIComponent(ne)}`);w.length&&K.push(`filter=${w.join(",")}`)}return K}constructor(V){(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:W()}}}},25271:function(Ct,$e,r){"use strict";r.d($e,{Tf:function(){return H},P1:function(){return ln},q1:function(){return Tn},M6:function(){return Ce},l2:function(){return h},zG:function(){return t},w$:function(){return Ln},nP:function(){return fn},aS:function(){return _n},S4:function(){return Bt},cz:function(){return ut},iB:function(){return St},CV:function(){return Xe},of:function(){return It},Ou:function(){return Oe},eE:function(){return xt},NZ:function(){return Me}});const t="default",h="backstage.io/view-url",H="backstage.io/edit-url",f="kubernetes.io/api-server",W="kubernetes.io/api-server-certificate-authority",g="kubernetes.io/auth-provider";var u=r(76635),B=r.n(u);class ve{async enforce(D){return D.metadata.namespace?D:lodash.merge({metadata:{namespace:this.namespace}},D)}constructor(D=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=D}}class ue{static isValidPrefixAndOrSuffix(D,me,De,et){if(typeof D!="string")return!1;const it=D.split(me);return it.length===1?et(it[0]):it.length===2?De(it[0])&&et(it[1]):!1}static isJsonSafe(D){try{return B().isEqual(D,JSON.parse(JSON.stringify(D)))}catch{return!1}}static isValidDnsSubdomain(D){return typeof D=="string"&&D.length>=1&&D.length<=253&&D.split(".").every(ue.isValidDnsLabel)}static isValidDnsLabel(D){return typeof D=="string"&&D.length>=1&&D.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(D)}static isValidTag(D){return typeof D=="string"&&D.length>=1&&D.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(D)}static isValidUrl(D){if(typeof D!="string")return!1;try{return new URL(D),!0}catch{return!1}}static isValidString(D){var me;return typeof D=="string"&&((me=D==null?void 0:D.trim())===null||me===void 0?void 0:me.length)>=1}static isNonEmptyString(D){var me;return typeof D=="string"&&((me=D==null?void 0:D.trim())===null||me===void 0?void 0:me.length)>=1}}var V=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),K=r(27991),I=r.n(K),w=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),ie=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}}}}}}'),ee=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const ne=new Map,$=[V,w,ie,ee];function T(se){if(!(se!=null&&se.length))throw new TypeError("Unknown error");const D=se[0];throw new TypeError(`${D.instancePath||"<root>"} ${D.message}${D.params?` - ${Object.entries(D.params).map(([me,De])=>`${me}: ${De}`).join(", ")}`:""}`)}function P(se,D={}){var me;const De=(me=D==null?void 0:D.disableCache)!==null&&me!==void 0?me:!1,et=De?"":JSON.stringify(se);if(!De){const Qt=ne.get(et);if(Qt)return Qt}const it=L(se),kt=new(I())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});it.length&&kt.addSchema(it,void 0,void 0,!0);const Ft=kt.compile(se);return De||ne.set(et,Ft),Ft}function L(se){if(typeof se!="object")return[];const D=new Set;se.$id&&D.add(se.$id);const me=new Array,De=[se];for(;De.length;){const et=De.pop();for(const it of O(et))if(!D.has(it)){D.add(it);const kt=$.find(Ft=>Ft.$id===it);kt&&(me.push(kt),De.push(kt))}}return me}function*O(se){const D=[se];for(;D.length;){const me=D.pop();if(typeof me=="object"&&me)for(const[De,et]of Object.entries(me))De==="$ref"&&typeof et=="string"?yield et.split("#")[0]:D.push(et)}}function oe(se){const D=compileAjvSchema(se||entityEnvelopeSchema);return me=>{if(D(me)===!0)return me;throw throwAjvError(D.errors)}}function Le(se){const D=P(se);return me=>{var De;if(D(me)===!0)return me;const it=(De=D.errors)===null||De===void 0?void 0:De.filter(kt=>["/kind","/apiVersion"].includes(kt.instancePath));if(it!=null&&it.length&&it.every(kt=>kt.keyword==="enum"))return!1;throw T(D.errors)}}function ze(se){const D=compileAjvSchema(se||entitySchema);return me=>{if(D(me)===!0)return me;throw throwAjvError(D.errors)}}class z{static isValidApiVersion(D){return ue.isValidPrefixAndOrSuffix(D,"/",ue.isValidDnsSubdomain,me=>me.length>=1&&me.length<=63&&/^[a-z0-9A-Z]+$/.test(me))}static isValidKind(D){return typeof D=="string"&&D.length>=1&&D.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(D)}static isValidObjectName(D){return typeof D=="string"&&D.length>=1&&D.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(D)}static isValidNamespace(D){return ue.isValidDnsLabel(D)}static isValidLabelKey(D){return ue.isValidPrefixAndOrSuffix(D,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidLabelValue(D){return D===""||z.isValidObjectName(D)}static isValidAnnotationKey(D){return ue.isValidPrefixAndOrSuffix(D,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidAnnotationValue(D){return typeof D=="string"}}const yt={isValidApiVersion:z.isValidApiVersion,isValidKind:z.isValidKind,isValidEntityName:z.isValidObjectName,isValidNamespace:z.isValidNamespace,isValidLabelKey:z.isValidLabelKey,isValidLabelValue:z.isValidLabelValue,isValidAnnotationKey:z.isValidAnnotationKey,isValidAnnotationValue:z.isValidAnnotationValue,isValidTag:se=>typeof se=="string"&&se.length>=1&&se.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(se)};function ot(se={}){return{...yt,...se}}class He{async enforce(D){function me(le,y,Z){if(y==null)throw new Error(`${le} must have a value`);let q;try{q=Z(y)}catch(Y){throw new Error(`${le} could not be validated, ${Y}`)}if(!q){let Y;switch(Z.name){case"isValidLabelValue":case"isValidObjectName":Y="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":Y="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Y="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Y="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Y="a string";break;case"isValidKind":Y="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Y="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Y="a non empty string";break;default:Y=void 0;break}const we=Y?` expected ${Y} but found "${y}".`:"";throw new Error(`"${le}" is not valid;${we} 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 De(le,y,Z){return y===void 0||me(le,y,Z)}me("apiVersion",D.apiVersion,this.validators.isValidApiVersion),me("kind",D.kind,this.validators.isValidKind),me("metadata.name",D.metadata.name,this.validators.isValidEntityName),De("metadata.namespace",D.metadata.namespace,this.validators.isValidNamespace);var et;for(const[le,y]of Object.entries((et=D.metadata.labels)!==null&&et!==void 0?et:[]))me(`labels.${le}`,le,this.validators.isValidLabelKey),me(`labels.${le}`,y,this.validators.isValidLabelValue);var it;for(const[le,y]of Object.entries((it=D.metadata.annotations)!==null&&it!==void 0?it:[]))me(`annotations.${le}`,le,this.validators.isValidAnnotationKey),me(`annotations.${le}`,y,this.validators.isValidAnnotationValue);var kt;const Ft=(kt=D.metadata.tags)!==null&&kt!==void 0?kt:[];for(let le=0;le<Ft.length;++le)me(`tags.${le}`,Ft[le],this.validators.isValidTag);var Qt;const _=(Qt=D.metadata.links)!==null&&Qt!==void 0?Qt:[];for(let le=0;le<_.length;++le){var J,te,pe;me(`links.${le}.url`,(J=_[le])===null||J===void 0?void 0:J.url,CommonValidatorFunctions.isValidUrl),De(`links.${le}.title`,(te=_[le])===null||te===void 0?void 0:te.title,CommonValidatorFunctions.isNonEmptyString),De(`links.${le}.icon`,(pe=_[le])===null||pe===void 0?void 0:pe.icon,KubernetesValidatorFunctions.isValidObjectName)}return D}constructor(D=makeValidator()){_define_property(this,"validators",void 0),this.validators=D}}class st{async enforce(D){if(!this.validate){const et=new Ajv({allowUnionTypes:!0});this.validate=et.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(D)===!0)return D;const[De]=this.validate.errors||[];throw De?new Error(`Malformed envelope, ${De.instancePath||"<root>"} ${De.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Qe(se){let D=se.indexOf(":");const me=se.indexOf("/");me!==-1&&me<D&&(D=-1);const De=D===-1?void 0:se.slice(0,D),et=me===-1?void 0:se.slice(D+1,me),it=se.slice(Math.max(D+1,me+1));if(De===""||et===""||it==="")throw new TypeError(`Entity reference "${se}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:De,namespace:et,name:it}}function St(se){return{kind:se.kind,namespace:se.metadata.namespace||t,name:se.metadata.name}}function It(se,D){if(!se)throw new Error("Entity reference must not be empty");const me=D==null?void 0:D.defaultKind,De=(D==null?void 0:D.defaultNamespace)||t;let et,it,kt;if(typeof se=="string"){const te=Qe(se);var Ft;et=(Ft=te.kind)!==null&&Ft!==void 0?Ft:me;var Qt;it=(Qt=te.namespace)!==null&&Qt!==void 0?Qt:De,kt=te.name}else{var _;et=(_=se.kind)!==null&&_!==void 0?_:me;var J;it=(J=se.namespace)!==null&&J!==void 0?J:De,kt=se.name}if(et)if(it){if(!kt){const te=JSON.stringify(se);throw new Error(`Entity reference ${te} had missing or empty name`)}}else{const te=JSON.stringify(se);throw new Error(`Entity reference ${te} had missing or empty namespace`)}else{const te=JSON.stringify(se);throw new Error(`Entity reference ${te} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:et,namespace:it,name:kt}}function xt(se){let D,me,De;if("metadata"in se){D=se.kind;var et;me=(et=se.metadata.namespace)!==null&&et!==void 0?et:t,De=se.metadata.name}else{D=se.kind;var it;me=(it=se.namespace)!==null&&it!==void 0?it:t,De=se.name}return`${D.toLocaleLowerCase("en-US")}:${me.toLocaleLowerCase("en-US")}/${De.toLocaleLowerCase("en-US")}`}var lt=r(87612);class Pt{async enforce(D){let me=D;for(const De of this.policies){const et=await De.enforce(me);if(!et)throw new Error(`Policy ${De.constructor.name} did not return a result`);me=et}return me}constructor(D){(0,lt._)(this,"policies",void 0),this.policies=D}}class Nt{async enforce(D){for(const me of this.policies){const De=await me.enforce(D);if(De)return De}throw new Error("The entity did not match any known policy")}constructor(D){(0,lt._)(this,"policies",void 0),this.policies=D}}const We={allOf(se){return new Pt(se)},oneOf(se){return new Nt(se)}};var _t=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function ge(se){let D;return{async check(me){return D||(D=Le(se)),D(me)===me}}}const Se=ge(_t);var Fe=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 tt=ge(Fe);var mt=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 bt=ge(mt);var pt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const Ot=ge(pt);var Ht=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 Jt=ge(Ht),Bt="ownedBy",un="ownerOf",Yt="consumesApi",pn="apiConsumedBy",Fn="providesApi",Pn="apiProvidedBy",fn="dependsOn",Ln="dependencyOf",Un="parentOf",tn="childOf",wn="memberOf",Mn="hasMember",ut="partOf",_n="hasPart";var wt=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 ct=ge(wt);var vn=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 Kt=ge(vn);var hn=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 jn=ge(hn),ln="backstage.io/managed-by-location",Tn="backstage.io/managed-by-origin-location",Ce="backstage.io/source-location",ce=/^[\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 Oe(se){if(typeof se!="string")throw new TypeError(`Unable to parse location ref '${se}', unexpected argument ${typeof se}`);const D=se.indexOf(":");if(D<0)throw new TypeError(`Unable to parse location ref '${se}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const me=se.substring(0,D).trim(),De=se.substring(D+1).trim();if(!me||!De)throw new TypeError(`Unable to parse location ref '${se}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(me==="http"||me==="https")throw new TypeError(`Invalid location ref '${se}', please prefix it with 'url:', e.g. 'url:${se}'`);if(ce.test(De))throw new TypeError(`Invalid location ref '${se}', target is a javascript: URL`);return{type:me,target:De}}function Me(se){const{type:D,target:me}=se;if(D){if(!me)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(ce.test(me))throw new TypeError(`Invalid location ref '${D}:${me}', target is a javascript: URL`);return`${D}:${me}`}function Xe(se){var D,me,De,et,it;const kt=(it=(D=se.metadata)===null||D===void 0||(me=D.annotations)===null||me===void 0?void 0:me[Ce])!==null&&it!==void 0?it:(De=se.metadata)===null||De===void 0||(et=De.annotations)===null||et===void 0?void 0:et[ln];if(!kt)throw new Error(`Entity '${xt(se)}' is missing location`);return Oe(kt)}},15332:function(Ct,$e,r){"use strict";r.d($e,{r:function(){return L}});var t=r(52322),h=r(60871),H=r(86689),f=r(79692),W=r(90436),g=r(72779),u=r.n(g),B=r(76635),ve=r(2784),ue=r(73557),V=r(71597);function K(){const[O]=(0,ue.is)((0,t.jsx)(ue.AW,{index:!0,element:(0,t.jsx)("div",{})}));return!O.index}const I=(0,f.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),w=O=>/^([a-z+.-]+):/.test(O),ie=/^[\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 O=function(...Le){const ze=String(Le[0]);if(ie.test(ze))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return ee.apply(this,Le)};O.__backstage=!0,window.open=O}const ne=()=>{try{return(0,h.h_)(h.Ds).getOptionalString("app.baseUrl")}catch{return}},$=()=>{const O="http://sample.dev";var oe;const Le=(oe=ne())!==null&&oe!==void 0?oe:"/",{pathname:ze}=new URL(Le,O);return(0,B.trimEnd)(ze,"/")},T=O=>{let oe=String(O);const Le=$(),ze=w(oe),z=oe.startsWith(Le);return!ze&&!z&&(oe=Le.concat(oe)),oe},P=O=>{if(O instanceof Array)return O.map(P).join(" ").trim();if(typeof O=="object"&&O){var oe;return P(O==null||(oe=O.props)===null||oe===void 0?void 0:oe.children)}return["string","number"].includes(typeof O)?String(O):""},L=ve.forwardRef(({onClick:O,noTrack:oe,...Le},ze)=>{const z=I(),yt=(0,h.z$)(),ot=K()?T(Le.to):Le.to,He=P(Le.children)||ot,st=w(ot),Qe=st&&!!/^https?:/.exec(ot);if(ie.test(ot))throw new Error("Link component rejected javascript: URL as a security precaution");const St=It=>{O==null||O(It),oe||yt.captureEvent("click",He,{attributes:{to:ot}})};return st?(0,t.jsxs)(H.Z,{...Qe?{target:"_blank",rel:"noopener"}:{},...Le,...Le["aria-label"]?{"aria-label":`${Le["aria-label"]}, Opens in a new window`}:{},ref:ze,href:ot,onClick:St,className:u()(z.externalLink,Le.className),children:[Le.children,(0,t.jsx)(W.Z,{component:"span",className:z.visuallyHidden,children:", Opens in a new window"})]}):(0,t.jsx)(H.Z,{...Le,ref:ze,component:V.rU,to:ot,onClick:St})})},53974:function(Ct,$e,r){"use strict";r.d($e,{Oi:function(){return Le},VY:function(){return Ws},yW:function(){return za},XF:function(){return ot},mn:function(){return Ln},NX:function(){return Pt},ub:function(){return ce},mf:function(){return Ka},yu:function(){return dt},h4:function(){return va},M6:function(){return c},i9:function(){return ol},aR:function(){return n},rJ:function(){return jr},Oh:function(){return dl},hu:function(){return al},rU:function(){return ue.r},Qj:function(){return K},nU:function(){return br},SA:function(){return or},sk:function(){return it},Or:function(){return Dr},T3:function(){return ya},g9:function(){return pl},Ex:function(){return no},Gk:function(){return Mt},tn:function(){return a},Ph:function(){return C},YE:function(){return Bn},v7:function(){return wi},R6:function(){return Us},tR:function(){return Ki},uw:function(){return ae},qt:function(){return Cs},iA:function(){return ma},GB:function(){return vt},po:function(){return Ar},mZ:function(){return xo},Pf:function(){return es}});var t=r(52322),h=r(60871),H=r(19928),f=r(2784);function W(e){const[o,l]=useState([]),d=useApi(alertApiRef),{anchorOrigin:m={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,j=v!=null?v:5e3;useEffect(()=>{const U=d.alert$().subscribe(fe=>l(he=>he.concat(fe)));return()=>{U.unsubscribe()}},[d]);const[F]=o;if(useEffect(()=>{if(F&&F.display==="transient"){const U=setTimeout(()=>{l(fe=>{const he=fe.filter(Pe=>Pe!==F);return he.length===fe.length?fe:he})},j);return()=>clearTimeout(U)}},[F,j]),o.length===0)return null;const G=()=>{l(U=>U.filter(fe=>fe!==F))};return _jsx(Snackbar,{open:!0,anchorOrigin:m,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:G,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:F.severity,children:_jsxs(Typography,{component:"span",children:[String(F.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var g=r(79692);const u=(0,g.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function B(e){const{displayName:o,picture:l,customStyles:d}=e,m=u();let v={...d};const j={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return l||(v={backgroundColor:stringToColor(o||""),...d}),_jsx(MaterialAvatar,{alt:o,src:l,className:m.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:m.avatarText,style:j,children:extractInitials(o)})})}var ve=r(77277),ue=r(15332);const V=f.forwardRef((e,o)=>(0,t.jsx)(ue.r,{ref:o,...e,color:"initial"})),K=f.forwardRef((e,o)=>(0,t.jsx)(ve.Z,{ref:o,component:V,...e})),I=null;var w=r(95544),ie=r(60364),ee=r(83229),ne=r(26639),$=r(39595),T=r(61837),P=r(80030),L=r(19353),O=r(95074);function oe(e){const{text:o,tooltipDelay:l=1e3,tooltipText:d="Text copied to clipboard","aria-label":m="Copy text"}=e,v=(0,h.h_)(h.VE),[j,F]=(0,f.useState)(!1),[{error:G},U]=(0,O.Z)();(0,f.useEffect)(()=>{G&&v.post(G)},[G,v]);const fe=he=>{he.stopPropagation(),F(!0),U(o)};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(P.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:l,onClose:()=>F(!1),open:j,children:(0,t.jsx)(T.Z,{onClick:fe,"aria-label":m,children:(0,t.jsx)(L.Z,{})})})})}function Le(e){const{text:o,language:l,showLineNumbers:d=!1,highlightedNumbers:m,customStyle:v,showCopyCodeButton:j=!1}=e,F=(0,ie.Z)(),G=F.palette.type==="dark"?ne.Z:$.Z,U=F.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,t.jsxs)(w.Z,{position:"relative",children:[(0,t.jsx)(ee.Z,{customStyle:v,language:l,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:F.palette.textVerySubtle},lineProps:fe=>m!=null&&m.includes(fe)?{style:{backgroundColor:U}}:{},children:o}),j&&(0,t.jsx)(w.Z,{position:"absolute",top:0,right:0,children:(0,t.jsx)(oe,{text:o})})]})}var ze=r(41156),z=r(71597),yt=r(88188);function ot(e){const{title:o,to:l}=e,d=(0,ze.Z)(m=>m.breakpoints.down("xs"));return l?d?(0,t.jsx)(T.Z,{component:z.rU,color:"primary",title:o,size:"small",to:l,children:(0,t.jsx)(yt.Z,{})}):(0,t.jsx)(ve.Z,{component:z.rU,variant:"contained",color:"primary",to:l,children:o}):null}var He=r(27397),st=r(11105),Qe=r(97963),St=r(46506),It=r.n(St),xt=r(54073),lt=r.n(xt),Pt;(function(e){let o;(function(v){v.TOP_BOTTOM="TB",v.BOTTOM_TOP="BT",v.LEFT_RIGHT="LR",v.RIGHT_LEFT="RL"})(o=e.Direction||(e.Direction={}));let l;(function(v){v.UP_LEFT="UL",v.UP_RIGHT="UR",v.DOWN_LEFT="DL",v.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let d;(function(v){v.NETWORK_SIMPLEX="network-simplex",v.TIGHT_TREE="tight-tree",v.LONGEST_PATH="longest-path"})(d=e.Ranker||(e.Ranker={}));let m;(function(v){v.LEFT="l",v.RIGHT="r",v.CENTER="c"})(m=e.LabelPosition||(e.LabelPosition={}))})(Pt||(Pt={}));var Nt=r(10368);const We=(0,g.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function _t({node:{id:e}}){const o=We(),[l,d]=f.useState(0),[m,v]=f.useState(0),j=f.useRef(null);f.useLayoutEffect(()=>{if(j.current){let{height:fe,width:he}=j.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==l)&&(d(he),v(fe))}},[l,m]);const F=10,G=l+F*2,U=m+F*2;return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{className:o.node,width:G,height:U,rx:10}),(0,t.jsx)("text",{ref:j,className:o.text,y:U/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const ge="arrow-marker",Se="node",Fe="edge",tt="label",mt=(0,Nt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),bt=e=>(0,t.jsx)(_t,{...e});function pt({render:e=bt,setNode:o,node:l}){const{width:d,height:m,x:v=0,y:j=0}=l,F=l,G=mt(),U=f.useRef(null);return f.useLayoutEffect(()=>{if(U.current){let{height:fe,width:he}=U.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==d)&&o(l.id,{...l,height:fe,width:he})}},[l,d,m,o]),(0,t.jsx)("g",{ref:U,"data-testid":Se,className:G.node,transform:`translate(${v-d/2},${j-m/2})`,children:e({node:F})})}var Ot=r(76985),Ht=r(39829),Jt=r(19574),Bt=r.n(Jt);const un=(0,Nt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Yt({edge:{label:e}}){const o=un();return(0,t.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const pn=(0,Nt.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),Fn=e=>(0,t.jsx)(Yt,{...e});function Pn({render:e=Fn,setEdge:o,id:l,edge:d,curve:m}){const{x:v=0,y:j=0,width:F,height:G,points:U}=d,fe=d,he=pn(),Pe=f.useRef(null);f.useLayoutEffect(()=>{if(Pe.current){let{height:_e,width:Vt}=Pe.current.getBBox();_e=Math.round(_e),Vt=Math.round(Vt),(_e!==G||Vt!==F)&&o(l,{...d,height:_e,width:Vt})}},[d,G,F,o,l]);let Te="";const Ue=f.useMemo(()=>Ot.Z().x(_e=>_e.x).y(_e=>_e.y).curve(Ht[m]),[m]);if(U){const _e=U.filter(Vt=>Bt()(Vt.x)&&Bt()(Vt.y));Te=Ue(_e)||""}return(0,t.jsxs)(t.Fragment,{children:[Te&&(0,t.jsx)("path",{"data-testid":Fe,className:he.path,d:Te}),fe.label?(0,t.jsx)("g",{ref:Pe,"data-testid":tt,className:he.label,transform:`translate(${v},${j})`,children:e({edge:fe})}):null]})}const fn="workspace";function Ln(e){var o,l;const{edges:d,nodes:m,renderNode:v,direction:j=Pt.Direction.TOP_BOTTOM,align:F,nodeMargin:G=50,edgeMargin:U=10,rankMargin:fe=50,paddingX:he=0,paddingY:Pe=0,acyclicer:Te,ranker:Ue=Pt.Ranker.NETWORK_SIMPLEX,labelPosition:_e=Pt.LabelPosition.RIGHT,labelOffset:Vt=10,edgeRanks:dn=1,edgeWeight:Dn=1,renderLabel:rr,defs:$t,zoom:sn="enabled",curve:an="curveMonotoneX",fit:dr="grow",...gr}=e,mr=(0,Qe.Z)(),[vr,ls]=f.useState(100),[Mr,Zi]=f.useState(100),rn=f.useRef(new(It()).graphlib.Graph),[jo,Vs]=f.useState(((o=rn.current.graph())===null||o===void 0?void 0:o.width)||0),[zr,Ni]=f.useState(((l=rn.current.graph())===null||l===void 0?void 0:l.height)||0),[Zn,Tr]=f.useState([]),[Xr,qr]=f.useState([]),gn=Math.max(jo,vr),Cn=Math.max(zr,Mr),Eo=Math.min(zr,Mr),_r=dr==="grow"?Cn:Eo,cs=f.useMemo(()=>lt()(xn=>{if(!xn)return;const Nn=st.Z(xn),mn=st.Z(xn.getElementById(fn));function yr(){Nn.call(He.sP().scaleExtent([1,10]).on("zoom",kr=>{kr.transform.x=Math.min(0,Math.max(kr.transform.x,gn-gn*kr.transform.k)),kr.transform.y=Math.min(0,Math.max(kr.transform.y,Cn-Cn*kr.transform.k)),mn.attr("transform",kr.transform)}))}sn==="enabled"?yr():sn==="enable-on-click"&&Nn.on("click",()=>yr());const{width:xr,height:Hs}=xn.getBoundingClientRect();vr!==xr&&ls(xr),Mr!==Hs&&Zi(Hs)},100),[Mr,vr,gn,Cn,sn]),Ea=f.useCallback(()=>{const xn=rn.current.nodes(),Nn=rn.current.edges();xn.forEach(mn=>{m.some(xr=>xr.id===mn)||rn.current.removeNode(mn)}),Nn.forEach(mn=>{d.some(xr=>xr.from===mn.v&&xr.to===mn.w)||rn.current.removeEdge(mn.v,mn.w)}),m.forEach(mn=>{const yr=rn.current.nodes().find(xr=>mn.id===xr);if(yr&&rn.current.node(yr)){const{width:xr,height:Hs,x:kr,y:Ol}=rn.current.node(yr);rn.current.setNode(yr,{...mn,width:xr,height:Hs,x:kr,y:Ol})}else rn.current.setNode(mn.id,{...mn,width:0,height:0})}),d.forEach(mn=>{rn.current.setEdge(mn.from,mn.to,{...mn,label:mn.label,width:0,height:0,labelpos:_e,labeloffset:Vt,weight:Dn,minlen:dn})})},[d,m,_e,Vt,Dn,dn]),ds=f.useMemo(()=>lt()(()=>{It().layout(rn.current);const{height:xn,width:Nn}=rn.current.graph(),mn=Math.max(0,xn||0),yr=Math.max(0,Nn||0);Vs(yr),Ni(mn),Tr(rn.current.nodes()),qr(rn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(rn.current.setGraph({rankdir:j,align:F,nodesep:G,edgesep:U,ranksep:fe,marginx:he,marginy:Pe,acyclicer:Te,ranker:Ue}),Ea(),ds(),ds.cancel),[Te,F,j,U,he,Pe,G,fe,Ue,Ea,ds]);function Pl(xn,Nn){return rn.current.setNode(xn,Nn),ds(),rn.current}function Ll(xn,Nn){return rn.current.setEdge(xn,Nn),ds(),rn.current}return(0,t.jsxs)("svg",{ref:cs,...gr,width:"100%",height:_r,viewBox:`0 0 ${gn} ${Cn}`,children:[(0,t.jsxs)("defs",{children:[(0,t.jsx)("marker",{id:ge,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,t.jsx)("path",{fill:mr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),$t]}),(0,t.jsx)("g",{id:fn,children:(0,t.jsxs)("svg",{width:jo,height:zr,y:Cn/2-zr/2,x:gn/2-jo/2,viewBox:`0 0 ${jo} ${zr}`,children:[Xr.map(xn=>{const Nn=rn.current.edge(xn);return Nn?(0,t.jsx)(Pn,{id:xn,setEdge:Ll,render:rr,edge:Nn,curve:an},`${xn.v}-${xn.w}`):null}),Zn.map(xn=>{const Nn=rn.current.node(xn);return Nn?(0,t.jsx)(pt,{setNode:Pl,render:v,node:Nn},xn):null})]})})]})}var Un=r(72779),tn=r.n(Un),wn,Mn;const ut=(0,g.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(wn=e.palette.banner.closeButtonColor)!==null&&wn!==void 0?wn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Mn=e.palette.banner.warning)!==null&&Mn!==void 0?Mn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),_n=e=>{const{variant:o,message:l,id:d,fixed:m=!1}=e,v=ut(),F=useApi(storageApiRef).forBucket("notifications");var G;const U=(G=F.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[fe,he]=useState(new Set(U)),Pe=useObservable(F.observe$("dismissedBanners"));useEffect(()=>{if(Pe!=null&&Pe.value){var Ue;const _e=(Ue=Pe==null?void 0:Pe.value)!==null&&Ue!==void 0?Ue:[];he(new Set(_e))}},[Pe==null?void 0:Pe.value]);const Te=()=>{F.set("dismissedBanners",[...fe,d])};return _jsx(Snackbar,{anchorOrigin:m?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(d),classes:{root:classNames(v.root,!m&&v.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(v.content,v[o]),message:v.message},message:l,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:v.button,onClick:Te,children:_jsx(Close,{className:v.icon})},"dismiss")]})})};var wt=r(60905),ct=r(90436),vn=r.p+"static/missingAnnotation.67f79e98..svg",Kt=r.p+"static/noInformation.4b426325..svg",hn=r.p+"static/createComponent.975d1e1e..svg",jn=r.p+"static/noBuild.1715fa71..svg";const ln=(0,g.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Tn=({missing:e})=>{const o=ln();switch(e){case"field":return(0,t.jsx)("img",{src:vn,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,t.jsx)("img",{src:Kt,alt:"no Information",className:o.generalImg});case"content":return(0,t.jsx)("img",{src:hn,alt:"create Component",className:o.generalImg});case"data":return(0,t.jsx)("img",{src:jn,alt:"no Build",className:o.generalImg});default:return null}},Ce=(0,g.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function ce(e){const{title:o,description:l,missing:d,action:m}=e,v=Ce();return(0,t.jsxs)(wt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,t.jsx)(wt.Z,{item:!0,xs:12,md:6,children:(0,t.jsxs)(wt.Z,{container:!0,direction:"column",children:[(0,t.jsx)(wt.Z,{item:!0,xs:!0,children:(0,t.jsx)(ct.Z,{variant:"h5",children:o})}),(0,t.jsx)(wt.Z,{item:!0,xs:!0,children:(0,t.jsx)(ct.Z,{variant:"body1",children:l})}),(0,t.jsx)(wt.Z,{item:!0,xs:!0,className:v.action,children:m})]})}),(0,t.jsx)(wt.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof d=="string"?(0,t.jsx)(Tn,{missing:d}):d.customImage})]})}const Oe=`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`,Me=/^.*ANNOTATION.*$/m,Xe=Oe.match(Me)[0],se=Oe.split(`
|
|
12
|
-
`).findIndex(e=>Me.test(e)),D=(0,g.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function me(e){return Array.from(Array(e+1).keys(),o=>o+se)}function De(e){const o=e.map(l=>Xe.replace("ANNOTATION",l)).join(`
|
|
13
|
-
`);return Oe.replace(Xe,o)}function et(e){const o=e.length<=1;return(0,t.jsxs)(t.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,t.jsx)("code",{children:l})).reduce((l,d)=>(0,t.jsxs)(t.Fragment,{children:[l,", ",d]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function it(e){const{annotation:o,readMoreUrl:l}=e,d=Array.isArray(o)?o:[o],m=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=D();return(0,t.jsx)(ce,{missing:"field",title:"Missing Annotation",description:et(d),action:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ct.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,t.jsx)(w.Z,{className:v.code,children:(0,t.jsx)(Le,{text:De(d),language:"yaml",showLineNumbers:!0,highlightedNumbers:me(d.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(ve.Z,{color:"primary",component:ue.r,to:m,children:"Read more"})]})})}var kt=r(11776),Ft=r(38402),Qt=r(49378),_=r(41128),J=r(27616),te=r(8284),pe=r(70660),le=r(91750),y=r(38016);const Z=(e,o)=>(o.palette.type==="light"?_._j:_.$n)(o.palette[e].light,.6),q=(e,o)=>(o.palette.type==="light"?_.$n:_._j)(o.palette[e].light,.9),Y=(0,g.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>Z(o,e)}})),we=({severity:e})=>{const o=Y({severity:e});return(0,t.jsx)(le.Z,{classes:o})},Ae=({severity:e})=>{const o=Y({severity:e});return(0,t.jsx)(y.Z,{classes:o})},Ye=(0,g.Z)(e=>({panel:{backgroundColor:({severity:o})=>q(o,e),color:({severity:o})=>Z(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>Z(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>Z(o,e),backgroundColor:({severity:o})=>q(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"}),jt=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function vt(e){const{severity:o="warning",title:l,message:d,children:m,defaultExpanded:v}=e,j=Ye({severity:o}),F=jt(o)+(l?`: ${l}`:"");return(0,t.jsxs)(J.Z,{defaultExpanded:v!=null?v:!1,className:j.panel,role:"alert",children:[(0,t.jsxs)(te.Z,{expandIcon:(0,t.jsx)(Ae,{severity:o}),className:j.summary,children:[(0,t.jsx)(we,{severity:o}),(0,t.jsx)(ct.Z,{className:j.summaryText,variant:"subtitle1",children:F})]}),(d||m)&&(0,t.jsx)(pe.Z,{children:(0,t.jsxs)(wt.Z,{container:!0,children:[d&&(0,t.jsx)(wt.Z,{item:!0,xs:12,children:(0,t.jsx)(ct.Z,{className:j.message,variant:"body1",children:d})}),m&&(0,t.jsx)(wt.Z,{item:!0,xs:12,className:j.details,children:m})]})})]})}const nt=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Ke=({error:e,message:o,stack:l,children:d})=>{const m=nt();return(0,t.jsxs)(kt.Z,{dense:!0,children:[(0,t.jsxs)(Ft.Z,{alignItems:"flex-start",children:[(0,t.jsx)(Qt.Z,{classes:{secondary:m.text},primary:"Error",secondary:e}),(0,t.jsx)(oe,{text:e})]}),(0,t.jsxs)(Ft.Z,{alignItems:"flex-start",children:[(0,t.jsx)(Qt.Z,{classes:{secondary:m.text},primary:"Message",secondary:o}),(0,t.jsx)(oe,{text:o})]}),l&&(0,t.jsxs)(Ft.Z,{alignItems:"flex-start",children:[(0,t.jsx)(Qt.Z,{classes:{secondary:m.text},primary:"Stack Trace",secondary:l}),(0,t.jsx)(oe,{text:l})]}),d]})};function dt(e){const{title:o,error:l,defaultExpanded:d,children:m}=e;return(0,t.jsx)(vt,{severity:"error",title:o!=null?o:l.message,defaultExpanded:d,children:(0,t.jsx)(Ke,{error:l.name,message:l.message,stack:l.stack,children:m})})}var at=r(85256);const Dt=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function Mt(e){var o;const{title:l,error:d,defaultExpanded:m}=e,v=Dt();if(d.name!=="ResponseError")return(0,t.jsx)(dt,{title:l!=null?l:d.message,defaultExpanded:m,error:d});const{body:j,cause:F}=d,{request:G,response:U}=j,fe=`${U.statusCode}: ${F.name}`,he=G&&`${G.method} ${G.url}`,Pe=F.message.replace(/\\n/g,`
|
|
14
|
-
`),Te=(o=F.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
-
`),Ue=JSON.stringify(j,void 0,2);return(0,t.jsxs)(dt,{title:l!=null?l:d.message,defaultExpanded:m,error:{name:fe,message:Pe,stack:Te},children:[he&&(0,t.jsxs)(Ft.Z,{alignItems:"flex-start",children:[(0,t.jsx)(Qt.Z,{classes:{secondary:v.text},primary:"Request",secondary:G?`${he}`:void 0}),(0,t.jsx)(oe,{text:he})]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(at.Z,{component:"li",className:v.divider}),(0,t.jsx)(Ft.Z,{alignItems:"flex-start",children:(0,t.jsx)(Qt.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,t.jsx)(Le,{language:"json",text:Ue,showCopyCodeButton:!0})]})]})}var Xt=r(28316);function en(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function Ut(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function zt(e){const o=useRef(null);useEffect(function(){const m=document.querySelector(`#${e}`),v=m||en(e);return m||Ut(v),v.appendChild(o.current),function(){o.current.remove(),v.childNodes.length===-1&&v.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var Et=null;const Lt="core.calloutSeen";function Zt(){const[e,o]=useState(()=>{const d=localStorage.getItem(Lt);return d?JSON.parse(d):{}}),l=useCallback((d,m)=>{const v=localStorage.getItem(Lt),F={...v?JSON.parse(v):{},[d]:m};o(F),localStorage.setItem(Lt,JSON.stringify(F))},[]);return{states:e,setState:l}}function bn(e){const{states:o,setState:l}=Zt(),d=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:d}}function zn(e){const{seen:o,markSeen:l}=bn(e);return{show:o===!1,hide:l}}const Gn=(0,g.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function ur(e){const{featureId:o,title:l,description:d,children:m}=e,{show:v,hide:j}=useShowCallout(o),F=usePortal("core.callout"),G=useRef(null),[U,fe]=useState(),he=Gn(),Pe=useCallback(()=>{if(G.current){const Te=G.current.getBoundingClientRect(),Ue=Math.max(Te.width,Te.height),_e=800,Vt=Te.x-(Ue-Te.width)/2-_e,dn=Te.y-(Ue-Te.height)/2-_e,Dn=Ue+2*_e,rr=450,$t=Te.x+Te.width/2-rr,sn=Te.y-(Ue-Te.height)/2+Ue+20;fe({dotLeft:Vt,dotTop:dn,dotSize:Dn,borderWidth:_e,textTop:sn,textLeft:$t,textWidth:rr})}},[]);return useEffect(()=>(window.addEventListener("resize",Pe),window.addEventListener("scroll",Pe),()=>{window.removeEventListener("resize",Pe),window.removeEventListener("scroll",Pe)}),[Pe]),useLayoutEffect(Pe,[G.current,Pe]),v?_jsxs(_Fragment,{children:[_jsx(Box,{className:he.featureWrapper,ref:G,children:m}),createPortal(_jsx(Box,{className:he.backdrop,children:_jsx(ClickAwayListener,{onClickAway:j,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:he.dot,"data-testid":"dot",style:{left:U==null?void 0:U.dotLeft,top:U==null?void 0:U.dotTop,width:U==null?void 0:U.dotSize,height:U==null?void 0:U.dotSize,borderWidth:U==null?void 0:U.borderWidth},onClick:j,onKeyDown:j,role:"button",tabIndex:0,children:_jsx(Box,{className:he.pulseCircle})}),_jsxs(Box,{className:he.text,"data-testid":"text",style:{left:U==null?void 0:U.textLeft,top:U==null?void 0:U.textTop,width:U==null?void 0:U.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:d})]})]})})}),F)]}):_jsx(_Fragment,{children:m})}var En=r(35292);const On=(0,g.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function er({color:e="primary",disabled:o=!1,href:l="#",icon:d=(0,t.jsx)(En.Z,{}),label:m,onClick:v,title:j}){const F=On();return o?(0,t.jsxs)(w.Z,{title:j,className:tn()(F.link,F.disabled),children:[d,(0,t.jsx)(ct.Z,{variant:"caption",component:"span",className:F.label,children:m})]}):(0,t.jsxs)(ue.r,{title:j,className:tn()(F.link,F[e]),to:l,onClick:v,children:[d,(0,t.jsx)(ct.Z,{variant:"caption",component:"span",className:F.label,children:m})]})}const S=(0,g.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function c(e){const{links:o}=e,l=S();return(0,t.jsx)("nav",{className:l.links,children:o.map((d,m)=>(0,t.jsx)(er,{...d},m+1))})}const b=e=>{const o=e==="dark"?"16%":"97%";return`
|
|
16
|
-
hsl(0, 0%, ${o}) 0%,
|
|
17
|
-
hsla(0, 0%, ${o}, 0.987) 8.1%,
|
|
18
|
-
hsla(0, 0%, ${o}, 0.951) 15.5%,
|
|
19
|
-
hsla(0, 0%, ${o}, 0.896) 22.5%,
|
|
20
|
-
hsla(0, 0%, ${o}, 0.825) 29%,
|
|
21
|
-
hsla(0, 0%, ${o}, 0.741) 35.3%,
|
|
22
|
-
hsla(0, 0%, ${o}, 0.648) 41.2%,
|
|
23
|
-
hsla(0, 0%, ${o}, 0.55) 47.1%,
|
|
24
|
-
hsla(0, 0%, ${o}, 0.45) 52.9%,
|
|
25
|
-
hsla(0, 0%, ${o}, 0.352) 58.8%,
|
|
26
|
-
hsla(0, 0%, ${o}, 0.259) 64.7%,
|
|
27
|
-
hsla(0, 0%, ${o}, 0.175) 71%,
|
|
28
|
-
hsla(0, 0%, ${o}, 0.104) 77.5%,
|
|
29
|
-
hsla(0, 0%, ${o}, 0.049) 84.5%,
|
|
30
|
-
hsla(0, 0%, ${o}, 0.013) 91.9%,
|
|
31
|
-
hsla(0, 0%, ${o}, 0) 100%
|
|
32
|
-
`},E=100,Q=10,be=(0,g.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:E,height:`calc(100% + ${Q}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Q,background:`linear-gradient(90deg, ${b(e.palette.type)})`},fadeRight:{right:-Q,background:`linear-gradient(270deg, ${b(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function je(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){d([0,0]);return}const v=()=>{const j=m.scrollLeft,F=m.scrollWidth-m.offsetWidth-m.scrollLeft;d([j,F])};return v(),m.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{m.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,l]}function ke(e,o,l){const[d,m]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const v=window.performance.now(),j=requestAnimationFrame(F=>{if(!e.current)return;const G=F-v,U=Math.abs(d)*G/o,he=Math.max(l,U)*Math.sign(d);e.current.scrollBy({left:he});const Pe=d-he;Math.sign(d)!==Math.sign(Pe)?m(0):m(Pe)});return()=>cancelAnimationFrame(j)},[e,d,o,l]),m}function ht(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:m,...v}=e,j=be(e),F=React.useRef(),[G,U]=je(F),fe=ke(F,l,d),he=Pe=>{F.current&&fe(Pe?o:-o)};return _jsxs(Box,{...v,className:j.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:j.container,ref:F,children:m}),_jsx(Box,{className:classNames(j.fade,j.fadeLeft,{[j.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(j.fade,j.fadeRight,{[j.fadeHidden]:U===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>he(!1),className:classNames(j.button,j.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),U>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>he(!0),className:classNames(j.button,j.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const ft=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function yn(e){const o=ft(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 kn=(0,f.lazy)(()=>Promise.all([r.e(1049),r.e(6051)]).then(r.bind(r,76051)).then(e=>({default:e.RealLogViewer})));function br(e){const{Progress:o}=(0,h.qD)().getComponents();return(0,t.jsx)(f.Suspense,{fallback:(0,t.jsx)(o,{}),children:(0,t.jsx)(kn,{...e})})}var Br=r(28865),$r=r(60251);const Ao=(0,g.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),eo=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(eo,e):e,Sr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(eo,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},Rr={code:({inline:e,className:o,children:l,...d})=>{const m=String(l).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,t.jsx)(Le,{language:v[1],text:m}):(0,t.jsx)("code",{className:o,...d,children:l})},h1:Sr,h2:Sr,h3:Sr,h4:Sr,h5:Sr,h6:Sr};function or(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:m,transformImageUri:v,className:j}=e,F=Ao();return(0,t.jsx)(Br.D,{remarkPlugins:l==="gfm"?[$r.Z]:[],className:`${F.markdown} ${j}`,children:o,components:Rr,linkTarget:d,transformLinkUri:m,transformImageUri:v})}var Kn=r(23054);const Ir=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Cr=({request:e,busy:o,setBusy:l})=>{const d=Ir(),[m,v]=useState(),j=async()=>{l(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{l(!1)}},F=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(F,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:j,children:"Log in"})]})};var To=null;const Ro=(0,g.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function to(e){const o=Ro(),[l,d]=useState(!1),m=useApi(oauthRequestApiRef),v=useApi(configApiRef);var j;const F=(j=v.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&j!==void 0?j:!1,G=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),U=()=>{G.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(G.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"}),F?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:G.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:d},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:U,children:"Reject All"})})]})}var Io=r(15277),Po=r.n(Io),Wr=r(29862);const tr=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Dr(e){const[o,l]=(0,f.useState)(!1),d=(0,Wr.t)(),m=tr(),v=F=>{d()&&l(F)};var j;return(0,t.jsx)(P.ZP,{title:(j=e.title)!==null&&j!==void 0?j:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,t.jsx)(Po(),{text:e.text,line:e.line,onToggled:v,containerClassName:m.container})})}var Zr=r(67358);function no(e){const o=(0,ie.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,t.jsx)(Zr.Z,{...e,"data-testid":"progress"}):(0,t.jsx)(w.Z,{display:"none"})}var Pr=r(94339),Vr=r(14503),Lo=r(24579),ro=r(32552),Sn=r(15459),oo=r(27597);const so=(0,g.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function io(e){const{link:o,title:l,onClick:d}=e,m=so();return(0,t.jsxs)(w.Z,{children:[(0,t.jsx)(at.Z,{}),(0,t.jsx)(ue.r,{to:o,onClick:d,underline:"none",children:(0,t.jsxs)(w.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,t.jsx)(w.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,t.jsx)(ct.Z,{children:(0,t.jsx)("strong",{children:l})})}),(0,t.jsx)(oo.Z,{className:m.arrow})]})})]})}const wr=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,t.jsxs)(ct.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,t.jsxs)(ct.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,t.jsx)(K,{to:o.href,variant:"contained",children:o.name})},Oo=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,t.jsx)(dt,{title:"Something Went Wrong",error:d,children:(0,t.jsx)(wr,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ao=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),ko=(0,Sn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Vr.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"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function jr(e){const{title:o,subheader:l,divider:d=!0,deepLink:m,slackChannel:v,errorBoundaryProps:j,variant:F,children:G,headerStyle:U,headerProps:fe,icon:he,action:Pe,actionsClassName:Te,actions:Ue,cardClassName:_e,actionsTopRight:Vt,className:dn,noPadding:Dn,titleTypographyProps:rr}=e,$t=ao();let sn={},an={};F&&F.split(/[\s]+/g).forEach(vr=>{sn={...sn,...lo.card[vr]},an={...an,...lo.cardContent[vr]}});const dr=()=>!l&&!he?null:(0,t.jsxs)("div",{className:$t.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,t.jsx)("div",{className:$t.subheader,children:l}),he]}),gr=j||(v?{slackChannel:v}:{});return(0,t.jsx)(Pr.Z,{style:sn,className:dn,children:(0,t.jsxs)(Oo,{...gr,children:[o&&(0,t.jsx)(ro.Z,{classes:{root:$t.header,title:$t.headerTitle,subheader:$t.headerSubheader,avatar:$t.headerAvatar,action:$t.headerAction,content:$t.headerContent},title:o,subheader:dr(),action:Pe,style:{...U},titleTypographyProps:rr,...fe}),Vt&&(0,t.jsx)(ko,{children:Vt}),d&&(0,t.jsx)(at.Z,{}),(0,t.jsx)(Lo.Z,{className:tn()(_e,{[$t.noPadding]:Dn}),style:an,children:G}),Ue&&(0,t.jsx)(Vr.Z,{className:Te,children:Ue}),m&&(0,t.jsx)(io,{...m})]})})}var us=r(39307);const co=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),hr={fractional:!0,inverse:!1,unit:"%",max:100},Lr=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const m=d||hr.max,v=l?m-o:o;return v<m/3?e.status.error:v<m*(2/3)?e.status.warning:e.status.ok};function Bo(e){const[o,l]=useState(null),{getColor:d=Lr}=e,m=co(e),{palette:v}=useTheme(),{value:j,fractional:F,inverse:G,unit:U,max:fe,description:he}={...hr,...e},Pe=F?Math.round(j*fe):j,Te=fe!==100?Math.round(j):Pe,[Ue,_e]=useState(!1);return useEffect(()=>{const Vt=o,dn=()=>_e(!0),Dn=()=>_e(!1);return Vt&&he?(Vt.addEventListener("mouseenter",dn),Vt.addEventListener("mouseleave",Dn),()=>{Vt.removeEventListener("mouseenter",dn),Vt.removeEventListener("mouseleave",Dn)}):()=>{_e(!1)}},[he,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Pe,strokeWidth:12,trailWidth:12,strokeColor:d({palette:v,value:Te,inverse:G,max:fe}),className:m.circle}),he&&Ue?_jsx(Box,{className:m.description,children:he}):_jsx(Box,{className:m.overlay,children:isNaN(j)?"N/A":`${Te}${U}`})]})}const Yn=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Gs(e){const o=Yn(e),{title:l,subheader:d,progress:m,inverse:v,deepLink:j,description:F,icon:G,variant:U,getColor:fe}=e,he={inverse:v,description:F,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:j,variant:U,icon:G,children:_jsx(Gauge,{...he})})})}function $o(e){const{value:o,getColor:l=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(o))return null;let m=Math.round(o*100*100)/100;m>100&&(m=100);const v=l({palette:d,value:m,inverse:!1,max:100});return _jsx(Tooltip,{title:`${m}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:m,strokeWidth:4,trailWidth:4,strokeColor:v})})})}var hs=r(21324),ps=r(7089),uo=r(42494),fs=r(74603),gs=r(56939),sr=r(12231),Do=r(73698),Wn=r(12420),ho=r(72379);const Zo=(0,g.Z)(e=>(0,Wn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var No=()=>{const e=Zo();return(0,t.jsx)(ho.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Fo=(0,g.Z)(e=>(0,Wn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Uo=()=>{const e=Fo();return(0,t.jsx)(ho.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const po=(0,Sn.Z)(e=>(0,Wn.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(fs.Z),x=(0,g.Z)(e=>(0,Wn.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function C(e){const{multiple:o,items:l,label:d,placeholder:m,selected:v,onChange:j,triggerReset:F,native:G=!1,disabled:U=!1,margin:fe}=e,he=x(),[Pe,Te]=(0,f.useState)(v||(o?[]:"")),[Ue,_e]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Te(o?[]:"")},[F,o]),(0,f.useEffect)(()=>{Te(v||(o?[]:""))},[v,o]);const Vt=$t=>{Te($t.target.value),j($t.target.value)},dn=$t=>{if(U){$t.preventDefault();return}_e(sn=>o&&!($t.target instanceof HTMLElement)?!0:!sn)},Dn=()=>{_e(!1)},rr=$t=>()=>{const sn=Pe.filter(an=>an!==$t);Te(sn),j(sn)};return(0,t.jsx)(w.Z,{className:he.root,children:(0,t.jsxs)(uo.Z,{className:he.formControl,children:[(0,t.jsx)(gs.Z,{className:he.formLabel,children:d}),(0,t.jsxs)(Do.Z,{"aria-label":d,value:Pe,native:G,disabled:U,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Vt,open:Ue,onOpen:dn,onClose:Dn,input:(0,t.jsx)(po,{}),label:d,tabIndex:0,renderValue:$t=>{var sn;return o&&Pe.length!==0?(0,t.jsx)(w.Z,{className:he.chips,children:$t.map(an=>{var dr,gr;return(0,t.jsx)(ps.Z,{label:(dr=l.find(mr=>mr.value===an))===null||dr===void 0?void 0:dr.label,clickable:!0,onDelete:rr(an),className:he.chip},(gr=l.find(mr=>mr.value===an))===null||gr===void 0?void 0:gr.value)})}):(0,t.jsx)(ct.Z,{children:Pe.length===0?m||"":(sn=l.find(an=>an.value===$t))===null||sn===void 0?void 0:sn.label})},IconComponent:()=>Ue?(0,t.jsx)(Uo,{}):(0,t.jsx)(No,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,t.jsx)(sr.Z,{value:[],children:m}),G?l&&l.map($t=>(0,t.jsx)("option",{value:$t.value,children:$t.label},$t.value)):l&&l.map($t=>(0,t.jsxs)(sr.Z,{value:$t.value,children:[o&&(0,t.jsx)(hs.Z,{color:"primary",checked:Pe.includes($t.value)||!1,className:he.checkbox}),$t.label]},$t.value))]})]})})}const R=()=>{},N=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:R,stepHistory:[],setStepHistory:R,onStepChange:R});function re(e){const{children:o,elevated:l,onStepChange:d,activeStep:m=0}=e,[v,j]=useState(m),[F,G]=useState([0]);useEffect(()=>{j(m)},[m]);const U=[];let fe;return Children.forEach(o,he=>{isValidElement(he)&&(he.props.end?fe=he:U.push(he))}),_jsxs(_Fragment,{children:[_jsx(N.Provider,{value:{stepIndex:v,setStepIndex:j,stepHistory:F,setStepHistory:G,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:l?2:0,children:U})}),v>=Children.count(o)-1&&fe]})}const de=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),X=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),ye=({text:e,handleClick:o,disabled:l,last:d,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(d?"Finish":"Next")}),Ee=({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"}),Re=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),Ze=({actions:e={},children:o})=>{const l=de(),{stepperLength:d,stepIndex:m,setStepIndex:v,stepHistory:j,setStepHistory:F,onStepChange:G}=useContext(VerticalStepperContext),U=(Te,Ue)=>{Ue&&Ue(),G&&G(m,Te),v(Te)},fe=()=>{const Te=e.nextStep?e.nextStep(m,d-1):m+1;U(Te,e.onNext),F([...j,Te])},he=()=>{j.pop(),U(j[j.length-1],e.onBack),F([...j])},Pe=()=>{U(0,e.onRestart),F([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(Re,{text:e.backText,handleClick:he,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(Ee,{text:e.skipText,handleClick:fe,disabled:!!d&&m>=d||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(ye,{text:e.nextText,handleClick:fe,disabled:!!d&&m>=d||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(X,{text:e.restartText,handleClick:Pe,stepIndex:m}),o]})},Ne=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function rt(e){const{title:o,children:l,end:d,actions:m,...v}=e,j=Ne();return d?_jsxs(Box,{className:j.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...v,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const qe=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function Ge(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Be(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Je(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function At(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function cn(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function qt(e){const o=qe(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var on=r(74600),nn=r(15584);const An=e=>(0,Wn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Rn={root:{border:"0",verticalAlign:"top"}},Er=e=>(0,Wn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Nr=e=>(0,Wn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Gr=(0,Sn.Z)(An,{name:"BackstageMetadataTableTitleCell"})(nn.Z),In=(0,Sn.Z)(Rn,{name:"BackstageMetadataTableCell"})(nn.Z),Vn=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Or=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Gr,{children:e}),_jsx(In,{colSpan:e?1:2,...l,children:o})]}),Mo=(0,Sn.Z)(Er,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(kt.Z,{disablePadding:!0,className:e.root,children:o})),Fi=(0,Sn.Z)(Nr,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,t.jsx)(Ft.Z,{className:e.root,children:o})),vs=(0,Wn.Z)({root:{margin:"0 0",listStyleType:"none"}}),Ks=e=>(0,Wn.Z)({root:{...vs.root,paddingLeft:e.spacing(1)}}),ys=(0,Sn.Z)(vs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,t.jsx)(Mo,{classes:e,children:o})),zo=(0,Sn.Z)(Ks,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,t.jsx)(Mo,{classes:e,children:o}));function ir(e,o){const l=e.map((d,m)=>_jsx(MetadataListItem,{children:Jn(d)},m));return o?_jsx(zo,{children:l}):_jsx(ys,{children:l})}function ar(e,o,l){const d=Object.keys(e).map(m=>{const v=Jn(e[m],!0),j=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${j}: `}),v]},m)});return o?_jsx(zo,{children:d}):_jsx(ys,{children:d})}function Jn(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?ar(e,o,l):Array.isArray(e)?ir(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Wo=({value:e,options:o})=>_jsx(Fragment,{children:Jn(e,o)}),Ys=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Wo,{value:o,options:l})});function Js(e,o){return Object.keys(e).map(l=>_jsx(Ys,{title:l,value:e[l],options:o},l))}function Ui(e){const{metadata:o,dense:l=!0,options:d}=e,m=Js(o,d||{});return _jsx(MetadataTable,{dense:l,children:m})}var Qs=r(49429),xs=r(86136),Vo=r(79784),Kr=r(76635),Xs=r(19126),bs=r.n(Xs);function _s(e){return qs.stringify(e,{strictNullHandling:!0})}function Ho(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Go(e,o){return Ho(e)[o]}function ei(e,o,l){const d={...Ho(e),[o]:l};return _s(d)}function Mi(e,o=250){const[l,d]=useSearchParams(),m=l.toString(),[v,j]=useState(Go(m,e));return useEffect(()=>{const F=Go(m,e);j(G=>isEqual(F,G)?G:F)},[m,j,e]),useDebouncedEffect(()=>{const F=ei(m,e,v);m!==F&&d(F,{replace:!0})},[d,v,m,e],o),[v,j]}const fo={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 Ko(){const o=(0,h.I_)().get(h.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return fo;var d;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((d=m.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var ti=r(80079);function nr(e,o){const d=(0,h.qD)().getSystemIcon(e);return d?(0,t.jsx)(d,{...o}):(0,t.jsx)(ti.Z,{...o})}function Aa(e){return nr("brokenImage",e)}function Yr(e){return nr("catalog",e)}function zi(e){return nr("chat",e)}function Hn(e){return nr("dashboard",e)}function Ta(e){return nr("docs",e)}function Ra(e){return nr("email",e)}function Ia(e){return nr("github",e)}function Wi(e){return nr("group",e)}function Yo(e){return nr("help",e)}function Pa(e){return nr("user",e)}function Ss(e){return nr("warning",e)}const ni=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),go=({icon:e})=>{const o=(0,h.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:Yo;return(0,t.jsx)(d,{})};var Fr;const mo=({link:e})=>(0,t.jsx)(ue.r,{to:e.url,children:(Fr=e.title)!==null&&Fr!==void 0?Fr:e.url}),ri=({item:e})=>{var o;return(0,t.jsxs)(Ft.Z,{children:[(0,t.jsx)(xs.Z,{children:(0,t.jsx)(go,{icon:e.icon})}),(0,t.jsx)(Qt.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,m)=>[...l,m>0&&(0,t.jsx)("br",{},m),(0,t.jsx)(mo,{link:d},d.url)],[])})]})};function Cs(e){const{title:o,items:l,children:d}=e,{items:m}=Ko(),[v,j]=(0,f.useState)(!1),[F,G]=(0,f.useState)(null),U=ni(),fe=(0,ze.Z)(Te=>Te.breakpoints.down("sm")),he=Te=>{G(Te.currentTarget),j(!0)},Pe=()=>{j(!1)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{display:"flex",ml:1,children:fe?(0,t.jsx)(T.Z,{color:"primary",size:"small",onClick:he,"data-testid":"support-button","aria-label":"Support",children:(0,t.jsx)(Yo,{})}):(0,t.jsx)(ve.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:he,startIcon:(0,t.jsx)(Yo,{}),children:"Support"})}),(0,t.jsxs)(Vo.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:F,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Pe,children:[(0,t.jsxs)(kt.Z,{className:U.popoverList,children:[o&&(0,t.jsx)(Ft.Z,{alignItems:"flex-start",children:(0,t.jsx)(ct.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Te,Ue)=>(0,t.jsx)(Ft.Z,{alignItems:"flex-start",children:Te},`child-${Ue}`)),(l!=null?l:m).map((Te,Ue)=>(0,t.jsx)(ri,{item:Te},`item-${Ue}`))]}),(0,t.jsx)(Qs.Z,{children:(0,t.jsx)(ve.Z,{color:"primary",onClick:Pe,"aria-label":"Close",children:"Close"})})]})]})}var vo=r(18671),lr=r(73557),Jo=r(84800);const yo=72,ws=24,js=18,Ar={drawerWidthClosed:yo,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:yo,iconSize:yo-ws*2,iconPadding:ws,selectedIndicatorWidth:3,userBadgePadding:js,userBadgeDiameter:yo-js*2,mobileSidebarHeight:56},oi=e=>({...Ar,...e,iconContainerWidth:Ar.drawerWidthClosed,iconSize:Ar.drawerWidthClosed-Ar.iconPadding*2,userBadgeDiameter:Ar.drawerWidthClosed-Ar.userBadgePadding*2}),Es={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Ar.defaultOpenDelayMs+200},Qo=e=>({...Es,...e}),Vi="@backstage/core/sidebar-intro-dismissed",cr=(0,f.createContext)({sidebarConfig:Ar,submenuConfig:Es}),Xo=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var si=r(50023),ii=r(4190),ai=r(87685),li=r(44882),qo=r(51837);const As={isOpen:!1,setOpen:()=>{}},Ts=(0,f.createContext)(As),Rs=(0,qo.CT)("sidebar-open-state-context");function Is(e){const{children:o,value:l}=e;return(0,t.jsx)(Ts.Provider,{value:l,children:(0,t.jsx)(Rs.Provider,{value:(0,qo.EI)({1:l}),children:o})})}const xo=()=>{const e=(0,f.useContext)(Rs),o=(0,f.useContext)(Ts);if(e===void 0)return o||As;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var _o=r(57998);const Ps={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ls=(0,f.createContext)(Ps),Os=(0,qo.CT)("sidebar-pin-state-context");function ci(e){const{children:o,value:l}=e;return(0,t.jsx)(Ls.Provider,{value:l,children:(0,t.jsx)(Os.Provider,{value:(0,qo.EI)({1:l}),children:o})})}const es=()=>{const e=(0,f.useContext)(Os),o=(0,f.useContext)(Ls);if(e===void 0)return o||Ps;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},bo=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Hi=e=>{const{to:o,label:l,icon:d,value:m}=e,{sidebarConfig:v}=(0,f.useContext)(cr),j=bo({sidebarConfig:v}),F=(0,lr.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:U}=(0,f.useContext)(hi),fe=(Pe,Te)=>{U(Te===G?-1:Te)},he=m===G&&G>=0||m!==G&&!(G>=0)&&o===F.pathname;return(0,t.jsx)(_o.Z,{"aria-label":l,label:l,icon:d,component:ue.r,to:o||F.pathname,onChange:fe,value:m,selected:he,classes:j})},di=e=>{const{children:o,to:l,label:d,icon:m,value:v}=e,{isMobile:j}=es();return j?(0,t.jsx)(Hi,{to:l,label:d,icon:m,value:v}):(0,t.jsx)(t.Fragment,{children:o})},ks=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),ui=e=>(0,Kr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Bs=f.createElement(di).type,Gi=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:m}=(0,f.useContext)(cr),v=ks({sidebarConfig:m});return(0,t.jsxs)(ii.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,t.jsxs)(w.Z,{className:v.overlayHeader,children:[(0,t.jsx)(ct.Z,{variant:"h3",children:o}),(0,t.jsx)(T.Z,{onClick:d,classes:{root:v.overlayHeaderClose},children:(0,t.jsx)(ai.Z,{})})]}),(0,t.jsx)(w.Z,{component:"nav",children:e})]})},hi=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),$s=e=>{const{sidebarConfig:o}=(0,f.useContext)(cr),{children:l}=e,d=ks({sidebarConfig:o}),m=(0,lr.TH)(),[v,j]=(0,f.useState)(-1);(0,f.useEffect)(()=>{j(-1)},[m.pathname]);let F=(0,h.vJ)(l,U=>U.getElements().filter(fe=>fe.type===Bs));if(l)F.length?F=ui(F):F.push((0,t.jsx)(di,{icon:(0,t.jsx)(li.Z,{}),children:l},"default_menu"));else return null;const G=v>=0&&!F[v].props.to;return(0,t.jsx)(Is,{value:{isOpen:!0,setOpen:()=>{}},children:(0,t.jsxs)(hi.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:j},children:[(0,t.jsx)(Gi,{label:F[v]&&F[v].props.label,open:G,onClose:()=>j(-1),children:F[v]&&F[v].props.children}),(0,t.jsx)(si.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:F})]})})};var Jr;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Jr||(Jr={}));const Ds={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Jr.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Jr.SIDEBAR_PIN_STATE,JSON.stringify(e))}},pi=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),Qr=(0,f.createContext)({content:{contentRef:void 0}});function Ki(e){const[o,l]=(0,f.useState)(()=>Ds.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(cr),m=(0,f.useRef)(null),v=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Ds.setSidebarPinState(o)},[o]);const j=(0,ze.Z)(U=>U.breakpoints.down("xs"),{noSsr:!0}),F=()=>l(!o),G=pi({isPinned:o,sidebarConfig:d});return(0,t.jsx)(ci,{value:{isPinned:o,toggleSidebarPinState:F,isMobile:j},children:(0,t.jsx)(Qr.Provider,{value:v,children:(0,t.jsx)(w.Z,{className:G.root,children:e.children})})})}function fi(){const{content:e}=(0,f.useContext)(Qr);return{focusContent:(0,f.useCallback)(()=>{var l,d;e==null||(l=e.contentRef)===null||l===void 0||(d=l.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const gi=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Qn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Qn||(Qn={}));const mi=e=>{const{sidebarConfig:o}=(0,f.useContext)(cr),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:m,children:v}=e,j=gi({sidebarConfig:o}),F=(0,ze.Z)(dn=>dn.breakpoints.down("md"),{noSsr:!0}),[G,U]=(0,f.useState)(Qn.Closed),fe=(0,f.useRef)(),{isPinned:he,toggleSidebarPinState:Pe}=es(),Te=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G!==Qn.Open&&!F&&(fe.current=window.setTimeout(()=>{fe.current=void 0,U(Qn.Open)},l),U(Qn.Idle)))},Ue=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G===Qn.Idle?U(Qn.Closed):G===Qn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,U(Qn.Closed)},d)))},_e=G===Qn.Open&&!F||he,Vt=dn=>{dn?(U(Qn.Open),Pe()):(U(Qn.Closed),Pe())};return(0,t.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,t.jsx)(Yi,{}),(0,t.jsx)(Is,{value:{isOpen:_e,setOpen:Vt},children:(0,t.jsx)(w.Z,{className:j.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Te,onFocus:m?()=>{}:Te,onMouseLeave:m?()=>{}:Ue,onBlur:m?()=>{}:Ue,children:(0,t.jsx)(w.Z,{className:tn()(j.drawer,j.drawerWidth,{[j.drawerOpen]:_e}),children:v})})})]})},Bn=e=>{var o;const l=oi((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const m=Qo((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:v,disableExpandOnHover:j,openDelayMs:F,closeDelayMs:G}=e,{isMobile:U}=es();return U?(0,t.jsx)($s,{children:v}):(0,t.jsx)(cr.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,t.jsx)(mi,{openDelayMs:F,closeDelayMs:G,disableExpandOnHover:j,children:v})})};function Yi(){const{sidebarConfig:e}=(0,f.useContext)(cr),{focusContent:o,contentRef:l}=fi(),d=gi({sidebarConfig:e});return l!=null&&l.current?(0,t.jsx)(ve.Z,{onClick:o,variant:"contained",className:tn()(d.visuallyHidden),children:"Skip to content"}):null}function Zs(e,o){const l=new URLSearchParams(o.search).toString(),d=bs().parse(l),m=new URLSearchParams(e.search).toString(),v=bs().parse(m);return(0,Kr.isEqual)(o.pathname,e.pathname)&&(0,Kr.isMatch)(v,d)}const Ji=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),La=e=>{const{title:o,subtitle:l,to:d,icon:m,dropdownItems:v}=e,j=Ji(),{setIsHoveredOn:F}=useContext(SidebarItemWithSubmenuContext),G=()=>{F(!1)},U=useResolvedPath(d!=null?d:""),fe=useLocation();let he=isLocationMatch(fe,U);const[Pe,Te]=useState(!1),Ue=()=>{Te(!Pe)};return v!==void 0?(v.some(_e=>{const Vt=resolvePath(_e.to);return he=isLocationMatch(fe,Vt),he}),_jsxs(Box,{className:j.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Ue,onTouchStart:_e=>_e.stopPropagation(),className:classnames(j.item,he?j.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:l})]}),Pe?_jsx(ArrowDropUpIcon,{className:j.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:j.dropdownArrow})]})}),v&&Pe&&_jsx(Box,{className:j.dropdown,children:v.map((_e,Vt)=>_jsx(Tooltip,{title:_e.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:_e.to,underline:"none",className:j.dropdownItem,onClick:G,onTouchStart:dn=>dn.stopPropagation(),children:_jsx(Typography,{className:j.textContent,children:_e.title})})},Vt))})]})):_jsx(Box,{className:j.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(j.item,he?j.selected:void 0),onClick:G,onTouchStart:_e=>_e.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:j.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:j.subtitle,children:l})]})]})})})};var Ns;const Qi=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Ns=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Ns!==void 0?Ns:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),Xi=e=>{const{isOpen:o}=xo(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(cr),m=o?l.drawerWidthOpen:l.drawerWidthClosed,v=Qi({left:m,submenuConfig:d}),{isHoveredOn:j}=(0,f.useContext)(Xo),[F,G]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{G(j)},[j]),(0,t.jsxs)(w.Z,{className:tn()(v.drawer,{[v.drawerOpen]:F}),children:[(0,t.jsx)(ct.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var qi=r(26739),ts=r(76600),_i=r(83543),ea=r(59797),vi=r(98989);const ta=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Oa=()=>{const e=ta();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 yi=null;const xi=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),na=()=>{const e=xi();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 ra=null,ns,rs;const bi=e=>(0,g.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(ns=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&ns!==void 0?ns:"#404040"}},highlighted:{background:(rs=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&rs!==void 0?rs:"#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 So(e){return(0,f.useMemo)(()=>bi(e),[e])()}const Si=(e,o)=>(0,h.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:v}})=>{if(!d){if(v!=null&&v.length){v.forEach(({to:j})=>d=d||Zs(o,(0,Jo.i3)(j)));return}m&&(d=Zs(o,(0,Jo.i3)(m)))}}),d},[o.pathname]);function os(e){return e.to===void 0}const oa=f.createElement(Xi).type,Ci=f.forwardRef(function({to:o,end:l,style:d,className:m,activeStyle:v,caseSensitive:j,activeClassName:F="active","aria-current":G="page",...U},fe){let{pathname:he}=(0,lr.TH)(),{pathname:Pe}=(0,lr.WU)(o);j||(he=he.toLocaleLowerCase("en-US"),Pe=Pe.toLocaleLowerCase("en-US"));let Te=he===Pe;!Te&&!l&&(Te=he.startsWith(`${Pe}/`));const Ue=Te?G:void 0;return(0,t.jsx)(z.rU,{...U,to:o,ref:fe,"aria-current":Ue,style:{...d,...Te?v:void 0},className:tn()([m,Te?F:void 0])})}),Fs=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:m=!1,hasSubmenu:v=!1,disableHighlight:j=!1,onClick:F,noTrack:G,children:U,className:fe,...he}=e,{sidebarConfig:Pe}=(0,f.useContext)(cr),Te=So(Pe),{isOpen:Ue}=xo(),_e=!Ue&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Vt=(0,t.jsxs)(w.Z,{style:_e,children:[(0,t.jsx)(l,{fontSize:"small"}),!Ue&&v?(0,t.jsx)(vi.Z,{fontSize:"small"}):(0,t.jsx)(t.Fragment,{})]}),dn=(0,t.jsx)(qi.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:tn()({[Te.closedItemIcon]:!Ue}),children:Vt}),Dn=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{"data-testid":"login-button",className:Te.iconContainer,children:dn}),d&&(0,t.jsx)(ct.Z,{variant:"subtitle2",className:Te.label,children:d}),(0,t.jsx)("div",{className:Te.secondaryAction,children:U})]}),rr=Ue?Dn:dn,$t={onClick:F,className:tn()(fe,Te.root,Ue?Te.open:Te.closed,os(e)&&Te.buttonItem,{[Te.highlightable]:!j})},sn=(0,h.z$)(),{pathname:an}=(0,lr.WU)(!os(e)&&e.to?e.to:""),dr=(0,f.useCallback)(gr=>{if(!G){const mr="click",vr=d!=null?d:"Sidebar Item",ls=an?{attributes:{to:an}}:void 0;sn.captureEvent(mr,vr,ls)}F==null||F(gr)},[sn,d,an,G,F]);return os(e)?(0,t.jsx)(ve.Z,{role:"button","aria-label":d,...$t,ref:o,onClick:dr,children:rr}):(0,t.jsx)(Ci,{...$t,activeClassName:Te.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...he,onClick:dr,children:rr})}),sa=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(cr),d=So(l),[m,v]=(0,f.useState)(!1),j=(0,lr.TH)(),F=Si(e,j),G=(0,ze.Z)(Pe=>Pe.breakpoints.down("sm")),U=()=>{v(!0)},fe=()=>{v(!1)},he=()=>G?m?(0,t.jsx)(ea.Z,{fontSize:"small",className:d.submenuArrow}):(0,t.jsx)(_i.Z,{fontSize:"small",className:d.submenuArrow}):!m&&(0,t.jsx)(vi.Z,{fontSize:"small",className:d.submenuArrow});return(0,t.jsx)(Xo.Provider,{value:{isHoveredOn:m,setIsHoveredOn:v},children:(0,t.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:U,onMouseEnter:U,className:tn()(m&&d.highlighted),children:[(0,t.jsx)(Fs,{hasSubmenu:!0,className:F?d.selected:"",...o,children:he()}),m&&e]})})},Us=(0,f.forwardRef)((e,o)=>{const[l]=(0,h.vJ)(e.children,d=>d.getElements().filter(m=>m.type===oa));return l?(0,t.jsx)(sa,{...e,children:l}):(0,t.jsx)(Fs,{...e,ref:o})});function ia(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),m=So(o),v=e.icon?e.icon:SearchIcon,j=()=>{e.onSearch(l),d("")},F=he=>{he.key==="Enter"&&(he.preventDefault(),j())},G=he=>{d(he.target.value)},U=he=>{he.preventDefault(),he.stopPropagation()},fe=he=>{j(),he.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Us,{icon:v,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:U,onChange:G,onKeyDown:F,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const aa=(0,ts.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),la=(0,ts.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),wi=(0,ts.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),ji=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),ca=(0,ts.Z)("div")(({theme:e})=>{const o=ji(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),pr=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=So(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(j=>j.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:v,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Ei=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function Ai(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Ei({sidebarConfig:o}),{text:d,onClose:m}=e,v=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:v,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Ms=e=>{const{text:o,onDismiss:l}=e,[d,m]=useState(!1),v=()=>{m(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(Ai,{text:o,onClose:v})})},zs=null,Ti="And your recently viewed plugins will pop up here!";function da(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:j}=d!=null?d:{},F=()=>{m(U=>({...l,...U,starredItemsDismissed:!0}))},G=()=>{m(U=>({...l,...U,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ms,{text:zs,onDismiss:F}),_jsx(SidebarDivider,{})]}),!j&&_jsx(Ms,{text:Ti,onDismiss:G})]}):null}const Ri=(0,g.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ws(e){const{className:o,stretch:l,noPadding:d,children:m,...v}=e,{contentRef:j}=fi(),F=Ri();return(0,t.jsx)("article",{ref:j,tabIndex:-1,...v,className:tn()(F.root,o,{[F.stretch]:l,[F.noPadding]:d}),children:m})}var ua=r(6487),Ii=r(99152);const i=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function n(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[m,v]=(0,f.useState)(d!=null?d:0),j=i(),F=(0,f.useCallback)((G,U)=>{d===void 0&&v(U),l&&d!==U&&l(U)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&v(d)},[d]),(0,t.jsx)(w.Z,{className:j.tabsWrapper,children:(0,t.jsx)(Ii.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:F,value:m,children:o.map((G,U)=>(0,f.createElement)(ua.Z,{...G.tabProps,"data-testid":`header-tab-${U}`,label:G.label,key:G.id,value:U,className:j.defaultTab,classes:{selected:j.selected,root:j.tabRoot}}))})})}function s(e){const o=(0,lr.UO)(),d=e.map(({path:Pe,children:Te})=>({caseSensitive:!1,path:`${Pe}/*`,element:Te})).sort((Pe,Te)=>Te.path.replace(/\/\*$/,"").localeCompare(Pe.path.replace(/\/\*$/,"")));var m;const v=(m=(0,lr.V$)(d))!==null&&m!==void 0?m:e[0].children;var j;let F=(j=o["*"])!==null&&j!==void 0?j:"";F.startsWith("/")||(F=`/${F}`);var G;const[U]=(G=(0,Jo.fp)(d,F))!==null&&G!==void 0?G:[],fe=U?e.findIndex(Pe=>`${Pe.path}/*`===U.route.path):0;var he;return{index:fe===-1?0:fe,element:v,route:(he=e[fe])!==null&&he!==void 0?he:e[0]}}function a(e){const{routes:o}=e,l=(0,lr.s0)(),{index:d,route:m,element:v}=s(o),j=(0,f.useMemo)(()=>o.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[o]),F=G=>{let{path:U}=o[G];U=U.replace(/\/\*$/,""),U=U.replace(/^\//,""),l(U)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n,{tabs:j,selectedIndex:d,onChange:F}),(0,t.jsxs)(Ws,{children:[(0,t.jsx)(vo.q,{title:m.title}),v]})]})}const p=()=>null;(0,h.R5)(p,"core.gatherMountPoints",!0);function A(e){const o=(0,t.jsx)(p,{path:"",title:"",children:(0,t.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return A(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:m,children:v,tabProps:j}=l.props;return[{path:d,title:m,children:v,tabProps:j}]})}function k(e){const o=A(e.children);return(0,t.jsx)(a,{routes:o})}k.Route=p;const M=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ae(e){const{value:o,subvalue:l}=e,d=M();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{className:d.value,children:o}),(0,t.jsx)(w.Z,{className:d.subvalue,children:l})]})}var xe=r(67222),Ie=r(21070),Ve=r(90324),gt=r(98281),Tt=r(48049),Rt=r(51209),Wt=r(33375),Gt=r(44233),$n=r(27604),Xn=r(36444),fr=r(37971),Co=r(59709),Pi=r(17373),Li=r(3702),ss=r(93111);const Oi=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ur=e=>{var o;const l=Oi(),{onChangeFilters:d}=e,[m,v]=(0,f.useState)({...e.selectedFilters}),[j,F]=(0,f.useState)(!1),G=()=>{v({}),F(U=>!U)};return(0,f.useEffect)(()=>{d(m)},[m,d]),(0,t.jsxs)(w.Z,{className:l.root,children:[(0,t.jsxs)(w.Z,{className:l.header,children:[(0,t.jsx)(w.Z,{className:l.value,children:"Filters"}),(0,t.jsx)(ve.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,t.jsx)(w.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(U=>(0,t.jsx)(C,{triggerReset:j,...U.element,selected:m[U.element.label],onChange:fe=>v({...m,[U.element.label]:fe})},U.element.label))})]})},ha={Add:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ie.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,t.jsx)(gt.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Wt.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Gt.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Rt.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,t.jsx)($n.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Li.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Xn.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(fr.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Co.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Rt.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Tt.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Wt.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Xn.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Ve.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,t.jsx)(Pi.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,t.jsx)(ss.Z,{...e,ref:o}))};function pa(e,o){const l=o.split(".");let d=e[l[0]];for(let m=1;m<l.length;++m){if(d===void 0)return d;const v=l[m];d=d[v]}return d}const ka=(0,Sn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(xe.W$),fa=(0,Sn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(xe.UW),Ba=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),$a=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Da(e,o){return e.map(l=>{var d;const m=(d=l.headerStyle)!==null&&d!==void 0?d:{};let v=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof v=="object")v.fontWeight=o.typography.fontWeightBold;else{const j=v;v=(F,G,U)=>({...j(F,G,U),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:v}})}function Za(e,o){return(0,Kr.transform)(e,(l,d,m)=>{(0,Kr.isEqual)(d,o[m])||(l[m]=d)})}const ga={search:"",filtersOpen:!1,filters:{}};function Na(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:m,toggleFilters:v}=e,j=Ba(),F=(0,f.useCallback)(G=>{e.onSearchChanged(G),l(G)},[e,l]);return d?(0,t.jsxs)(w.Z,{className:j.root,children:[(0,t.jsxs)(w.Z,{className:j.root,children:[(0,t.jsx)(T.Z,{onClick:v,"aria-label":"filter list",children:(0,t.jsx)(Xn.Z,{})}),(0,t.jsxs)(ct.Z,{className:j.title,children:["Filters (",m,")"]})]}),(0,t.jsx)(fa,{...e,ref:o,onSearchChanged:F})]}):(0,t.jsx)(fa,{...e,ref:o,onSearchChanged:F})}function ma(e){const{data:o,columns:l,options:d,title:m,subtitle:v,filters:j,initialState:F,emptyContent:G,onStateChange:U,components:fe,...he}=e,Pe=$a(),Te=(0,ie.Z)(),Ue={...ga,...F},[_e,Vt]=(0,f.useState)(Ue.filtersOpen),dn=(0,f.useCallback)(()=>Vt(Zn=>!Zn),[Vt]),[Dn,rr]=(0,f.useState)(0),[$t,sn]=(0,f.useState)(o),[an,dr]=(0,f.useState)(Ue.filters),gr=Da(l,Te),[mr,vr]=(0,f.useState)(Ue.search);(0,f.useEffect)(()=>{if(U){const Zn=Za({search:mr,filtersOpen:_e,filters:an},ga);U(Zn)}},[mr,_e,an,U]);const ls={headerStyle:{textTransform:"uppercase"}},Mr=(0,f.useCallback)(Zn=>{var Tr;return(Tr=l.find(Xr=>Xr.title===Zn))===null||Tr===void 0?void 0:Tr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!an){sn(o);return}const Zn=Object.values(an);if(o&&Zn.flat().length){const Tr=o.filter(Xr=>!!Object.entries(an).filter(([,qr])=>!!qr.length).every(([qr,gn])=>{const Cn=pa(Xr,Mr(qr));return Array.isArray(Cn)&&Array.isArray(gn)?Cn.some(Eo=>gn.includes(Eo)):Array.isArray(Cn)?Cn.includes(gn):Array.isArray(gn)?gn.includes(Cn):Cn===gn}));sn(Tr)}else sn(o);rr(Zn.flat().length)},[o,an,Mr]);const Zi=(Zn,Tr)=>{const Xr=gn=>{const Cn=new Set,Eo=_r=>{_r!=null&&Cn.add(_r)};return Tr&&Tr.forEach(_r=>{const cs=pa(_r,Mr(gn));Array.isArray(cs)?cs.forEach(Eo):Eo(cs)}),Cn},qr=gn=>({placeholder:"All results",label:gn.column,multiple:gn.type==="multiple-select",items:[...Xr(gn.column)].sort().map(Cn=>({label:Cn,value:Cn}))});return Zn.map(gn=>({type:gn.type,element:qr(gn)}))},rn=!!(j!=null&&j.length),jo=(0,f.useCallback)(Zn=>(0,t.jsx)(Na,{setSearch:vr,hasFilters:rn,selectedFiltersLength:Dn,toggleFilters:dn,...Zn}),[dn,rn,Dn,vr]),Vs=typeof o!="function"&&o.length===0,zr=l.length,Ni=(0,f.useCallback)(Zn=>G&&Vs?(0,t.jsx)("tbody",{children:(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:zr,children:G})})}):(0,t.jsx)(xe.os,{...Zn}),[Vs,G,zr]);return(0,t.jsxs)(w.Z,{className:Pe.root,children:[_e&&o&&typeof o!="function"&&(j==null?void 0:j.length)&&(0,t.jsx)(Ur,{filters:Zi(j,o),selectedFilters:an,onChangeFilters:dr}),(0,t.jsx)(xe.ZP,{components:{Header:ka,Toolbar:jo,Body:Ni,...fe},options:{...ls,...d},columns:gr,icons:ha,title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ct.Z,{variant:"h5",component:"h2",children:m}),v&&(0,t.jsx)(ct.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:$t,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...he})]})}ma.icons=Object.freeze(ha);var kl=r(44311);function Fa(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 Bl(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:Fa(e.data,o)})]})}const Ua=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Ma=({title:e="Unknown page",className:o})=>(0,t.jsx)(ct.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function za(e){const{description:o,title:l,titleComponent:d=void 0,children:m,textAlign:v="left"}=e,j=Ua({textAlign:v})(),F=d||(0,t.jsx)(Ma,{title:l,className:j.title});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(vo.q,{title:l}),(0,t.jsxs)(w.Z,{className:j.container,children:[(0,t.jsxs)(w.Z,{className:j.leftItemsBox,children:[F,o&&(0,t.jsx)(ct.Z,{className:j.description,variant:"body2",children:o})]}),(0,t.jsx)(w.Z,{className:j.rightItemsBox,children:m})]})]})}var Wa=r.p+"static/mic-drop.fe3ef4d0..svg";const Va=(0,g.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Ha=()=>{const e=Va();return(0,t.jsx)("img",{src:Wa,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ga=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Ka(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:m}=e,v=Ga(),j=(0,lr.s0)(),F=Ko();return(0,t.jsxs)(wt.Z,{container:!0,spacing:0,className:v.container,children:[(0,t.jsxs)(wt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,t.jsxs)(ct.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",l]}),(0,t.jsx)(ct.Z,{variant:"body1",className:v.subtitle,children:d}),(0,t.jsx)(ct.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,t.jsxs)(ct.Z,{variant:"h6",children:[(0,t.jsx)(ue.r,{to:"#","data-testid":"go-back-link",onClick:()=>j(-1),children:"Go back"}),"... or please"," ",(0,t.jsx)(ue.r,{to:m||F.url,children:"contact support"})," if you think this is a bug."]})]}),(0,t.jsx)(Ha,{})]})}var Ya=r(16173);const Ja=(0,Sn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(ct.Z),ki=(0,Sn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(w.Z);function Qa(e){const{children:o,...l}=e,[d,m]=f.useState(null),v=f.Children.toArray(o),[j,F,...G]=v,U=G.length?G.pop():v[v.length-1],fe=v.length>3,he=Ue=>{m(Ue.currentTarget)},Pe=()=>{m(null)},Te=Boolean(d);return(0,t.jsxs)(f.Fragment,{children:[(0,t.jsxs)(Ya.Z,{"aria-label":"breadcrumb",...l,children:[v.length>1&&(0,t.jsx)(ki,{clone:!0,children:j}),v.length>2&&(0,t.jsx)(ki,{clone:!0,children:F}),fe&&(0,t.jsx)(Ja,{onClick:he,children:"..."}),(0,t.jsx)(w.Z,{style:{fontStyle:"italic"},children:U})]}),(0,t.jsx)(Vo.ZP,{open:Te,anchorEl:d,onClose:Pe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,t.jsx)(kt.Z,{children:G.map((Ue,_e)=>(0,t.jsx)(Ft.Z,{button:!0,children:(0,t.jsx)(ki,{clone:!0,children:Ue})},_e))})})]})}const Xa=(0,g.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),qa=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,t.jsxs)(Qa,{className:l.breadcrumb,children:[(0,t.jsx)(ue.r,{to:o,children:e}),(0,t.jsx)(ct.Z,{children:d})]}):(0,t.jsx)(ct.Z,{className:l.type,children:e}):null,_a=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,t.jsx)(ct.Z,{className:o.title,variant:"h1",children:e});return l?(0,t.jsx)(P.ZP,{title:l,placement:"top-start",children:d}):d},el=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,t.jsx)(t.Fragment,{children:o}):(0,t.jsx)(ct.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function va(e){const{children:o,pageTitleOverride:l,style:d,subtitle:m,title:v,tooltip:j,type:F,typeLink:G}=e,U=Xa(),he=(0,h.h_)(h.Ds).getOptionalString("app.title")||"Backstage",Pe=l||v,Te=v||l,Ue=`${Pe} | %s | ${he}`,_e=`${Pe} | ${he}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(vo.q,{titleTemplate:Ue,defaultTitle:_e}),(0,t.jsxs)("header",{style:d,className:U.header,children:[(0,t.jsxs)(w.Z,{className:U.leftItemsBox,children:[(0,t.jsx)(qa,{classes:U,type:F,typeLink:G,pageTitle:Te}),(0,t.jsx)(_a,{classes:U,pageTitle:Te,tooltip:j}),(0,t.jsx)(el,{classes:U,subtitle:m})]}),(0,t.jsx)(wt.Z,{container:!0,className:U.rightItemsBox,spacing:4,children:o})]})]})}const tl=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:v=>{m&&m(v)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function $l(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,m]=React.useState(!1),v=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:v,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((j,F)=>_jsx(tl,{...j},`header-action-menu-${F}`))})})]})}const nl=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,_.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),rl=({value:e,className:o})=>(0,t.jsx)(ct.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function ol(e){const{label:o,value:l,url:d}=e,m=nl(),v=(0,t.jsx)(rl,{className:m.value,value:l||"<Unknown>"});return(0,t.jsx)(wt.Z,{item:!0,children:(0,t.jsxs)(ct.Z,{component:"span",className:m.root,children:[(0,t.jsx)(ct.Z,{className:m.label,children:o}),d?(0,t.jsx)(ue.r,{to:d,children:v}):v]})})}const sl=e=>(0,Wn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),il=(0,g.Z)(sl,{name:"BackstageItemCardHeader"});function al(e){const{title:o,subtitle:l,children:d}=e,m=il(e);return(0,t.jsxs)(w.Z,{className:m.root,children:[l&&(0,t.jsx)(ct.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,t.jsx)(ct.Z,{variant:"h6",component:"h4",children:o}),d]})}function Dl(e){const{description:o,tags:l,title:d,type:m,subtitle:v,label:j,onClick:F,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:v||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((U,fe)=>_jsx(Chip,{size:"small",label:U},fe))}):null,o]}),_jsxs(CardActions,{children:[!G&&_jsx(LinkButton,{to:"#",onClick:F,color:"primary",children:j}),G&&_jsx(LinkButton,{to:G,color:"primary",children:j})]})]})}const ll=e=>(0,Wn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),cl=(0,g.Z)(ll,{name:"BackstageItemCardGrid"});function dl(e){const{children:o,...l}=e,d=cl(l);return(0,t.jsx)(w.Z,{className:d.root,...l,children:o})}var ul=r(41547);const hl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"}}}),{name:"BackstagePage"});function ya(e){const{themeId:o,children:l}=e,d=hl();return(0,t.jsx)(ul.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,t.jsx)("main",{className:d.root,children:l})})}function pl(e){const{themeId:o,children:l,...d}=e;return(0,t.jsxs)(ya,{themeId:o,children:[(0,t.jsx)(va,{...d}),l]})}var qn=r(30195);const Zl=qn.z.object({providerInfo:qn.z.object({}).catchall(qn.z.unknown()).optional(),profile:qn.z.object({email:qn.z.string().optional(),displayName:qn.z.string().optional(),picture:qn.z.string().optional()}),backstageIdentity:qn.z.object({token:qn.z.string(),identity:qn.z.object({type:qn.z.literal("user"),userEntityRef:qn.z.string(),ownershipEntityRefs:qn.z.array(qn.z.string())})})}),xa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function fl(e){const o=new Date(Date.now()+xa.defaultTokenExpiryMillis);if(!e)return o;const[l,d,m]=e.split("."),v=JSON.parse(window.atob(d));return typeof v.exp!="number"?o:new Date(v.exp*1e3-xa.tokenExpiryMarginMillis)}class Nl{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:fl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Fl=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:m}]=useAsync(async()=>{const v=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await v.start(),e.onSignInSuccess(v)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},gl=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Bi=({children:e})=>{const o=gl();return(0,t.jsx)(wt.Z,{component:"li",item:!0,classes:o,children:e})};var is=r(87612);class $i{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function ml(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class Di{getUserId(){return this.result.userId}static fromResult(o){return new Di(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:d}=ml(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,is._)(this,"result",void 0),this.result=o}}class as{static createGuest(){return new $i}static fromLegacy(o){return Di.fromResult(o)}static create(o){return new as(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,is._)(this,"identity",void 0),(0,is._)(this,"authApi",void 0),(0,is._)(this,"profile",void 0),(0,is._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const vl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:m,title:v,message:j}=e,F=(0,h.h_)(m),G=(0,h.h_)(h.VE),U=async()=>{try{o();const fe=await F.getBackstageIdentity({instantPopup:!0});if(!fe)throw d(),new Error(`The ${v} provider is not configured to support sign-in`);const he=await F.getProfile();l(as.create({identity:fe.identity,profile:he,authApi:F}))}catch(fe){d(),G.post(new Kn.SP("Login failed",fe))}};return(0,t.jsx)(Bi,{children:(0,t.jsx)(jr,{variant:"fullHeight",title:v,actions:(0,t.jsx)(ve.Z,{color:"primary",variant:"outlined",onClick:U,children:"Sign In"}),children:(0,t.jsx)(ct.Z,{variant:"body1",children:j})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const m=await l.getProfile();return as.create({identity:d.identity,profile:m,authApi:l})}},yl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,t.jsx)(Bi,{children:(0,t.jsx)(jr,{title:"Guest",variant:"fullHeight",actions:(0,t.jsx)(ve.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new $i)},children:"Enter"}),children:(0,t.jsxs)(ct.Z,{variant:"body1",children:["Enter as a Guest User.",(0,t.jsx)("br",{}),"You will not have a verified identity,",(0,t.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new $i};var xl=r(63955),ba=r(86619),Sa=r(74828),bl=r(45455),Sl=r.n(bl);const Cl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,wl=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ca=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},jl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=wl(),{register:d,handleSubmit:m,formState:v}=(0,xl.cI)({mode:"onChange"}),{errors:j}=v,F=({userId:G,idToken:U})=>{e(),o(as.fromLegacy({userId:G,getIdToken:U!==void 0?async()=>U:void 0,profile:{email:`${G}@example.com`}}))};return(0,t.jsx)(Bi,{children:(0,t.jsxs)(jr,{title:"Custom User",variant:"fullHeight",children:[(0,t.jsxs)(ct.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,t.jsx)("br",{}),"This selection will not be stored."]}),(0,t.jsxs)("form",{className:l.form,onSubmit:m(F),children:[(0,t.jsxs)(uo.Z,{children:[(0,t.jsx)(ba.Z,{...Ca(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(j.userId)}),j.userId&&(0,t.jsx)(Sa.Z,{error:!0,children:j.userId.message})]}),(0,t.jsxs)(uo.Z,{children:[(0,t.jsx)(ba.Z,{...Ca(d("idToken",{required:!1,validate:G=>!G||Cl.test(G)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(j.idToken)}),j.idToken&&(0,t.jsx)(Sa.Z,{error:!0,children:j.idToken.message})]}),(0,t.jsx)(ve.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(v!=null&&v.isDirty)||!Sl()(j),children:"Continue"})]})]})})},loader:async()=>{}},wo="@backstage/core:SignInPage:provider",wa={guest:yl,custom:jl,common:vl};function ja(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Gl(e){return e.reduce((l,d)=>{if(typeof d=="string")return ja(d,l),l[d]={components:wa[d],id:d},l;const{id:m}=d;return ja(m,l),l[m]={components:wa.common,id:m,config:d},l},{})}const Kl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[m,v]=useState(!0),j=useCallback(G=>{o(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var U;localStorage.removeItem(wo),await((U=G.signOut)===null||U===void 0?void 0:U.call(G))}}))},[o]);useLayoutEffect(()=>{var G;if(!m)return;const U=localStorage.getItem(wo);if(U===null){v(!1);return}const fe=e[U];if(!fe){v(!1);return}let he=!1;return fe.components.loader(d,(G=fe.config)===null||G===void 0?void 0:G.apiRef).then(Pe=>{if(he){localStorage.removeItem(wo);return}Pe?j(Pe):v(!1)}).catch(Pe=>{localStorage.removeItem(wo),!he&&(l.post(Pe),v(!1))}),()=>{he=!0}},[m,l,o,d,e,j]);const F=useMemo(()=>Object.keys(e).map(G=>{const U=e[G],{Component:fe}=U.components,he=Ue=>{j(Ue)},Pe=()=>{var Ue;localStorage.setItem(wo,(U==null||(Ue=U.config)===null||Ue===void 0?void 0:Ue.id)||U.id)},Te=()=>{localStorage.removeItem(wo)};return _jsx(fe,{config:U.config,onSignInStarted:Pe,onSignInSuccess:he,onSignInFailure:Te},U.id)}),[e,j]);return[m,F]},El=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const m=useApi(configApiRef),v=useStyles(),j=getSignInProviders(o),[F,G]=useSignInProviders(j,e);return F?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:v,children:G})]})]})},Al=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),m=useApi(e.apiRef),v=useApi(configApiRef),[j,F]=useState(),[G,U]=useState(!1),fe=async({checkExisting:he,showPopup:Pe})=>{try{let Te;if(he&&(Te=await m.getBackstageIdentity({optional:!0})),!Te&&(Pe||o)&&(U(!0),Te=await m.getBackstageIdentity({instantPopup:!0}),!Te))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Te){U(!0);return}const Ue=await m.getProfile();l(UserIdentity.create({identity:Te.identity,authApi:m,profile:Ue}))}catch(Te){F(Te),U(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),G?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:v.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),j&&j.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:j.message})]})})})})]}):_jsx(Progress,{})};function Yl(e){return"provider"in e?_jsx(Al,{...e}):_jsx(El,{...e})}const Tl=(0,g.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Rl=(0,Sn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(ro.Z);function Jl(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:m,deepLink:v,value:j,onChange:F}=e,G=Tl(),[U,fe]=useState(0),he=F||((Ue,_e)=>fe(_e));let Pe;j?React.Children.map(d,Ue=>{if(React.isValidElement(Ue)&&(Ue==null?void 0:Ue.props.value)===j){var _e;Pe=Ue==null||(_e=Ue.props)===null||_e===void 0?void 0:_e.children}}):React.Children.map(d,(Ue,_e)=>{React.isValidElement(Ue)&&_e===U&&(Pe=Ue==null?void 0:Ue.props.children)});const Te=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Te,children:[m&&_jsx(Rl,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:j||U,onChange:he,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Pe}),v&&_jsx(BottomLink,{...v})]})})}const Il=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Ql(e){const{children:o,...l}=e,d=Il();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(Ct,$e,r){"use strict";r.d($e,{fC:function(){return g},CL:function(){return Qe},sM:function(){return ie},$v:function(){return ze},v_:function(){return z},hg:function(){return yt},uB:function(){return Le},R5:function(){return tt},bq:function(){return O},Km:function(){return oe},Ds:function(){return ot},ni:function(){return w},T0:function(){return I},CO:function(){return ct},x8:function(){return Un},rx:function(){return Tn},YO:function(){return vn},P4:function(){return wt},NT:function(){return Jt},NW:function(){return He},VE:function(){return st},W0:function(){return St},gP:function(){return It},IY:function(){return mt},F4:function(){return ne},ux:function(){return T},Kp:function(){return ee},$4:function(){return xt},p_:function(){return P},ZM:function(){return lt},D:function(){return $},gW:function(){return L},E6:function(){return Pt},z$:function(){return _t},h_:function(){return ve},I_:function(){return B},qD:function(){return ge},vJ:function(){return jn},tg:function(){return wn},Oi:function(){return Mn}});var t=r(52322),h=r(51837),H=r(2784);const f=(0,h.CT)("analytics-context"),W=()=>{const Ce=(0,H.useContext)(f);if(Ce===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ce=Ce.atVersion(1);if(ce===void 0)throw new Error("No context found for version 1.");return ce},g=Ce=>{const{attributes:ce,children:Oe}=Ce,Xe={...W(),...ce},se=(0,h.EI)({1:Xe});return(0,t.jsx)(f.Provider,{value:se,children:Oe})};function u(Ce,ce){const Oe=Me=>_jsx(g,{attributes:ce,children:_jsx(Ce,{...Me})});return Oe.displayName=`WithAnalyticsContext(${Ce.displayName||Ce.name||"Component"})`,Oe}function B(){const Ce=(0,h.Vt)("api-context");if(!Ce)throw new Error("API context is not available");const ce=Ce.atVersion(1);if(!ce)throw new Error("ApiContext v1 not available");return ce}function ve(Ce){const Oe=B().get(Ce);if(!Oe)throw new Error(`No implementation available for ${Ce}`);return Oe}function ue(Ce){return function(Oe){const Me=se=>{const D=B(),me={};for(const De in Ce)if(Ce.hasOwnProperty(De)){const et=Ce[De],it=D.get(et);if(!it)throw new Error(`No implementation available for ${et}`);me[De]=it}return _jsx(Oe,{...se,...me})},Xe=Oe.displayName||Oe.name||"Component";return Me.displayName=`withApis(${Xe})`,Me}}var V=r(87612);class K{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(ce){if((0,V._)(this,"config",void 0),this.config=ce,!ce.id.split(".").flatMap(Me=>Me.split("-")).every(Me=>Me.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ce.id}'`)}}function I(Ce){return new K(Ce)}function w(Ce,ce){return"id"in Ce?{api:Ce,deps:{},factory:()=>ce}:Ce}var ie;(function(Ce){Ce.SignedIn="SignedIn",Ce.SignedOut="SignedOut"})(ie||(ie={}));const ee=I({id:"core.auth.google"}),ne=I({id:"core.auth.github"}),$=I({id:"core.auth.okta"}),T=I({id:"core.auth.gitlab"}),P=I({id:"core.auth.microsoft"}),L=I({id:"core.auth.onelogin"}),O=I({id:"core.auth.bitbucket"}),oe=I({id:"core.auth.bitbucket-server"}),Le=I({id:"core.auth.atlassian"}),ze=I({id:"core.alert"}),z=I({id:"core.analytics"}),yt=I({id:"core.apptheme"}),ot=I({id:"core.config"}),He=I({id:"core.discovery"}),st=I({id:"core.error"});var Qe;(function(Ce){Ce[Ce.None=0]="None",Ce[Ce.Active=1]="Active"})(Qe||(Qe={}));const St=I({id:"core.featureflags"}),It=I({id:"core.fetch"}),xt=I({id:"core.identity"}),lt=I({id:"core.oauthrequest"}),Pt=I({id:"core.storage"});class Nt{setContext(ce){this.context=ce}captureEvent(ce,Oe,{value:Me,attributes:Xe}={}){try{this.analyticsApi.captureEvent({action:ce,subject:Oe,value:Me,attributes:Xe,context:this.context})}catch(se){console.warn("Error during analytics event capture. %o",se)}}constructor(ce,Oe={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=ce,this.context=Oe}}function We(){try{return ve(z)}catch{return{captureEvent:()=>{}}}}function _t(){const Ce=(0,H.useRef)(null),ce=W(),Oe=We();function Me(){return Ce.current===null&&(Ce.current=new Nt(Oe)),Ce.current}const Xe=Me();return Xe.setContext(ce),Xe}const ge=()=>{const Ce=(0,h.Vt)("app-context");if(!Ce)throw new Error("App context is not available");const ce=Ce.atVersion(1);if(!ce)throw new Error("AppContext v1 not available");return ce},Se=(0,h.uW)("component-data-store",()=>new WeakMap),Fe="__backstage_data";function tt(Ce,ce,Oe){const Me=Ce;var Xe;let se=(Xe=Me[Fe])!==null&&Xe!==void 0?Xe:Se.get(Ce);if(se||(se={map:new Map},Object.defineProperty(Me,Fe,{enumerable:!1,configurable:!0,writable:!1,value:se}),Se.set(Ce,se)),se.map.has(ce)){const D=Ce.displayName||Ce.name;throw new Error(`Attempted to attach duplicate data "${ce}" to component "${D}"`)}se.map.set(ce,Oe)}function mt(Ce,ce){if(!Ce)return;const Oe=Ce.type;if(!Oe)return;var Me;const Xe=(Me=Oe[Fe])!==null&&Me!==void 0?Me:Se.get(Oe);if(Xe)return Xe.map.get(ce)}const bt=(0,h.uW)("route-ref-type",()=>Symbol("route-ref-type"));let pt=bt,Ot=pt;class Ht{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ce,Oe){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Ot,void 0),this.id=ce,this.params=Oe,this[pt]="absolute"}}function Jt(Ce){var ce;return new Ht(Ce.id,(ce=Ce.params)!==null&&ce!==void 0?ce:[])}const Bt=/^\w+$/;let un=null,Yt=null;class pn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ce,Oe,Me,Xe){_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,Yt,void 0),this.id=ce,this.path=Oe,this.parent=Me,this.params=Xe,this[un]="sub"}}function Fn(Ce){const{id:ce,path:Oe,parent:Me}=Ce,Xe=Oe.split("/").filter(me=>me.startsWith(":")).map(me=>me.substring(1)),se=[...Me.params,...Xe];if(Me.params.some(me=>Xe.includes(me)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Oe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Oe}'`);if(Oe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Oe}'`);for(const me of Xe)if(!Bt.test(me))throw new Error(`SubRouteRef path has invalid param, got '${me}'`);return new pn(ce,Oe,Me,se)}let Pn=bt,fn=Pn;class Ln{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ce,Oe,Me){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,fn,void 0),this.id=ce,this.params=Oe,this.optional=Me,this[Pn]="external"}}function Un(Ce){var ce;return new Ln(Ce.id,(ce=Ce.params)!==null&&ce!==void 0?ce:[],Boolean(Ce.optional))}var tn=r(73557);function wn(Ce){const{pathname:ce}=(0,tn.TH)(),Oe=(0,h.Vt)("routing-context");if(!Oe)throw new Error("Routing context is not available");const Me=Oe.atVersion(1),Xe=(0,H.useMemo)(()=>Me&&Me.resolve(Ce,{pathname:ce}),[Me,Ce,ce]);if(!Oe)throw new Error("useRouteRef used outside of routing context");if(!Me)throw new Error("RoutingContext v1 not available");const se="optional"in Ce&&Ce.optional;if(!Xe&&!se)throw new Error(`No path for ${Ce}`);return Xe}function Mn(Ce){return(0,tn.UO)()}class ut extends H.Component{static getDerivedStateFromError(ce){return{error:ce}}render(){const{error:ce}=this.state,{app:Oe,plugin:Me}=this.props,{ErrorBoundaryFallback:Xe}=Oe.getComponents();return ce?(0,t.jsx)(Xe,{error:ce,resetError:this.handleErrorReset,plugin:Me}):this.props.children}constructor(...ce){super(...ce),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var _n=r(64355);function wt(Ce){const{component:ce,mountPoint:Oe,name:Me}=Ce;return vn({component:{lazy:()=>ce().then(Xe=>{const se=me=>{try{wn(Oe)}catch(De){if(typeof De=="object"&&De!==null){const{message:et}=De;if(typeof et=="string"&&et.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Oe} 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 De}return(0,t.jsx)(Xe,{...me})},D=Me||Xe.displayName||Xe.name||"LazyComponent";return se.displayName=`RoutableExtension(${D})`,se},Xe=>D=>{const me=ge(),{BootErrorPage:De}=me.getComponents();return(0,t.jsx)(De,{step:"load-chunk",error:Xe})})},data:{"core.mountPoint":Oe},name:Me})}function ct(Ce){const{component:ce,name:Oe}=Ce;return vn({component:ce,name:Oe})}function vn(Ce){const{data:ce={},name:Oe}=Ce;Oe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Me;if("lazy"in Ce.component){const se=Ce.component.lazy;Me=(0,H.lazy)(()=>se().then(D=>({default:D})))}else Me=Ce.component.sync;const Xe=Oe||Me.displayName||Me.name||"Component";return{expose(se){const D=me=>{const De=ge(),{Progress:et}=De.getComponents(),it=ce==null?void 0:ce["core.mountPoint"];return(0,t.jsx)(H.Suspense,{fallback:(0,t.jsx)(et,{}),children:(0,t.jsx)(ut,{app:De,plugin:se,children:(0,t.jsx)(g,{attributes:{pluginId:se.getId(),...Oe&&{extension:Oe},...it&&{routeRef:it.id}},children:(0,t.jsx)(_n.o,{plugin:se,children:(0,t.jsx)(Me,{...me})})})})})};tt(D,"core.plugin",se),tt(D,"core.extensionName",Oe);for(const[me,De]of Object.entries(ce))tt(D,me,De);return D.displayName=`Extension(${Xe})`,D}}}function Kt(Ce,ce,Oe,Me){return H.Children.toArray(Ce).flatMap(Xe=>{if(!(0,H.isValidElement)(Xe))return[];if(Xe.type===H.Fragment)return Kt(Xe.props.children,ce,Oe,Me);if(mt(Xe,"core.featureFlagged")){const se=Xe.props;return("with"in se?ce.isActive(se.with):!ce.isActive(se.without))?Kt(Xe.props.children,ce,Oe,Me):[]}if(Oe===void 0||Oe(Xe))return[Xe];if(Me)throw new Error(Me);return Kt(Xe.props.children,ce,Oe,Me)})}class hn{selectByComponentData(ce){const Oe=Kt(this.node,this.featureFlagsApi,Me=>mt(Me,ce.key)!==void 0,ce.withStrictError);return new hn(Oe,this.featureFlagsApi)}findComponentData(ce){return Kt(this.node,this.featureFlagsApi,Me=>mt(Me,ce.key)!==void 0).map(Me=>mt(Me,ce.key)).filter(Me=>Me!==void 0)}getElements(){return Kt(this.node,this.featureFlagsApi)}constructor(ce,Oe){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=ce,this.featureFlagsApi=Oe}}function jn(Ce,ce,Oe=[]){const Me=ve(St),Xe=new hn(Ce,Me);return(0,H.useMemo)(()=>ce(Xe),[Ce,...Oe])}class ln{getId(){return this.config.id}getApis(){var ce;return(ce=this.config.apis)!==null&&ce!==void 0?ce:[]}getFeatureFlags(){var ce,Oe;return(Oe=(ce=this.config.featureFlags)===null||ce===void 0?void 0:ce.slice())!==null&&Oe!==void 0?Oe:[]}get routes(){var ce;return(ce=this.config.routes)!==null&&ce!==void 0?ce:{}}get externalRoutes(){var ce;return(ce=this.config.externalRoutes)!==null&&ce!==void 0?ce:{}}provide(ce){return ce.expose(this)}__experimentalReconfigure(ce){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ce))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ce;return(ce=this.options)!==null&&ce!==void 0?ce:{}}toString(){return`plugin{${this.config.id}}`}constructor(ce){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=ce,this.options=void 0}}function Tn(Ce){return new ln(Ce)}},64355:function(Ct,$e,r){"use strict";r.d($e,{o:function(){return W},y:function(){return g}});var t=r(52322),h=r(51837),H=r(2784);const f="plugin-context",W=u=>{const{children:B,plugin:ve}=u,{Provider:ue}=(0,h.CT)(f);return(0,t.jsx)(ue,{value:(0,h.EI)({1:{plugin:ve}}),children:B})};function g(){const u=(0,h.Vt)(f);if(!u)throw new Error("Plugin Options context is not available");const B=u.atVersion(1);if(!B)throw new Error("Plugin Options v1 is not available");return B.plugin.getPluginOptions()}},23054:function(Ct,$e,r){"use strict";r.d($e,{SP:function(){return ee},dR:function(){return K},VL:function(){return $},BD:function(){return h}});function t(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const P=T;return!(typeof P.name!="string"||P.name===""||typeof P.message!="string")}function h(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const P=T;if(typeof P.name!="string"||P.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof P.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var H=r(87612),f=r(24852);function W(T,P){const O={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return P!=null&&P.includeStack||delete O.stack,O}function g(T){const P=(0,f.deserializeError)(T);return T.stack||(P.stack=void 0),P}function u(T){if(t(T)){const P=String(T);return P!=="[object Object]"?P:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class B extends Error{constructor(P,L){var O;let oe=P;if(L!==void 0){const Le=u(L);oe?oe+=`; caused by ${Le}`:oe=`caused by ${Le}`}super(oe),(0,H._)(this,"cause",void 0),(O=Error.captureStackTrace)===null||O===void 0||O.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=t(L)?L:void 0}}class ve extends null{}class ue extends null{}class V extends null{}class K extends B{}class I extends null{}class w extends null{}class ie extends null{}class ee extends B{constructor(P,L){super(P,L),this.name=t(L)?L.name:"Error"}}async function ne(T){try{const L=await T.text();if(L){var P;if(!((P=T.headers.get("content-type"))===null||P===void 0)&&P.startsWith("application/json"))try{const O=JSON.parse(L);if(O.error&&O.response)return O}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${L}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class $ extends Error{static async fromResponse(P){const L=await ne(P),O=L.response.statusCode||P.status,oe=L.error.name||P.statusText,Le=`Request failed with ${O} ${oe}`,ze=g(L.error);return new $({message:Le,response:P,data:L,cause:ze})}constructor(P){super(P.message),(0,H._)(this,"response",void 0),(0,H._)(this,"body",void 0),(0,H._)(this,"cause",void 0),this.name="ResponseError",this.response=P.response,this.body=P.data,this.cause=P.cause}}},32838:function(Ct,$e,r){"use strict";r.d($e,{nW:function(){return ee},ae:function(){return V},q3:function(){return K}});var t=r(60871);const h=(0,t.T0)({id:"core.scmauth"});var H=new WeakMap;class f{async getCredentials($){const T=new URL($.url),P=_class_private_field_get(this,H).find(L=>L.isUrlSupported(T));if(!P)throw new Error(`No auth provider available for '${$.url}', see https://backstage.io/link?scm-auth`);return P.getCredentials($)}constructor($){_class_private_field_init(this,H,{writable:!0,value:void 0}),_class_private_field_set(this,H,$)}}var W=new WeakMap,g=new WeakMap,u=new WeakMap,B=new WeakMap;class ve{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:$,gitlab:T,azure:P,bitbucket:L})=>ve.merge(ve.forGithub($),ve.forGitlab(T),ve.forAzure(P),ve.forBitbucket(L))})}static forAuthApi($,T){return new ve("generic",$,T.host,T.scopeMapping)}static forGithub($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"github.com";return new ve("github",$,L,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"gitlab.com";return new ve("gitlab",$,L,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"dev.azure.com";return new ve("azure",$,L,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket($,T){var P;const L=(P=T==null?void 0:T.host)!==null&&P!==void 0?P:"bitbucket.org";return new ve("bitbucket",$,L,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...$){return new f($)}isUrlSupported($){return $.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider($){var T;if(!($!=null&&$.customScopes)||_class_private_field_get(this,B)==="generic")return[];var P;return(P=(T=$.customScopes)===null||T===void 0?void 0:T[_class_private_field_get(this,B)])!==null&&P!==void 0?P:[]}async getCredentials($){const{url:T,additionalScope:P,...L}=$,O=_class_private_field_get(this,u).default.slice();P!=null&&P.repoWrite&&O.push(..._class_private_field_get(this,u).repoWrite);const oe=this.getAdditionalScopesForProvider(P);oe.length&&O.push(...oe);const Le=[...new Set(O)],ze=await _class_private_field_get(this,W).getAccessToken(Le,L);return{token:ze,headers:{Authorization:`Bearer ${ze}`}}}constructor($,T,P,L){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,u,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,W,T),_class_private_field_set(this,g,P),_class_private_field_set(this,u,L),_class_private_field_set(this,B,$)}}var ue=r(79158);class V{static fromConfig($){return ue.Lx.fromConfig($)}}const K=(0,t.T0)({id:"integration.scmintegrations"});var I=r(52322),w=r(73250),ie=r(2784);const ee=ne=>{const{type:$}=ne,T=(0,t.qD)(),P=w.Z;var L;const O=$&&(L=T.getSystemIcon($))!==null&&L!==void 0?L:P;return(0,I.jsx)(O,{})}},79158:function(Ct,$e,r){"use strict";r.d($e,{Lx:function(){return er},BT:function(){return dt}});var t=r(87612),h=r(82717),H=r.n(h),f=r(76635);function W(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function u(S,c){return{list(){return S},byUrl(b){try{const E=typeof b=="string"?new URL(b):b;return S.find(Q=>c(Q)===E.host)}catch{return}},byHost(b){return S.find(E=>c(E)===b)}}}function B(S){const{url:c,base:b,lineNumber:E}=S;try{return new URL(c),c}catch{}let Q;if(c.startsWith("/")){const{filepath:be}=H()(b);Q=new URL(b);const je=(0,f.trimEnd)(Q.pathname.substring(0,Q.pathname.length-be.length),"/");Q.pathname=`${je}${c}`}else Q=new URL(c,b);return Q.search=new URL(b).search,E&&(Q.hash=`L${E}`),Q.toString()}function ve(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const ue="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var b;const E=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let Q,be;if(c){try{const yn=new URL(c);Q=yn.host,be=yn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(be!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else Q=ue;const je=S.getOptionalString("accessKeyId"),ke=S.getOptionalString("secretAccessKey"),ht=S.getOptionalString("roleArn"),ft=S.getOptionalString("externalId");return{host:Q,endpoint:c,s3ForcePathStyle:E,accessKeyId:je,secretAccessKey:ke,roleArn:ht,externalId:ft}}function K(S){const c=S.map(V);return c.some(b=>b.host===ue)||c.push({host:ue}),c}class I{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(I,"factory",({config:S})=>{var c;const b=K((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new I(E)),E=>E.config.host)});var w=r(88412),ie=r(50629),ee=r(80956);const ne="GB";var $=new WeakMap,T=new WeakMap,P=new WeakMap,L=new WeakMap,O=new WeakMap,oe=new WeakMap,Le=new WeakMap;class ze{static fromRepoUrl(c){const b=new URL(c);let E,Q,be;const je=b.pathname.split("/").map(kn=>decodeURIComponent(kn));if(je[2]==="_git"?(E=je[1],Q=be=je[3]):je[3]==="_git"?(E=je[1],Q=je[2],be=je[4]):je[4]==="_git"&&(E=`${je[1]}/${je[2]}`,Q=je[3],be=je[5]),!E||!Q||!be)throw new Error("Azure URL must point to a git repository");var ke;const ht=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let ft;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");ft=yn.slice(2)}return new ze(b.origin,E,Q,be,ht,ft)}toRepoUrl(){let c;return(0,w._)(this,P)===(0,w._)(this,L)?c=(0,w._)(this,Le).call(this,(0,w._)(this,T),"_git",(0,w._)(this,L)):c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_git",(0,w._)(this,L)),(0,w._)(this,O)&&c.searchParams.set("path",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",ne+(0,w._)(this,oe)),c.toString()}toFileUrl(){if(!(0,w._)(this,O))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",(0,w._)(this,oe)),c.toString()}toArchiveUrl(){const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,w._)(this,O)&&c.searchParams.set("scopePath",(0,w._)(this,O)),(0,w._)(this,oe)&&c.searchParams.set("version",(0,w._)(this,oe)),c.toString()}toCommitsUrl(){const c=(0,w._)(this,Le).call(this,(0,w._)(this,T),(0,w._)(this,P),"_apis","git","repositories",(0,w._)(this,L),"commits");return c.searchParams.set("api-version","6.0"),(0,w._)(this,oe)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,w._)(this,oe)),c.toString()}getOwner(){return(0,w._)(this,T)}getProject(){return(0,w._)(this,P)}getRepo(){return(0,w._)(this,L)}getPath(){return(0,w._)(this,O)}getRef(){return(0,w._)(this,oe)}constructor(c,b,E,Q,be,je){(0,ie._)(this,$,{writable:!0,value:void 0}),(0,ie._)(this,T,{writable:!0,value:void 0}),(0,ie._)(this,P,{writable:!0,value:void 0}),(0,ie._)(this,L,{writable:!0,value:void 0}),(0,ie._)(this,O,{writable:!0,value:void 0}),(0,ie._)(this,oe,{writable:!0,value:void 0}),(0,ie._)(this,Le,{writable:!0,value:(...ke)=>{const ht=new URL((0,w._)(this,$));return ht.pathname=ke.map(ft=>encodeURIComponent(ft)).join("/"),ht}}),(0,ee._)(this,$,c),(0,ee._)(this,T,b),(0,ee._)(this,P,E),(0,ee._)(this,L,Q),(0,ee._)(this,O,be),(0,ee._)(this,oe,je)}}const z="dev.azure.com";function yt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:z,E=S.getOptionalString("token");if(!W(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);return{host:b,token:E}}function ot(S){const c=S.map(yt);return c.some(b=>b.host===z)||c.push({host:z}),c}class He{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E}=c;if(g(b))return b;try{const be=ze.fromRepoUrl(E),je=new URL(E);var Q;const ke=new URL(`https://a.com${(Q=be.getPath())!==null&&Q!==void 0?Q:""}`),ht=new URL(b,ke).pathname;return je.searchParams.set("path",ht),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(b,E).toString()}}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(He,"factory",({config:S})=>{var c;const b=ot((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new He(E)),E=>E.config.host)});var st=r(48834).lW;function Qe(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function St(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function It(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}function xt(S,c){const b=c?{...c}:{};if(S.token){const E=st.from(`:${S.token}`,"utf8");b.Authorization=`Basic ${E.toString("base64")}`}return{headers:b}}const lt="bitbucket.org",Pt="https://api.bitbucket.org/2.0";function Nt(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:lt;let E=S.getOptionalString("apiBaseUrl");const Q=S.getOptionalString("token"),be=S.getOptionalString("username"),je=S.getOptionalString("appPassword");if(!W(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return E?E=(0,f.trimEnd)(E,"/"):b===lt?E=Pt:E=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:E,token:Q,username:be,appPassword:je}}function We(S){const c=S.map(Nt);return c.some(b=>b.host===lt)||c.push({host:lt,apiBaseUrl:Pt}),c}class _t{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(!c.lineNumber)return b;const 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=H()(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,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(_t,"factory",({config:S})=>{var c,b,E;const Q=We((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 u(Q.map(be=>new _t(be)),be=>be.config.host)});var ge=r(96279),Se=r(48834).lW;async function Fe(S,c){const{name:b,owner:E,resource:Q}=parseGitUrl(S),be=Q==="bitbucket.org";let je=be?`${c.apiBaseUrl}/repositories/${E}/${b}`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,ke=await fetch(je,bt(c));if(ke.status===404&&!be&&(je=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,ke=await fetch(je,bt(c))),!ke.ok){const ft=`Failed to retrieve default branch from ${je}, ${ke.status} ${ke.statusText}`;throw new Error(ft)}let ht;if(be)ht=(await ke.json()).mainbranch.name;else{const{displayId:ft}=await ke.json();ht=ft}if(!ht)throw new Error(`Failed to read default branch from ${je}. Response ${ke.status} ${ke.json()}`);return ht}async function tt(S,c){const{name:b,owner:E,ref:Q,protocol:be,resource:je,filepath:ke}=parseGitUrl(S),ht=je==="bitbucket.org";let ft=Q;ft||(ft=await Fe(S,c));const yn=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return ht?`${be}://${je}/${E}/${b}/get/${ft}.tar.gz`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${ft}&prefix=${E}-${b}${yn}`}function mt(S,c){try{const{owner:b,name:E,ref:Q,filepathtype:be,filepath:je}=parseGitUrl(S);if(!b||!E||be!=="browse"&&be!=="raw"&&be!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${Q}/${ke}`}return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function bt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=Se.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const pt="bitbucket.org",Ot="https://api.bitbucket.org/2.0";function Ht(S){const c=pt,b=Ot,E=S.getString("username"),Q=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:E,appPassword:Q}}function Jt(S){const c=S.map(Ht);return c.length===0&&c.push({host:pt,apiBaseUrl:Ot}),c}class Bt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(c.lineNumber){const E=new URL(b);return E.hash=`lines-${c.lineNumber}`,E.toString()}return b}resolveEditUrl(c){const b=H()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Bt,"factory",({config:S})=>{var c;const b=Jt((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new Bt(E)),E=>E.config.host)});var un=r(48834).lW;async function Yt(S,c){const{name:b,owner:E}=parseGitUrl(S),Q=`${c.apiBaseUrl}/repositories/${E}/${b}`,be=await fetch(Q,Pn(c));if(!be.ok){const ht=`Failed to retrieve default branch from ${Q}, ${be.status} ${be.statusText}`;throw new Error(ht)}const ke=(await be.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${Q}. Response ${be.status} ${be.json()}`);return ke}async function pn(S,c){const{name:b,owner:E,ref:Q,protocol:be,resource:je}=parseGitUrl(S);let ke=Q;return ke||(ke=await Yt(S,c)),`${be}://${je}/${E}/${b}/get/${ke}.tar.gz`}function Fn(S,c){try{const{owner:b,name:E,ref:Q,filepathtype:be,filepath:je}=parseGitUrl(S);if(!b||!E||be!=="src"&&be!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=je.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${Q}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Pn(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 fn(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token"),Q=S.getOptionalString("username"),be=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:E,username:Q,password:be}}function Ln(S){return S.map(fn)}class Un{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=B(c);if(c.lineNumber){const 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,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Un,"factory",({config:S})=>{var c;const b=Ln((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new Un(E)),E=>E.config.host)});var tn=r(48834).lW;async function wn(S,c){const{name:b,owner:E}=parseGitUrl(S);let Q=`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,be=await fetch(Q,_n(c));if(be.status===404&&(Q=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,be=await fetch(Q,_n(c))),!be.ok){const ht=`Failed to retrieve default branch from ${Q}, ${be.status} ${be.statusText}`;throw new Error(ht)}const{displayId:je}=await be.json(),ke=je;if(!ke)throw new Error(`Failed to read default branch from ${Q}. Response ${be.status} ${be.json()}`);return ke}async function Mn(S,c){const{name:b,owner:E,ref:Q,filepath:be}=parseGitUrl(S);let je=Q;je||(je=await wn(S,c));const ke=be?`&path=${encodeURIComponent(decodeURIComponent(be))}`:"";return`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${je}&prefix=${E}-${b}${ke}`}function ut(S,c){try{const{owner:b,name:E,ref:Q,filepathtype:be,filepath:je}=parseGitUrl(S);if(!b||!E||be!=="browse"&&be!=="raw"&&be!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${Q}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function _n(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=tn.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function wt(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),E=S.getOptionalString("cloneUrl"),Q=S.getOptionalString("gitilesBaseUrl");const be=S.getOptionalString("username"),je=S.getOptionalString("password");if(W(c)){if(b&&!g(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(E&&!g(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(Q&&!g(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' 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}`,Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,E?E=(0,f.trimEnd)(E,"/"):E=b,{host:c,baseUrl:b,cloneUrl:E,gitilesBaseUrl:Q,username:be,password:je}}function ct(S){return S.map(wt)}var vn=r(48834).lW;const Kt=")]}'";function hn(S,c){const E=c.replace(S.gitilesBaseUrl,"").split("/").filter(ft=>!!ft),Q=E.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${c}`);const be=(0,f.trimStart)(E.slice(0,Q).join("/"),"/"),je=E.indexOf("heads");if(je<=0)throw new Error(`Unable to parse branch from url: ${c}`);const ke=E[je+1],ht=E.slice(je+2).join("/");return{branch:ke,filePath:ht===""?"/":ht,project:be}}function jn(S,c,b,E){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(E,"/")}`}function ln(S){return S.password?"/a/":"/"}function Tn(S,c){const{branch:b,project:E}=hn(S,c);return`${S.baseUrl}${ln(S)}projects/${encodeURIComponent(E)}/branches/${b}`}function Ce(S,c){const{project:b}=hn(S,c);return`${S.cloneUrl}${ln(S)}${b}`}function ce(S,c){const{branch:b,filePath:E,project:Q}=hn(S,c);return`${S.baseUrl}${ln(S)}projects/${encodeURIComponent(Q)}/branches/${b}/files/${encodeURIComponent(E)}/content`}function Oe(S){return`${S.baseUrl}${ln(S)}projects/`}function Me(S){const c={};if(!S.password)return c;const b=vn.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function Xe(S){const c=await S.text();if(c.startsWith(Kt))try{return JSON.parse(c.slice(Kt.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 se{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E,lineNumber:Q}=c;let be;if(b.startsWith("/")){const{branch:je,project:ke}=hn(this.config,E);return jn(this.config,ke,je,b)}return b?be=new URL(b,E):be=new URL(E),Q&&(be.hash=Q.toString()),be.toString()}resolveEditUrl(c){return c}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(se,"factory",({config:S})=>{var c;const b=ct((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new se(E)),E=>E.config.host)});function D(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const E=S.getOptionalString("username"),Q=S.getOptionalString("password");if(!W(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:E,password:Q}}var me=r(48834).lW;function De(S,c){try{var b;const E=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[Q,be,je,ke,ht,ft,...yn]=c.replace(E,"").split("/"),kn=yn.join("/").replace(/^\//,"");return`${E}/${be}/${je}/_edit/${ft}/${kn}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function et(S,c){try{var b;const E=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[Q,be,je,ke,ht,ft,...yn]=c.replace(E,"").split("/"),kn=yn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${be}/${je}/contents/${kn}?ref=${ft}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function it(S){const c={},{username:b,password:E}=S;return E?(b?c.Authorization=`basic ${me.from(`${b}:${E}`).toString("base64")}`:c.Authorization=`token ${E}`,{headers:c}):c}class kt{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return B(c)}resolveEditUrl(c){return De(this.config,c)}constructor(c){(0,t._)(this,"config",void 0),this.config=c}}(0,t._)(kt,"factory",({config:S})=>{var c;const E=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(Q=>D(Q));return u(E.map(Q=>new kt(Q)),Q=>Q.config.host)});const Ft="github.com",Qt="https://api.github.com",_="https://raw.githubusercontent.com";function J(S){var c,b;const E=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Ft;let Q=S.getOptionalString("apiBaseUrl"),be=S.getOptionalString("rawBaseUrl");const je=S.getOptionalString("token"),ke=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(ht=>({appId:ht.getNumber("appId"),clientId:ht.getString("clientId"),clientSecret:ht.getString("clientSecret"),webhookSecret:ht.getString("webhookSecret"),privateKey:ht.getString("privateKey"),allowedInstallationOwners:ht.getOptionalStringArray("allowedInstallationOwners")}));if(!W(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return Q?Q=(0,f.trimEnd)(Q,"/"):E===Ft&&(Q=Qt),be?be=(0,f.trimEnd)(be,"/"):E===Ft&&(be=_),{host:E,apiBaseUrl:Q,rawBaseUrl:be,token:je,apps:ke}}function te(S){const c=S.map(J);return c.some(b=>b.host===Ft)||c.push({host:Ft,apiBaseUrl:Qt,rawBaseUrl:_}),c}function pe(S,c,b){try{const{owner:E,name:Q,ref:be,filepathtype:je,filepath:ke}=parseGitUrl(S);if(!E||!Q||!be||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const ht=ke.replace(/^\//,"");return y(c,b)==="api"?`${c.apiBaseUrl}/repos/${E}/${Q}/contents/${ht}?ref=${be}`:`${c.rawBaseUrl}/${E}/${Q}/${be}/${ht}`}catch(E){throw new Error(`Incorrect URL: ${S}, ${E}`)}}function le(S,c){const b={};return y(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function y(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var Z=r(42822),q=r(89393),Y=r(26228);class we{async getOrCreateToken(c,b,E){let Q=this.tokenCache.get(c);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await E(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(c,Q)),!this.appliesToRepo(Q,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:Q.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,t._)(this,"tokenCache",new Map),(0,t._)(this,"isExpired",c=>Y.ou.local()>c)}}const Ae={Accept:"application/vnd.github.machine-man-preview+json"};class Ye{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:Q,suspended:be}=await this.getInstallationData(c);if(be)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:Ae});let ke;if(je.data.repository_selection==="selected"){const ft=new q.v({baseUrl:this.baseUrl,auth:je.data.token}),yn=await ft.paginate(ft.apps.listReposAccessibleToInstallation);var ht;ke=((ht=yn.repositories)!==null&&ht!==void 0?ht:yn).map(br=>br.name)}return{token:je.data.token,expiresAt:Y.ou.fromISO(je.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const E=(await this.getInstallations()).find(be=>{var je,ke;return((je=be.account)===null||je===void 0||(ke=je.login)===null||ke===void 0?void 0:ke.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const Q=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(c,b){(0,t._)(this,"appClient",void 0),(0,t._)(this,"baseUrl",void 0),(0,t._)(this,"baseAuthConfig",void 0),(0,t._)(this,"cache",new we),(0,t._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new q.v({baseUrl:b,headers:Ae,authStrategy:Z.i,auth:this.baseAuthConfig})}}class jt{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(ke=>ke.getInstallationCredentials(c,b).then(ht=>({credentials:ht,error:void 0}),ht=>({credentials:void 0,error:ht})))),Q=E.find(ke=>{var ht;return(ht=ke.credentials)===null||ht===void 0?void 0:ht.accessToken});if(Q)return Q.credentials.accessToken;const je=E.map(ke=>ke.error).find(ke=>(ke==null?void 0:ke.name)!=="NotFoundError");if(je)throw je}constructor(c){var b;(0,t._)(this,"apps",void 0);var E;this.apps=(E=(b=c.apps)===null||b===void 0?void 0:b.map(Q=>new Ye(Q,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class vt{async getCredentials(c){const b=H()(c.url),E=b.owner||b.name,Q=b.owner?b.name:void 0;let be="app",je=await this.githubAppCredentialsMux.getAppToken(E,Q);return je||(be="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:be}}constructor(c,b){(0,t._)(this,"githubAppCredentialsMux",void 0),(0,t._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,t._)(vt,"create",S=>new vt(new jt(S),S.token));class nt{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(E=>{const Q=SingleInstanceGithubCredentialsProvider.create(E.config);b.set(E.config.host,Q)}),new nt(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 Ke{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return dt(B(c),"tree")}resolveEditUrl(c){return dt(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(Ke,"factory",({config:S})=>{var c;const b=te((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new Ke(E)),E=>E.config.host)});function dt(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,E,Q,be)=>`//${E}/${Q}/${be}/${c}/`)}const at=null;class Dt extends Ke{get config(){return super.config}constructor(c){super(c)}}(0,t._)(Dt,"factory",Ke.factory);const Mt=null,Xt=null,en=null,Ut="gitlab.com",zt="https://gitlab.com/api/v4";function Et(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const E=S.getOptionalString("token");let Q=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===Ut&&(b=zt),Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,W(c)){if(!b||!g(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!g(Q))throw new Error(`Invalid GitLab integration config, '${Q}' 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:Q}}function Lt(S){const c=S.map(Et);return c.some(b=>b.host===Ut)||c.push({host:Ut,apiBaseUrl:zt,baseUrl:`https://${Ut}`}),c}function Zt(S){let c="";return S.host!==Ut&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function bn(S,c){const b=await ur(S,c);return Gn(S,b,c).toString()}function zn(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Gn(S,c,b){try{const E=new URL(S),Q=E.pathname.split("/blob/").slice(1).join("/blob/"),[be,...je]=Q.split("/"),ke=getGitLabIntegrationRelativePath(b);return E.pathname=[...ke?[ke]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${be}`,E}catch(E){throw new Error(`Incorrect url: ${S}, ${E}`)}}async function ur(S,c){const b=new URL(S);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(c);Q&&(E=E.replace(Q,""));const be=new URL(`${b.origin}${Q}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(be.toString(),zn(c)),ke=await je.json();if(!je.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${S}, ${E}`)}}class En{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return On(c,"edit")}constructor(c){(0,t._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,t._)(En,"factory",({config:S})=>{var c;const b=Lt((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return u(b.map(E=>new En(E)),E=>E.config.host)});function On(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class er{static fromConfig(c){return new er({awsS3:I.factory({config:c}),azure:He.factory({config:c}),bitbucket:_t.factory({config:c}),bitbucketCloud:Bt.factory({config:c}),bitbucketServer:Un.factory({config:c}),gerrit:se.factory({config:c}),github:Ke.factory({config:c}),gitlab:En.factory({config:c}),gitea:kt.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(E=>E.byUrl(c)).filter(Boolean);if(b.length>1){const E=b.filter(Q=>!(Q instanceof _t));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):B(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,t._)(this,"byType",void 0),this.byType=c}}},6290:function(Ct,$e,r){"use strict";var t={};r.r(t),r.d(t,{TechDocsPlugin:function(){return L.s4}});var h=r(52322),H=r(2784),f=r(28316),W=r(73557),g=r(60871);const u=(0,g.T0)({id:"plugin.techdocs.storageservice"}),B=(0,g.T0)({id:"plugin.techdocs.service"});var ve=r(92077),ue=r(95481),V=r(7476),K=r(93225),I=r(86317),w=r(65124),ie=r(22478),ee=r(85478),ne=r(68435),$=r(3482),T=r(42081),P=r(48431),L=r(89258),O=r(52943),oe=r(61886),Le=r(13980),ze=r.n(Le),z=r(87612);class yt{get(n){for(const s of this.holders){const a=s.get(n);if(a)return a}}constructor(...n){(0,z._)(this,"holders",void 0),this.holders=n}}var ot=r(51837);const He=(0,ot.CT)("api-context"),st=i=>{var n;const{apis:s,children:a}=i,p=(n=(0,H.useContext)(He))===null||n===void 0?void 0:n.atVersion(1),A=p?new yt(s,p):s;return(0,h.jsx)(He.Provider,{value:(0,ot.EI)({1:A}),children:a})};st.propTypes={apis:ze().shape({get:ze().func.isRequired}).isRequired,children:ze().node};class Qe{static validateFactories(n,s){for(const a of s){const p=[a],A=new Set;for(;p.length;){const k=p.shift(),M=n.get(k);if(M)for(const ae of Object.values(M.deps)){if(ae.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);A.has(ae)||(A.add(ae),p.push(ae))}}}}get(n){return this.load(n)}load(n,s=[]){const a=this.apis.get(n.id);if(a)return a;const p=this.factories.get(n);if(!p)return;if(s.includes(p.api))throw new Error(`Circular dependency of api factory for ${p.api}`);const A=this.loadDeps(n,p.deps,[...s,p.api]),k=p.factory(A);return this.apis.set(n.id,k),k}loadDeps(n,s,a){const p={};for(const A in s)if(s.hasOwnProperty(A)){const k=s[A],M=this.load(k,a);if(!M)throw new Error(`No API factory available for dependency ${k} of dependent ${n}`);p[A]=M}return p}constructor(n){(0,z._)(this,"factories",void 0),(0,z._)(this,"apis",void 0),this.factories=n,this.apis=new Map}}var St;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(St||(St={}));class It{register(n,s){const a=St[n],p=this.factories.get(s.api.id);return p&&p.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(n){const s=this.factories.get(n.id);if(s)return s.factory}getAllApis(){const n=new Set;for(const{factory:s}of this.factories.values())n.add(s.api);return n}constructor(){(0,z._)(this,"factories",new Map)}}function xt(i){return new Promise((n,s)=>{const a=i.width||500,p=i.height||700,A=window.screen.width/2-a/2,k=window.screen.height/2-p/2,M=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${p},top=${k},left=${A}`);let ae="";if(!M||typeof M.closed=="undefined"||M.closed){const gt=new Error("Failed to open auth popup.");gt.name="PopupRejectedError",s(gt);return}const xe=gt=>{if(gt.source!==M||gt.origin!==i.origin)return;const{data:Tt}=gt;if(Tt.type==="config_info"){ae=Tt.targetOrigin;return}if(Tt.type!=="authorization_response")return;const Rt=Tt;if("error"in Rt){const Wt=new Error(Rt.error.message);Wt.name=Rt.error.name,s(Wt)}else n(Rt.response);Ve()},Ie=setInterval(()=>{if(M.closed){const gt=`Login failed, ${ae&&ae!==window.location.origin?`Incorrect app origin, expected ${ae}`:"popup was closed"}`,Tt=new Error(gt);Tt.name="PopupClosedError",s(Tt),Ve()}},100);function Ve(){window.removeEventListener("message",xe),clearInterval(Ie)}window.addEventListener("message",xe)})}let lt=!1;function Pt(i){return[...i].join(" ")}class Nt{async createSession(n){return n.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(n.scopes):this.showPopup(n.scopes):this.authRequester(n.scopes)}async refreshSession(n){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...n&&{scope:this.joinScopesFunc(n)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(p=>{throw new Error(`Auth refresh request failed, ${p}`)});if(!s.ok){const p=new Error(`Auth refresh request failed, ${s.statusText}`);throw p.status=s.status,p}const a=await s.json();if(a.error){const p=new Error(a.error.message);throw a.error.name&&(p.name=a.error.name),p}return await this.sessionTransform(a)}async removeSession(){const n=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!n.ok){const s=new Error(`Logout request failed, ${n.statusText}`);throw s.status=n.status,s}}async showPopup(n){const s=this.joinScopesFunc(n),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),p=await xt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(p)}async executeRedirect(n){const s=this.joinScopesFunc(n);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(n,s){const a=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${n}${p}`}buildQueryString(n){if(!n)return"";const s=Object.entries(n).map(([a,p])=>{if(typeof p=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(n){(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"joinScopesFunc",void 0),(0,z._)(this,"authRequester",void 0),(0,z._)(this,"sessionTransform",void 0),(0,z._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:p,provider:A,joinScopes:k=Pt,oauthRequestApi:M,sessionTransform:ae=Ie=>Ie}=n;!lt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),lt=!0);var xe;this.enableExperimentalRedirectFlow=s&&(xe=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&xe!==void 0?xe:!1,this.authRequester=M.createAuthRequester({provider:A,onAuthRequest:async Ie=>this.enableExperimentalRedirectFlow?this.executeRedirect(Ie):this.showPopup(Ie)}),this.discoveryApi=a,this.environment=p,this.provider=A,this.joinScopesFunc=k,this.sessionTransform=ae}}function We(i,n){for(const s of n)if(!i.has(s))return!1;return!0}class _t{sessionExistsAndHasScope(n,s){if(!n)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(n);return We(a,s)}getExtendedScope(n,s){const a=new Set(this.options.defaultScopes);if(n&&this.options.sessionScopes!==void 0){const p=this.options.sessionScopes(n);for(const A of p)a.add(A)}if(s)for(const p of s)a.add(p);return a}constructor(n){(0,z._)(this,"options",void 0),this.options=n}}var ge=r(82394),Se=r.n(ge);let Fe=Symbol.observable;class tt{[Fe](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(){(0,z._)(this,"isClosed",!1),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",new(Se())(n=>this.isClosed?(this.terminatingError?n.error(this.terminatingError):n.complete(),()=>{}):(this.subscribers.add(n),()=>{this.subscribers.delete(n)}))),(0,z._)(this,"subscribers",new Set)}}let mt=Symbol.observable;class bt{[mt](){return this}get closed(){return this.isClosed}next(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=n,this.subscribers.forEach(s=>s.next(n))}error(n){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=n,this.subscribers.forEach(s=>s.error(n))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(n=>n.complete())}subscribe(n,s,a){const p=typeof n=="function"?{next:n,error:s,complete:a}:n;return this.observable.subscribe(p)}constructor(n){(0,z._)(this,"isClosed",void 0),(0,z._)(this,"currentValue",void 0),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",void 0),(0,z._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=n,this.terminatingError=void 0,this.observable=new(Se())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class pt{setIsSignedIn(n){this.signedIn!==n&&(this.signedIn=n,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,z._)(this,"subject",new bt(g.sM.SignedOut)),(0,z._)(this,"signedIn",!1)}}class Ot{async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(n.scopes),p=this.sessionScopesFunc(this.currentSession),A=this.sessionScopesFunc(a);return We(A,p)&&(this.currentSession=a),a}catch(a){if(n.optional)return;throw a}}if(!this.currentSession&&!n.instantPopup)try{const s=await this.collapsedSessionRefresh(n.scopes);return this.currentSession=s,this.getSession(n)}catch{}if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(n){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(n);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(n){(0,z._)(this,"connector",void 0),(0,z._)(this,"helper",void 0),(0,z._)(this,"sessionScopesFunc",void 0),(0,z._)(this,"sessionShouldRefreshFunc",void 0),(0,z._)(this,"stateTracker",new pt),(0,z._)(this,"refreshPromise",void 0),(0,z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p,sessionShouldRefresh:A}=n;this.connector=s,this.sessionScopesFunc=p,this.sessionShouldRefreshFunc=A,this.helper=new _t({sessionScopes:p,defaultScopes:a})}}class Ht{setSession(n){this.currentSession=n,this.stateTracker.setIsSignedIn(Boolean(n))}async getSession(n){if(this.helper.sessionExistsAndHasScope(this.currentSession,n.scopes))return this.currentSession;if(!n.optional)return this.currentSession=await this.connector.createSession({...n,scopes:this.helper.getExtendedScope(this.currentSession,n.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(n){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p}=n;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:p,defaultScopes:a})}}const Jt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Bt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Jt,oauthRequestApi:k,defaultScopes:M=[],scopeTransform:ae=Ve=>Ve}=n,xe=new Nt({configApi:s,discoveryApi:a,environment:p,provider:A,oauthRequestApi:k,sessionTransform(Ve){return{...Ve,providerInfo:{idToken:Ve.providerInfo.idToken,accessToken:Ve.providerInfo.accessToken,scopes:Bt.normalizeScopes(ae,Ve.providerInfo.scope),expiresAt:new Date(Date.now()+Ve.providerInfo.expiresInSeconds*1e3)}}}}),Ie=new Ot({connector:xe,defaultScopes:new Set(M),sessionScopes:Ve=>Ve.providerInfo.scopes,sessionShouldRefresh:Ve=>(Ve.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Bt({sessionManager:Ie,scopeTransform:ae})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(n,s){const a=Bt.normalizeScopes(this.scopeTransform,n),p=await this.sessionManager.getSession({...s,scopes:a});var A;return(A=p==null?void 0:p.providerInfo.accessToken)!==null&&A!==void 0?A:""}async getIdToken(n={}){const s=await this.sessionManager.getSession({...n,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}static normalizeScopes(n,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(n(a))}constructor(n){(0,z._)(this,"sessionManager",void 0),(0,z._)(this,"scopeTransform",void 0),this.sessionManager=n.sessionManager,this.scopeTransform=n.scopeTransform}}const un={id:"github",title:"GitHub",icon:()=>null};class Yt{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=un,oauthRequestApi:k,defaultScopes:M=["read:user"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const pn={id:"gitlab",title:"GitLab",icon:()=>null};class Fn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=pn,oauthRequestApi:k,defaultScopes:M=["read_user"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Pn={id:"google",title:"Google",icon:()=>null},fn="https://www.googleapis.com/auth/";class Ln{static create(n){const{configApi:s,discoveryApi:a,oauthRequestApi:p,environment:A="development",provider:k=Pn,defaultScopes:M=["openid",`${fn}userinfo.email`,`${fn}userinfo.profile`]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:p,provider:k,environment:A,defaultScopes:M,scopeTransform(ae){return ae.map(xe=>xe==="openid"?xe:xe==="profile"||xe==="email"?`${fn}userinfo.${xe}`:xe.startsWith(fn)?xe:`${fn}${xe}`)}})}}const Un={id:"okta",title:"Okta",icon:()=>null},tn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),wn="okta.";class Mn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Un,oauthRequestApi:k,defaultScopes:M=["openid","email","profile","offline_access"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M,scopeTransform(ae){return ae.map(xe=>tn.has(xe)||xe.startsWith(wn)?xe:`${wn}${xe}`)}})}}var ut=r(30195);const _n=ut.z.object({profile:ut.z.object({email:ut.z.string().optional(),displayName:ut.z.string().optional(),picture:ut.z.string().optional()}),backstageIdentity:ut.z.object({token:ut.z.string(),identity:ut.z.object({type:ut.z.literal("user"),userEntityRef:ut.z.string(),ownershipEntityRefs:ut.z.array(ut.z.string())})})}),wt={id:"saml",title:"SAML",icon:()=>null};class ct{static create(n){const{discoveryApi:s,environment:a="development",provider:p=wt}=n,A=new DirectAuthConnector({discoveryApi:s,environment:a,provider:p}),k=new StaticAuthSessionManager({connector:A}),M=new AuthSessionStore({manager:k,storageKey:`${p.id}Session`,schema:samlSessionSchema});return new ct(M)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.backstageIdentity}async getProfile(n={}){const s=await this.sessionManager.getSession(n);return s==null?void 0:s.profile}constructor(n){_define_property(this,"sessionManager",void 0),this.sessionManager=n}}const vn={id:"microsoft",title:"Microsoft",icon:()=>null};class Kt{static create(n){return new Kt(n)}microsoftGraph(){return this.oauth2[Kt.MicrosoftGraphID]}static resourceForScopes(n){const s=[...new Set(n.split(" ").map(Kt.resourceForScope).filter(A=>A!=="openid"))];if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const p=(a=s[0])!==null&&a!==void 0?a:Kt.MicrosoftGraphID;return Promise.resolve(p)}static resourceForScope(n){var s;const a=(s=n.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:p}=a;return p.replace(/^api:\/\//,"")}switch(n){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Kt.MicrosoftGraphID}}async getAccessToken(n,s){const a=n===void 0?Kt.MicrosoftGraphID:await Kt.resourceForScopes(Array.isArray(n)?n.join(" "):n);return a in this.oauth2||(this.oauth2[a]=Bt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(n,s)}getIdToken(n){return this.microsoftGraph().getIdToken(n)}getProfile(n){return this.microsoftGraph().getProfile(n)}getBackstageIdentity(n){return this.microsoftGraph().getBackstageIdentity(n)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(n){(0,z._)(this,"oauth2",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"environment",void 0),(0,z._)(this,"provider",void 0),(0,z._)(this,"oauthRequestApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:p=vn,oauthRequestApi:A,discoveryApi:k,defaultScopes:M=["openid","offline_access","profile","email","User.Read"],scopeTransform:ae=xe=>xe.concat("offline_access")}=n;this.configApi=s,this.environment=a,this.provider=p,this.oauthRequestApi=A,this.discoveryApi=k,this.scopeTransform=ae,this.oauth2={[Kt.MicrosoftGraphID]:Bt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:M})}}}(0,z._)(Kt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const hn={id:"onelogin",title:"onelogin",icon:()=>null},jn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),ln="onelogin.";class Tn{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=hn,oauthRequestApi:k}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(M){return M.map(ae=>jn.has(ae)||ae.startsWith(ln)?ae:`${ln}${ae}`)}})}}const Ce={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ce{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Ce,oauthRequestApi:k,defaultScopes:M=["team"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Oe={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Me{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Oe,oauthRequestApi:k,defaultScopes:M=["PROJECT_ADMIN"]}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p,defaultScopes:M})}}const Xe={id:"atlassian",title:"Atlassian",icon:()=>null};class se{static create(n){const{configApi:s,discoveryApi:a,environment:p="development",provider:A=Xe,oauthRequestApi:k}=n;return Bt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:A,environment:p})}}class D{post(n){this.subject.next(n)}alert$(){return this.subject}constructor(){(0,z._)(this,"subject",new tt)}}class me{captureEvent(n){}}const De="theme";class et{static createWithStorage(n){const s=new et(n);if(!window.localStorage)return s;var a;const p=(a=window.localStorage.getItem(De))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(p),s.activeThemeId$().subscribe(A=>{A?window.localStorage.setItem(De,A):window.localStorage.removeItem(De)}),window.addEventListener("storage",A=>{if(A.key===De){var k;const M=(k=localStorage.getItem(De))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(M)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(n){this.activeThemeId=n,this.subject.next(n)}constructor(n){(0,z._)(this,"themes",void 0),(0,z._)(this,"activeThemeId",void 0),(0,z._)(this,"subject",void 0),this.themes=n,this.subject=new bt(void 0)}}var it=r(9850),kt=r.n(it),Ft=r(12782),Qt=r.n(Ft);const _=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function J(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function te(i){if(i===null)return"null";if(Array.isArray(i))return"array";const n=typeof i;return n==="number"&&isNaN(i)?"nan":n==="string"&&i===""?"empty-string":n}const pe={type(i,n,s,a){return`Invalid type in config for key '${i}' in '${n}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,n,s){return`Unable to convert config value for key '${i}' in '${n}' to a ${s}`}};class le{static fromConfigs(n){return n.length===0?new le(void 0):n.reduce((s,{data:a,context:p,filteredKeys:A,deprecatedKeys:k})=>{const M=new le(a,p,s);if(M.filteredKeys=A,k)for(const{key:ae,description:xe}of k)console.warn(`The configuration key '${ae}' of ${p} is deprecated and may be removed soon. ${xe||""}`);return M},void 0)}has(n){var s;if(this.readValue(n)!==void 0)return!0;var p;return(p=(s=this.fallback)===null||s===void 0?void 0:s.has(n))!==null&&p!==void 0?p:!1}keys(){var n;const s=this.data?Object.keys(this.data):[];var a;const p=(a=(n=this.fallback)===null||n===void 0?void 0:n.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...p])]}get(n){const s=this.getOptional(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n!=null?n:"")));return s}getOptional(n){var s;const a=kt()(this.readValue(n)),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(n);if(a===void 0){if(!1)var A;return p}else if(p===void 0)return a;return Qt()({},{value:p},{value:a},(k,M)=>!J(M)||!J(k)?M:void 0).value}getConfig(n){const s=this.getOptionalConfig(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalConfig(n){var s;const a=this.readValue(n),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(n);if(J(a))return this.copy(a,n,p);if(a!==void 0)throw new TypeError(pe.type(this.fullKey(n),this.context,te(a),"object"));return p}getConfigArray(n){const s=this.getOptionalConfigArray(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalConfigArray(n){const s=this.readConfigValue(n,p=>{if(!Array.isArray(p))return{expected:"object-array"};for(const[A,k]of p.entries())if(!J(k))return{expected:"object-array",value:k,key:`${n}[${A}]`};return!0});if(!s){if(!1)var a;return}return s.map((p,A)=>this.copy(p,`${n}[${A}]`))}getNumber(n){const s=this.getOptionalNumber(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalNumber(n){const s=this.readConfigValue(n,p=>typeof p=="number"||typeof p=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(pe.convert(this.fullKey(n),this.context,"number"));return a}getBoolean(n){const s=this.getOptionalBoolean(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalBoolean(n){const s=this.readConfigValue(n,p=>typeof p=="boolean"||typeof p=="number"||typeof p=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(pe.convert(this.fullKey(n),this.context,"boolean"))}getString(n){const s=this.getOptionalString(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalString(n){return this.readConfigValue(n,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(n){const s=this.getOptionalStringArray(n);if(s===void 0)throw new Error(pe.missing(this.fullKey(n)));return s}getOptionalStringArray(n){return this.readConfigValue(n,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,p]of s.entries())if(typeof p!="string"||p==="")return{expected:"string-array",value:p,key:`${n}[${a}]`};return!0})}fullKey(n){return`${this.prefix}${this.prefix?".":""}${n}`}copy(n,s,a){const p=new le(n,this.context,a,this.fullKey(s));return p.filteredKeys=this.filteredKeys,p}readConfigValue(n,s){const a=this.readValue(n);if(a===void 0){var p;if(!1)var A;return(p=this.fallback)===null||p===void 0?void 0:p.readConfigValue(n,s)}const k=s(a);if(k!==!0){const{key:M=n,value:ae=a,expected:xe}=k;throw new TypeError(pe.type(this.fullKey(M),this.context,te(ae),xe))}return a}readValue(n){const s=n?n.split("."):[];for(const p of s)if(!_.test(p))throw new TypeError(`Invalid config key '${n}'`);if(this.data===void 0)return;let a=this.data;for(const[p,A]of s.entries())if(J(a))a=a[A];else if(a!==void 0){const k=this.fullKey(s.slice(0,p).join("."));throw new TypeError(pe.type(k,this.context,te(a),"object"))}return a}constructor(n,s="mock-config",a,p=""){(0,z._)(this,"data",void 0),(0,z._)(this,"context",void 0),(0,z._)(this,"fallback",void 0),(0,z._)(this,"prefix",void 0),(0,z._)(this,"filteredKeys",void 0),(0,z._)(this,"notifiedFilteredKeys",void 0),this.data=n,this.context=s,this.fallback=a,this.prefix=p,this.notifiedFilteredKeys=new Set}}const y="Invalid discovery URL pattern,";class Z{static compile(n){const s=n.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let p;try{p=new URL(a)}catch{throw new Error(`${y} URL '${a}' is invalid`)}if(p.hash)throw new Error(`${y} URL must not have a hash`);if(p.search)throw new Error(`${y} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${y} URL must not end with a slash`);return new Z(s)}async getBaseUrl(n){return this.parts.join(encodeURIComponent(n))}constructor(n){(0,z._)(this,"parts",void 0),this.parts=n}}class q{post(n,s){return s!=null&&s.hidden||this.alertApi.post({message:n.message,severity:"error"}),this.errorApi.post(n,s)}error$(){return this.errorApi.error$()}constructor(n,s){(0,z._)(this,"alertApi",void 0),(0,z._)(this,"errorApi",void 0),this.alertApi=n,this.errorApi=s}}class Y{post(n,s){this.subject.next({error:n,context:s})}error$(){return this.subject}constructor(){(0,z._)(this,"subject",new tt)}}class we{static forward(n,s){window.addEventListener("unhandledrejection",a=>{n.post(a.reason,s)})}}function Ae(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 Ye{registerFlag(n){Ae(n.name),this.registeredFeatureFlags.push(n)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(n){return this.flags||(this.flags=this.load()),this.flags.get(n)===g.CL.Active}save(n){this.flags||(this.flags=this.load()),n.merge||this.flags.clear();for(const[a,p]of Object.entries(n.states))this.flags.set(a,p);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const n=window.localStorage.getItem("featureFlags");if(!n)return new Map;const s=JSON.parse(n);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([p,A])=>(Ae(p),A===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,z._)(this,"registeredFeatureFlags",[]),(0,z._)(this,"flags",void 0)}}function jt(i){let n=i.baseImplementation||r.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const p of a)n=p.apply(n);return{fetch:n}}class vt{static create(n){var s,a;const p=nt(n),A=((s=n.header)===null||s===void 0?void 0:s.name)||"authorization",k=((a=n.header)===null||a===void 0?void 0:a.value)||(M=>`Bearer ${M}`);return new vt(n.identityApi,p,A,k)}apply(n){return async(s,a)=>{const p=new Request(s,a),{token:A}=await this.identityApi.getCredentials();return p.headers.get(this.headerName)||typeof A!="string"||!A||!this.allowUrl(p.url)?n(s,a):(p.headers.set(this.headerName,this.headerValue(A)),n(p))}}constructor(n,s,a,p){(0,z._)(this,"identityApi",void 0),(0,z._)(this,"allowUrl",void 0),(0,z._)(this,"headerName",void 0),(0,z._)(this,"headerValue",void 0),this.identityApi=n,this.allowUrl=s,this.headerName=a,this.headerValue=p}}function nt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?Ke(i.urlPrefixAllowlist):i.config?Ke([i.config.getString("backend.baseUrl")]):()=>!1}function Ke(i){const n=i.map(s=>s.replace(/\/$/,""));return s=>n.some(a=>s===a||s.startsWith(`${a}/`))}function dt(i,n){return!n||n==="/"?i:`${i.replace(/\/$/,"")}/${n.replace(/^\//,"")}`}class at{apply(n){return async(s,a)=>{const p=new Request(s,a),A="plugin://";if(!p.url.startsWith(A))return n(s,a);const{hostname:k,pathname:M,search:ae,hash:xe,username:Ie,password:Ve}=new URL(`http://${p.url.substring(A.length)}`);let gt=await this.discoveryApi.getBaseUrl(k);if(Ie||Ve){const Rt=new URL(gt),Wt=`${Ie}${Ve?`:${Ve}`:""}@`;gt=`${Rt.protocol}//${Wt}${Rt.host}${Rt.pathname}`}const Tt=`${dt(gt,M)}${ae}${xe}`;return n(Tt,typeof s=="string"||Dt(s)?a:s)}}constructor(n){(0,z._)(this,"discoveryApi",void 0),this.discoveryApi=n}}function Dt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Mt{static resolvePluginProtocol(n){return new at(n.discoveryApi)}static injectIdentityAuth(n){return vt.create(n)}constructor(){}}function Xt(i,n){for(const s of n)if(!i.has(s))return!1;return!0}function en(i,...n){const s=new Set(i);for(const a of n)for(const p of a)s.add(p);return s}class Ut{request(n){return new Promise((s,a)=>{this.requests.push({scopes:n,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(n,s){this.requests=this.requests.filter(a=>Xt(n,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(n){this.requests.forEach(s=>s.reject(n)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const n=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>en(s,a.scopes),this.requests[0].scopes);return{scopes:n,resolve:s=>{n&&this.resolve(n,s)},reject:s=>{n&&this.reject(s)}}}constructor(){(0,z._)(this,"requests",[]),(0,z._)(this,"subject",new bt(this.getCurrentPending()))}}class zt{createAuthRequester(n){const s=new Ut,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:p=>{const A=this.currentRequests.slice(),k=this.makeAuthRequest(p,n);k?A[a]=k:delete A[a],this.currentRequests=A,this.subject.next(A.filter(Boolean))}}),p=>s.request(p)}makeAuthRequest(n,s){const{scopes:a}=n;if(a)return{provider:s.provider,trigger:async()=>{const p=await s.onAuthRequest(a);n.resolve(p)},reject:()=>{const p=new Error("Login failed, rejected by user");p.name="RejectedError",n.reject(p)}}}authRequest$(){return this.subject}constructor(){(0,z._)(this,"subject",new bt([])),(0,z._)(this,"currentRequests",[]),(0,z._)(this,"handlerCount",0)}}const Et=new Map;class Lt{static create(n){var s;return new Lt((s=n.namespace)!==null&&s!==void 0?s:"",n.errorApi)}static addStorageEventListener(){window.addEventListener("storage",n=>{for(const[a,p]of Et.entries()){var s;!((s=n.key)===null||s===void 0)&&s.startsWith(a)&&p.handleStorageChange(n.key)}})}get(n){return this.snapshot(n).value}snapshot(n){let s,a="absent";try{const p=localStorage.getItem(this.getKeyName(n));p&&(s=JSON.parse(p,(A,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${n}`))}return{key:n,value:s,presence:a}}forBucket(n){const s=`${this.namespace}/${n}`;return Et.has(s)||Et.set(s,new Lt(s,this.errorApi)),Et.get(s)}async set(n,s){localStorage.setItem(this.getKeyName(n),JSON.stringify(s)),this.notifyChanges(n)}async remove(n){localStorage.removeItem(this.getKeyName(n)),this.notifyChanges(n)}observe$(n){return Lt.hasSubscribed||(Lt.addStorageEventListener(),Lt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===n)}handleStorageChange(n){if(!(n!=null&&n.startsWith(this.namespace)))return;const s=n==null?void 0:n.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(n){return`${this.namespace}/${encodeURIComponent(n)}`}notifyChanges(n){const s=this.snapshot(n);for(const a of this.subscribers)a.next(s)}constructor(n,s){(0,z._)(this,"namespace",void 0),(0,z._)(this,"errorApi",void 0),(0,z._)(this,"subscribers",void 0),(0,z._)(this,"observable",void 0),this.namespace=n,this.errorApi=s,this.subscribers=new Set,this.observable=new(Se())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,z._)(Lt,"hasSubscribed",!1);const Zt=(0,H.createContext)(void 0);function bn(){const[i]=(0,W.is)((0,h.jsx)(W.AW,{index:!0,element:(0,h.jsx)("div",{})}));return!i.index}var zn=r(84800);const Gn=(i,n)=>{try{var s;const a=(0,zn.fp)(n,{pathname:i}),p=a==null?void 0:a.filter(ae=>{var xe;return((xe=ae==null?void 0:ae.route.routeRefs)===null||xe===void 0?void 0:xe.size)>0}).pop(),A=p==null?void 0:p.route;if(!A)return;let k;A.routeRefs.size===1&&(k=A.routeRefs.values().next().value);const M=Object.entries((p==null?void 0:p.params)||{}).reduce((ae,[xe,Ie])=>(Ie!==void 0&&(ae[xe]=Ie),ae),{});return{extension:"App",pluginId:((s=A.plugin)===null||s===void 0?void 0:s.getId())||"root",...k?{routeRef:k.id}:{},params:M}}catch{return}},ur=({pathname:i,search:n,hash:s,attributes:a})=>{const p=(0,g.z$)();return(0,H.useEffect)(()=>{p.captureEvent("navigate",`${i}${n}${s}`,{attributes:a})},[p,i,n,s,a]),null},En=({routeObjects:i})=>{const{pathname:n,search:s,hash:a}=(0,W.TH)(),{params:p,...A}=Gn(n,i)||{params:{}};return(0,h.jsx)(g.fC,{attributes:A,children:(0,h.jsx)(ur,{pathname:n,search:s,hash:a,attributes:p})})};function On(i){return bn()?er(i):""}function er(i){var n;let{pathname:s}=new URL((n=i.getOptionalString("app.baseUrl"))!==null&&n!==void 0?n:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function S({component:i,appIdentityProxy:n,children:s}){const[a,p]=(0,H.useState)(),A=(0,g.h_)(g.Ds),k=On(A);return a?(n.setTarget(a,{signOutTargetUrl:k||"/"}),(0,h.jsx)(h.Fragment,{children:s})):(0,h.jsx)(i,{onSignInSuccess:p})}function c(i){const{Router:n,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),p=er(a),A=`${p}/*`,k=(0,H.useContext)(Zt);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:M,appIdentityProxy:ae}=k;return s?bn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(S,{component:s,appIdentityProxy:ae,children:(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(S,{component:s,appIdentityProxy:ae,children:i.children})]}):(ae.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:p||"/"}),bn()?(0,h.jsxs)(n,{children:[(0,h.jsx)(En,{routeObjects:M}),(0,h.jsx)(W.Z5,{children:(0,h.jsx)(W.AW,{path:A,element:(0,h.jsx)(h.Fragment,{children:i.children})})})]}):(0,h.jsxs)(n,{basename:p,children:[(0,h.jsx)(En,{routeObjects:M}),i.children]}))}var b=r(88412),E=r(50629),Q=r(80956),be=r(64279);function je(i){const n={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(n[a]=i.collectors[a]());const s=[{node:H.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:p,contexts:A}=s.shift();H.Children.forEach(a,k=>{if(!(0,H.isValidElement)(k))return;const M={};for(const ae in n)if(n.hasOwnProperty(ae)){const xe=n[ae];M[ae]=xe.visit(xe.accumulator,k,p,A[ae])}for(const ae of i.discoverers){const xe=ae(k);xe&&s.push({node:xe,parent:k,contexts:M})}})}return Object.fromEntries(Object.entries(n).map(([a,p])=>[a,p.accumulator]))}function ke(i,n){return()=>({accumulator:i(),visit:n})}function ht(i){var n;return(n=i.props)===null||n===void 0?void 0:n.children}function ft(i){var n,s;if(!((n=i.props)===null||n===void 0)&&n.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const yn=ke(()=>new Set,(i,n)=>{const s=(0,g.IY)(n,"core.plugin");s&&i.add(s)}),kn=i=>{const{children:n}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,h.jsx)(h.Fragment,{children:a?n:null})};(0,g.R5)(kn,"core.featureFlagged",!0);const br={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Br(i){const n=i;if(n!=null&&n.type){var s,a;return(a=(s=n.type.displayName)!==null&&s!==void 0?s:n.type.name)!==null&&a!==void 0?a:String(n.type)}return String(n)}function $r(i,n=new Array){return H.Children.forEach(i,s=>{if(!(0,H.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const p=(0,g.IY)(s,"core.plugin");n.push({routeRef:a,plugin:p})}$r(s.props.children,n)}),n}const Ao=ke(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===n)return{...a,isElementAncestor:!0};const k=(p=n.props)===null||p===void 0?void 0:p.path,M=(0,g.IY)(n,"core.mountPoint");if(M&&k)throw new Error(`Path property may not be set directly on a routable extension "${Br(n)}"`);var ae;const xe=(ae=a==null||(A=a.obj)===null||A===void 0?void 0:A.children)!==null&&ae!==void 0?ae:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${Br(n)}"`);const Tt=k.startsWith("/")?k.slice(1):k,Rt=n.props.element;if((0,g.IY)(n,"core.gatherMountPoints")){var Ie;if(Rt)throw new Error(`Mount point gatherers may not have an element prop "${Br(n)}"`);const Wt={path:Tt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ie=n.props)===null||Ie===void 0?void 0:Ie.caseSensitive),children:[br],plugin:void 0};return xe.push(Wt),{obj:Wt,gatherPath:Tt,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(Rt){var Ve;const[Wt,...Gt]=$r(Rt);if(Gt.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Wt)return a;const{routeRef:$n,plugin:Xn}=Wt,fr={path:Tt,element:"mounted",routeRefs:new Set([$n]),caseSensitive:Boolean((Ve=n.props)===null||Ve===void 0?void 0:Ve.caseSensitive),children:[br],plugin:Xn};return xe.push(fr),i.paths.set($n,Tt),i.parents.set($n,a==null?void 0:a.routeRef),{obj:fr,routeRef:$n!=null?$n:a==null?void 0:a.routeRef,gatherPath:Tt,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(M){var gt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${Br(n)}" with mount point "${M}" must be assigned a path`);return a==null||(gt=a.obj)===null||gt===void 0||gt.routeRefs.add(M),i.paths.set(M,a.gatherPath),i.parents.set(M,a==null?void 0:a.gatherRouteRef),{...a,routeRef:M}}return a}),eo=ke(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,n,s,a)=>{var p,A,k;if((s==null?void 0:s.props.element)===n)return a;let M=a==null?void 0:a.obj,ae=a==null?void 0:a.routeRef,xe=a==null?void 0:a.sticky;const Ie=(p=n.props)===null||p===void 0?void 0:p.path;var Ve;const gt=(Ve=M==null?void 0:M.children)!==null&&Ve!==void 0?Ve:i.objects,Tt=Boolean((A=n.props)===null||A===void 0?void 0:A.caseSensitive);let Rt=a==null?void 0:a.path;if((0,g.IY)(n,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");Rt=Ie}const Wt=(k=n.props)===null||k===void 0?void 0:k.element;let Gt=(0,g.IY)(n,"core.mountPoint");if(!Gt&&(0,H.isValidElement)(Wt)&&(Gt=(0,g.IY)(Wt,"core.mountPoint")),Gt){let fr=Ie;if(Rt&&(fr?Rt=void 0:fr=Rt),!fr)throw new Error("Mounted routable extension must have a path");i.paths.set(Gt,fr),ae&&xe?(i.parents.set(Gt,ae),Ie&&(ae=Gt,xe=!1)):(i.parents.set(Gt,ae),ae=Gt),Ie?(M={caseSensitive:Tt,path:Ie,element:"mounted",routeRefs:new Set([Gt]),children:[br],plugin:(0,g.IY)(n.props.element,"core.plugin")},gt.push(M)):M==null||M.routeRefs.add(Gt)}if((0,g.IY)(n,"core.gatherMountPoints")&&(xe=!0),(0,g.IY)(n,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");if(!Gt){var Xn;M={caseSensitive:Tt,path:Ie,element:"gathered",routeRefs:new Set,children:[br],plugin:a==null||(Xn=a.obj)===null||Xn===void 0?void 0:Xn.plugin},gt.push(M)}}return{obj:M,path:Rt,routeRef:ae,sticky:xe}}),Sr=ke(()=>new Set,(i,n)=>{if(n.type===kn){const s=n.props;i.add("with"in s?s.with:s.without)}}),Rr=(0,ot.uW)("route-ref-type",()=>Symbol("route-ref-type"));function or(i){return i[Rr]==="absolute"}function Kn(i){return i[Rr]==="sub"}function Ir(i){return i[Rr]==="external"}function Cr(...i){const n=i.join("/").replace(/\/\/+/g,"/");return n!=="/"&&n.endsWith("/")?n.slice(0,-1):n}function To(i,n,s){let a,p="";if(or(i))a=i;else if(Kn(i))a=i.parent,p=i.path;else if(Ir(i)){const M=s.get(i);if(!M)return[void 0,""];if(or(M))a=M;else if(Kn(M))a=M.parent,p=M.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${M}`)}else throw i[Rr]?new Error(`Unknown or invalid route ref type, ${i[Rr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const A=n.get(a);if(A===void 0)return[void 0,""];const k=Cr(A,p);return[a,k]}function Ro(i,n,s,a,p){var A;const k=(A=(0,zn.fp)(p,n))!==null&&A!==void 0?A:[],M=Array();let ae=-1;for(let Ve=i;Ve&&(ae=k.findIndex(gt=>gt.route.routeRefs.has(Ve)),ae===-1);Ve=a.get(Ve))M.unshift(Ve);M.length===0&&(ae-=1);const xe=ae===-1?"":k[ae].pathname,Ie=M.slice(0,-1).map(Ve=>{const gt=s.get(Ve);if(gt===void 0)throw new Error(`No path for ${Ve}`);if(gt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Ve} as it has parameters`);return gt});return`${Cr(xe,...Ie)}/`}class to{resolve(n,s){const[a,p]=To(n,this.routePaths,this.routeBindings);if(!a)return;let A;typeof s=="string"?A=this.trimPath(s):s.pathname?A={...s,pathname:this.trimPath(s.pathname)}:A=s;const k=this.appBasePath+Ro(a,A,this.routePaths,this.routeParents,this.routeObjects);return(...[ae])=>Cr(k,(0,zn.Gn)(p,ae))}trimPath(n){return n&&(n.startsWith(this.appBasePath)?n.slice(this.appBasePath.length):n)}constructor(n,s,a,p,A){(0,z._)(this,"routePaths",void 0),(0,z._)(this,"routeParents",void 0),(0,z._)(this,"routeObjects",void 0),(0,z._)(this,"routeBindings",void 0),(0,z._)(this,"appBasePath",void 0),this.routePaths=n,this.routeParents=s,this.routeObjects=a,this.routeBindings=p,this.appBasePath=A}}const Io=(0,ot.CT)("routing-context"),Po=({routePaths:i,routeParents:n,routeObjects:s,routeBindings:a,basePath:p="",children:A})=>{const k=new to(i,n,s,a,p),M=(0,ot.EI)({1:k});return(0,h.jsx)(Io.Provider,{value:M,children:A})};function Wr(i,n){const s=new Set(n.values());s.delete(void 0);for(const a of n.keys()){if(s.has(a))continue;let p=a,A="";for(;p;){const M=i.get(p);if(M===void 0)throw new Error(`No path for ${p}`);A=Cr(M,A),p=n.get(p)}const k=A.match(/:(\w+)/g);if(k){for(let M=0;M<k.length;M++)for(let ae=M+1;ae<k.length;ae++)if(k[ae]===k[M])throw new Error(`Parameter ${k[ae]} is duplicated in path ${A}`)}}}function tr(i,n){for(const s of n)if(s.externalRoutes){for(const[a,p]of Object.entries(s.externalRoutes))if(!p.optional&&!i.has(p))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Dr=(0,ot.CT)("app-context"),Zr=({appContext:i,children:n})=>{const s=(0,ot.EI)({1:i});return(0,h.jsx)(Dr.Provider,{value:s,children:n})};function no(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Pr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Vr{setTarget(n,s){this.target=n,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(n)}getUserId(){if(!this.target)throw no("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Pr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw no("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Pr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(n=>n.getProfileInfo())}async getBackstageIdentity(){const n=await this.waitForTarget.then(s=>s.getBackstageIdentity());return n.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${n.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),n}async getCredentials(){return this.waitForTarget.then(n=>n.getCredentials())}async getIdToken(){return this.waitForTarget.then(n=>{if(!n.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Pr("getIdToken"),n.getIdToken()})}async signOut(){await this.waitForTarget.then(n=>n.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,z._)(this,"target",void 0),(0,z._)(this,"waitForTarget",void 0),(0,z._)(this,"resolveTarget",()=>{}),(0,z._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(n=>{this.resolveTarget=n})}}var Lo=r(72164);function ro(i,n,s){if(i!==void 0){const p=s.find(A=>A.id===i);if(p)return p}if(n){const p=s.find(A=>A.variant==="dark");if(p)return p}const a=s.find(p=>p.variant==="light");return a||s[0]}const Sn=()=>{const i=(0,H.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[n,s]=(0,H.useState)(i.matches);return(0,H.useEffect)(()=>{const a=p=>{s(p.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),n};function oo({children:i}){const n=(0,g.h_)(g.hg),s=(0,Lo.Z)(n.activeThemeId$(),n.getActiveThemeId()),a=Boolean(window.matchMedia)?Sn():!1,p=ro(s,a,n.getInstalledThemes());if(!p)throw new Error("App has no themes");return(0,h.jsx)(p.Provider,{children:i})}const so=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const n=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!n)throw new Error("No static configuration provided");if(!Array.isArray(n))throw new Error("Static configuration has invalid format");const s=n.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const p=JSON.parse(i);Array.isArray(p)?s.push(...p):s.push({data:p,context:"env"})}catch(p){throw new Error(`Failed to load runtime configuration, ${p}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class io{add(n,s){return this.apis.push([n.id,s]),s}build(){return new wr(new Map(this.apis))}constructor(){(0,z._)(this,"apis",[])}}class wr{static builder(){return new io}static from(n){return new wr(new Map(n.map(([s,a])=>[s.id,a])))}static with(n,s){return new wr(new Map([[n.id,s]]))}with(n,s){return new wr(new Map([...this.apis,[n.id,s]]))}get(n){return this.apis.get(n.id)}constructor(n){(0,z._)(this,"apis",void 0),this.apis=n}}function Oo(i){const n=new Map;return i&&i({bind:(a,p)=>{for(const[A,k]of Object.entries(p)){const M=a[A];if(!M)throw new Error(`Key ${A} is not an existing external route`);if(!k&&!M.optional)throw new Error(`External route ${A} is required but was undefined`);k&&n.set(M,k)}}}),n}function ao(i){const n=new URL(i);return n.protocol=document.location.protocol,n.hostname=document.location.hostname,n.port=document.location.port,n.toString().replace(/\/$/,"")}function ko(i,n,s){var a;const p=Boolean(i),A=(0,be.default)(i||(()=>Promise.resolve([])));let k;if(p&&A.loading){const{Progress:xe}=n;k=(0,h.jsx)(xe,{})}else if(A.error){const{BootErrorPage:xe}=n;k=(0,h.jsx)(xe,{step:"load-config",error:A.error})}const{ThemeProvider:M=oo}=n;if(k)return{node:(0,h.jsx)(st,{apis:wr.with(g.hg,s),children:(0,h.jsx)(M,{children:k})})};let ae;if(!((a=A.value)===null||a===void 0)&&a.length){const xe=le.fromConfigs(A.value),Ie=xe.getOptionalString("app.baseUrl"),Ve=xe.getOptionalString("backend.baseUrl");let gt=A.value;const Tt={data:{},context:"relative-resolver"};if(Ie&&Ve){const Rt=new URL(Ie).origin,Wt=new URL(Ve).origin;if(Rt===Wt){const Gt=ao(Ve);Ve!==Gt&&(Tt.data.backend={baseUrl:Gt})}}if(Ie){const Rt=ao(Ie);Ie!==Rt&&(Tt.data.app={baseUrl:Rt})}Object.keys(Tt.data).length&&(gt=gt.concat([Tt])),ae=le.fromConfigs(gt)}else ae=le.fromConfigs([]);return{api:ae}}class lo{getPlugins(){return this.app.getPlugins()}getSystemIcon(n){return this.app.getSystemIcon(n)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(n){(0,z._)(this,"app",void 0),this.app=n}}var jr=new WeakMap;class us{getPlugins(){return Array.from(this.plugins)}getSystemIcon(n){return this.icons[n]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(n){const s=this.getProvider();return()=>(0,h.jsx)(s,{children:n})}getProvider(){if((0,b._)(this,jr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q._)(this,jr,!0);const n=new lo(this);let s=!1;return({children:p})=>{const A=(0,H.useRef)(!0),k=(0,H.useMemo)(()=>et.createWithStorage(this.themes),[]),{routing:M,featureFlags:ae,routeBindings:xe}=(0,H.useMemo)(()=>{const Tt=je({root:p,discoverers:[ht,ft],collectors:{routing:bn()?eo:Ao,collectedPlugins:yn,featureFlags:Sr}});return Tt.collectedPlugins.forEach(Rt=>this.plugins.add(Rt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Tt,routeBindings:Oo(this.bindRoutes)}},[p]);s||(s=!0,Wr(M.paths,M.parents),tr(xe,this.plugins));const Ie=ko(this.configLoader,this.components,k),Ve="api"in Ie;if(Ve){const{api:Tt}=Ie;this.configApi=Tt}if("node"in Ie)return Ie.node;if(Ve&&A.current){A.current=!1;const Tt=this.getApiHolder().get(g.W0);if(Tt){for(const Gt of this.featureFlags)Tt.registerFlag({...Gt,pluginId:""});for(const Gt of this.plugins.values())if("getFeatureFlags"in Gt)for(const $n of Gt.getFeatureFlags())Tt.registerFlag({name:$n.name,pluginId:Gt.getId()});else for(const $n of Gt.output())$n.type==="feature-flag"&&Tt.registerFlag({name:$n.name,pluginId:Gt.getId()});const Rt=Tt.getRegisteredFlags(),Wt=new Set(Rt.map(Gt=>Gt.name));for(const Gt of ae)Wt.has(Gt)||Tt.registerFlag({name:Gt,pluginId:""})}}const{ThemeProvider:gt=oo}=this.components;return(0,h.jsx)(st,{apis:this.getApiHolder(),children:(0,h.jsx)(Zr,{appContext:n,children:(0,h.jsx)(gt,{children:(0,h.jsx)(Po,{routePaths:M.paths,routeParents:M.parents,routeObjects:M.objects,routeBindings:xe,basePath:On(Ie.api),children:(0,h.jsx)(Zt.Provider,{value:{routeObjects:M.objects,appIdentityProxy:this.appIdentityProxy},children:p})})})})})}}getRouter(){return c}getApiHolder(){if(this.apiHolder){for(const n of this.plugins)for(const s of n.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>et.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new Ye});for(const n of this.defaultApis)this.apiFactoryRegistry.register("default",n);for(const n of this.plugins)for(const s of n.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${n.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const n of this.apis)if(!this.apiFactoryRegistry.register("app",n))throw new Error(`Duplicate or forbidden API factory for ${n.api} in app`);return Qe.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Qe(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(n){const s=new Set;for(const a of n){const p=a.getId();if(s.has(p))throw new Error(`Duplicate plugin found '${p}'`);s.add(p)}}constructor(n){(0,z._)(this,"apiHolder",void 0),(0,z._)(this,"configApi",void 0),(0,z._)(this,"apis",void 0),(0,z._)(this,"icons",void 0),(0,z._)(this,"plugins",void 0),(0,z._)(this,"featureFlags",void 0),(0,z._)(this,"components",void 0),(0,z._)(this,"themes",void 0),(0,z._)(this,"configLoader",void 0),(0,z._)(this,"defaultApis",void 0),(0,z._)(this,"bindRoutes",void 0),(0,z._)(this,"appIdentityProxy",new Vr),(0,z._)(this,"apiFactoryRegistry",void 0),(0,E._)(this,jr,{writable:!0,value:!1});var s;this.apis=(s=n.apis)!==null&&s!==void 0?s:[],this.icons=n.icons;var a;this.plugins=new Set((a=n.plugins)!==null&&a!==void 0?a:[]);var p;this.featureFlags=(p=n.featureFlags)!==null&&p!==void 0?p:[],this.components=n.components,this.themes=n.themes;var A;this.configLoader=(A=n.configLoader)!==null&&A!==void 0?A:so;var k;this.defaultApis=(k=n.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=n.bindRoutes,this.apiFactoryRegistry=new It}}function co(i){return new us(i)}let hr=!1;const Lr=i=>{const n=(0,g.qD)(),{NotFoundErrorPage:s}=n.getComponents(),a=(0,H.useMemo)(()=>bn(),[]),A=[...(0,g.vJ)(i.children,k=>k.getElements().flatMap(M=>{let ae=M.props.path;if(ae==="")return[];var xe;ae=(xe=ae==null?void 0:ae.replace(/\/\*$/,""))!==null&&xe!==void 0?xe:"/";let Ie=a?M:M.props.element;return!a&&!Ie&&(Ie=M,hr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),hr=!0)),[{path:ae,element:Ie,children:M.props.children?[{path:ae==="/"?"/":"*",element:M.props.children}]:void 0}]}).sort((M,ae)=>ae.path.localeCompare(M.path)).map(M=>({...M,path:M.path==="/"?"/":`${M.path}/*`}))),{path:"*",element:(0,h.jsx)(s,{})}];return(0,W.V$)(A)},Bo=(0,g.T0)({id:"plugin.permission.api"});var Yn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Yn||(Yn={}));function Gs(i,n){return i.name===n.name}function $o(i,n){return"resourceType"in i?!n||i.resourceType===n:!1}function hs(i){return i.attributes.action==="create"}function ps(i){return i.attributes.action==="read"}function uo(i){return i.attributes.action==="update"}function fs(i){return i.attributes.action==="delete"}function gs(i){return{authorize:async(n,s)=>await i.authorize(n,s),authorizeConditional(n,s){const a=n;return i.authorize(a,s)}}}function sr({name:i,attributes:n,resourceType:s}){return s?{type:"resource",name:i,attributes:n,resourceType:s}:{type:"basic",name:i,attributes:n}}var Do=r(23054),Wn=r(96279),ho=r.n(Wn),Zo=r(9571);const Hr=ut.z.lazy(()=>ut.z.object({rule:ut.z.string(),resourceType:ut.z.string(),params:ut.z.record(ut.z.any()).optional()}).or(ut.z.object({anyOf:ut.z.array(Hr).nonempty()})).or(ut.z.object({allOf:ut.z.array(Hr).nonempty()})).or(ut.z.object({not:Hr}))),No=ut.z.object({result:ut.z.literal(Yn.ALLOW).or(ut.z.literal(Yn.DENY))}),Fo=ut.z.union([ut.z.object({result:ut.z.literal(Yn.ALLOW).or(ut.z.literal(Yn.DENY))}),ut.z.object({result:ut.z.literal(Yn.CONDITIONAL),pluginId:ut.z.string(),resourceType:ut.z.string(),conditions:Hr})]),ms=(i,n)=>ut.z.object({items:ut.z.array(ut.z.intersection(ut.z.object({id:ut.z.string()}),i)).refine(s=>s.length===n.size&&s.every(({id:a})=>n.has(a)),{message:"Items in response do not match request"})});class Uo{async authorize(n,s){return this.makeRequest(n,No,s)}async authorizeConditional(n,s){return this.makeRequest(n,Fo,s)}async makeRequest(n,s,a){if(!this.enabled)return n.map(Ie=>({result:Yn.ALLOW}));const p={items:n.map(Ie=>({id:Zo.Z(),...Ie}))},A=await this.discovery.getBaseUrl("permission"),k=await ho()(`${A}/authorize`,{method:"POST",body:JSON.stringify(p),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!k.ok)throw await Do.VL.fromResponse(k);const M=await k.json(),xe=ms(s,new Set(p.items.map(({id:Ie})=>Ie))).parse(M).items.reduce((Ie,Ve)=>(Ie[Ve.id]=Ve,Ie),{});return p.items.map(Ie=>xe[Ie.id])}getAuthorizationHeader(n){return n?{Authorization:`Bearer ${n}`}:{}}constructor(n){(0,z._)(this,"enabled",void 0),(0,z._)(this,"discovery",void 0),this.discovery=n.discovery;var s;this.enabled=(s=n.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class po{static create(n){const{config:s,discovery:a,identity:p}=n,A=new Uo({discovery:a,config:s});return new po(A,p)}async authorize(n){return(await this.permissionClient.authorize([n],await this.identityApi.getCredentials()))[0]}constructor(n,s){(0,z._)(this,"permissionClient",void 0),(0,z._)(this,"identityApi",void 0),this.permissionClient=n,this.identityApi=s}}var x=r(69984);function C(i){const n=(0,g.h_)(Bo),{data:s,error:a}=(0,x.ZP)(i,async p=>{if($o(p.permission)&&!p.resourceRef)return Yn.DENY;const{result:A}=await n.authorize(p);return A});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Yn.ALLOW}}const R=i=>{const{permission:n,resourceRef:s,errorComponent:a,...p}=i,A=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),k=useApp(),{NotFoundErrorPage:M}=k.getComponents();let ae=a===void 0?_jsx(M,{}):a;return A.loading?ae=null:A.allowed&&(ae=i.element),_jsx(Route,{...p,element:ae})};function N(i){const{permission:n,resourceRef:s}=i,a=usePermission(isResourcePermission(n)?{permission:n,resourceRef:s}:{permission:n}),p=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:A}=p.getComponents();return _jsx(A,{})}const re=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>Z.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new D}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new me}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const n=new q(i,new Y);return we.forward(n,{hidden:!1}),n}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>Lt.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:n,discoveryApi:s})=>jt({middleware:[Mt.resolvePluginProtocol({discoveryApi:s}),Mt.injectIdentityAuth({identityApi:n,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new zt}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Ln.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Kt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Yt.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Mn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Fn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Tn.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>ce.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>Me.create({configApi:s,discoveryApi:i,oauthRequestApi:n,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:n,configApi:s})=>se.create({configApi:s,discoveryApi:i,oauthRequestApi:n,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Bo,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:n,identity:s})=>po.create({config:i,discovery:n,identity:s})})];var de=r(77277),X=r(53974),ye=r(71597);function Ee({children:i}){return(0,W.GV)()?(0,h.jsx)(h.Fragment,{children:i}):(0,h.jsx)(W.VA,{children:i})}const Re=()=>(0,h.jsx)(X.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),Ze=({step:i,error:n})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${n.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${n.message}`),(0,h.jsx)(Ee,{children:(0,h.jsx)(X.mf,{status:"501",statusMessage:s})})},Ne=({error:i,resetError:n,plugin:s})=>(0,h.jsx)(X.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,h.jsx)(de.Z,{variant:"outlined",onClick:n,children:"Retry"})}),rt={Progress:X.Ex,Router:ye.VK,NotFoundErrorPage:Re,BootErrorPage:Ze,ErrorBoundaryFallback:Ne};var qe=r(43642),Ge=r(80079),Be=r(90941),Je=r(32915),At=r(40562),cn=r(21853),qt=r(60744),on=r(66569),nn=r(30254),An=r(13384),Rn=r(15933),Er=r(58838),Nr=r(86737),Gr=r(4989),In=r(44407),Vn=r(18628),Or=r(84219),Mo=r(98685),Fi=r(39781),vs=r(39412);const Ks={brokenImage:Ge.Z,catalog:Vn.Z,scaffolder:Je.Z,techdocs:At.Z,search:cn.Z,chat:qt.Z,dashboard:on.Z,docs:nn.Z,email:An.Z,github:Er.Z,group:Or.Z,help:Nr.Z,"kind:api":Rn.Z,"kind:component":In.Z,"kind:domain":qe.Z,"kind:group":Or.Z,"kind:location":Gr.Z,"kind:system":Be.Z,"kind:user":Mo.Z,"kind:resource":vs.Z,user:Mo.Z,warning:Fi.Z};var ys=r(73689),zo=r(48032);const ir={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")`},ar={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 Jn(i){const{colors:n,shape:s,options:a}=i,A=`linear-gradient(90deg, ${(n.length===1?[n[0],n[0]]:n).join(", ")})`,k=`${s}, ${A}`;var M;const ae=(M=a==null?void 0:a.fontColor)!==null&&M!==void 0?M:"#FFFFFF";return{colors:n,shape:s,backgroundImage:k,fontColor:ae}}const Wo={home:Jn({colors:ar.teal,shape:ir.wave}),documentation:Jn({colors:ar.pinkSea,shape:ir.wave2}),tool:Jn({colors:ar.purpleSky,shape:ir.round}),service:Jn({colors:ar.marineBlue,shape:ir.wave}),website:Jn({colors:ar.veryBlue,shape:ir.wave}),library:Jn({colors:ar.rubyRed,shape:ir.wave}),other:Jn({colors:ar.darkGrey,shape:ir.wave}),app:Jn({colors:ar.toastyOrange,shape:ir.wave}),apis:Jn({colors:ar.teal,shape:ir.wave2}),card:Jn({colors:ar.greens,shape:ir.wave})},Ys=16,Js='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Ui(i){const{palette:n,htmlFontSize:s=Ys,fontFamily:a=Js,defaultPageTheme:p,pageTheme:A=Wo}=i;if(!A[p])throw new Error(`${p} is not defined in pageTheme.`);var k;return{palette:n,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:a,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:A[p],getPageTheme:({themeId:M})=>(k=A[M])!==null&&k!==void 0?k:A[p]}}function Qs(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,zo.darken)(i.palette.link,.3),background:(0,zo.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"}},active:{fontWeight:"bold"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function xs(i){const n=Ui(i),s=(0,ys.Z)(n),a=Qs(s);return{...s,overrides:a}}var Vo=r(34505);const Kr=xs({palette:{type:"light",background:{default:"#F8F8F8"},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:Vo.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Wo}),Xs=xs({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:Vo.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Wo});var bs=r(98192),_s=r(15222),Ho=r(41547),Go=r(87561);const ei=[{id:"light",title:"Light Theme",variant:"light",icon:(0,h.jsx)(_s.Z,{}),Provider:({children:i})=>(0,h.jsx)(Ho.Z,{theme:Kr,children:(0,h.jsx)(Go.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,h.jsx)(bs.Z,{}),Provider:({children:i})=>(0,h.jsx)(Ho.Z,{theme:Xs,children:(0,h.jsx)(Go.ZP,{children:i})})}];function Mi(i){var n,s,a,p;return co({...i,apis:(n=i==null?void 0:i.apis)!==null&&n!==void 0?n:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...rt,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:re,icons:{...Ks,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(p=i==null?void 0:i.themes)!==null&&p!==void 0?p:ei})}var fo=r(25271),Ko=r(76635);async function ti({storageApi:i}){const n=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=n.snapshot("starredEntities").value;if(!(0,Ko.isArray)(a))return;var p;const A=new Set((p=s.snapshot("entityRefs").value)!==null&&p!==void 0?p:[]);a.filter(Ko.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,M,ae,xe])=>(0,fo.eE)({kind:M,namespace:ae,name:xe})).forEach(k=>A.add(k)),await s.set("entityRefs",Array.from(A)),await n.remove("starredEntities")}class nr{async toggleStarred(n){this.starredEntities.has(n)?this.starredEntities.delete(n):this.starredEntities.add(n),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const n of this.subscribers)n.next(new Set(this.starredEntities))}constructor(n){(0,z._)(this,"settingsStore",void 0),(0,z._)(this,"starredEntities",void 0),(0,z._)(this,"subscribers",new Set),(0,z._)(this,"observable",new(Se())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),ti(n).then(),this.settingsStore=n.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var p;this.starredEntities=new Set((p=a.value)!==null&&p!==void 0?p:[]),this.notifyChanges()}})}}var Aa=r(33414),Yr=r(79692),zi=r(12420),Hn=r(43514),Ta=r(19928);function Ra(){const i=useApi(catalogApiRef),{error:n,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(A=>{var k;return((k=A.facets.kind)===null||k===void 0?void 0:k.map(M=>M.value).sort())||[]}),[i]);return{loading:s,error:n,allKinds:a!=null?a:[]}}function Ia(i,n,s){let a=i;return n&&(a=a.filter(A=>n.some(k=>k.toLocaleLowerCase("en-US")===A.toLocaleLowerCase("en-US")))),s&&!i.some(A=>A.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((A,k)=>(A[k.toLocaleLowerCase("en-US")]=k,A),{})}const Wi=(0,Yr.Z)(i=>(0,zi.Z)({root:{...i.typography.h4}}));function Yo(i){var n;const{initialFilter:s="component",allowedKinds:a}=i,p=Wi(),{allKinds:A}=useAllKinds(),{filters:k,updateFilters:M,queryParameters:{kind:ae}}=useEntityList(),xe=useMemo(()=>[ae].flat()[0],[ae]);var Ie;const[Ve,gt]=useState((Ie=xe!=null?xe:(n=k.kind)===null||n===void 0?void 0:n.value)!==null&&Ie!==void 0?Ie:s);useEffect(()=>{xe&>(xe)},[xe]),useEffect(()=>{var Rt;if(!((Rt=k.kind)===null||Rt===void 0)&&Rt.value){var Wt;gt((Wt=k.kind)===null||Wt===void 0?void 0:Wt.value)}},[k.kind]),useEffect(()=>{M({kind:Ve?new EntityKindFilter(Ve):void 0})},[Ve,M]);const Tt=filterKinds(A,a,Ve);return _jsx(Select,{input:_jsx(InputBase,{}),value:Ve.toLocaleLowerCase("en-US"),onChange:Rt=>gt(Rt.target.value),classes:p,children:Object.keys(Tt).map(Rt=>_jsx(MenuItem,{value:Rt,children:`${pluralize(Tt[Rt])}`},Rt))})}var Pa=r(86359),Ss=r(95544),ni=r(99688),go=r(12231),Fr=r(86136),mo=r(49378),ri=r(85256),Cs=r(80030),vo=r(61837),lr=r(79784),Jo=r(50758),yo=r(31654),ws=r(43054),js=r(65759),Ar=r(49280),oi=r(96641);function Es(i){const{entity:n,loading:s,error:a}=(0,oi.ce)(),{allowed:p,loading:A,error:k}=C({permission:i,resourceRef:n?(0,fo.eE)(n):void 0});return s||A?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:p,error:k}}const Qo="catalog-entity",Vi=sr({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Qo}),cr=sr({name:"catalog.entity.create",attributes:{action:"create"}}),Xo=sr({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Qo}),si=sr({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Qo}),ii=sr({name:"catalog.location.read",attributes:{action:"read"}}),ai=sr({name:"catalog.location.create",attributes:{action:"create"}}),li=sr({name:"catalog.location.delete",attributes:{action:"delete"}}),qo=[Vi,cr,Xo,si,ii,ai,li];var As=r(49166);function Ts(i){const{unregisterEntityOptions:n,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:p}=i,A=typeof(n==null?void 0:n.disableUnregister)=="boolean";var k;const M=(k=!s||(A?!!(n!=null&&n.disableUnregister):(n==null?void 0:n.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let ae=(0,h.jsx)(h.Fragment,{});return(n==null?void 0:n.disableUnregister)!=="hidden"&&(ae=(0,h.jsxs)(go.Z,{onClick:()=>{p(),a()},disabled:M,children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(As.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Unregister entity"})]})),(0,h.jsx)(h.Fragment,{children:ae})}const Rs=(0,Yr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Is(i){const{UNSTABLE_extraContextMenuItems:n,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:p}=i,[A,k]=(0,H.useState)(),M=Rs(),xe=Es(Xo).allowed,Ie=Wt=>{k(Wt.currentTarget)},Ve=()=>{k(void 0)},gt=(0,g.h_)(g.$v),Tt=(0,H.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>gt.post({message:"Copied!",severity:"info",display:"transient"}))},[gt]),Rt=n&&[...n.map(Wt=>(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),Wt.onClick()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(Wt.Icon,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:Wt.title})]},Wt.title)),(0,h.jsx)(ri.Z,{},"the divider is here!")];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Cs.ZP,{title:"More",arrow:!0,children:(0,h.jsx)(vo.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!A,role:"button",onClick:Ie,"data-testid":"menu-button",className:M.button,id:"long-menu",children:(0,h.jsx)(ws.Z,{})})}),(0,h.jsx)(lr.ZP,{open:Boolean(A),onClose:Ve,anchorEl:A,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,h.jsxs)(Jo.Z,{children:[Rt,(0,h.jsx)(Ts,{unregisterEntityOptions:s,isUnregisterAllowed:xe,onUnregisterEntity:a,onClose:Ve}),(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),p()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(yo.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Inspect entity"})]}),(0,h.jsxs)(go.Z,{onClick:()=>{Ve(),Tt()},children:[(0,h.jsx)(Fr.Z,{children:(0,h.jsx)(js.Z,{fontSize:"small"})}),(0,h.jsx)(mo.Z,{primary:"Copy entity URL"})]})]})})]})}const xo="plugin.catalog.entityLayoutRoute",_o=()=>null;(0,g.R5)(_o,xo,!0),(0,g.R5)(_o,"core.gatherMountPoints",!0);function Ps(i){const{entity:n,title:s}=i;return(0,h.jsxs)(Ss.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,h.jsx)(Ss.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),n&&(0,h.jsx)(Hn.LH,{entity:n})]})}function Ls(i,n,s,a){var p;const A=(p=i!=null?i:a==null?void 0:a.kind)!==null&&p!==void 0?p:"";var k;const M=(k=n!=null?n:a==null?void 0:a.metadata.namespace)!==null&&k!==void 0?k:"";var ae,xe,Ie;return{headerTitle:`${(Ie=(xe=(ae=a==null?void 0:a.metadata.title)!==null&&ae!==void 0?ae:s)!==null&&xe!==void 0?xe:a==null?void 0:a.metadata.name)!==null&&Ie!==void 0?Ie:""}${M&&M!==fo.zG?` in ${M}`:""}`,headerType:(()=>{let gt=A.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(gt+=" \u2014 ",gt+=a.spec.type.toLocaleLowerCase("en-US")),gt})()}}function Os(i){var n;const{entity:s}=i,a=(0,Hn.hF)(s,fo.S4);return(0,h.jsxs)(h.Fragment,{children:[a.length>0&&(0,h.jsx)(X.i9,{label:"Owner",value:(0,h.jsx)(Hn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((n=s.spec)===null||n===void 0?void 0:n.lifecycle)&&(0,h.jsx)(X.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const ci=i=>{var n,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,children:A,NotFoundComponent:k}=i,{kind:M,namespace:ae,name:xe}=(0,g.Oi)(Hn.wi),{entity:Ie,loading:Ve,error:gt}=(0,Hn.ce)(),Tt=(0,W.TH)(),Rt=(0,g.vJ)(A,Oi=>Oi.selectByComponentData({key:xo,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Ur})=>{if(Ie){if(Ur.if&&!Ur.if(Ie))return[]}else return[];return[{path:Ur.path,title:Ur.title,children:Ur.children,tabProps:Ur.tabProps}]}),[Ie]),{headerTitle:Wt,headerType:Gt}=Ls(M,ae,xe,Ie),[$n,Xn]=(0,H.useState)(!1),[fr,Co]=(0,H.useState)(!1),Pi=(0,W.s0)(),Li=async()=>{Xn(!1),Co(!1),Pi("/")};(0,H.useEffect)(()=>{Xn(!1),Co(!1)},[Tt.pathname]);var ss;return(0,h.jsxs)(X.T3,{themeId:(ss=Ie==null||(n=Ie.spec)===null||n===void 0||(s=n.type)===null||s===void 0?void 0:s.toString())!==null&&ss!==void 0?ss:"home",children:[(0,h.jsx)(X.h4,{title:(0,h.jsx)(Ps,{title:Wt,entity:Ie}),pageTitleOverride:Wt,type:Gt,children:Ie&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Os,{entity:Ie}),(0,h.jsx)(Is,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,onUnregisterEntity:()=>Xn(!0),onInspectEntity:()=>Co(!0)})]})}),Ve&&(0,h.jsx)(X.Ex,{}),Ie&&(0,h.jsx)(X.tn,{routes:Rt}),gt&&(0,h.jsx)(X.VY,{children:(0,h.jsx)(ni.Z,{severity:"error",children:gt.toString()})}),!Ve&&!gt&&!Ie&&(0,h.jsx)(X.VY,{children:k||(0,h.jsxs)(X.GB,{title:"Entity not found",children:["There is no ",M," with the requested"," ",(0,h.jsx)(X.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,h.jsx)(Hn.pp,{open:$n,entity:Ie,onConfirm:Li,onClose:()=>Xn(!1)}),(0,h.jsx)(Hn.U_,{open:fr,entity:Ie,onClose:()=>Co(!1)})]})};ci.Route=_o;function es(i){const{open:n,onClose:s,onConfirm:a,entity:p}=i,[A,k]=useState(!1),M=useApi(catalogApiRef),ae=useApi(alertApiRef),xe=async()=>{k(!0);try{const Ie=p.metadata.uid;await M.removeEntityByUid(Ie),a()}catch(Ie){assertError(Ie),ae.post({message:Ie.message})}finally{k(!1)}};return _jsxs(Dialog,{open:n,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:A,onClick:xe,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var bo=r(19625);function Hi(i){var n,s;return(i==null||(n=i.metadata)===null||n===void 0||(s=n.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function di(){const i=useNavigate(),n=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:p}=useEntity(),A=async()=>{a(!1),i(n())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:p,onConfirm:A,onClose:()=>a(!1)})]})}var ks=r(4791);const ui=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Bs(i,n){return{items:(await n.getEntityAncestors({entityRef:i})).items.map(p=>{var A,k;return{errors:((k=(A=p.entity.status)===null||A===void 0?void 0:A.items)!==null&&k!==void 0?k:[]).filter(ui).map(xe=>xe.error).filter(xe=>Boolean(xe)),entity:p.entity}}).filter(p=>p.errors.length>0)}}async function Gi(i,n){const s=n.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Bs(stringifyEntityRef(i),s)).items.length>0}function hi(){const{entity:i}=useEntity(),n=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:p,value:A}=useAsync(async()=>Bs(n,s),[n,s]);return p?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:p})}):a||!A?null:_jsx(_Fragment,{children:A.items.map((k,M)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((ae,xe)=>_jsx(ResponseErrorPanel,{error:ae},xe))]},M))})}const $s="core.backstage.entitySwitch",Jr=i=>null;(0,g.R5)(Jr,$s,!0);const Ds=i=>{var n;const{entity:s,loading:a}=(0,Hn.ce)(),p=(0,g.I_)(),A=(0,g.vJ)(i.children,ae=>ae.selectByComponentData({key:$s,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(xe=>{if(a)return[];const{if:Ie,children:Ve}=xe.props;return s?[{if:Ie==null?void 0:Ie(s,{apis:p}),children:Ve}]:[{if:Ie===void 0,children:Ve}]}),[p,s,a]);if(A.some(ae=>typeof ae.if=="object"&&"then"in ae.if))return(0,h.jsx)(pi,{results:A,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ae=A.filter(xe=>xe.if).map(xe=>xe.children);return ae.length===0?Qr(A):(0,h.jsx)(h.Fragment,{children:ae})}var M;return(M=(n=A.find(ae=>ae.if))===null||n===void 0?void 0:n.children)!==null&&M!==void 0?M:Qr(A)};function pi({results:i,renderMultipleMatches:n}){const{loading:s,value:a}=(0,be.default)(async()=>{const p=i.map(async({if:k,children:M})=>{try{if(await k)return M}catch{}return null});if(n==="all"){const k=(await Promise.all(p)).filter(Boolean);return k.length===0?Qr(i):(0,h.jsx)(h.Fragment,{children:k})}var A;return(A=(await Promise.all(p)).find(Boolean))!==null&&A!==void 0?A:Qr(i)},[i]);return s||!a?null:a}function Qr(i){var n,s;return(s=(n=i.filter(a=>a.if===void 0)[0])===null||n===void 0?void 0:n.children)!==null&&s!==void 0?s:null}Ds.Case=Jr;const Ki=null,fi=Hn._i.Filters,gi=Hn._i.Content;var Qn=r(85877),mi=r(15096);const Bn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Hn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:n})=>new ks.MS({discoveryApi:i,fetchApi:n})}),(0,g.ni)({api:Hn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new nr({storageApi:i})})],routes:{catalogIndex:bo._Z,catalogEntity:Hn.wi},externalRoutes:{createComponent:bo.yw,viewTechDoc:bo.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Yi=Bn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>r.e(9323).then(r.bind(r,89323)).then(i=>i.CatalogPage),mountPoint:bo._Z})),Zs=Bn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>r.e(8951).then(r.bind(r,78951)).then(i=>i.CatalogEntityPage),mountPoint:Hn.wi})),Ji=Bn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,33414)).then(i=>i.AboutCard)}})),La=Bn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>r.e(7750).then(r.bind(r,17750)).then(i=>i.EntityLinksCard)}})),Ns=Bn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(r.bind(r,85877)).then(i=>i.EntityLabelsCard)}})),Qi=Bn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>r.e(5458).then(r.bind(r,5458)).then(i=>i.HasSystemsCard)}})),Xi=Bn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>r.e(1105).then(r.bind(r,1105)).then(i=>i.HasComponentsCard)}})),qi=Bn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>r.e(2440).then(r.bind(r,82440)).then(i=>i.HasSubcomponentsCard)}})),ts=Bn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>r.e(9770).then(r.bind(r,79770)).then(i=>i.HasResourcesCard)}})),_i=Bn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>r.e(9545).then(r.bind(r,19545)).then(i=>i.DependsOnComponentsCard)}})),ea=Bn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>r.e(184).then(r.bind(r,40184)).then(i=>i.DependencyOfComponentsCard)}})),vi=Bn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>r.e(1032).then(r.bind(r,81032)).then(i=>i.DependsOnResourcesCard)}})),ta=Bn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>r.e(732).then(r.bind(r,732)).then(i=>i.RelatedEntitiesCard)}})),Oa=Bn.provide((0,mi.E5)({name:"CatalogSearchResultListItem",component:()=>r.e(7670).then(r.bind(r,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var yi=r(32838);class xi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(n,s){const p=`${await this.getApiOrigin()}/${s}`,A=await fetch(`${p.endsWith("/")?p:`${p}/`}index.html`);if(A.status===404)throw new Error("Page not found");return A.text()}async syncEntityDocs(n){return"cached"}async getBaseUrl(n,s,a){const p=await this.getApiOrigin();return new URL(n,`${p}/${a}`).toString()}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}class na{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(n){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(n){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:n,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=n,this.discoveryApi=s,this.identityApi=a}}const ra=[(0,g.ni)({api:oe.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new xi({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:oe.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:n,identityApi:s})=>new na({configApi:i,discoveryApi:n,identityApi:s})}),(0,g.ni)({api:yi.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>yi.ae.fromConfig(i)})],ns={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},rs={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function bi(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function So(){const i=await so(),n=await bi();return[...i,{context:"detected",data:n?ns:rs}]}var Si=r(58845);const os=(0,Yr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Ci=()=>{const i=os();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,h.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Fs=(0,Yr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Us=()=>{const i=Fs();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,h.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ia=(0,Yr.Z)({root:{width:X.po.drawerWidthClosed,height:3*X.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:X.po.drawerWidthClosed,marginLeft:24}}),aa=()=>{const i=ia(),{isOpen:n}=(0,X.mZ)();return(0,h.jsx)("div",{className:i.root,children:(0,h.jsx)(X.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:n?(0,h.jsx)(Ci,{}):(0,h.jsx)(Us,{})})})},la=({children:i})=>(0,h.jsxs)(X.tR,{children:[(0,h.jsxs)(X.YE,{children:[(0,h.jsx)(aa,{}),(0,h.jsx)(X.v7,{}),(0,h.jsx)(X.R6,{icon:Si.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var wi=r(32388),ji=r(4142);const ca=(0,Yr.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 pr;(function(i){i.LIGHT="light",i.DARK="dark"})(pr||(pr={}));const Ei=()=>{const i=(0,g.h_)(g.hg),n=ca(),[s,a]=(0,H.useState)(i.getActiveThemeId()===pr.DARK?pr.DARK:pr.LIGHT),p={[pr.LIGHT]:{icon:ji.Z,title:"Dark theme"},[pr.DARK]:{icon:wi.Z,title:"Light theme"}},{title:A,icon:k}=p[s],M=()=>{a(ae=>{const xe=ae===pr.LIGHT?pr.DARK:pr.LIGHT;return i.setActiveThemeId(xe),xe})};return(0,h.jsx)(Ss.Z,{display:"flex",alignItems:"center",mr:2,children:(0,h.jsx)(Cs.ZP,{title:A,arrow:!0,children:(0,h.jsx)(vo.Z,{size:"small",onClick:M,children:(0,h.jsx)(k,{className:n.headerIcon})})})})},Ai=()=>(0,h.jsxs)(L.I6,{children:[(0,h.jsx)(K.S,{}),(0,h.jsx)(I.F,{withSearch:!1})]}),Ms=(0,h.jsx)(Ai,{}),zs=Mi({apis:ra,configLoader:So,plugins:Object.values(t)}),Ti=zs.getProvider(),da=zs.getRouter(),Ri=L.s4.provide((0,oe.KY)({name:"ThemeToggleAddon",component:Ei,location:oe.oZ.Header})),Ws=(0,h.jsxs)(Lr,{children:[(0,h.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,h.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,h.jsx)(Zs,{})}),(0,h.jsx)(W.AW,{path:"/docs",element:(0,h.jsx)(L.Jl,{}),children:(0,h.jsx)($.u,{})}),(0,h.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,h.jsx)(L.I6,{}),children:[Ms,(0,h.jsx)(oe.DR,{children:(0,h.jsx)(Ri,{})})]})]});var Ii=()=>(0,h.jsx)(Ti,{children:(0,h.jsx)(da,{children:(0,h.jsx)(la,{children:Ws})})});f.render((0,h.jsx)(Ii,{}),document.getElementById("root"))},51837:function(Ct,$e,r){"use strict";r.d($e,{CT:function(){return g},EI:function(){return ve},uW:function(){return f},Vt:function(){return u}});function t(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const h=t(),H=ue=>`__@backstage/${ue}__`;function f(ue,V){const K=H(ue);let I=h[K];return I||(I=V(),h[K]=I,I)}var W=r(2784);function g(ue){return f(ue,()=>(0,W.createContext)(void 0))}function u(ue){return(0,W.useContext)(g(ue))}function B(ue){return{set(V){globalThis[`__@backstage/${ue}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${ue}__`]}}}function ve(ue){Object.freeze(ue);const V={atVersion(K){return ue[K]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),V}},96641:function(Ct,$e,r){"use strict";r.d($e,{X2:function(){return ve},ce:function(){return ue},h$:function(){return u}});var t=r(52322),h=r(25271),H=r(60871),f=r(51837),W=r(2784);const g=(0,f.CT)("entity-context"),u=V=>{const{children:K,entity:I,loading:w,error:ie,refresh:ee}=V,ne={entity:I,loading:w,error:ie,refresh:ee};return(0,t.jsx)(g.Provider,{value:(0,f.EI)({1:ne}),children:(0,t.jsx)(H.fC,{attributes:{...I?{entityRef:(0,h.eE)(I)}:void 0},children:K})})},B=V=>_jsx(u,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function ve(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");if(!K.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:K.entity}}function ue(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const K=V.atVersion(1);if(!K)throw new Error("EntityContext v1 not available");const{entity:I,loading:w,error:ie,refresh:ee}=K;return{entity:I,loading:w,error:ie,refresh:ee}}},43514:function(Ct,$e,r){"use strict";r.d($e,{h$:function(){return xt.h$},n3:function(){return t.n3},_i:function(){return T},tW:function(){return _n},df:function(){return Me},UO:function(){return tt},ph:function(){return Uo},dq:function(){return kt},nl:function(){return Fo},dx:function(){return te},rI:function(){return le},u3:function(){return Dt},xE:function(){return Gn},sL:function(){return ur},LH:function(){return b},U_:function(){return Bo},pp:function(){return uo},EW:function(){return ho},Ah:function(){return H},wi:function(){return Qt},hF:function(){return oe.hF},CV:function(){return oe.CV},$3:function(){return D},p3:function(){return f},ce:function(){return xt.ce},X2:function(){return xt.X2},wp:function(){return mt},ZW:function(){return tn},eK:function(){return Yt},CR:function(){return Pn}});var t=r(4791),h=r(60871);const H=(0,h.T0)({id:"plugin.catalog.service"}),f=(0,h.T0)({id:"catalog-react.starred-entities"});var W=r(82394);class g{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const R of this.subscribers)R.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}}var u=r(52322),B=r(2784),ve=r(41156),ue=r(60364),V=r(77277),K=r(4190),I=r(95544),w=r(90436),ie=r(60905),ee=r(36444);const ne=x=>{const C=(0,ve.Z)(de=>de.breakpoints.down("md")),R=(0,ue.Z)(),[N,re]=(0,B.useState)(!1);return C?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{style:{marginTop:R.spacing(1),marginLeft:R.spacing(1)},onClick:()=>re(!0),startIcon:(0,u.jsx)(ee.Z,{}),children:"Filters"}),(0,u.jsx)(K.ZP,{open:N,onClose:()=>re(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,u.jsxs)(I.Z,{m:2,children:[(0,u.jsx)(w.Z,{variant:"h6",component:"h2",style:{marginBottom:R.spacing(1)},children:"Filters"}),x.children]})})]}):(0,u.jsx)(ie.Z,{item:!0,lg:2,children:x.children})},$=x=>(0,u.jsx)(ie.Z,{item:!0,xs:12,lg:10,children:x.children}),T=x=>(0,u.jsx)(ie.Z,{container:!0,style:{position:"relative"},children:x.children});T.Filters=ne,T.Content=$;var P=r(53974),L=r(87612),O=r(25271),oe=r(49280);class Le{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class ze{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class z{filterEntity(C){var R;return this.values.every(N=>((R=C.metadata.tags)!==null&&R!==void 0?R:[]).includes(N))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class yt{filterEntity(C){const R=this.toUpperArray(this.value.split(/\s/)),N=this.toUpperArray([C.metadata.tags]),re=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const de of R)if(N.every(X=>X!==de)&&re.every(X=>!X.includes(de)))return!1;return!0}toUpperArray(C){return C.flat().filter(R=>Boolean(R)).map(R=>R.toLocaleUpperCase("en-US"))}constructor(C){_define_property(this,"value",void 0),this.value=C}}class ot{filterEntity(C){return this.values.some(R=>(0,oe.hF)(C,O.S4).some(N=>(0,O.eE)(N)===R))}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C.reduce((R,N)=>{try{return R.push((0,O.eE)((0,O.of)(N,{defaultKind:"Group"}))),R}catch{return R}},[])}}class He{filterEntity(C){return this.values.some(R=>{var N;return((N=C.spec)===null||N===void 0?void 0:N.lifecycle)===R})}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class st{filterEntity(C){return this.values.some(R=>C.metadata.namespace===R)}toQueryValue(){return this.values}constructor(C){(0,L._)(this,"values",void 0),this.values=C}}class Qe{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,R,N){(0,L._)(this,"value",void 0),(0,L._)(this,"isOwnedEntity",void 0),(0,L._)(this,"isStarredEntity",void 0),this.value=C,this.isOwnedEntity=R,this.isStarredEntity=N}}class St{filterEntity(C){var R;const N=(R=C.metadata.annotations)===null||R===void 0?void 0:R["backstage.io/orphan"];return N!==void 0&&this.value.toString()===N}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}class It{filterEntity(C){var R,N;const re=(C==null||(R=C.status)===null||R===void 0||(N=R.items)===null||N===void 0?void 0:N.length)>0;return re!==void 0&&this.value===re}constructor(C){(0,L._)(this,"value",void 0),this.value=C}}var xt=r(96641),lt=r(76635),Pt=r(19126),Nt=r.n(Pt),We=r(73557),_t=r(69294),ge=r(48760),Se=r(90736);const Fe=(0,B.createContext)(void 0),tt=x=>{const C=(0,Se.default)(),R=(0,h.h_)(H),[N,re]=(0,B.useState)({}),de=(0,We.TH)();var X;const ye=(0,B.useMemo)(()=>(X=Nt().parse(de.search,{ignoreQueryPrefix:!0}).filters)!==null&&X!==void 0?X:{},[de]),[Ee,Re]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ze,error:Ne},rt]=(0,_t.default)(async()=>{const Be=(0,lt.compact)(Object.values(N)),Je=(0,oe.Gz)(Be),At=(0,oe.wq)(Be),cn=(0,oe.wq)((0,lt.compact)(Object.values(Ee.appliedFilters))),qt=Object.keys(N).reduce((nn,An)=>{const Rn=N[An];return Rn!=null&&Rn.toQueryValue&&(nn[An]=Rn.toQueryValue()),nn},{});if((0,lt.isEqual)(cn,At))Re({appliedFilters:N,backendEntities:Ee.backendEntities,entities:Ee.backendEntities.filter(Je)});else{const nn=await R.getEntities({filter:At});Re({appliedFilters:N,backendEntities:nn.items,entities:nn.items.filter(Je)})}if(C()){var on;const nn=Nt().parse(de.search,{ignoreQueryPrefix:!0}),An=Nt().stringify({...nn,filters:qt},{addQueryPrefix:!0,arrayFormat:"repeat"}),Rn=`${window.location.pathname}${An}`;(on=window.history)===null||on===void 0||on.replaceState(null,document.title,Rn)}},[R,ye,N,Ee],{loading:!0});(0,ge.Z)(rt,10,[N]);const qe=(0,B.useCallback)(Be=>{re(Je=>{const At=typeof Be=="function"?Be(Je):Be;return{...Je,...At}})},[]),Ge=(0,B.useMemo)(()=>({filters:Ee.appliedFilters,entities:Ee.entities,backendEntities:Ee.backendEntities,updateFilters:qe,queryParameters:ye,loading:Ze,error:Ne}),[Ee,qe,ye,Ze,Ne]);return(0,u.jsx)(Fe.Provider,{value:Ge,children:x.children})};function mt(){const x=(0,B.useContext)(Fe);if(!x)throw new Error("useEntityList must be used within EntityListProvider");return x}var bt=r(64279),pt=r(18149),Ot=r.n(pt),Ht=r(829),Jt=r.n(Ht);function Bt(){const x=(0,h.h_)(H),{filters:{kind:C,type:R},queryParameters:{type:N},updateFilters:re}=mt(),de=(0,B.useMemo)(()=>[N].flat().filter(Boolean),[N]);var X;const[ye,Ee]=(0,B.useState)(de.length?de:(X=R==null?void 0:R.getTypes())!==null&&X!==void 0?X:[]);(0,B.useEffect)(()=>{de.length&&Ee(de)},[de]);const[Re,Ze]=(0,B.useState)([]),Ne=(0,B.useMemo)(()=>C==null?void 0:C.value,[C]),{error:rt,loading:qe,value:Ge}=(0,bt.default)(async()=>Ne?await x.getEntityFacets({filter:{kind:Ne},facets:["spec.type"]}).then(At=>At.facets["spec.type"]||[]):[],[Ne,x]),Be=(0,B.useRef)(Ge);return(0,B.useEffect)(()=>{const Je=Be.current;if(Be.current=Ge,qe||!Ne||Je===Ge||!Ge)return;const At=[...new Set(Jt()(Ge,qt=>-qt.count).map(qt=>qt.value.toLocaleLowerCase("en-US")))];Ze(At);const cn=ye.filter(qt=>At.includes(qt));Ot()(ye,cn)||Ee(cn)},[qe,Ne,ye,Ee,Ge]),(0,B.useEffect)(()=>{re({type:ye.length?new ze(ye):void 0})},[ye,re]),{loading:qe,error:rt,availableTypes:Re,selectedTypes:ye,setSelectedTypes:Ee}}const un=20;function Yt(x,C){var R,N;const re=C==null||(R=C.type)===null||R===void 0?void 0:R.toLocaleLowerCase("en-US"),de=C==null||(N=C.kind)===null||N===void 0?void 0:N.toLocaleLowerCase("en-US"),X=(0,h.h_)(H),{loading:ye,value:Ee,error:Re}=(0,bt.default)(async()=>{var Ze;const Ne=(Ze=x.relations)===null||Ze===void 0?void 0:Ze.map(Be=>({type:Be.type,target:(0,O.of)(Be.targetRef)})).filter(Be=>(!re||Be.type.toLocaleLowerCase("en-US")===re)&&(!de||Be.target.kind===de));if(!Ne)return[];const rt=Object.values((0,lt.groupBy)(Ne,({target:Be})=>`${Be.kind}:${Be.namespace}`.toLocaleLowerCase("en-US"))),qe=[];for(const Be of rt)qe.push({kind:Be[0].target.kind,namespace:Be[0].target.namespace,nameBatches:(0,lt.chunk)(Be.map(Je=>Je.target.name),un)});return(await Promise.all(qe.flatMap(Be=>Be.nameBatches.map(Je=>X.getEntities({filter:{kind:Be.kind,"metadata.namespace":Be.namespace,"metadata.name":Je}}))))).flatMap(Be=>Be.items)},[x,re,de]);return{entities:Ee,loading:ye,error:Re}}var pn=r(72164);function Fn(x){return typeof x=="string"?x:(0,O.eE)(x)}function Pn(){const x=(0,h.h_)(f),C=(0,pn.Z)(x.starredEntitie$(),new Set),R=(0,B.useCallback)(re=>C.has(Fn(re)),[C]),N=(0,B.useCallback)(re=>x.toggleStarred(Fn(re)).then(),[x]);return{starredEntities:C,toggleStarredEntity:N,isStarredEntity:R}}function fn(x){return typeof x=="string"?x:(0,O.eE)(x)}function Ln(x){const C=(0,h.h_)(f),[R,N]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const de=C.starredEntitie$().subscribe({next(X){N(X.has(fn(x)))}});return()=>{de.unsubscribe()}},[x,C]),{toggleStarredEntity:(0,B.useCallback)(()=>C.toggleStarred(fn(x)).then(),[x,C]),isStarredEntity:R}}var Un=r(75435);function tn(){const x=(0,h.h_)(h.$4),{loading:C,value:R}=(0,bt.default)(async()=>{const{ownershipEntityRefs:re}=await x.getBackstageIdentity();return re},[]),N=(0,B.useMemo)(()=>{const re=new Set(R!=null?R:[]);return de=>{const X=(0,Un.h)(de,O.S4).map(O.eE);for(const ye of X)if(re.has(ye))return!0;return!1}},[R]);return(0,B.useMemo)(()=>({loading:C,isOwnedEntity:N}),[C,N])}function wn(){const x=(0,h.h_)(H),{error:C,loading:R,value:N}=(0,bt.default)(async()=>await x.getEntityFacets({facets:["kind"]}).then(de=>{var X;return((X=de.facets.kind)===null||X===void 0?void 0:X.map(ye=>ye.value).sort())||[]}),[x]);return{loading:R,error:C,allKinds:N!=null?N:[]}}function Mn(x,C,R){let N=x;return C&&(N=N.filter(de=>C.some(X=>X.toLocaleLowerCase("en-US")===de.toLocaleLowerCase("en-US")))),R&&!x.some(de=>de.toLocaleLowerCase("en-US")===R.toLocaleLowerCase("en-US"))&&(N=N.concat([R])),N.sort().reduce((de,X)=>(de[X.toLocaleLowerCase("en-US")]=X,de),{})}function ut(x){var C;const{filters:R,queryParameters:{kind:N},updateFilters:re}=mt(),de=(0,B.useMemo)(()=>[N].flat()[0],[N]);var X;const[ye,Ee]=(0,B.useState)((X=de!=null?de:(C=R.kind)===null||C===void 0?void 0:C.value)!==null&&X!==void 0?X:x.initialFilter);(0,B.useEffect)(()=>{de&&Ee(de)},[de]),(0,B.useEffect)(()=>{var rt;if(!((rt=R.kind)===null||rt===void 0)&&rt.value){var qe;Ee((qe=R.kind)===null||qe===void 0?void 0:qe.value)}},[R.kind]),(0,B.useEffect)(()=>{re({kind:ye?new Le(ye):void 0})},[ye,re]);const{allKinds:Re,loading:Ze,error:Ne}=wn();return{loading:Ze,error:Ne,allKinds:Re!=null?Re:[],selectedKind:ye,setSelectedKind:Ee}}const _n=x=>{const{allowedKinds:C,hidden:R,initialFilter:N="component"}=x,re=(0,h.h_)(h.$v),{error:de,allKinds:X,selectedKind:ye,setSelectedKind:Ee}=ut({initialFilter:N});if((0,B.useEffect)(()=>{de&&re.post({message:"Failed to load entity kinds",severity:"error"})},[de,re]),de)return null;const Re=Mn(X,C,ye),Ze=Object.keys(Re).map(Ne=>({value:Ne,label:Re[Ne]}));return R?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Kind",items:Ze,selected:ye.toLocaleLowerCase("en-US"),onChange:Ne=>Ee(String(Ne))})})};var wt=r(79692),ct=r(5806),vn=r(21324),Kt=r(86619),hn=r(19996),jn=r(25505),ln=r(38016),Tn=r(88013);const Ce=(0,wt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),ce=(0,u.jsx)(jn.Z,{fontSize:"small"}),Oe=(0,u.jsx)(hn.Z,{fontSize:"small"}),Me=x=>{var C;const{initialFilter:R=[]}=x,N=Ce(),{updateFilters:re,backendEntities:de,filters:X,queryParameters:{lifecycles:ye}}=mt(),Ee=(0,B.useMemo)(()=>[ye].flat().filter(Boolean),[ye]);var Re;const[Ze,Ne]=(0,B.useState)(Ee.length?Ee:(Re=(C=X.lifecycles)===null||C===void 0?void 0:C.values)!==null&&Re!==void 0?Re:R);(0,B.useEffect)(()=>{Ee.length&&Ne(Ee)},[Ee]);const rt=(0,B.useMemo)(()=>[...new Set(de.map(qe=>{var Ge;return(Ge=qe.spec)===null||Ge===void 0?void 0:Ge.lifecycle}).filter(Boolean))].sort(),[de]);return(0,B.useEffect)(()=>{re({lifecycles:Ze.length&&rt.length?new He(Ze):void 0})},[Ze,re,rt]),rt.length?(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Lifecycle",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:rt,value:Ze,onChange:(qe,Ge)=>Ne(Ge),renderOption:(qe,{selected:Ge})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:ce,checkedIcon:Oe,checked:Ge}),onClick:Be=>Be.preventDefault(),label:qe}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:qe=>(0,u.jsx)(Kt.Z,{...qe,className:N.input,variant:"outlined"})})]})}):null};var Xe=r(72579),se=r.n(Xe);function D(x,C){const R=C==null?void 0:C.defaultKind;let N,re,de;return"metadata"in x?(N=x.kind,re=x.metadata.namespace,de=x.metadata.name):(N=x.kind,re=x.namespace,de=x.name),(re===void 0||re==="")&&(re=O.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===re&&(re=void 0):re===O.zG&&(re=void 0),N=N.toLocaleLowerCase("en-US"),N=R&&R.toLocaleLowerCase("en-US")===N?void 0:N,`${N?`${N}:`:""}${re?`${re}/`:""}${de}`}function me(x,C){for(const R of["spec.profile.displayName","metadata.title"]){const N=se()(x,R);if(N&&typeof N=="string")return N}return D(x,C)}const De=(0,wt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),et=(0,u.jsx)(jn.Z,{fontSize:"small"}),it=(0,u.jsx)(hn.Z,{fontSize:"small"}),kt=()=>{var x;const C=De(),{updateFilters:R,backendEntities:N,filters:re,queryParameters:{owners:de}}=mt(),X=(0,h.h_)(H),ye=(0,h.h_)(h.VE),Ee=(0,B.useMemo)(()=>[de].flat().filter(Boolean),[de]);var Re;const[Ze,Ne]=(0,B.useState)(Ee.length?new ot(Ee).values:(Re=(x=re.owners)===null||x===void 0?void 0:x.values)!==null&&Re!==void 0?Re:[]),{loading:rt,error:qe,value:Ge}=(0,bt.default)(async()=>{const Je=[...new Set(N.flatMap(qt=>(0,oe.hF)(qt,O.S4).map(on=>(0,O.eE)(on))).filter(Boolean))],{items:At}=await X.getEntitiesByRefs({entityRefs:Je,fields:["kind","metadata.name","metadata.title","metadata.namespace","spec.profile.displayName"]});return At.map((qt,on)=>qt?{label:me(qt,{defaultKind:"Group"}),entityRef:(0,O.eE)(qt)}:{label:D((0,O.of)(Je[on]),{defaultKind:"group"}),entityRef:Je[on]}).sort((qt,on)=>qt.label.localeCompare(on.label,"en-US",{ignorePunctuation:!0,caseFirst:"upper"}))},[N]);if((0,B.useEffect)(()=>{qe&&ye.post({...qe,message:`EntityOwnerPicker failed to initialize: ${qe.message}`},{})},[qe,ye]),(0,B.useEffect)(()=>{if(Ee.length){const Je=new ot(Ee);Ne(Je.values)}},[Ee]),(0,B.useEffect)(()=>{!rt&&Ge&&R({owners:Ze.length&&Ge.length?new ot(Ze):void 0})},[Ze,R,Ge,rt]),!rt&&!(Ge!=null&&Ge.length))return null;var Be;return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Owner",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:rt,options:Ge||[],value:(Be=Ge==null?void 0:Ge.filter(Je=>Ze.some(At=>At===Je.entityRef)))!==null&&Be!==void 0?Be:[],onChange:(Je,At)=>Ne(At.map(cn=>cn.entityRef)),getOptionLabel:Je=>Je.label,renderOption:(Je,{selected:At})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:et,checkedIcon:it,checked:At}),onClick:cn=>cn.preventDefault(),label:Je.label}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"owner-picker-expand"}),renderInput:Je=>(0,u.jsx)(Kt.Z,{...Je,className:C.input,variant:"outlined"})})]})})};var Ft=r(51837);const Qt=(0,Ft.uW)("catalog:entity-route-ref",()=>(0,h.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function _(x){var C,R;return{kind:x.kind.toLocaleLowerCase("en-US"),namespace:(R=(C=x.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&R!==void 0?R:DEFAULT_NAMESPACE,name:x.metadata.name}}var J=r(80030);const te=(0,B.forwardRef)((x,C)=>{const{entityRef:R,defaultKind:N,title:re,children:de,...X}=x,ye=(0,h.tg)(Qt);let Ee,Re,Ze;if(typeof R=="string"){const Be=(0,O.of)(R);Ee=Be.kind,Re=Be.namespace,Ze=Be.name}else"metadata"in R?(Ee=R.kind,Re=R.metadata.namespace,Ze=R.metadata.name):(Ee=R.kind,Re=R.namespace,Ze=R.name);Ee=Ee.toLocaleLowerCase("en-US");var Ne;Re=(Ne=Re==null?void 0:Re.toLocaleLowerCase("en-US"))!==null&&Ne!==void 0?Ne:O.zG;const rt={kind:Ee,namespace:Re,name:Ze},qe=D({kind:Ee,namespace:Re,name:Ze},{defaultKind:N}),Ge=(0,u.jsxs)(P.rU,{...X,ref:C,to:ye(rt),children:[de,!de&&(re!=null?re:qe)]});return re?(0,u.jsx)(J.ZP,{title:qe,children:Ge}):Ge});function pe(x){const{entityRefs:C,defaultKind:R,getTitle:N,...re}=x,de=(0,h.h_)(H),{value:X=new Array,loading:ye,error:Ee}=(0,bt.default)(async()=>{const Re=C.reduce((Ne,rt)=>typeof rt=="object"&&"metadata"in rt?Ne:[...Ne,(0,O.of)(rt)],new Array),Ze=C.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return Re.length>0?[...(await de.getEntities({filter:Re.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...Ze]:Ze},[C]);return ye?(0,u.jsx)(P.Ex,{}):Ee?(0,u.jsx)(P.yu,{error:Ee}):(0,u.jsx)(u.Fragment,{children:X.map((Re,Ze)=>(0,u.jsxs)(B.Fragment,{children:[Ze>0&&", ",(0,u.jsx)(te,{...re,defaultKind:R,entityRef:Re,title:N(Re)})]},Ze))})}function le(x){const{entityRefs:C,defaultKind:R,fetchEntities:N,getTitle:re,...de}=x;return N?(0,u.jsx)(pe,{...de,defaultKind:R,entityRefs:C,getTitle:re}):(0,u.jsx)(u.Fragment,{children:C.map((X,ye)=>(0,u.jsxs)(B.Fragment,{children:[ye>0&&", ",(0,u.jsx)(te,{...de,defaultKind:R,entityRef:X,title:re?re(X):void 0})]},ye))})}const y=x=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(x.entity)),children:_jsx(InfoIcon,{})})},Z=x=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${x.email}`,to:`mailto:${x.email}`,children:_jsx(EmailIcon,{})}),q=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},Y=x=>{var C;const R=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return R?_jsx(EmailCardAction,{email:R}):null},we=(0,wt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Ae=4,Ye=x=>{var C,R,N;const{entityRef:re,children:de,delayTime:X=500}=x,ye=we(),Ee=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Ze,Ne]=useState(!1),rt=useMemo(()=>debounce(()=>Ne(!0),X),[X]),[{loading:qe,error:Ge,value:Be},Je]=useAsyncFn(async()=>{const cn=Ee.get(catalogApiRef);if(cn){const qt=await cn.getEntityByRef(re);if(!qt)throw new Error(`${re} not found`);return qt}},[Ee,re]),At=()=>{Ne(!1),rt.cancel()};return useEffect(()=>{Re.isOpen&&!Be&&!Ge&&!qe&&Je()},[Re.isOpen,Je,Be,Ge,qe]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:rt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:de})}),Ze&&_jsx(HoverPopover,{PaperProps:{className:ye.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:At,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Ge&&_jsx(ResponseErrorPanel,{error:Ge}),qe&&_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:ye.descriptionTypography,paragraph:!0,children:Be.metadata.description}),_jsx(Typography,{children:(C=Be.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Be.metadata.tags||[]).slice(0,Ae).map(cn=>_jsx(Chip,{size:"small",label:cn},cn)),((R=Be.metadata.tags)===null||R===void 0?void 0:R.length)&&((N=Be.metadata.tags)===null||N===void 0?void 0:N.length)>Ae&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Ge&&Be&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Be)&&_jsx(UserCardActions,{entity:Be}),isGroupEntity(Be)&&_jsx(GroupCardActions,{entity:Be}),_jsx(EntityCardActions,{entity:Be})]})})]})})]})},jt=(0,wt.Z)(x=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),vt=()=>{var x;const C=jt(),{filters:R,updateFilters:N}=useEntityList();var re;const[de,X]=useState((re=(x=R.text)===null||x===void 0?void 0:x.value)!==null&&re!==void 0?re:"");return useDebounce(()=>{N({text:de.length?new EntityTextFilter(de):void 0})},250,[de,N]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:ye=>X(ye.target.value),value:de,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>X(""),edge:"end",disabled:de.length===0,children:_jsx(Clear,{})})})})})})},nt=Object.freeze({createEntityRefColumn(x){const{defaultKind:C}=x;function R(N){var re;return((re=N.metadata)===null||re===void 0?void 0:re.title)||D(N,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(N,re){return R(re).includes(N)},customSort(N,re){return R(N).localeCompare(R(re))},render:N=>{var re;return(0,u.jsx)(te,{entityRef:N,defaultKind:C,title:(re=N.metadata)===null||re===void 0?void 0:re.title})}}},createEntityRelationColumn(x){const{title:C,relation:R,defaultKind:N,filter:re}=x;function de(ye){return(0,oe.hF)(ye,R,re)}function X(ye){return de(ye).map(Ee=>D(Ee,{defaultKind:N})).join(", ")}return{title:C,customFilterAndSearch(ye,Ee){return X(Ee).includes(ye)},customSort(ye,Ee){return X(ye).localeCompare(X(Ee))},render:ye=>(0,u.jsx)(le,{entityRefs:de(ye),defaultKind:N})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:O.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:O.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:O.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:x=>(0,u.jsx)(P.Or,{text:x.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Ke=[nt.createEntityRefColumn({defaultKind:"system"}),nt.createDomainColumn(),nt.createOwnerColumn(),nt.createMetadataDescriptionColumn()],dt=[nt.createEntityRefColumn({defaultKind:"component"}),nt.createSystemColumn(),nt.createOwnerColumn(),nt.createSpecTypeColumn(),nt.createSpecLifecycleColumn(),nt.createMetadataDescriptionColumn()],at=(0,wt.Z)(x=>({empty:{padding:x.spacing(2),display:"flex",justifyContent:"center"}})),Dt=x=>{const{entities:C,title:R,emptyContent:N,variant:re="gridItem",columns:de}=x,X=at(),ye={minWidth:"0",width:"100%"};return re==="gridItem"&&(ye.height="calc(100% - 10px)"),(0,u.jsx)(P.iA,{columns:de,title:R,style:ye,emptyContent:N&&(0,u.jsx)("div",{className:X.empty,children:N}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Dt.columns=nt,Dt.systemEntityColumns=Ke,Dt.componentEntityColumns=dt;const Mt=(0,u.jsx)(jn.Z,{fontSize:"small"}),Xt=(0,u.jsx)(hn.Z,{fontSize:"small"});function en({selected:x}){return(0,u.jsx)(vn.Z,{icon:Mt,checkedIcon:Xt,checked:x})}const Ut=(0,B.memo)(x=>{const{selected:C,value:R,availableOptions:N,showCounts:re}=x,de=re?`${R} (${N==null?void 0:N[R]})`:R;return(0,u.jsx)(ct.Z,{control:(0,u.jsx)(en,{selected:C}),label:de,onClick:X=>X.preventDefault()})});var zt=r(72779),Et=r.n(zt);const Lt=(0,wt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function Zt(x){const C=Lt();return(0,u.jsx)(Kt.Z,{variant:"outlined",...x,className:Et()(C.input,x.className)})}function bn(x){var C;const{label:R,name:N,path:re,showCounts:de,Filter:X,InputProps:ye}=x,{updateFilters:Ee,filters:Re,queryParameters:{[N]:Ze}}=mt(),Ne=(0,h.h_)(H),{value:rt}=(0,bt.default)(async()=>{var on;const nn=re,{facets:An}=await Ne.getEntityFacets({facets:[nn],filter:(on=Re.kind)===null||on===void 0?void 0:on.getCatalogFilters()});return Object.fromEntries(An[nn].map(({value:Rn,count:Er})=>[Rn,Er]))},[Re.kind]),qe=(0,B.useMemo)(()=>[Ze].flat().filter(Boolean),[Ze]);var Ge;const[Be,Je]=(0,B.useState)(qe.length?qe:(Ge=(C=Re[N])===null||C===void 0?void 0:C.values)!==null&&Ge!==void 0?Ge:[]);(0,B.useEffect)(()=>{qe.length&&Je(qe)},[qe]);const At=Object.keys(rt!=null?rt:{}),cn=Be.length&&At.length;(0,B.useEffect)(()=>{Ee({[N]:cn?new X(Be):void 0})},[N,cn,Be,X,Ee]);const qt=Re[N];return qt&&typeof qt=="object"&&!("values"in qt)||!At.length||At.length<=1?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:[R,(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:At,value:Be,onChange:(on,nn)=>Je(nn),renderOption:(on,{selected:nn})=>(0,u.jsx)(Ut,{selected:nn,value:on,availableOptions:rt,showCounts:!!de}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":`${String(N)}-picker-expand`}),renderInput:on=>(0,u.jsx)(Zt,{...on,...ye})})]})})}const zn=(0,wt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Gn=x=>{const C=zn();return(0,u.jsx)(bn,{label:"Tags",name:"tags",path:"metadata.tags",Filter:z,showCounts:x.showCounts,InputProps:{className:C.input}})},ur=x=>{const{hidden:C,initialFilter:R}=x,N=(0,h.h_)(h.$v),{error:re,availableTypes:de,selectedTypes:X,setSelectedTypes:ye}=Bt();if((0,B.useEffect)(()=>{re&&N.post({message:"Failed to load entity types",severity:"error"}),R&&ye([R])},[re,N,R,ye]),de.length===0||re)return null;const Ee=[{value:"all",label:"all"},...de.map(Ze=>({value:Ze,label:Ze}))];var Re;return C?null:(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsx)(P.Ph,{label:"Type",items:Ee,selected:(Re=Ee.length>1?X[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:Ze=>ye(Ze==="all"?[]:[String(Ze)])})})};var En=r(15459),On=r(61837),er=r(11640),S=r(28347);const c=(0,En.Z)({root:{color:"#f3ba37"}})(er.Z),b=x=>{const{toggleStarredEntity:C,isStarredEntity:R}=Ln(x.entity);return(0,u.jsx)(On.Z,{"aria-label":"favorite",color:"inherit",...x,onClick:()=>C(),children:(0,u.jsx)(J.ZP,{title:R?"Remove from favorites":"Add to favorites",children:R?(0,u.jsx)(c,{}):(0,u.jsx)(S.Z,{})})})};var E=r(8629),Q=r(79249),be=r(38724),je=r(99152),ke=r(6487),ht=r(49429),ft=r(55999),yn=r(39412);const kn=yn.Z;function br(x,C){if(x)return x.toLocaleLowerCase("en-US");if(C)try{return(0,O.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function Br(x,C){const R=(0,h.qD)(),N=br(x,C);return N&&R.getSystemIcon(`kind:${N}`)||kn}function $r(x){const{kind:C,entityRef:R,...N}=x,re=Br(C,R);return(0,u.jsx)(re,{...N})}const Ao=(0,wt.Z)(x=>({node:{fill:x.palette.grey[300],stroke:x.palette.grey[300],"&.primary":{fill:x.palette.primary.light,stroke:x.palette.primary.light},"&.secondary":{fill:x.palette.secondary.light,stroke:x.palette.secondary.light}},text:{fill:x.palette.getContrastText(x.palette.grey[300]),"&.primary":{fill:x.palette.primary.contrastText},"&.secondary":{fill:x.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function eo(x){const C=(0,h.h_)(H),R=(0,O.eE)(x),{loading:N,error:re,value:de}=(0,bt.default)(async()=>{const X=await C.getEntityAncestors({entityRef:R}),ye=new Array,Ee=new Array;for(const Re of X.items){const Ze=(0,O.eE)(Re.entity),Ne=Ze===X.rootEntityRef;ye.push({id:Ze,root:Ne,...Re.entity});for(const rt of Re.parentEntityRefs)Ee.push({from:Ze,to:rt})}return{nodes:ye,edges:Ee}},[R]);return{loading:N,error:re,nodes:(de==null?void 0:de.nodes)||[],edges:(de==null?void 0:de.edges)||[]}}function Sr({node:x}){const C=Ao(),R=(0,We.s0)(),N=(0,h.tg)(Qt),[re,de]=(0,B.useState)(0),[X,ye]=(0,B.useState)(0),Ee=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Ee.current){let{height:Je,width:At}=Ee.current.getBBox();Je=Math.round(Je),At=Math.round(At),(Je!==X||At!==re)&&(de(At),ye(Je))}},[re,X]);const Re=10,Ze=X,Ne=Ze+Re,rt=Ne+re+Re*2,qe=X+Re*2,Ge=x.metadata.title||(x.kind&&x.metadata.name&&x.metadata.namespace?D({kind:x.kind,name:x.metadata.name,namespace:x.metadata.namespace||""}):x.id),Be=()=>{R(N({kind:x.kind,namespace:x.metadata.namespace||O.zG,name:x.metadata.name}))};return(0,u.jsxs)("g",{onClick:Be,className:C.clickable,children:[(0,u.jsx)("rect",{className:Et()(C.node,x.root?"secondary":"primary"),width:rt,height:qe,rx:10}),(0,u.jsx)($r,{kind:x.kind,y:Re,x:Re,width:Ze,height:Ze,className:Et()(C.text,x.root?"secondary":"primary")}),(0,u.jsx)("text",{ref:Ee,className:Et()(C.text,x.root?"secondary":"primary"),y:qe/2,x:Ne+(re+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Ge})]})}function Rr(x){const{loading:C,error:R,nodes:N,edges:re}=eo(x.entity);return C?(0,u.jsx)(P.Ex,{}):R?(0,u.jsx)(P.Gk,{error:R}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Ancestry"}),(0,u.jsxs)(ft.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,u.jsx)(P.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,u.jsx)(I.Z,{mt:4,children:(0,u.jsx)(P.mn,{nodes:N,edges:re,renderNode:Sr,direction:P.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var or=r(11776),Kn=r(38402),Ir=r(86136),Cr=r(99688),To=r(49378),Ro=r(54506),to=r(94339),Io=r(24579),Po=r(27685);const Wr=(0,wt.Z)(x=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:x.spacing(2)},helpIcon:{marginLeft:x.spacing(1),color:x.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function tr(x){const C=Wr();return(0,u.jsx)(To.Z,{...x,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function Dr(x){const C=Wr();return(0,u.jsx)(Ro.Z,{className:C.monospace,children:x.children})}function Zr(x){return(0,u.jsx)(I.Z,{mt:2,children:(0,u.jsx)(to.Z,{variant:"outlined",children:(0,u.jsxs)(Io.Z,{children:[(0,u.jsxs)(w.Z,{variant:"h6",gutterBottom:!0,children:[x.title,x.helpLink&&(0,u.jsx)(Vr,{to:x.helpLink})]}),x.children]})})})}function no(x){if(x.match(/^url:https?:\/\//))return x.slice(4);if(x.match(/^https?:\/\//))return x}function Pr(x){const[C,R]=x.entry,N=no(R);return(0,u.jsxs)(Kn.Z,{children:[x.indent&&(0,u.jsx)(Ir.Z,{}),(0,u.jsx)(tr,{primary:C,secondary:N?(0,u.jsx)(P.rU,{to:N,children:R}):R})]})}function Vr(x){const C=Wr();return(0,u.jsx)(P.rU,{to:x.to,className:C.helpIcon,children:(0,u.jsx)(Po.Z,{fontSize:"inherit"})})}const Lo=(0,wt.Z)({root:{display:"flex",flexDirection:"column"}});function ro(x){var C,R;const N=(0,h.h_)(H),re=(0,O.eE)(x),de=(C=x.metadata.annotations)===null||C===void 0?void 0:C[O.P1],X=(R=x.metadata.annotations)===null||R===void 0?void 0:R[O.q1],{loading:ye,error:Ee,value:Re}=(0,bt.default)(async()=>!de&&!X?[]:(await N.getEntities({filter:[...de?[{[`metadata.annotations.${O.P1}`]:de}]:[],...X?[{[`metadata.annotations.${O.q1}`]:X}]:[]]})).items,[de,X]);return{loading:ye,error:Ee,location:de,originLocation:X,colocatedEntities:Re==null?void 0:Re.filter(Ze=>(0,O.eE)(Ze)!==re)}}function Sn(x){return(0,u.jsxs)(or.Z,{dense:!0,children:[x.header&&(0,u.jsx)(Pr,{entry:x.header},"header"),x.entities.map(C=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{children:(0,u.jsx)($r,{kind:C.kind})}),(0,u.jsx)(tr,{primary:(0,u.jsx)(te,{entityRef:C})})]},(0,O.eE)(C)))]})}function oo(x){const{entity:C}=x,{loading:R,error:N,location:re,originLocation:de,colocatedEntities:X}=ro(C);if(R)return(0,u.jsx)(P.Ex,{});if(N)return(0,u.jsx)(P.Gk,{error:N});if(!re&&!de)return(0,u.jsx)(Cr.Z,{severity:"warning",children:"Entity had no location information."});if(!(X!=null&&X.length))return(0,u.jsx)(Cr.Z,{severity:"info",children:"There were no other entities on this location."});if(re===de)return(0,u.jsx)(Sn,{entities:X});const ye=X.filter(Re=>{var Ze;return((Ze=Re.metadata.annotations)===null||Ze===void 0?void 0:Ze[O.P1])===re}),Ee=X.filter(Re=>{var Ze;return((Ze=Re.metadata.annotations)===null||Ze===void 0?void 0:Ze[O.q1])===de});return(0,u.jsxs)(u.Fragment,{children:[ye.length>0&&(0,u.jsx)(Sn,{entities:ye,header:["At the same location",re]}),Ee.length>0&&(0,u.jsx)(Sn,{entities:Ee,header:["At the same origin",de]})]})}function so(x){const C=Lo();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Colocated"}),(0,u.jsx)(ft.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,u.jsx)("div",{className:C.root,children:(0,u.jsx)(oo,{entity:x.entity})})]})}function io(x){return Object.fromEntries([...Object.entries(x)].sort((C,R)=>C[0]<R[0]?-1:1))}function wr(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Entity as JSON"}),(0,u.jsx)(ft.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,u.jsx)(ft.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:JSON.stringify(io(x.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Oo=r(3440),ao=r.n(Oo);const ko=(0,wt.Z)({root:{display:"flex",flexDirection:"column"}});function lo(x){var C,R;const N=ko(),{apiVersion:re,kind:de,metadata:X,spec:ye,relations:Ee=[],status:Re={}}=x.entity,Ze=ao()(Jt()(Ee,Ne=>Ne.targetRef),"type");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Overview"}),(0,u.jsxs)("div",{className:N.root,children:[(0,u.jsx)(Zr,{title:"Identity",children:(0,u.jsxs)(or.Z,{dense:!0,children:[(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"apiVersion",secondary:re})}),(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"kind",secondary:de})}),(ye==null?void 0:ye.type)&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"spec.type",secondary:ye.type})}),X.uid&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"uid",secondary:X.uid})}),X.etag&&(0,u.jsx)(Kn.Z,{children:(0,u.jsx)(tr,{primary:"etag",secondary:X.etag})})]})}),(0,u.jsxs)(Zr,{title:"Metadata",children:[!!Object.keys(X.annotations||{}).length&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsxs)(Dr,{children:["Annotations",(0,u.jsx)(Vr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(X.annotations).map(Ne=>(0,u.jsx)(Pr,{indent:!0,entry:Ne},Ne[0]))}),!!Object.keys(X.labels||{}).length&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:"Labels"}),children:Object.entries(X.labels).map(Ne=>(0,u.jsx)(Pr,{indent:!0,entry:Ne},Ne[0]))}),!!(!((C=X.tags)===null||C===void 0)&&C.length)&&(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:"Tags"}),children:X.tags.map((Ne,rt)=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{}),(0,u.jsx)(tr,{primary:Ne})]},`${Ne}-${rt}`))})]}),!!Ee.length&&(0,u.jsx)(Zr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ze).map(([Ne,rt],qe)=>(0,u.jsx)("div",{children:(0,u.jsx)(or.Z,{dense:!0,subheader:(0,u.jsx)(Dr,{children:Ne}),children:rt.map(Ge=>(0,u.jsxs)(Kn.Z,{children:[(0,u.jsx)(Ir.Z,{children:(0,u.jsx)($r,{entityRef:Ge.targetRef})}),(0,u.jsx)(tr,{primary:(0,u.jsx)(te,{entityRef:Ge.targetRef})})]},Ge.targetRef))})},qe))}),!!(!((R=Re.items)===null||R===void 0)&&R.length)&&(0,u.jsx)(Zr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Re.items.map((Ne,rt)=>(0,u.jsxs)("div",{children:[(0,u.jsxs)(w.Z,{children:[Ne.level,": ",Ne.type]}),(0,u.jsx)(I.Z,{ml:2,children:Ne.message})]},rt))})]})]})}var jr=r(72847);function us(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{variant:"h2",children:"Entity as YAML"}),(0,u.jsx)(ft.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,u.jsx)(ft.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(P.Oi,{text:jr.ZP.stringify(io(x.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const co=(0,wt.Z)(x=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:x.palette.background.paper},tabs:{borderRight:`1px solid ${x.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function hr(x){const{children:C,value:R,index:N,...re}=x,de=co();return(0,u.jsx)("div",{role:"tabpanel",hidden:R!==N,id:`vertical-tabpanel-${N}`,"aria-labelledby":`vertical-tab-${N}`,className:de.tabContents,...re,children:R===N&&(0,u.jsx)(I.Z,{pl:3,pr:3,children:C})})}function Lr(x){return{id:`vertical-tab-${x}`,"aria-controls":`vertical-tabpanel-${x}`}}function Bo(x){const C=co(),[R,N]=B.useState(0);return(0,B.useEffect)(()=>{N(0)},[x.open]),x.entity?(0,u.jsxs)(E.Z,{fullWidth:!0,maxWidth:"xl",open:x.open,onClose:x.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,u.jsx)(Q.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,u.jsx)(be.Z,{dividers:!0,children:(0,u.jsxs)("div",{className:C.root,children:[(0,u.jsxs)(je.Z,{orientation:"vertical",variant:"scrollable",value:R,onChange:(re,de)=>N(de),"aria-label":"Inspector options",className:C.tabs,children:[(0,u.jsx)(ke.Z,{label:"Overview",...Lr(0)}),(0,u.jsx)(ke.Z,{label:"Ancestry",...Lr(1)}),(0,u.jsx)(ke.Z,{label:"Colocated",...Lr(2)}),(0,u.jsx)(ke.Z,{label:"Raw JSON",...Lr(3)}),(0,u.jsx)(ke.Z,{label:"Raw YAML",...Lr(4)})]}),(0,u.jsx)(hr,{value:R,index:0,children:(0,u.jsx)(lo,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:1,children:(0,u.jsx)(Rr,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:2,children:(0,u.jsx)(so,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:3,children:(0,u.jsx)(wr,{entity:x.entity})}),(0,u.jsx)(hr,{value:R,index:4,children:(0,u.jsx)(us,{entity:x.entity})})]})}),(0,u.jsx)(ht.Z,{children:(0,u.jsx)(V.Z,{onClick:x.onClose,color:"primary",children:"Close"})})]}):null}var Yn=r(85256);function Gs(x){var C;const R=(0,h.h_)(H),N=(C=x.metadata.annotations)===null||C===void 0?void 0:C[O.q1],re=x.metadata.uid,de=N==="bootstrap:bootstrap",X=(0,bt.default)(async()=>{const Ge=R.getLocationByRef(N);let Be;if(!N)Be=Promise.resolve([]);else{const Je=`metadata.annotations.${O.q1}`;Be=R.getEntities({filter:{[Je]:N},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(At=>At.items)}return Promise.all([Ge,Be]).then(([Je,At])=>({location:Je,colocatedEntities:At}))},[R,x]),ye=(0,B.useCallback)(async function(){const{location:Be}=X.value;await R.removeLocationById(Be.id)},[R,X]),Ee=(0,B.useCallback)(async function(){await R.removeEntityByUid(re)},[R,re]);if(de)return{type:"bootstrap",location:N,deleteEntity:Ee};const{loading:Re,error:Ze,value:Ne}=X;if(Re)return{type:"loading"};if(Ze)return{type:"error",error:Ze};const{location:rt,colocatedEntities:qe}=Ne;return rt?{type:"unregister",location:N,colocatedEntities:qe.map(O.iB),unregisterLocation:ye,deleteEntity:Ee}:{type:"only-delete",deleteEntity:Ee}}var $o=r(23054);const hs=(0,wt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ps=({entity:x,onConfirm:C,onClose:R})=>{const N=(0,h.h_)(h.$v),re=(0,h.h_)(h.Ds),de=hs(),X=Gs(x),[ye,Ee]=(0,B.useState)(!1),[Re,Ze]=(0,B.useState)(!1);var Ne;const rt=(Ne=re.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",qe=(0,B.useCallback)(async function(){if("unregisterLocation"in X){Ze(!0);try{await X.unregisterLocation(),C()}catch(At){(0,$o.BD)(At),N.post({message:At.message})}finally{Ze(!1)}}},[N,C,X]),Ge=(0,B.useCallback)(async function(){if("deleteEntity"in X){Ze(!0);try{await X.deleteEntity(),C()}catch(At){(0,$o.BD)(At),N.post({message:At.message})}finally{Ze(!1)}}},[N,C,X]),Be=()=>(0,u.jsx)(ht.Z,{className:de.dialogActions,children:(0,u.jsx)(V.Z,{onClick:R,color:"primary",children:"Cancel"})});return X.type==="loading"?(0,u.jsx)(P.Ex,{}):X.type==="error"?(0,u.jsx)(P.Gk,{error:X.error}):X.type==="bootstrap"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(Cr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',X.location,'"). If you believe this is in error, please contact the ',rt," ","integrator."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[!ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"}),(0,u.jsx)(Be,{})]}),ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"}),(0,u.jsx)(Be,{})]})]})]}):X.type==="only-delete"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"}),(0,u.jsx)(Be,{})]}):X.type==="unregister"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ft.Z,{children:"This action will unregister the following entities:"}),(0,u.jsx)(ft.Z,{component:"ul",children:X.colocatedEntities.map(Je=>(0,u.jsx)("li",{children:(0,u.jsx)(te,{entityRef:Je})},`${Je.kind}:${Je.namespace}/${Je.name}`))}),(0,u.jsx)(ft.Z,{children:"Located at the following location:"}),(0,u.jsx)(ft.Z,{component:"ul",children:(0,u.jsx)("li",{children:X.location})}),(0,u.jsxs)(ft.Z,{children:["To undo, just re-register the entity in ",rt,"."]}),(0,u.jsxs)(I.Z,{marginTop:2,children:[(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:qe,children:"Unregister Location"}),!ye&&(0,u.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Ee(!0),children:"Advanced Options"})})]}),ye&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,u.jsx)(Yn.Z,{})}),(0,u.jsx)(ft.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:Ge,children:"Delete Entity"})]})]}):(0,u.jsx)(Cr.Z,{severity:"error",children:"Internal error: Unknown state"})},uo=x=>{const{open:C,onConfirm:R,onClose:N,entity:re}=x;return(0,u.jsxs)(E.Z,{open:C,onClose:N,children:[(0,u.jsx)(Q.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,u.jsx)(be.Z,{children:(0,u.jsx)(ps,{entity:re,onConfirm:R,onClose:N})})]})};var fs=r(12231),gs=r(9520),sr=r(47603);const Do=(0,wt.Z)(x=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:x.spacing(1,0,1,0)},title:{margin:x.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:x.palette.text.primary},menuItem:{minHeight:x.spacing(6)},groupWrapper:{margin:x.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Wn(x){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:sr.Z},{id:"starred",label:"Starred",icon:er.Z}]},{name:x!=null?x:"Company",items:[{id:"all",label:"All"}]}]}const ho=x=>{const{initialFilter:C,availableFilters:R}=x,N=Do(),re=(0,h.h_)(h.Ds);var de;const X=(de=re.getOptionalString("organization.name"))!==null&&de!==void 0?de:"Company",{filters:ye,updateFilters:Ee,backendEntities:Re,queryParameters:{kind:Ze,user:Ne},loading:rt}=mt(),qe=["starred","all"],Ge=Wn(X).map(In=>({...In,items:In.items.filter(({id:Vn})=>["group","user"].some(Or=>Or===Ze)?qe.includes(Vn):!R||R.includes(Vn))})).filter(({items:In})=>!!In.length),{isStarredEntity:Be}=Pn(),{isOwnedEntity:Je,loading:At}=tn(),cn=rt||At,qt=(0,B.useMemo)(()=>new Qe("owned",Je,Be),[Je,Be]),on=(0,B.useMemo)(()=>new Qe("starred",Je,Be),[Je,Be]),nn=(0,B.useMemo)(()=>[Ne].flat()[0],[Ne]),[An,Rn]=(0,B.useState)(nn!=null?nn:C),Er=(0,B.useMemo)(()=>Re.filter((0,oe.Gz)((0,lt.compact)(Object.values({...ye,user:void 0})))),[ye,Re]),Nr=(0,B.useMemo)(()=>({all:Er.length,starred:Er.filter(In=>on.filterEntity(In)).length,owned:Er.filter(In=>qt.filterEntity(In)).length}),[Er,on,qt]);(0,B.useEffect)(()=>{nn&&Rn(nn)},[nn]),(0,B.useEffect)(()=>{!cn&&An&&An!=="all"&&Nr[An]===0&&Rn("all")},[cn,Nr,An,Rn]),(0,B.useEffect)(()=>{Ee({user:An?new Qe(An,Je,Be):void 0})},[An,Je,Be,Ee]);var Gr;return(0,u.jsx)(to.Z,{className:N.root,children:Ge.map(In=>(0,u.jsxs)(B.Fragment,{children:[(0,u.jsx)(w.Z,{variant:"subtitle2",component:"span",className:N.title,children:In.name}),(0,u.jsx)(to.Z,{className:N.groupWrapper,children:(0,u.jsx)(or.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":In.name,children:In.items.map(Vn=>{var Or;return(0,u.jsxs)(fs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Rn(Vn.id),selected:Vn.id===((Or=ye.user)===null||Or===void 0?void 0:Or.value),className:N.menuItem,disabled:Nr[Vn.id]===0,"data-testid":`user-picker-${Vn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Vn.icon&&(0,u.jsx)(Ir.Z,{className:N.listIcon,children:(0,u.jsx)(Vn.icon,{fontSize:"small"})}),(0,u.jsx)(To.Z,{children:(0,u.jsxs)(w.Z,{variant:"body1",children:[Vn.label," "]})}),(0,u.jsx)(gs.Z,{children:(Gr=Nr[Vn.id])!==null&&Gr!==void 0?Gr:"-"})]},Vn.id)})})})]},In.name))})},Zo=(0,wt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Hr=(0,u.jsx)(jn.Z,{fontSize:"small"}),No=(0,u.jsx)(hn.Z,{fontSize:"small"}),Fo=()=>{const x=Zo(),{updateFilters:C}=mt(),[R,N]=(0,B.useState)([]);function re(ye){C({orphan:ye?new St(ye):void 0})}function de(ye){C({error:ye?new It(ye):void 0})}const X=["Is Orphan","Has Error"];return(0,u.jsx)(I.Z,{pb:1,pt:1,children:(0,u.jsxs)(w.Z,{variant:"button",component:"label",children:["Processing Status",(0,u.jsx)(Tn.ZP,{multiple:!0,disableCloseOnSelect:!0,options:X,value:R,onChange:(ye,Ee)=>{N(Ee),re(Ee.includes("Is Orphan")),de(Ee.includes("Has Error"))},renderOption:(ye,{selected:Ee})=>(0,u.jsx)(ct.Z,{control:(0,u.jsx)(vn.Z,{icon:Hr,checkedIcon:No,checked:Ee}),onClick:Re=>Re.preventDefault(),label:ye}),size:"small",popupIcon:(0,u.jsx)(ln.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ye=>(0,u.jsx)(Kt.Z,{...ye,className:x.input,variant:"outlined"})})]})})},ms=(0,wt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Uo=()=>{const x=ms();return(0,u.jsx)(bn,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:st,InputProps:{className:x.input}})};function po(x){const{children:C,value:R}=x;var N;const[re,de]=useState((N=R==null?void 0:R.filters)!==null&&N!==void 0?N:{}),X=useCallback(Ge=>{de(Be=>{const Je=typeof Ge=="function"?Ge(Be):Ge;return{...Be,...Je}})},[]),ye=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ee,Re,Ze,Ne,rt;const qe=useMemo(()=>({entities:(Ee=R==null?void 0:R.entities)!==null&&Ee!==void 0?Ee:ye.entities,backendEntities:(Re=R==null?void 0:R.backendEntities)!==null&&Re!==void 0?Re:ye.backendEntities,updateFilters:(Ze=R==null?void 0:R.updateFilters)!==null&&Ze!==void 0?Ze:X,filters:re,loading:(Ne=R==null?void 0:R.loading)!==null&&Ne!==void 0?Ne:!1,queryParameters:(rt=R==null?void 0:R.queryParameters)!==null&&rt!==void 0?rt:ye.queryParameters,error:R==null?void 0:R.error}),[R,ye,re,X]);return _jsx(EntityListContext.Provider,{value:qe,children:C})}},75435:function(Ct,$e,r){"use strict";r.d($e,{h:function(){return h}});var t=r(25271);function h(H,f,W){var g;let u=(H==null||(g=H.relations)===null||g===void 0?void 0:g.filter(B=>B.type===f).map(B=>(0,t.of)(B.targetRef)))||[];return W!=null&&W.kind&&(u=u.filter(B=>B.kind.toLocaleLowerCase("en-US")===W.kind.toLocaleLowerCase("en-US"))),u}},49280:function(Ct,$e,r){"use strict";r.d($e,{hF:function(){return H.h},CV:function(){return W},wq:function(){return t},Gz:function(){return h}});function t(u){return u.reduce((B,ve)=>({...B,...ve.getCatalogFilters?ve.getCatalogFilters():{}}),{})}function h(u){return B=>u.every(ve=>!ve.filterEntity||ve.filterEntity(B))}var H=r(75435),f=r(25271);function W(u,B){var ve;const ue=(ve=u.metadata.annotations)===null||ve===void 0?void 0:ve[f.M6];if(ue)try{const V=(0,f.Ou)(ue),K=B.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:K==null?void 0:K.type}}catch{return}}function g(u,B){const ve=new Set([...getEntityRelations(u,RELATION_MEMBER_OF,{kind:"group"}),...u?[getCompoundEntityRef(u)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of ue)if(ve.has(V))return!0;return!1}},33414:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{AboutCard:function(){return ot},AboutContent:function(){return z},AboutField:function(){return O}});var t=r(52322),h=r(25271),H=r(53974),f=r(60871),W=r(32838),g=r(43514),u=r(79692),B=r(94339),ve=r(32552),ue=r(61837),V=r(85256),K=r(24579),I=r(52866),w=r(30254),ie=r(27604),ee=r(2784),ne=r(19625),$=r(60905),T=r(7089),P=r(90436);const L=(0,u.Z)(He=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:He.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function O(He){const{label:st,value:Qe,gridSizes:St,children:It}=He,xt=L(),lt=(0,f.vJ)(It,Nt=>Nt.getElements()),Pt=lt.length>0?lt:(0,t.jsx)(P.Z,{variant:"body2",className:xt.value,children:Qe||"unknown"});return(0,t.jsxs)($.Z,{item:!0,...St,children:[(0,t.jsx)(P.Z,{variant:"h2",className:xt.label,children:st}),Pt]})}var oe=r(24851);const Le=(0,u.Z)({description:{wordBreak:"break-word"}});function ze(He,st,Qe){if(st==="url"||He.includes("://"))return He;const St=Qe.type==="file"?`file://${Qe.target}`:Qe.target;return st==="file"||Qe.type==="file"?new URL(He,St).href:St}function z(He){var st,Qe,St,It,xt,lt,Pt,Nt;const{entity:We}=He,_t=Le(),ge=We.kind.toLocaleLowerCase("en-US")==="system",Se=We.kind.toLocaleLowerCase("en-US")==="resource",Fe=We.kind.toLocaleLowerCase("en-US")==="component",tt=We.kind.toLocaleLowerCase("en-US")==="api",mt=We.kind.toLocaleLowerCase("en-US")==="template",bt=We.kind.toLocaleLowerCase("en-US")==="location",pt=We.kind.toLocaleLowerCase("en-US")==="group",Ot=(0,g.hF)(We,h.cz,{kind:"system"}),Ht=(0,g.hF)(We,h.cz,{kind:"component"}),Jt=(0,g.hF)(We,h.cz,{kind:"domain"}),Bt=(0,g.hF)(We,h.S4);let un;try{un=(0,h.CV)(We)}catch{un=void 0}return(0,t.jsxs)($.Z,{container:!0,children:[(0,t.jsx)(O,{label:"Description",gridSizes:{xs:12},children:(0,t.jsx)(H.SA,{className:_t.description,content:(We==null||(st=We.metadata)===null||st===void 0?void 0:st.description)||"No description"})}),(0,t.jsx)(O,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Bt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Bt,defaultKind:"group"})}),(ge||Jt.length>0)&&(0,t.jsx)(O,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,t.jsx)(g.rI,{entityRefs:Jt,defaultKind:"domain"})}),(tt||Fe||Se||Ot.length>0)&&(0,t.jsx)(O,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Ot.length>0&&(0,t.jsx)(g.rI,{entityRefs:Ot,defaultKind:"system"})}),Fe&&Ht.length>0&&(0,t.jsx)(O,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,t.jsx)(g.rI,{entityRefs:Ht,defaultKind:"component"})}),(tt||Fe||Se||mt||pt||bt||typeof(We==null||(Qe=We.spec)===null||Qe===void 0?void 0:Qe.type)=="string")&&(0,t.jsx)(O,{label:"Type",value:We==null||(St=We.spec)===null||St===void 0?void 0:St.type,gridSizes:{xs:12,sm:6,lg:4}}),(tt||Fe||typeof(We==null||(It=We.spec)===null||It===void 0?void 0:It.lifecycle)=="string")&&(0,t.jsx)(O,{label:"Lifecycle",value:We==null||(xt=We.spec)===null||xt===void 0?void 0:xt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,t.jsx)(O,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((We==null||(lt=We.metadata)===null||lt===void 0?void 0:lt.tags)||[]).map(Yt=>(0,t.jsx)(T.Z,{size:"small",label:Yt},Yt))}),bt&&((We==null||(Pt=We.spec)===null||Pt===void 0?void 0:Pt.targets)||(We==null||(Nt=We.spec)===null||Nt===void 0?void 0:Nt.target))&&(0,t.jsx)(O,{label:"Targets",gridSizes:{xs:12},children:(0,t.jsx)(oe.s,{cols:1,items:(We.spec.targets||[We.spec.target]).map(Yt=>Yt).map(Yt=>{var pn;return{text:Yt,href:ze(Yt,(We==null||(pn=We.spec)===null||pn===void 0?void 0:pn.type)||"unknown",un)}})})})]})}const yt=(0,u.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function ot(He){var st,Qe,St;const{variant:It}=He,xt=yt(),{entity:lt}=(0,g.X2)(),Pt=(0,f.h_)(W.q3),Nt=(0,f.h_)(g.Ah),We=(0,f.h_)(f.$v),_t=(0,f.h_)(f.VE),ge=(0,f.tg)(ne.jU),Se=(0,g.CV)(lt,Pt),Fe=(st=lt.metadata.annotations)===null||st===void 0?void 0:st[h.Tf],tt={label:"View Source",disabled:!Se,icon:(0,t.jsx)(W.nW,{type:Se==null?void 0:Se.integrationType}),href:Se==null?void 0:Se.locationTargetUrl},mt={label:"View TechDocs",disabled:!(!((Qe=lt.metadata.annotations)===null||Qe===void 0)&&Qe["backstage.io/techdocs-ref"])||!ge,icon:(0,t.jsx)(w.Z,{}),href:ge&&ge({namespace:lt.metadata.namespace||h.zG,kind:lt.kind,name:lt.metadata.name})};let bt="";It==="gridItem"?bt=xt.gridItemCard:It==="fullHeight"&&(bt=xt.fullHeightCard);let pt="";It==="gridItem"?pt=xt.gridItemCardContent:It==="fullHeight"&&(pt=xt.fullHeightCardContent);const Ot=(St=lt.metadata.annotations)===null||St===void 0?void 0:St[h.P1],Ht=(Ot==null?void 0:Ot.startsWith("url:"))||(Ot==null?void 0:Ot.startsWith("file:")),Jt=(0,ee.useCallback)(async()=>{try{await Nt.refreshEntity((0,h.eE)(lt)),We.post({message:"Refresh scheduled",severity:"info"})}catch(Bt){_t.post(Bt)}},[Nt,We,_t,lt]);return(0,t.jsxs)(B.Z,{className:bt,children:[(0,t.jsx)(ve.Z,{title:"About",action:(0,t.jsxs)(t.Fragment,{children:[Ht&&(0,t.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Jt,children:(0,t.jsx)(I.Z,{})}),(0,t.jsx)(ue.Z,{component:H.rU,"aria-label":"Edit",disabled:!Fe,title:"Edit Metadata",to:Fe!=null?Fe:"#",children:(0,t.jsx)(ie.Z,{})})]}),subheader:(0,t.jsx)(H.M6,{links:[tt,mt]})}),(0,t.jsx)(V.Z,{}),(0,t.jsx)(K.Z,{className:pt,children:(0,t.jsx)(z,{entity:lt})})]})}},86359:function(Ct,$e,r){"use strict";r.d($e,{E:function(){return ne}});var t=r(52322),h=r(25271),H=r(53974),f=r(43514),W=r(90436),g=r(15459),u=r(27604),B=r(2997),ve=r(11640),ue=r(28347),V=r(76635),K=r(2784),I=r(7089);const w=Object.freeze({createNameColumn($){function T(P){var L;return((L=P.metadata)===null||L===void 0?void 0:L.title)||(0,f.$3)(P,{defaultKind:$==null?void 0:$.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:L}){return T(P).localeCompare(T(L))},render:({entity:P})=>{var L;return(0,t.jsx)(f.dx,{entityRef:P,defaultKind:($==null?void 0:$.defaultKind)||"Component",title:(L=P.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:$})=>(0,t.jsx)(f.rI,{entityRefs:$.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:$})=>{var T,P;return(0,t.jsx)(t.Fragment,{children:(($==null||(T=$.spec)===null||T===void 0?void 0:T.targets)||($==null||(P=$.spec)===null||P===void 0?void 0:P.target))&&(0,t.jsx)(H.Or,{text:($.spec.targets||[$.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:$})=>(0,t.jsx)(H.Or,{text:$.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:$})=>(0,t.jsx)(t.Fragment,{children:$.metadata.tags&&$.metadata.tags.map(T=>(0,t.jsx)(I.Z,{label:T,size:"small",variant:"outlined",style:{marginBottom:"0px"}},T))}),width:"auto"}},createTitleColumn($){return{title:"Title",field:"entity.metadata.title",hidden:$==null?void 0:$.hidden,searchable:!0}},createLabelColumn($,T){return{title:(T==null?void 0:T.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var L;const O=(L=P.metadata)===null||L===void 0?void 0:L.labels,oe=O&&O[$]||(T==null?void 0:T.defaultValue);return(0,t.jsx)(t.Fragment,{children:oe&&(0,t.jsx)(I.Z,{label:oe,size:"small",variant:"outlined"},oe)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}}),ie=(0,g.Z)({root:{color:"#f3ba37"}})(ve.Z),ee=($,T)=>{const P=L=>L.metadata.title||(0,f.$3)(L,{defaultKind:"Component"});return P($).localeCompare(P(T))},ne=$=>{var T,P;const{columns:L,actions:O,tableOptions:oe,subtitle:Le,emptyContent:ze}=$,{isStarredEntity:z,toggleStarredEntity:yt}=(0,f.CR)(),{loading:ot,error:He,entities:st,filters:Qe}=(0,f.wp)(),St=(0,K.useMemo)(()=>{var ge;return[w.createTitleColumn({hidden:!0}),w.createNameColumn({defaultKind:(ge=Qe.kind)===null||ge===void 0?void 0:ge.value}),...Se(),w.createMetadataDescriptionColumn(),w.createTagsColumn()];function Se(){var Fe;const tt=[w.createSystemColumn(),w.createOwnerColumn(),w.createSpecTypeColumn(),w.createSpecLifecycleColumn()];switch((Fe=Qe.kind)===null||Fe===void 0?void 0:Fe.value){case"user":return[];case"domain":case"system":return[w.createOwnerColumn()];case"group":case"template":return[w.createSpecTypeColumn()];case"location":return[w.createSpecTypeColumn(),w.createSpecTargetsColumn()];default:return st.every(mt=>mt.metadata.namespace==="default")?tt:[...tt,w.createNamespaceColumn()]}}},[(T=Qe.kind)===null||T===void 0?void 0:T.value,st]),It=Qe.type===void 0;var xt;const lt=(0,V.capitalize)((xt=(P=Qe.user)===null||P===void 0?void 0:P.value)!==null&&xt!==void 0?xt:"all");if(He)return(0,t.jsx)("div",{children:(0,t.jsx)(H.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,t.jsx)(H.Oi,{language:"text",text:He.toString()})})});const Pt=[({entity:ge})=>{var Se;const Fe=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[h.l2],tt="View";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:tt}),(0,t.jsx)(B.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ge})=>{var Se;const Fe=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[h.Tf],tt="Edit";return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:tt}),(0,t.jsx)(u.Z,{fontSize:"small"})]}),tooltip:tt,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ge})=>{const Se=z(ge),Fe=Se?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Z,{variant:"srOnly",children:Fe}),Se?(0,t.jsx)(ie,{}):(0,t.jsx)(ue.Z,{})]}),tooltip:Fe,onClick:()=>yt(ge)}}],Nt=st.sort(ee).map(ge=>{const Se=(0,f.hF)(ge,h.cz,{kind:"system"}),Fe=(0,f.hF)(ge,h.S4);return{entity:ge,resolved:{name:(0,f.$3)(ge,{defaultKind:"Component"}),ownedByRelationsTitle:Fe.map(tt=>(0,f.$3)(tt,{defaultKind:"group"})).join(", "),ownedByRelations:Fe,partOfSystemRelationTitle:Se.map(tt=>(0,f.$3)(tt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Se}}}),We=(L||St).find(ge=>ge.title==="Type");We&&(We.hidden=!It);const _t=Nt.length>20;return(0,t.jsx)(H.iA,{isLoading:ot,columns:L||St,options:{paging:_t,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!ot,padding:"dense",pageSizeOptions:[20,50,100],...oe},title:`${lt} (${st.length})`,data:Nt,actions:O||Pt,subtitle:Le,emptyContent:ze})};ne.columns=w},85877:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{EntityLabelsCard:function(){return K},hasLabels:function(){return I}});var t=r(52322),h=r(43514),H=r(2784),f=r(53974),W=r(79692),g=r(90436),u=r(77277);const B=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,ve=(0,W.Z)(w=>({code:{borderRadius:6,margin:`${w.spacing(2)}px 0px`,background:w.palette.type==="dark"?"#444":w.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const w=ve();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,t.jsx)("div",{className:w.code,children:(0,t.jsx)(f.Oi,{text:B,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,t.jsx)(u.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const V=(0,W.Z)(w=>({key:{fontWeight:"bold"}})),K=w=>{var ie;const{variant:ee,title:ne}=w,{entity:$}=(0,h.X2)(),T=V(),P=[{render:O=>(0,t.jsx)(g.Z,{className:T.key,variant:"body2",children:O.key})},{field:"value"}],L=$==null||(ie=$.metadata)===null||ie===void 0?void 0:ie.labels;return(0,t.jsx)(f.rJ,{title:ne||"Labels",variant:ee,children:!L||Object.keys(L).length===0?(0,t.jsx)(ue,{}):(0,t.jsx)(f.iA,{columns:P,data:Object.keys(L).map(O=>({key:O,value:L[O]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(L).length>5}})})};function I(w){var ie,ee;return!(w==null||(ie=w.metadata)===null||ie===void 0)&&ie.labels?Object.keys(w==null||(ee=w.metadata)===null||ee===void 0?void 0:ee.labels).some(Boolean):!1}},24851:function(Ct,$e,r){"use strict";r.d($e,{s:function(){return ie}});var t=r(52322),h=r(90348),H=r(11861),f=r(2784),W=r(79692),g=r(95544),u=r(90436),B=r(52160),ve=r(53974);const ue=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function V(ee){const{href:ne,text:$,Icon:T}=ee,P=ue();return(0,t.jsxs)(g.Z,{display:"flex",children:[(0,t.jsx)(g.Z,{mr:1,className:P.svgIcon,children:(0,t.jsx)(u.Z,{component:"div",children:T?(0,t.jsx)(T,{}):(0,t.jsx)(B.Z,{})})}),(0,t.jsx)(g.Z,{flexGrow:"1",children:(0,t.jsx)(ve.rU,{to:ne,target:"_blank",rel:"noopener",children:$||ne})})]})}var K=r(41156);const I={xs:1,sm:1,md:1,lg:2,xl:3};function w(ee){const ne=[(0,K.Z)(L=>L.breakpoints.up("xl"))?"xl":null,(0,K.Z)(L=>L.breakpoints.up("lg"))?"lg":null,(0,K.Z)(L=>L.breakpoints.up("md"))?"md":null,(0,K.Z)(L=>L.breakpoints.up("sm"))?"sm":null,(0,K.Z)(L=>L.breakpoints.up("xs"))?"xs":null];let $=1;if(typeof ee=="number")$=ee;else{var T;const L=(T=ne.find(O=>O!==null))!==null&&T!==void 0?T:"xs";var P;$=(P=ee==null?void 0:ee[L])!==null&&P!==void 0?P:I[L]}return $}function ie(ee){const{items:ne,cols:$=void 0}=ee,T=w($);return(0,t.jsx)(h.Z,{rowHeight:"auto",cols:T,children:ne.map(({text:P,href:L,Icon:O},oe)=>(0,t.jsx)(H.Z,{children:(0,t.jsx)(V,{href:L,text:P!=null?P:L,Icon:O})},oe))})}},19625:function(Ct,$e,r){"use strict";r.d($e,{_Z:function(){return f},jU:function(){return H},yw:function(){return h}});var t=r(60871);const h=(0,t.x8)({id:"create-component",optional:!0}),H=(0,t.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,t.NT)({id:"catalog"})},15096:function(Ct,$e,r){"use strict";r.d($e,{FA:function(){return ve},qO:function(){return xt},Nd:function(){return z},E5:function(){return kt},Rx:function(){return L}});var t=r(60871);const h=(0,t.T0)({id:"plugin.search.queryservice"});class H{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(J){_define_property(this,"mockedResults",void 0),this.mockedResults=J}}var f=r(52322),W=r(2784),g=r(38402),u=r(79692);const B=(0,u.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ve=_=>{const{text:J,preTag:te,postTag:pe}=_,le=B(),y=(0,W.useMemo)(()=>J.split(new RegExp(`(${te}.+?${pe})`)),[pe,te,J]);return(0,f.jsx)(f.Fragment,{children:y.map((Z,q)=>Z.includes(te)?(0,f.jsx)("mark",{className:le.highlight,children:Z.replace(new RegExp(`${te}|${pe}`,"g"),"")},q):Z)})};var ue=r(50581),V=r(61837),K=r(86619),I=r(77277),w=r(21853),ie=r(48760),ee=r(76635),ne=r(64279),$=r(1849),T=r(51837);const P=(0,T.CT)("search-context"),L=()=>{const _=(0,W.useContext)(P);if(!_)throw new Error("useSearch must be used within a SearchContextProvider");const J=_.atVersion(1);if(!J)throw new Error("No SearchContext v1 found");return J},O=()=>(0,W.useContext)(P)!==void 0,oe={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Le=(_=oe)=>{var J,te,pe,le;const y=(0,t.h_)(h),[Z,q]=(0,W.useState)(_.term),[Y,we]=(0,W.useState)(_.types),[Ae,Ye]=(0,W.useState)(_.filters),[jt,vt]=(0,W.useState)(_.pageLimit),[nt,Ke]=(0,W.useState)(_.pageCursor),dt=(0,$.Z)(Z),at=(0,$.Z)(Ae),Dt=(0,ne.default)(()=>y.query({term:Z,types:Y,filters:Ae,pageLimit:jt,pageCursor:nt}),[Z,Y,Ae,jt,nt]),Mt=!Dt.loading&&!Dt.error&&((J=Dt.value)===null||J===void 0?void 0:J.nextPageCursor),Xt=!Dt.loading&&!Dt.error&&((te=Dt.value)===null||te===void 0?void 0:te.previousPageCursor),en=(0,W.useCallback)(()=>{var Et;Ke((Et=Dt.value)===null||Et===void 0?void 0:Et.nextPageCursor)},[(pe=Dt.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Ut=(0,W.useCallback)(()=>{var Et;Ke((Et=Dt.value)===null||Et===void 0?void 0:Et.previousPageCursor)},[(le=Dt.value)===null||le===void 0?void 0:le.previousPageCursor]);return(0,W.useEffect)(()=>{dt!==void 0&&Z!==dt&&Ke(void 0)},[Z,dt,Ke]),(0,W.useEffect)(()=>{at!==void 0&&!(0,ee.isEqual)(Ae,at)&&Ke(void 0)},[Ae,at,Ke]),{result:Dt,term:Z,setTerm:q,types:Y,setTypes:we,filters:Ae,setFilters:Ye,pageLimit:jt,setPageLimit:vt,pageCursor:nt,setPageCursor:Ke,fetchNextPage:Mt?en:void 0,fetchPreviousPage:Xt?Ut:void 0}},ze=_=>{const{initialState:J,children:te}=_,pe=Le(J);return(0,f.jsx)(t.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,f.jsx)(P.Provider,{value:(0,T.EI)({1:pe}),children:te})})},z=_=>{const{initialState:J,inheritParentContextIfAvailable:te,children:pe}=_;return O()&&te?(0,f.jsx)(f.Fragment,{children:pe}):(0,f.jsx)(ze,{initialState:J,children:pe})},yt=({children:_})=>{var J;const te=Ae=>(0,$.Z)(Ae)!==Ae,pe=(0,t.z$)(),{term:le,result:y}=L();var Z;const q=(Z=(J=y.value)===null||J===void 0?void 0:J.numberOfResults)!==null&&Z!==void 0?Z:void 0,we=te(y.loading)&&!y.loading;return(0,W.useEffect)(()=>{le&&we&&pe.captureEvent("search",le,{value:q})},[pe,le,q,we]),(0,f.jsx)(f.Fragment,{children:_})};function ot(_){return(0,W.forwardRef)((J,te)=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(_,{...J,ref:te})}))}const He=ot((0,W.forwardRef)((_,J)=>{const{onChange:te,onKeyDown:pe=()=>{},onClear:le=()=>{},onSubmit:y=()=>{},debounceTime:Z=200,clearButton:q=!0,fullWidth:Y=!0,value:we,label:Ae,placeholder:Ye,inputProps:jt={},InputProps:vt={},endAdornment:nt,...Ke}=_,dt=(0,t.h_)(t.Ds),[at,Dt]=(0,W.useState)("");(0,W.useEffect)(()=>{Dt(Zt=>Zt!==we?String(we):Zt)},[we]),(0,ie.Z)(()=>te(at),Z,[at]);const Mt=(0,W.useCallback)(Zt=>{Dt(Zt.target.value)},[Dt]),Xt=(0,W.useCallback)(Zt=>{pe&&pe(Zt),y&&Zt.key==="Enter"&&y()},[pe,y]),en=(0,W.useCallback)(()=>{te(""),le&&le()},[te,le]),Ut=Ae?void 0:"Search",zt=Ye!=null?Ye:`Search in ${dt.getOptionalString("app.title")||"Backstage"}`,Et=(0,f.jsx)(ue.Z,{position:"start",children:(0,f.jsx)(V.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(w.Z,{})})}),Lt=(0,f.jsx)(ue.Z,{position:"end",children:(0,f.jsx)(I.Z,{"aria-label":"Clear",size:"small",onClick:en,onKeyDown:Zt=>{Zt.key==="Enter"&&Zt.stopPropagation()},children:"Clear"})});return(0,f.jsx)(yt,{children:(0,f.jsx)(K.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:J,value:at,label:Ae,placeholder:zt,InputProps:{startAdornment:Et,endAdornment:q?Lt:nt,...vt},inputProps:{"aria-label":Ut,...jt},fullWidth:Y,onChange:Mt,onKeyDown:Xt,...Ke})})})),st=ot((0,W.forwardRef)((_,J)=>{const{value:te="",onChange:pe,...le}=_,{term:y,setTerm:Z}=L();(0,W.useEffect)(()=>{te&&Z(String(te))},[te,Z]);const q=(0,W.useCallback)(Y=>{pe?pe(Y):Z(Y)},[pe,Z]);return(0,f.jsx)(t.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(He,{...le,ref:J,value:y,onChange:q})})}));var Qe=r(4614),St=r(88013);const xt=(_=>J=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(_,{...J})}))(function(J){const{loading:te,value:pe,onChange:le=()=>{},options:y=[],getOptionLabel:Z=Mt=>String(Mt),inputPlaceholder:q,inputDebounceTime:Y,freeSolo:we=!0,fullWidth:Ae=!0,clearOnBlur:Ye=!1,"data-testid":jt="search-autocomplete",...vt}=J,{setTerm:nt}=L(),Ke=(0,W.useCallback)(Mt=>Mt?typeof Mt=="string"?Mt:Z(Mt):"",[Z]),dt=(0,W.useMemo)(()=>Ke(pe),[pe,Ke]),at=(0,W.useCallback)((Mt,Xt,en,Ut)=>{nt(Ke(Xt)),le(Mt,Xt,en,Ut)},[Ke,nt,le]),Dt=(0,W.useCallback)(({InputProps:{ref:Mt,endAdornment:Xt},InputLabelProps:en,...Ut})=>(0,f.jsx)(st,{...Ut,ref:Mt,clearButton:!1,value:dt,placeholder:q,debounceTime:Y,endAdornment:te?(0,f.jsx)(Qe.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Xt}),[te,dt,q,Y]);return(0,f.jsx)(St.ZP,{...vt,"data-testid":jt,value:pe,onChange:at,options:y,getOptionLabel:Z,renderInput:Dt,freeSolo:we,fullWidth:Ae,clearOnBlur:Ye})}),lt=_=>{const{icon:J,primaryText:te,primaryTextTypographyProps:pe,secondaryText:le,secondaryTextTypographyProps:y,disableTextTypography:Z}=_;return _jsxs(_Fragment,{children:[J?_jsx(ListItemIcon,{children:J}):null,_jsx(ListItemText,{primary:te,primaryTypographyProps:pe,secondary:le,secondaryTypographyProps:y,disableTypography:Z})]})};var Pt=r(42494),Nt=r(84899),We=r(5806),_t=r(21324),ge=r(56939),Se=r(73698),Fe=r(12231),tt=r(90436),mt=r(7089),bt=r(69294);const pt=(_,J,te=[],pe=250)=>{const le=(0,W.useRef)({}),y=_||(()=>Promise.resolve([])),[Z,q]=(0,bt.default)(y,[J],{loading:!0});if((0,ie.Z)(()=>{le.current[J]===void 0&&(le.current[J]=q(J).then(we=>(le.current[J]=we,we)))},pe,[q,J]),te.length)return{loading:!1,value:te};const Y=le.current[J];return Array.isArray(Y)?{loading:!1,value:Y}:Z},Ot=(_,J)=>{const{setFilters:te}=L();(0,W.useEffect)(()=>{J&&[J].flat().length>0&&te(pe=>({...pe,[_]:J}))},[])},Ht=_=>{const{className:J,defaultValue:te,name:pe,values:le,valuesDebounceMs:y,label:Z,filterSelectedOptions:q,limitTags:Y,multiple:we}=_,[Ae,Ye]=(0,W.useState)("");Ot(pe,te);const jt=typeof le=="function"?le:void 0,vt=typeof le=="function"?void 0:le,{value:nt,loading:Ke}=pt(jt,Ae,vt,y),{filters:dt,setFilters:at}=L(),Dt=dt[pe]||(we?[]:null),Mt=(Ut,zt)=>{at(Et=>{const{[pe]:Lt,...Zt}=Et;return zt?{...Zt,[pe]:zt}:{...Zt}})},Xt=Ut=>(0,f.jsx)(K.Z,{...Ut,name:"search",variant:"outlined",label:Z,fullWidth:!0}),en=(Ut,zt)=>Ut.map((Et,Lt)=>(0,f.jsx)(mt.Z,{label:Et,color:"primary",...zt({index:Lt})}));return(0,f.jsx)(St.ZP,{filterSelectedOptions:q,limitTags:Y,multiple:we,className:J,id:`${we?"multi-":""}select-filter-${pe}--select`,options:nt||[],loading:Ke,value:Dt,onChange:Mt,onInputChange:(Ut,zt)=>Ye(zt),renderInput:Xt,renderTags:en})},Jt=(0,u.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),Bt=_=>{const{className:J,defaultValue:te,label:pe,name:le,values:y=[],valuesDebounceMs:Z}=_,q=Jt(),{filters:Y,setFilters:we}=L();Ot(le,te);const Ae=typeof y=="function"?y:void 0,Ye=typeof y=="function"?void 0:y,{value:jt=[],loading:vt}=pt(Ae,"",Ye,Z),nt=dt=>{const{target:{value:at,checked:Dt}}=dt;we(Mt=>{const{[le]:Xt,...en}=Mt,Ut=(Xt||[]).filter(Et=>Et!==at),zt=Dt?[...Ut,at]:Ut;return zt.length?{...en,[le]:zt}:en})};var Ke;return(0,f.jsxs)(Pt.Z,{className:J,disabled:vt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,f.jsx)(Nt.Z,{className:q.label,children:pe}):null,jt.map(dt=>(0,f.jsx)(We.Z,{classes:{root:q.checkboxWrapper,label:q.textWrapper},label:dt,control:(0,f.jsx)(_t.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":dt},value:dt,name:dt,onChange:nt,checked:((Ke=Y[le])!==null&&Ke!==void 0?Ke:[]).includes(dt)})},dt))]})},un=_=>{const{className:J,defaultValue:te,label:pe,name:le,values:y,valuesDebounceMs:Z}=_,q=Jt();Ot(le,te);const Y=typeof y=="function"?y:void 0,we=typeof y=="function"?void 0:y,{value:Ae=[],loading:Ye}=pt(Y,"",we,Z),{filters:jt,setFilters:vt}=L(),nt=Ke=>{const{target:{value:dt}}=Ke;vt(at=>{const{[le]:Dt,...Mt}=at;return dt?{...Mt,[le]:dt}:Mt})};return(0,f.jsxs)(Pt.Z,{disabled:Ye,className:J,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,f.jsx)(ge.Z,{className:q.label,margin:"dense",children:pe}):null,(0,f.jsxs)(Se.Z,{variant:"outlined",value:jt[le]||"",onChange:nt,children:[(0,f.jsx)(Fe.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Ae.map(Ke=>(0,f.jsx)(Fe.Z,{value:Ke,children:(0,f.jsx)(tt.Z,{variant:"inherit",noWrap:!0,children:Ke})},Ke))]})]})},Yt=_=>{const{component:J,...te}=_;return(0,f.jsx)(J,{...te})};Yt.Checkbox=_=>(0,f.jsx)(Yt,{..._,component:Bt}),Yt.Select=_=>(0,f.jsx)(Yt,{..._,component:un}),Yt.Autocomplete=_=>(0,f.jsx)(Yt,{..._,component:Ht});var pn=r(48834).lW;const Fn=_=>pn.from(_.toString(),"utf-8").toString("base64"),Pn=_=>_?Number(pn.from(_,"base64").toString("utf-8")):0,fn=_=>{const{total:J=-1,cursor:te,hasNextPage:pe,onCursorChange:le,limit:y=25,limitLabel:Z="Results per page:",limitText:q=({from:nt,to:Ke})=>J>0?`of ${J}`:`${nt}-${Ke}`,limitOptions:Y,onLimitChange:we,...Ae}=_,Ye=useMemo(()=>Pn(te),[te]),jt=useCallback((nt,Ke)=>{le==null||le(Fn(Ke))},[le]),vt=useCallback(nt=>{const Ke=nt.target.value;we==null||we(parseInt(Ke,10))},[we]);return _jsx(TablePagination,{...Ae,component:"div",count:J,page:Ye,nextIconButtonProps:{...pe!==void 0&&{disabled:!pe}},onPageChange:jt,rowsPerPage:y,labelRowsPerPage:Z,labelDisplayedRows:q,rowsPerPageOptions:Y,onRowsPerPageChange:vt})},Ln=_=>{const{pageLimit:J,setPageLimit:te,pageCursor:pe,setPageCursor:le,fetchNextPage:y}=useSearch(),Z=useCallback(q=>{te(q),le(void 0)},[te,le]);return _jsx(fn,{..._,hasNextPage:!!y,limit:J,onLimitChange:Z,cursor:pe,onCursorChange:le})};var Un=r(53974);const tn=_=>{const{children:J}=_,te=useSearch(),{result:pe,...le}=te;return J(pe,le)},wn=_=>{const{query:J,children:te}=_,pe=useApi(searchApiRef),le=useAsync(()=>{const{term:y="",types:Z=[],filters:q={},...Y}=J;return pe.query({...Y,term:y,types:Z,filters:q})},[J]);return te(le,J)},Mn=_=>{const{query:J,children:te}=_;return J?_jsx(wn,{query:J,children:te}):_jsx(tn,{children:te})},ut=_=>{const{query:J,children:te,noResultsComponent:pe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...le}=_;return _jsx(Mn,{query:J,children:({loading:y,error:Z,value:q})=>y?_jsx(Progress,{}):Z?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Z}):q!=null&&q.results.length?isFunction(te)?te(q):_jsx(SearchResultListItemExtensions,{...le,results:q.results,children:te}):pe})},_n=_=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(ut,{..._})}),wt=({result:_,highlight:J,icon:te,secondaryAction:pe,lineClamp:le=5})=>_?_jsxs(_Fragment,{children:[te&&_jsx(ListItemIcon,{children:te}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:_.location,children:J!=null&&J.fields.title?_jsx(HighlightedSearchResultText,{text:(J==null?void 0:J.fields.title)||"",preTag:(J==null?void 0:J.preTag)||"",postTag:(J==null?void 0:J.postTag)||""}):_.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:le,overflow:"hidden"},color:"textSecondary",variant:"body2",children:J!=null&&J.fields.text?_jsx(HighlightedSearchResultText,{text:J.fields.text,preTag:J.preTag,postTag:J.postTag}):_.text})}),pe&&_jsx(Box,{alignItems:"flex-end",children:pe})]}):null,ct=_=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(wt,{..._})}),vn=_=>{const{error:J,loading:te,resultItems:pe,renderResultItem:le=Y=>_jsx(DefaultResultListItem,{result:Y.document},Y.document.location),disableRenderingWithNoResults:y,noResultsComponent:Z=y?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...q}=_;return te?_jsx(Progress,{}):J?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:J}):pe!=null&&pe.length?_jsx(List,{...q,children:pe.map(le)}):_jsx(_Fragment,{children:Z})},Kt=_=>{const{query:J,renderResultItem:te,children:pe,...le}=_,y=useSearchResultListItemExtensions(pe);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:J,children:({loading:Z,error:q,value:Y})=>_jsx(vn,{...le,error:q,loading:Z,resultItems:Y==null?void 0:Y.results,renderResultItem:te!=null?te:y})})})};var hn=r(19126);const jn=(0,u.Z)(_=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:_.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:_.palette.text.secondary,margin:_.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:_.palette.text.secondary,margin:_.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:_.spacing(.5)}})),ln=_=>{const J=jn(),{label:te,children:pe,...le}=_;return _jsx(Chip,{...le,className:J.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[te,": ",pe]})})},Tn=()=>null,Ce=(0,u.Z)(_=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:_.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:_.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),ce=_=>{const J=Ce(),{label:te,value:pe="None",onChange:le,onDelete:y}=_,Z=useCallback(q=>{le(q.target.value)},[le]);return _jsx(ln,{label:te,onDelete:y,children:_jsx(Typography,{role:"textbox",component:"span",className:J.root,onChange:Z,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},Oe=(0,u.Z)(_=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:_.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Me=_=>{const J=Oe(),{label:te,value:pe="none",onChange:le,onDelete:y,children:Z}=_,q=useCallback(Y=>{le(Y.target.value)},[le]);return _jsx(ln,{label:te,onDelete:y,children:_jsxs(Select,{className:J.root,value:pe,onChange:q,input:_jsx(InputBase,{}),IconComponent:Tn,children:[_jsx(MenuItem,{value:"none",children:"None"}),Z]})})};function Xe(_){const J=jn(),[te,pe]=useState(null),{error:le,loading:y,icon:Z,title:q,titleProps:Y={},link:we=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:J.listSubheaderLinkIcon})]}),linkProps:Ae={},filterOptions:Ye,renderFilterOption:jt=zt=>_jsx(MenuItem,{value:String(zt),children:zt},String(zt)),filterFields:vt,renderFilterField:nt,resultItems:Ke,renderResultItem:dt=zt=>_jsx(DefaultResultListItem,{result:zt.document},zt.document.location),disableRenderingWithNoResults:at,noResultsComponent:Dt=at?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Mt}=_,Xt=useCallback(zt=>{pe(zt.currentTarget)},[]),en=useCallback(()=>{pe(null)},[]);if(y)return _jsx(Progress,{});if(le)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:le});if(!(Ke!=null&&Ke.length))return _jsx(_Fragment,{children:Dt});var Ut;return _jsxs(List,{...Mt,children:[_jsxs(ListSubheader,{className:J.listSubheader,children:[Z,_jsx(Typography,{className:J.listSubheaderName,component:"strong",...Y,children:q}),Ye?_jsx(Chip,{className:J.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Xt}):null,Ye?_jsx(Menu,{id:"filters-menu",anchorEl:te,open:Boolean(te),onClose:en,onClick:en,keepMounted:!0,children:Ye.map(jt)}):null,vt==null?void 0:vt.map(zt=>(Ut=nt==null?void 0:nt(zt))!==null&&Ut!==void 0?Ut:null),_jsx(Link,{className:J.listSubheaderLink,to:"/search",...Ae,children:we})]}),Ke.map(dt)]})}function se(_){const{query:J,children:te,renderResultItem:pe,linkProps:le={},...y}=_,Z=useSearchResultListItemExtensions(te);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:J,children:({loading:q,error:Y,value:we},{term:Ae,types:Ye,pageCursor:jt,filters:vt={}})=>{const nt=`/search?${qs.stringify({term:Ae,types:Ye,filters:vt,pageCursor:jt,query:Ae},{arrayFormat:"brackets"})}`;return _jsx(Xe,{...y,error:Y,loading:q,linkProps:{to:nt,...le},filterFields:Object.keys(vt),resultItems:we==null?void 0:we.results,renderResultItem:pe!=null?pe:Z})}})})}const D=(0,u.Z)(_=>({root:{display:"flex",justifyContent:"space-between",gap:_.spacing(2),margin:_.spacing(2,0)}})),me=()=>{const{fetchNextPage:_,fetchPreviousPage:J}=useSearch(),te=D();return!_&&!J?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:te.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!J,onClick:J,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!_,onClick:_,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},De="search.results.list.items.extensions.v1",et=(_,J)=>{for(const te of _){if(!isValidElement(te))continue;const pe=getComponentData(te,De);if(pe!=null&&pe(J))return cloneElement(te,{rank:J.rank,highlight:J.highlight,result:J.document,...te.props})}return null},it=_=>{const{rank:J,result:te,noTrack:pe,children:le,alignItems:y="flex-start",...Z}=_,q=(0,t.z$)(),Y=(0,W.useCallback)(()=>{pe||te&&q.captureEvent("discover",te.title,{attributes:{to:te.location},value:J})},[J,te,pe,q]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:y,onClickCapture:Y,...Z,children:le})},kt=_=>{const{name:J,component:te,predicate:pe=()=>!0}=_;return(0,t.YO)({name:J,component:{lazy:()=>te().then(le=>y=>(0,f.jsx)(it,{rank:y.rank,result:y.result,noTrack:y.noTrack,children:(0,W.createElement)(le,y)}))},data:{[De]:pe}})},Ft=_=>{const J=useElementFilter(_,te=>te.selectByComponentData({key:De}).getElements(),[_]);return useCallback((te,pe)=>{const le=et(J,te);return _jsx(Fragment,{children:le!=null?le:_jsx(it,{rank:te.rank,result:te.document,children:_jsx(DefaultResultListItem,{rank:te.rank,highlight:te.highlight,result:te.document})})},pe)},[J])},Qt=_=>{const{results:J,children:te,...pe}=_,le=Ft(te);return _jsx(List,{...pe,children:J.map(le)})}},61886:function(Ct,$e,r){"use strict";r.d($e,{Ox:function(){return Qe},jM:function(){return W},Zz:function(){return g},oZ:function(){return z},DR:function(){return u},ZS:function(){return Le},VA:function(){return xt},KY:function(){return ve},gT:function(){return w},Dl:function(){return ie},ux:function(){return It},$L:function(){return I},x1:function(){return ze}});var t=r(52322),h=r(2784),H=r(73557),f=r(60871);const W="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",u=()=>null;(0,f.R5)(u,g,!0);const B=ge=>`${W}.${ge.toLocaleLowerCase("en-US")}`;function ve(ge){const{name:Se,component:Fe}=ge;return(0,f.YO)({name:Se,component:{sync:tt=>(0,t.jsx)(Fe,{...tt})},data:{[W]:ge,[B(Se)]:!0}})}const ue=(ge,Se)=>ge.selectByComponentData({key:Se}).getElements()[0],V=ge=>ge.selectByComponentData({key:g}).selectByComponentData({key:W}),K=ge=>ge.selectByComponentData({key:g}).findComponentData({key:W}),I=()=>{const ge=(0,H.pC)(),Se=(0,f.vJ)(ge,V),Fe=(0,f.vJ)(ge,K),tt=(0,h.useCallback)(pt=>{if(!Se||!pt)return null;const Ot=B(pt.name);var Ht;return(Ht=ue(Se,Ot))!==null&&Ht!==void 0?Ht:null},[Se]),mt=(0,h.useCallback)(pt=>{const Ot=Fe.find(Ht=>Ht.name===pt);return Ot?tt(Ot):null},[Fe,tt]),bt=(0,h.useCallback)(pt=>{const Ot=Fe.filter(Ht=>Ht.location===pt);return Ot.length?Ot.map(tt):null},[Fe,tt]);return{renderComponentByName:mt,renderComponentsByLocation:bt}},w=(0,f.T0)({id:"plugin.techdocs.service"}),ie=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ee=r(64279),ne=r(77446),$=r(25271),T=r(51837);function P(ge,Se){return Se.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ge.kind=ge.kind.toLocaleLowerCase(),ge.name=ge.name.toLocaleLowerCase(),ge.namespace=ge.namespace.toLocaleLowerCase()),ge}const L=(ge,Se)=>(0,$.eE)(ge)===(0,$.eE)(Se),O={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},oe=(0,T.CT)("techdocs-reader-page-context"),Le=(0,h.memo)(ge=>{const{entityRef:Se,children:Fe}=ge,tt=(0,f.h_)(w),mt=(0,f.h_)(f.Ds),bt=(0,ee.default)(async()=>tt.getEntityMetadata(Se),[Se]),pt=(0,ne.Z)(async()=>tt.getTechDocsMetadata(Se),[Se]),[Ot,Ht]=(0,h.useState)(O.title),[Jt,Bt]=(0,h.useState)(O.subtitle),[un,Yt]=(0,h.useState)(O.shadowRoot);(0,h.useEffect)(()=>{un&&!pt.value&&!pt.loading&&pt.retry()},[pt.value,pt.loading,un,pt.retry,pt]);const pn={metadata:pt,entityRef:P(Se,mt),entityMetadata:bt,shadowRoot:un,setShadowRoot:Yt,title:Ot,setTitle:Ht,subtitle:Jt,setSubtitle:Bt},Fn=(0,T.EI)({1:pn});return(0,t.jsx)(f.fC,{attributes:{entityRef:(0,$.eE)(Se)},children:(0,t.jsx)(oe.Provider,{value:Fn,children:Fe instanceof Function?Fe(pn):Fe})})},(ge,Se)=>L(ge.entityRef,Se.entityRef)),ze=()=>{const ge=(0,h.useContext)(oe);if(ge===void 0)return O;const Se=ge.atVersion(1);if(Se===void 0)throw new Error("No context found for version 1.");return Se},z=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var yt=r(70882),ot=r(50236),He=r(19219),st=r(53974);const Qe="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",St=ge=>{(0,h.useEffect)(()=>{if(!ge)return()=>{};const Se=ge.querySelectorAll('head > link[rel="stylesheet"]');var Fe;let tt=(Fe=Se==null?void 0:Se.length)!==null&&Fe!==void 0?Fe:0;const mt=new CustomEvent(Qe);if(!tt)return ge.dispatchEvent(mt),()=>{};const bt=()=>{--tt===0&&ge.dispatchEvent(mt)};return Se==null||Se.forEach(pt=>{pt.addEventListener("load",bt)}),()=>{Se==null||Se.forEach(pt=>{pt.removeEventListener("load",bt)})}},[ge])},It=ge=>{const[Se,Fe]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{if(!ge)return()=>{};Fe(!0);const tt=ge.style;tt.setProperty("opacity","0");const mt=()=>{Fe(!1),tt.setProperty("opacity","1")};return ge.addEventListener(Qe,mt),()=>{ge.removeEventListener(Qe,mt)}},[ge]),Se},xt=ge=>{const{element:Se,onAppend:Fe,children:tt}=ge,[mt,bt]=(0,h.useState)((0,yt.Ue)({...(0,ot.Z)(),insertionPoint:void 0}));St(Se);const pt=It(Se),Ot=(0,h.useCallback)(Ht=>{if(!Se||!Ht)return;bt((0,yt.Ue)({...(0,ot.Z)(),insertionPoint:Se.querySelector("head")||void 0}));let Jt=Ht.shadowRoot;Jt||(Jt=Ht.attachShadow({mode:"open"})),Jt.replaceChildren(Se),typeof Fe=="function"&&Fe(Jt)},[Se,Fe]);return(0,t.jsxs)(t.Fragment,{children:[pt&&(0,t.jsx)(st.Ex,{}),(0,t.jsxs)(He.ZP,{jss:mt,sheetsManager:new Map,children:[(0,t.jsx)("div",{ref:Ot,"data-testid":"techdocs-native-shadowroot"}),tt]})]})};var lt=r(54073);const Pt=()=>{const{shadowRoot:ge}=useTechDocsReaderPage();return ge},Nt=ge=>{const Se=Pt();return Se?ge.map(Fe=>Se==null?void 0:Se.querySelectorAll(Fe)).filter(Fe=>Fe.length).map(Fe=>Array.from(Fe)).flat():[]},We=ge=>ge.toString()&&ge.rangeCount&&ge.getRangeAt(0).getBoundingClientRect().top,_t=(ge=0)=>{const Se=Pt(),[Fe,tt]=useState(null),mt=useMemo(()=>debounce(()=>{const bt=Se,pt=bt.getSelection?bt.getSelection():document.getSelection();pt&&We(pt)?tt(pt):tt(null)},ge),[Se,tt,ge]);return useEffect(()=>(window.document.addEventListener("selectionchange",mt),()=>{mt.cancel(),window.document.removeEventListener("selectionchange",mt)}),[mt]),Fe}},52943:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{EmbeddedDocsRouter:function(){return ee},Router:function(){return ie},isTechDocsAvailable:function(){return w}});var t=r(52322),h=r(2784),H=r(73557),f=r(43514),W=r(53974),g=r(25271),u=r(89258),B=r(65124),ve=r(86317);const ue=({entity:ne})=>{const $=(0,g.iB)(ne);return(0,t.jsxs)(u.I6,{entityRef:$,children:[(0,t.jsx)(B.b,{}),(0,t.jsx)(ve.F,{withSearch:!1})]})};var V=r(18662),K=r(7476);const I="backstage.io/techdocs-ref",w=ne=>{var $,T;return Boolean(ne==null||($=ne.metadata)===null||$===void 0||(T=$.annotations)===null||T===void 0?void 0:T[I])},ie=()=>(0,t.jsxs)(H.Z5,{children:[(0,t.jsx)(H.AW,{path:"/",element:(0,t.jsx)(V.TechDocsIndexPage,{})}),(0,t.jsx)(H.AW,{path:"/:namespace/:kind/:name/*",element:(0,t.jsx)(K.TechDocsReaderPage,{})})]}),ee=ne=>{var $;const{children:T}=ne,{entity:P}=(0,f.X2)(),L=(0,H.V$)([{path:"/*",element:(0,t.jsx)(ue,{entity:P}),children:[{path:"*",element:T}]}]);return(($=P.metadata.annotations)===null||$===void 0?void 0:$[I])?L:(0,t.jsx)(W.sk,{annotation:I})}},92077:function(Ct,$e,r){"use strict";r.d($e,{k:function(){return g},p:function(){return W}});var t=r(87612),h=r(23054),H=r(76372),f=r.n(H);class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(B){const{kind:ve,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${ve}/${V}`,w=await this.fetchApi.fetch(`${I}`);if(!w.ok)throw await h.VL.fromResponse(w);return await w.json()}async getEntityMetadata(B){const{kind:ve,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/entity/${ue}/${ve}/${V}`,w=await this.fetchApi.fetch(`${I}`);if(!w.ok)throw await h.VL.fromResponse(w);return await w.json()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi}}class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var B;return(B=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&B!==void 0?B:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(B,ve){const{kind:ue,namespace:V,name:K}=B,w=`${await this.getStorageUrl()}/${V}/${ue}/${K}/${ve}`,ie=await this.fetchApi.fetch(`${w.endsWith("/")?w:`${w}/`}index.html`);let ee="";switch(ie.status){case 404:throw ee="Page not found. ",ve||(ee+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ee);case 500:throw ee="Could not generate documentation or an error in the TechDocs backend. ",new Error(ee);default:break}return ie.text()}async syncEntityDocs(B,ve=()=>{}){const{kind:ue,namespace:V,name:K}=B,w=`${await this.getApiOrigin()}/sync/${V}/${ue}/${K}`,{token:ie}=await this.identityApi.getCredentials();return new Promise((ee,ne)=>{const $=new H.EventSourcePolyfill(w,{withCredentials:!0,headers:ie?{Authorization:`Bearer ${ie}`}:{}});$.addEventListener("log",T=>{T.data&&ve(JSON.parse(T.data))}),$.addEventListener("finish",T=>{let P=!1;T.data&&({updated:P}=JSON.parse(T.data)),ee(P?"updated":"cached")}),$.onerror=T=>{switch($.close(),T.status){case 404:ne(new h.dR(T.message));return;default:ne(new Error(T.data));return}}})}async getBaseUrl(B,ve,ue){const{kind:V,namespace:K,name:I}=ve,ie=`${await this.getApiOrigin()}/static/docs/${K}/${V}/${I}/${ue}`;return new URL(B,ie.endsWith("/")?ie:`${ie}/`).toString()}constructor(B){(0,t._)(this,"configApi",void 0),(0,t._)(this,"discoveryApi",void 0),(0,t._)(this,"identityApi",void 0),(0,t._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.identityApi=B.identityApi,this.fetchApi=B.fetchApi}}},51953:function(Ct,$e,r){"use strict";r.d($e,{D:function(){return t}});function t(h,H){return H.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?h:h.toLocaleLowerCase("en-US")}},3482:function(Ct,$e,r){"use strict";r.d($e,{u:function(){return B}});var t=r(52322),h=r(2784),H=r(53974),f=r(43514),W=r(42081),g=r(48431),u=r(68435);const B=ve=>{const{initialFilter:ue="owned",columns:V,actions:K}=ve;return(0,t.jsx)(W.j,{children:(0,t.jsxs)(H.VY,{children:[(0,t.jsx)(H.yW,{title:"",children:(0,t.jsx)(H.qt,{children:"Discover documentation in your ecosystem."})}),(0,t.jsx)(f.UO,{children:(0,t.jsxs)(f._i,{children:[(0,t.jsxs)(f._i.Filters,{children:[(0,t.jsx)(g.f,{}),(0,t.jsx)(f.EW,{initialFilter:ue}),(0,t.jsx)(f.dq,{}),(0,t.jsx)(f.xE,{})]}),(0,t.jsx)(f._i.Content,{children:(0,t.jsx)(u.n,{actions:K,columns:V})})]})})]})})}},85478:function(Ct,$e,r){"use strict";r.d($e,{f:function(){return V}});var t=r(52322),h=r(95573),H=r(51953),f=r(60871),W=r(53974),g=r(94339),u=r(16111),B=r(24579),ve=r(14503),ue=r(2784);const V=ee=>{const{entities:ne}=ee,$=(0,f.tg)(h.Fw),T=(0,f.h_)(f.Ds);if(!ne)return null;var P,L;return(0,t.jsx)(W.Oh,{"data-testid":"docs-explore",children:ne!=null&&ne.length?ne.map((O,oe)=>(0,t.jsxs)(g.Z,{children:[(0,t.jsx)(u.Z,{children:(0,t.jsx)(W.hu,{title:(P=O.metadata.title)!==null&&P!==void 0?P:O.metadata.name})}),(0,t.jsx)(B.Z,{children:O.metadata.description}),(0,t.jsx)(ve.Z,{children:(0,t.jsx)(W.Qj,{to:$({namespace:(0,H.D)((L=O.metadata.namespace)!==null&&L!==void 0?L:"default",T),kind:(0,H.D)(O.kind,T),name:(0,H.D)(O.metadata.name,T)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},oe)):null})};var K=r(43514);const I={title:"All Documentation",filterPredicate:()=>!0},w=ee=>{const{entities:ne,group:$}=ee,{loading:T,isOwnedEntity:P}=useEntityOwnership(),L=ne.filter(oe=>$.filterPredicate==="ownedByUser"?T?!1:P(oe):typeof $.filterPredicate=="function"&&$.filterPredicate(oe)),O=(()=>typeof $.title=="string"?_jsx(ContentHeader,{title:$.title}):$.title)();return L.length===0?null:_jsxs(Content,{children:[O,_jsx(DocsCardGrid,{entities:L})]})},ie=ee=>{const{loading:ne,error:$,entities:T}=useEntityList();if($)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:$.toString()})});if(ne)return _jsx(Progress,{});if(T.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var P,L;return T.sort((O,oe)=>((P=O.metadata.title)!==null&&P!==void 0?P:O.metadata.name).localeCompare((L=oe.metadata.title)!==null&&L!==void 0?L:oe.metadata.name)),_jsx(Content,{children:(ee.groups||[I]).map((O,oe)=>_jsx(w,{entities:T,group:O},`${O.title}-${oe}`))})}},68435:function(Ct,$e,r){"use strict";r.d($e,{H:function(){return T},n:function(){return P}});var t=r(52322),h=r(2784),H=r(95074),f=r(76635),W=r(53974),g=r(43514),u=r(60871),B=r(25271),ve=r(95573),ue=r(39981),V=r(2337),K=r(11640),I=r(28347);const w=(0,V.Z)({root:{color:"#f3ba37"}})(K.Z),ie={createCopyDocsUrlAction(L){return O=>({icon:()=>(0,t.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>L(`${window.location.origin}${O.resolved.docsUrl}`)})},createStarEntityAction(L,O){return oe=>{const Le=oe.entity,ze=L(Le);return{cellStyle:{paddingLeft:"1em"},icon:()=>ze?(0,t.jsx)(w,{}):(0,t.jsx)(I.Z,{}),tooltip:ze?"Remove from favorites":"Add to favorites",onClick:()=>O(Le)}}}};function ee(L){return L.metadata.title||L.metadata.name}const ne={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:L=>(0,t.jsx)(W.uw,{value:(0,t.jsx)(W.rU,{to:L.resolved.docsUrl,children:ee(L.entity)}),subvalue:L.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:L})=>(0,t.jsx)(g.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var $=r(51953);const T=L=>{const{entities:O,title:oe,loading:Le,columns:ze,actions:z,options:yt}=L,[,ot]=(0,H.Z)(),He=(0,u.tg)(ve.Fw),st=(0,u.h_)(u.Ds);if(!O)return null;const Qe=O.map(xt=>{const lt=(0,g.hF)(xt,B.S4);var Pt;return{entity:xt,resolved:{docsUrl:He({namespace:(0,$.D)((Pt=xt.metadata.namespace)!==null&&Pt!==void 0?Pt:"default",st),kind:(0,$.D)(xt.kind,st),name:(0,$.D)(xt.metadata.name,st)}),ownedByRelations:lt,ownedByRelationsTitle:lt.map(Nt=>(0,g.$3)(Nt,{defaultKind:"group"})).join(", ")}}}),St=[ne.createNameColumn(),ne.createOwnerColumn(),ne.createTypeColumn()],It=[ie.createCopyDocsUrlAction(ot)];return(0,t.jsx)(t.Fragment,{children:Le||Qe&&Qe.length>0?(0,t.jsx)(W.iA,{isLoading:Le,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...yt},data:Qe,columns:ze||St,actions:z||It,title:oe?`${oe} (${Qe.length})`:`All (${Qe.length})`}):(0,t.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,t.jsx)(W.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};T.columns=ne,T.actions=ie;const P=L=>{var O;const{columns:oe,actions:Le,options:ze}=L,{loading:z,error:yt,entities:ot,filters:He}=(0,g.wp)(),{isStarredEntity:st,toggleStarredEntity:Qe}=(0,g.CR)(),[,St]=(0,H.Z)();var It;const xt=(0,f.capitalize)((It=(O=He.user)===null||O===void 0?void 0:O.value)!==null&&It!==void 0?It:"all"),lt=[ie.createCopyDocsUrlAction(St),ie.createStarEntityAction(st,Qe)];return yt?(0,t.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,t.jsx)(W.Oi,{language:"text",text:yt.toString()})}):(0,t.jsx)(T,{title:xt,entities:ot,loading:z,actions:Le||lt,columns:oe,options:ze})};P.columns=ne,P.actions=ie},18662:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{TechDocsIndexPage:function(){return W}});var t=r(52322),h=r(2784),H=r(73557),f=r(3482);const W=g=>(0,H.pC)()||(0,t.jsx)(f.u,{...g})},42081:function(Ct,$e,r){"use strict";r.d($e,{j:function(){return W}});var t=r(52322),h=r(2784),H=r(53974),f=r(60871);const W=g=>{const{children:u}=g,B=(0,f.h_)(f.Ds);var ve;const ue=`Documentation available in ${(ve=B.getOptionalString("organization.name"))!==null&&ve!==void 0?ve:"Backstage"}`;return(0,t.jsx)(H.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:u})}},48431:function(Ct,$e,r){"use strict";r.d($e,{f:function(){return f}});var t=r(2784),h=r(43514);class H{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":h.n3}}}const f=()=>{const{updateFilters:W}=(0,h.wp)();return(0,t.useEffect)(()=>{W({techdocs:new H})},[W]),null}},89258:function(Ct,$e,r){"use strict";r.d($e,{I6:function(){return V},Jl:function(){return ue},s4:function(){return g}});var t=r(61886),h=r(92077),H=r(95573),f=r(60871),W=r(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:t.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:I,discoveryApi:w,identityApi:ie,fetchApi:ee})=>new h.k({configApi:I,discoveryApi:w,identityApi:ie,fetchApi:ee})}),(0,f.ni)({api:t.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:I,discoveryApi:w,fetchApi:ie})=>new h.p({configApi:I,discoveryApi:w,fetchApi:ie})})],routes:{root:H._Z,docRoot:H.Fw,entityContent:H.pd}}),u=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.Router),mountPoint:H._Z})),B=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(r.bind(r,52943)).then(I=>I.EmbeddedDocsRouter),mountPoint:H.pd})),ve=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>r.e(7560).then(r.bind(r,27560)).then(I=>I.TechDocsCustomHome),mountPoint:H._Z})),ue=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(r.bind(r,18662)).then(I=>I.TechDocsIndexPage),mountPoint:H._Z})),V=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(r.bind(r,7476)).then(I=>I.TechDocsReaderPage),mountPoint:H.Fw})),K=g.provide((0,W.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(r.bind(r,55511)).then(I=>I.TechDocsSearchResultListItem),predicate:I=>I.type==="techdocs"}))},7476:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{TechDocsReaderLayout:function(){return V},TechDocsReaderPage:function(){return K}});var t=r(52322),h=r(2784),H=r(73557),f=r(53974),W=r(61886),g=r(86317),u=r(93225),B=r(65124),ve=r(95573),ue=r(60871);const V=I=>{const{withSearch:w,withHeader:ie=!0}=I;return(0,t.jsxs)(f.T3,{themeId:"documentation",children:[ie&&(0,t.jsx)(u.S,{}),(0,t.jsx)(B.b,{}),(0,t.jsx)(g.F,{withSearch:w})]})},K=I=>{const{kind:w,name:ie,namespace:ee}=(0,ue.Oi)(ve.Fw),{children:ne,entityRef:$={kind:w,name:ie,namespace:ee}}=I,T=(0,H.pC)();if(!ne){const L=T?h.Children.toArray(T.props.children):[];var P;const oe=L.flatMap(Le=>{var ze;return(P=Le==null||(ze=Le.props)===null||ze===void 0?void 0:ze.children)!==null&&P!==void 0?P:[]}).find(Le=>!(0,ue.IY)(Le,W.Zz)&&!(0,ue.IY)(Le,W.jM));return(0,t.jsx)(W.ZS,{entityRef:$,children:oe||(0,t.jsx)(V,{})})}return(0,t.jsx)(W.ZS,{entityRef:$,children:({metadata:L,entityMetadata:O,onReady:oe})=>(0,t.jsx)("div",{className:"techdocs-reader-page",children:(0,t.jsx)(f.T3,{themeId:"documentation",children:ne instanceof Function?ne({entityRef:$,techdocsMetadataValue:L.value,entityMetadataValue:O.value,onReady:oe}):ne})})})}},86317:function(Ct,$e,r){"use strict";r.d($e,{F:function(){return pe}});var t=r(52322),h=r(2784),H=r(79692),f=r(60905),W=r(61886),g=r(53974),u=r(22478),B=r(4614),ve=r(77277),ue=r(99688),V=r(12420),K=r(90436),I=r(61837),w=r(4190),ie=r(87685);const ee=(0,H.Z)(y=>(0,V.Z)({paper:{width:"100%",[y.breakpoints.up("sm")]:{width:"75%"},[y.breakpoints.up("md")]:{width:"50%"},padding:y.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:y.palette.background.default}})),ne=({buildLog:y,onClose:Z})=>{const q=ee(),Y=y.length===0?"Waiting for logs...":y.join(`
|
|
37
|
-
`);return(0,t.jsxs)(f.Z,{container:!0,direction:"column",className:q.root,spacing:0,wrap:"nowrap",children:[(0,t.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,t.jsx)(K.Z,{variant:"h5",children:"Build Details"}),(0,t.jsx)(I.Z,{title:"Close the drawer",onClick:Z,color:"inherit",children:(0,t.jsx)(ie.Z,{})},"dismiss")]}),(0,t.jsx)(f.Z,{item:!0,xs:!0,children:(0,t.jsx)(g.nU,{text:Y,classes:{root:q.logs}})})]})},$=({buildLog:y})=>{const Z=ee(),[q,Y]=(0,h.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ve.Z,{color:"inherit",onClick:()=>Y(!0),children:"Show Build Logs"}),(0,t.jsx)(w.ZP,{classes:{paper:Z.paper},anchor:"right",open:q,onClose:()=>Y(!1),children:(0,t.jsx)(ne,{buildLog:y,onClose:()=>Y(!1)})})]})};var T=r(60871);const P=({errorMessage:y})=>{const Z=(0,T.h_)(T.Ds).getOptionalString("techdocs.builder");let q="";return Z!=="local"&&(q="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,t.jsx)(g.mf,{status:"404",statusMessage:y||"Documentation not found",additionalInfo:q})};var L=r(95481);const O=(0,H.Z)(y=>({root:{marginBottom:y.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),oe=()=>{let y=null;const Z=O(),{state:q,contentReload:Y,contentErrorMessage:we,syncErrorMessage:Ae,buildLog:Ye}=(0,L.DK)();return q==="INITIAL_BUILD"&&(y=(0,t.jsx)(ue.Z,{classes:{root:Z.root},variant:"outlined",severity:"info",icon:(0,t.jsx)(B.Z,{size:"24px"}),action:(0,t.jsx)($,{buildLog:Ye}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),q==="CONTENT_STALE_REFRESHING"&&(y=(0,t.jsx)(ue.Z,{variant:"outlined",severity:"info",icon:(0,t.jsx)(B.Z,{size:"24px"}),action:(0,t.jsx)($,{buildLog:Ye}),classes:{root:Z.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),q==="CONTENT_STALE_READY"&&(y=(0,t.jsx)(ue.Z,{variant:"outlined",severity:"success",action:(0,t.jsx)(ve.Z,{color:"inherit",onClick:()=>Y(),children:"Refresh"}),classes:{root:Z.root},children:"A newer version of this documentation is now available, please refresh to view."})),q==="CONTENT_STALE_ERROR"&&(y=(0,t.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,t.jsx)($,{buildLog:Ye}),classes:{root:Z.root,message:Z.message},children:["Building a newer version of this documentation failed."," ",Ae]})),q==="CONTENT_NOT_FOUND"&&(y=(0,t.jsxs)(t.Fragment,{children:[Ae&&(0,t.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,t.jsx)($,{buildLog:Ye}),classes:{root:Z.root,message:Z.message},children:["Building a newer version of this documentation failed."," ",Ae]}),(0,t.jsx)(P,{errorMessage:we})]})),y};var Le=r(60364),ze=r(41156),z=r(32838),yt=r(35368),ot=r.n(yt);const He=/main\.[A-Fa-f0-9]{8}\.min\.css$/,st=/^https:\/\/fonts\.googleapis\.com/,Qe=/^https:\/\/fonts\.gstatic\.com/,St=y=>y.nodeName==="LINK",It=y=>{const Z=(y==null?void 0:y.getAttribute("href"))||"",q=Z.match(He),Y=Z.match(st),we=Z.match(Qe);return q||Y||we},xt=y=>(St(y)&&!It(y)&&y.remove(),y),lt=y=>y.nodeName==="IFRAME",Pt=(y,Z)=>{const q=y.getAttribute("src")||"";try{const{host:Y}=new URL(q);return Z.includes(Y)}catch{return!1}},Nt=y=>Z=>(lt(Z)&&!Pt(Z,y)&&Z.remove(),Z),We=()=>{const y=(0,T.h_)(T.Ds);return(0,h.useMemo)(()=>y.getOptionalConfig("techdocs.sanitizer"),[y])},_t=()=>{const y=We();return(0,h.useCallback)(async Z=>{const q=y==null?void 0:y.getOptionalStringArray("allowedIframeHosts");ot().addHook("beforeSanitizeElements",xt);const Y=["link"];return q&&(Y.push("iframe"),ot().addHook("beforeSanitizeElements",Nt(q))),ot().sanitize(Z.outerHTML,{ADD_TAGS:Y,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[y])};var ge=r(41128),Se=({theme:y})=>`
|
|
38
|
-
/*================== Variables ==================*/
|
|
39
|
-
/*
|
|
40
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
41
|
-
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
:host {
|
|
45
|
-
/* FONT */
|
|
46
|
-
--md-default-fg-color: ${y.palette.text.primary};
|
|
47
|
-
--md-default-fg-color--light: ${y.palette.text.secondary};
|
|
48
|
-
--md-default-fg-color--lighter: ${(0,ge.$n)(y.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,ge.$n)(y.palette.text.secondary,.3)};
|
|
50
|
-
|
|
51
|
-
/* BACKGROUND */
|
|
52
|
-
--md-default-bg-color:${y.palette.background.default};
|
|
53
|
-
--md-default-bg-color--light: ${y.palette.background.paper};
|
|
54
|
-
--md-default-bg-color--lighter: ${(0,ge.$n)(y.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,ge.$n)(y.palette.background.paper,.3)};
|
|
56
|
-
|
|
57
|
-
/* PRIMARY */
|
|
58
|
-
--md-primary-fg-color: ${y.palette.primary.main};
|
|
59
|
-
--md-primary-fg-color--light: ${y.palette.primary.light};
|
|
60
|
-
--md-primary-fg-color--dark: ${y.palette.primary.dark};
|
|
61
|
-
--md-primary-bg-color: ${y.palette.primary.contrastText};
|
|
62
|
-
--md-primary-bg-color--light: ${(0,ge.$n)(y.palette.primary.contrastText,.7)};
|
|
63
|
-
|
|
64
|
-
/* ACCENT */
|
|
65
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
-
|
|
67
|
-
/* SHADOW */
|
|
68
|
-
--md-shadow-z1: ${y.shadows[1]};
|
|
69
|
-
--md-shadow-z2: ${y.shadows[2]};
|
|
70
|
-
--md-shadow-z3: ${y.shadows[3]};
|
|
71
|
-
|
|
72
|
-
/* EXTENSIONS */
|
|
73
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
74
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
75
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
76
|
-
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
77
|
-
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
78
|
-
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
79
|
-
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
80
|
-
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
81
|
-
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
82
|
-
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
83
|
-
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
84
|
-
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
85
|
-
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
86
|
-
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
87
|
-
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
88
|
-
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
89
|
-
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
90
|
-
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
91
|
-
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
92
|
-
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
93
|
-
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
94
|
-
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
95
|
-
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
96
|
-
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
97
|
-
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
98
|
-
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
99
|
-
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
100
|
-
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
101
|
-
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host > * {
|
|
105
|
-
/* CODE */
|
|
106
|
-
--md-code-fg-color: ${y.palette.text.primary};
|
|
107
|
-
--md-code-bg-color: ${y.palette.background.paper};
|
|
108
|
-
--md-code-hl-color: ${(0,ge.Fq)(y.palette.warning.main,.5)};
|
|
109
|
-
--md-code-hl-keyword-color: ${y.palette.type==="dark"?y.palette.primary.light:y.palette.primary.dark};
|
|
110
|
-
--md-code-hl-function-color: ${y.palette.type==="dark"?y.palette.secondary.light:y.palette.secondary.dark};
|
|
111
|
-
--md-code-hl-string-color: ${y.palette.type==="dark"?y.palette.success.light:y.palette.success.dark};
|
|
112
|
-
--md-code-hl-number-color: ${y.palette.type==="dark"?y.palette.error.light:y.palette.error.dark};
|
|
113
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
114
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
115
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
116
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
117
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
118
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
119
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
120
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
121
|
-
|
|
122
|
-
/* TYPESET */
|
|
123
|
-
--md-typeset-font-size: 1rem;
|
|
124
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
125
|
-
--md-typeset-a-color: ${y.palette.link};
|
|
126
|
-
--md-typeset-table-color: ${y.palette.text.primary};
|
|
127
|
-
--md-typeset-del-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.error.dark,.5):(0,ge.Fq)(y.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.success.dark,.5):(0,ge.Fq)(y.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${y.palette.type==="dark"?(0,ge.Fq)(y.palette.warning.dark,.5):(0,ge.Fq)(y.palette.warning.light,.5)};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 76.1875em) {
|
|
133
|
-
:host > * {
|
|
134
|
-
/* TYPESET */
|
|
135
|
-
--md-typeset-font-size: .9rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media screen and (max-width: 600px) {
|
|
140
|
-
:host > * {
|
|
141
|
-
/* TYPESET */
|
|
142
|
-
--md-typeset-font-size: .7rem;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,Fe=({theme:y})=>`
|
|
146
|
-
/*================== Reset ==================*/
|
|
147
|
-
|
|
148
|
-
body {
|
|
149
|
-
--md-text-color: var(--md-default-fg-color);
|
|
150
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
151
|
-
--md-text-font-family: ${y.typography.fontFamily};
|
|
152
|
-
font-family: var(--md-text-font-family);
|
|
153
|
-
background-color: unset;
|
|
154
|
-
}
|
|
155
|
-
`;const tt="224px";var mt=({theme:y,sidebar:Z})=>`
|
|
156
|
-
/*================== Layout ==================*/
|
|
157
|
-
|
|
158
|
-
/* mkdocs material v9 compat */
|
|
159
|
-
.md-nav__title {
|
|
160
|
-
color: var(--md-default-fg-color);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.md-grid {
|
|
164
|
-
max-width: 100%;
|
|
165
|
-
margin: 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.md-nav {
|
|
169
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
170
|
-
}
|
|
171
|
-
.md-nav__link {
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
justify-content: space-between;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon {
|
|
177
|
-
height: 20px !important;
|
|
178
|
-
width: 20px !important;
|
|
179
|
-
margin-left:${y.spacing(1)}px;
|
|
180
|
-
}
|
|
181
|
-
.md-nav__icon svg {
|
|
182
|
-
margin: 0;
|
|
183
|
-
width: 20px !important;
|
|
184
|
-
height: 20px !important;
|
|
185
|
-
}
|
|
186
|
-
.md-nav__icon:after {
|
|
187
|
-
width: 20px !important;
|
|
188
|
-
height: 20px !important;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
192
|
-
text-decoration: underline;
|
|
193
|
-
color: var(--md-typeset-a-color);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.md-main__inner {
|
|
197
|
-
margin-top: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.md-sidebar {
|
|
201
|
-
bottom: 75px;
|
|
202
|
-
position: fixed;
|
|
203
|
-
width: 16rem;
|
|
204
|
-
overflow-y: auto;
|
|
205
|
-
overflow-x: hidden;
|
|
206
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
207
|
-
scrollbar-width: thin;
|
|
208
|
-
}
|
|
209
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
210
|
-
width: calc(12.1rem);
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar--secondary {
|
|
213
|
-
right: ${y.spacing(3)}px;
|
|
214
|
-
}
|
|
215
|
-
.md-sidebar::-webkit-scrollbar {
|
|
216
|
-
width: 5px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
219
|
-
width: 5px;
|
|
220
|
-
height: 5px;
|
|
221
|
-
}
|
|
222
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
223
|
-
background: #eee;
|
|
224
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
225
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
226
|
-
border-radius: 3px;
|
|
227
|
-
}
|
|
228
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
229
|
-
width: 5px;
|
|
230
|
-
background: rgb(193, 193, 193);
|
|
231
|
-
border: transparent;
|
|
232
|
-
border-radius: 3px;
|
|
233
|
-
}
|
|
234
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
235
|
-
background: rgb(125, 125, 125);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.md-content {
|
|
239
|
-
max-width: calc(100% - 16rem * 2);
|
|
240
|
-
margin-left: 16rem;
|
|
241
|
-
margin-bottom: 50px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.md-footer {
|
|
245
|
-
position: fixed;
|
|
246
|
-
bottom: 0px;
|
|
247
|
-
pointer-events: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.md-footer-nav__link, .md-footer__link {
|
|
251
|
-
pointer-events: all;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.md-footer__title {
|
|
255
|
-
background-color: unset;
|
|
256
|
-
}
|
|
257
|
-
.md-footer-nav__link {
|
|
258
|
-
width: 16rem;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.md-dialog {
|
|
262
|
-
background-color: unset;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@media screen and (min-width: 76.25em) {
|
|
266
|
-
.md-sidebar {
|
|
267
|
-
height: auto;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@media screen and (max-width: 76.1875em) {
|
|
272
|
-
.md-nav {
|
|
273
|
-
transition: none !important;
|
|
274
|
-
background-color: var(--md-default-bg-color)
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title {
|
|
277
|
-
cursor: auto;
|
|
278
|
-
color: var(--md-default-fg-color);
|
|
279
|
-
font-weight: 700;
|
|
280
|
-
white-space: normal;
|
|
281
|
-
line-height: 1rem;
|
|
282
|
-
height: auto;
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-flow: column;
|
|
285
|
-
row-gap: 1.6rem;
|
|
286
|
-
padding: 1.2rem .8rem .8rem;
|
|
287
|
-
background-color: var(--md-default-bg-color);
|
|
288
|
-
}
|
|
289
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
290
|
-
box-shadow: none;
|
|
291
|
-
}
|
|
292
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
293
|
-
border-top: none;
|
|
294
|
-
}
|
|
295
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
296
|
-
display: none;
|
|
297
|
-
}
|
|
298
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
299
|
-
color: var(--md-default-fg-color);
|
|
300
|
-
position: static;
|
|
301
|
-
height: auto;
|
|
302
|
-
margin: 0 0 0 -0.2rem;
|
|
303
|
-
}
|
|
304
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
305
|
-
padding-top: 0;
|
|
306
|
-
}
|
|
307
|
-
.md-nav--primary .md-nav__item {
|
|
308
|
-
border-top: none;
|
|
309
|
-
}
|
|
310
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
311
|
-
font-size : var(--md-typeset-font-size);
|
|
312
|
-
}
|
|
313
|
-
.md-nav .md-source {
|
|
314
|
-
display: none;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.md-sidebar {
|
|
318
|
-
height: 100%;
|
|
319
|
-
}
|
|
320
|
-
.md-sidebar--primary {
|
|
321
|
-
width: 12.1rem !important;
|
|
322
|
-
z-index: 200;
|
|
323
|
-
left: ${Z.isPinned?`calc(-12.1rem + ${tt})`:"calc(-12.1rem + 72px)"} !important;
|
|
324
|
-
}
|
|
325
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
326
|
-
display: none;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.md-content {
|
|
330
|
-
max-width: 100%;
|
|
331
|
-
margin-left: 0;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.md-header__button {
|
|
335
|
-
margin: 0.4rem 0;
|
|
336
|
-
margin-left: 0.4rem;
|
|
337
|
-
padding: 0;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.md-overlay {
|
|
341
|
-
left: 0;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.md-footer {
|
|
345
|
-
position: static;
|
|
346
|
-
padding-left: 0;
|
|
347
|
-
}
|
|
348
|
-
.md-footer-nav__link {
|
|
349
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
350
|
-
width: 50%;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@media screen and (max-width: 600px) {
|
|
355
|
-
.md-sidebar--primary {
|
|
356
|
-
left: -12.1rem !important;
|
|
357
|
-
width: 12.1rem;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
`;const bt=["h1","h2","h3","h4","h5","h6"];var pt=({theme:y})=>`
|
|
361
|
-
/*================== Typeset ==================*/
|
|
362
|
-
|
|
363
|
-
.md-typeset {
|
|
364
|
-
font-size: var(--md-typeset-font-size);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
${bt.reduce((Z,q)=>{var Y;const we=(Y=y.typography.htmlFontSize)!==null&&Y!==void 0?Y:16,Ae=y.typography[q],{lineHeight:Ye,fontFamily:jt,fontWeight:vt,fontSize:nt}=Ae,Ke=dt=>{let at=1;return typeof dt=="number"&&(at=dt/we*.6),typeof dt=="string"&&(at=dt.replace("rem","")),`calc(${at} * var(--md-typeset-font-size))`};return Z.concat(`
|
|
368
|
-
.md-typeset ${q} {
|
|
369
|
-
color: var(--md-default-fg-color);
|
|
370
|
-
line-height: ${Ye};
|
|
371
|
-
font-family: ${jt};
|
|
372
|
-
font-weight: ${vt};
|
|
373
|
-
font-size: ${Ke(nt)};
|
|
374
|
-
}
|
|
375
|
-
`)},"")}
|
|
376
|
-
|
|
377
|
-
.md-typeset .md-content__button {
|
|
378
|
-
color: var(--md-default-fg-color);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.md-typeset hr {
|
|
382
|
-
border-bottom: 0.05rem dotted ${y.palette.divider};
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
.md-typeset details {
|
|
386
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
387
|
-
}
|
|
388
|
-
.md-typeset details summary {
|
|
389
|
-
padding-left: 2.5rem !important;
|
|
390
|
-
}
|
|
391
|
-
.md-typeset details summary:before,
|
|
392
|
-
.md-typeset details summary:after {
|
|
393
|
-
top: 50% !important;
|
|
394
|
-
width: 20px !important;
|
|
395
|
-
height: 20px !important;
|
|
396
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
397
|
-
}
|
|
398
|
-
.md-typeset details[open] > summary:after {
|
|
399
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.md-typeset blockquote {
|
|
403
|
-
color: var(--md-default-fg-color--light);
|
|
404
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
.md-typeset table:not([class]) {
|
|
408
|
-
font-size: var(--md-typeset-font-size);
|
|
409
|
-
border: 1px solid var(--md-default-fg-color);
|
|
410
|
-
border-bottom: none;
|
|
411
|
-
border-collapse: collapse;
|
|
412
|
-
}
|
|
413
|
-
.md-typeset table:not([class]) th {
|
|
414
|
-
font-weight: bold;
|
|
415
|
-
}
|
|
416
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
417
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
421
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
422
|
-
}
|
|
423
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
424
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
425
|
-
}
|
|
426
|
-
`,Ot=()=>`
|
|
427
|
-
/*================== Animations ==================*/
|
|
428
|
-
/*
|
|
429
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
430
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
431
|
-
*/
|
|
432
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
433
|
-
transition: none;
|
|
434
|
-
}
|
|
435
|
-
`,Ht=({theme:y})=>`
|
|
436
|
-
/*================== Extensions ==================*/
|
|
437
|
-
|
|
438
|
-
/* HIGHLIGHT */
|
|
439
|
-
.highlight .md-clipboard:after {
|
|
440
|
-
content: unset;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.highlight .nx {
|
|
444
|
-
color: ${y.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/* CODE HILITE */
|
|
448
|
-
.codehilite .gd {
|
|
449
|
-
background-color: ${y.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.codehilite .gi {
|
|
453
|
-
background-color: ${y.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/* TABBED */
|
|
457
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
458
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
459
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
460
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
461
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
462
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
463
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
464
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
465
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
466
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
467
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
468
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
469
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
470
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
471
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
472
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
473
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
474
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
475
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
476
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
477
|
-
color: var(--md-accent-fg-color);
|
|
478
|
-
border-color: var(--md-accent-fg-color);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/* TASK-LIST */
|
|
482
|
-
.task-list-control .task-list-indicator::before {
|
|
483
|
-
background-color: ${y.palette.action.disabledBackground};
|
|
484
|
-
}
|
|
485
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
486
|
-
background-color: ${y.palette.success.main};
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
/* ADMONITION */
|
|
490
|
-
.admonition {
|
|
491
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
492
|
-
}
|
|
493
|
-
.admonition .admonition-title {
|
|
494
|
-
padding-left: 2.5rem !important;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.admonition .admonition-title:before {
|
|
498
|
-
top: 50% !important;
|
|
499
|
-
width: 20px !important;
|
|
500
|
-
height: 20px !important;
|
|
501
|
-
transform: translateY(-50%) !important;
|
|
502
|
-
}
|
|
503
|
-
`;const Jt=[Se,Fe,mt,pt,Ot,Ht],Bt=()=>(0,g.Pf)(),un=()=>{const y=Bt(),Z=(0,Le.Z)();return(0,h.useMemo)(()=>{const q={theme:Z,sidebar:y};return Jt.reduce((Y,we)=>Y+we(q),"")},[Z,y])},Yt=()=>{const y=un();return(0,h.useCallback)(Z=>(Z.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${y}</style>`),Z),[y])},pn=(y,Z,q)=>{const Y=y==="src"&&Z.endsWith(".svg"),we=!Z.match(/^([a-z]*:)?\/\//i),Ae=Z.startsWith(q);return Y&&(we||Ae)},Fn=({techdocsStorageApi:y,entityId:Z,path:q})=>async Y=>{const we=await y.getApiOrigin(),Ae=async(Ye,jt)=>{for(const vt of Ye)if(vt.hasAttribute(jt)){const nt=vt.getAttribute(jt);if(!nt)return;const Ke=await y.getBaseUrl(nt,Z,q);if(pn(jt,nt,we))try{const at=await(await fetch(Ke,{credentials:"include"})).text();vt.setAttribute(jt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(at)))}`)}catch{vt.setAttribute("alt",`Error: ${nt}`)}else vt.setAttribute(jt,Ke)}};return await Promise.all([Ae(Y.querySelectorAll("img"),"src"),Ae(Y.querySelectorAll("script"),"src"),Ae(Y.querySelectorAll("source"),"src"),Ae(Y.querySelectorAll("link"),"href"),Ae(Y.querySelectorAll("a[download]"),"href")]),Y};var Pn=r(79158),fn=r(67097),Ln=r(28316),Un=r(82717),tn=r.n(Un);const wn=y=>Z=>{var q;const Y=Z.querySelector('[title="Edit this page"]');if(!Y||!Y.href)return Z;const we=new URL(Y.href),Ae=y.byUrl(we);if((Ae==null?void 0:Ae.type)!=="github"&&(Ae==null?void 0:Ae.type)!=="gitlab")return Z;const Ye=((q=Z.querySelector("article>h1"))===null||q===void 0?void 0:q.childNodes[0].textContent)||"",jt=encodeURIComponent(`Documentation Feedback: ${Ye}`),vt=encodeURIComponent(`Page source:
|
|
504
|
-
${Y.href}
|
|
505
|
-
|
|
506
|
-
Feedback:`),nt=(Ae==null?void 0:Ae.type)==="github"?(0,Pn.BT)(we.href,"blob"):we.href,Ke=tn()(nt),dt=`/${Ke.organization}/${Ke.name}`,at=Y.cloneNode();switch(Ae==null?void 0:Ae.type){case"gitlab":at.href=`${we.origin}${dt}/issues/new?issue[title]=${jt}&issue[description]=${vt}`;break;case"github":at.href=`${we.origin}${dt}/issues/new?title=${jt}&body=${vt}`;break;default:return Z}return Ln.render(h.createElement(fn.Z),at),at.style.paddingLeft="5px",at.title="Leave feedback for this page",at.id="git-feedback-link",Y==null||Y.insertAdjacentElement("beforebegin",at),Z};var Mn=r(44882);const ut=()=>y=>{const Z=y.querySelector('.md-header label[for="__drawer"]'),q=y.querySelector("article");if(!Z||!q)return y;const Y=Z.cloneNode();return Ln.render(h.createElement(Mn.Z),Y),Y.id="toggle-sidebar",Y.title="Toggle Sidebar",Y.classList.add("md-content__button"),Y.style.setProperty("padding","0 0 0 5px"),Y.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),q==null||q.prepend(Y),y},_n=()=>y=>(((q,Y)=>{Array.from(q).filter(we=>we.hasAttribute(Y)).forEach(we=>{const Ae=we.getAttribute(Y);if(Ae){Ae.match(/^https?:\/\//i)&&we.setAttribute("target","_blank");try{const Ye=wt(window.location.href);we.setAttribute(Y,new URL(Ae,Ye).toString())}catch{we.replaceWith(we.textContent||Ae)}}})})(Array.from(y.getElementsByTagName("a")),"href"),y);function wt(y){const Z=new URL(y);return!Z.pathname.endsWith("/")&&!Z.pathname.endsWith(".html")&&(Z.pathname+="/"),Z.toString()}const ct=({baseUrl:y,onClick:Z})=>q=>(Array.from(q.getElementsByTagName("a")).forEach(Y=>{Y.addEventListener("click",we=>{const Ye=Y.getAttribute("href");Ye&&Ye.startsWith(y)&&!Y.hasAttribute("download")&&(we.preventDefault(),Z(we,Ye))})}),q);var vn=r(15459),Kt=r(80030),hn=r(72379),jn=r(41547),ln=r(95074);const Tn=(0,vn.Z)(y=>({tooltip:{fontSize:"inherit",color:y.palette.text.primary,margin:0,padding:y.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Kt.ZP),Ce=()=>(0,t.jsx)(hn.Z,{children:(0,t.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),ce=({text:y})=>{const[Z,q]=(0,h.useState)(!1),[,Y]=(0,ln.Z)(),we=(0,h.useCallback)(()=>{Y(y),q(!0)},[y,Y]),Ae=(0,h.useCallback)(()=>{q(!1)},[q]);return(0,t.jsx)(Tn,{title:"Copied to clipboard",placement:"left",open:Z,onClose:Ae,leaveDelay:1e3,children:(0,t.jsx)(I.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:we,children:(0,t.jsx)(Ce,{})})})},Oe=y=>Z=>{const q=Z.querySelectorAll("pre > code");for(const we of q){var Y;const Ae=we.textContent||"",Ye=document.createElement("div");we==null||(Y=we.parentElement)===null||Y===void 0||Y.prepend(Ye),Ln.render((0,t.jsx)(jn.Z,{theme:y,children:(0,t.jsx)(ce,{text:Ae})}),Ye)}return Z},Me=()=>y=>{var Z;return(Z=y.querySelector(".md-header"))===null||Z===void 0||Z.remove(),y},Xe=()=>y=>{var Z,q;return(Z=y.querySelector(".md-footer .md-copyright"))===null||Z===void 0||Z.remove(),(q=y.querySelector(".md-footer-copyright"))===null||q===void 0||q.remove(),y},se=({onLoading:y,onLoaded:Z})=>q=>(y(),q.addEventListener(W.Ox,function Y(){Z(),q.removeEventListener(W.Ox,Y)}),q),D=()=>y=>(y.addEventListener(W.Ox,function Z(){if(window.location.hash){var q;const Y=window.location.hash.slice(1);(q=y==null?void 0:y.querySelector(`[id="${Y}"]`))===null||q===void 0||q.scrollIntoView()}y.removeEventListener(W.Ox,Z)}),y),me=()=>y=>(setTimeout(()=>{const Z=y==null?void 0:y.querySelectorAll("li.md-nav__item--active");Z.length!==0&&(Z.forEach(Y=>{const we=Y==null?void 0:Y.querySelector("input");we!=null&&we.checked||we==null||we.click()}),Z[Z.length-1].scrollIntoView())},200),y),De=async(y,Z)=>{let q;if(typeof y=="string")q=new DOMParser().parseFromString(y,"text/html").documentElement;else if(y instanceof Element)q=y;else throw new Error("dom is not a recognized type");for(const Y of Z)q=await Y(q);return q};var et=r(73557);function it(y,Z){const q=new URL(Z),Y=`${q.origin}${q.pathname.replace(/\/$/,"")}`,we=y.replace(Y,"").replace(/^\/+/,""),Ae=new URL(`http://localhost/${we}`);return`${Ae.pathname}${Ae.search}${Ae.hash}`}function kt(){const y=(0,et.s0)(),q=(0,T.h_)(T.Ds).getOptionalString("app.baseUrl");return(0,h.useCallback)(we=>{let Ae=we;if(q)try{Ae=it(we,q)}catch{}y(Ae)},[y,q])}const Ft="screen and (max-width: 76.1875em)",Qt=y=>{const Z=kt(),q=(0,Le.Z)(),Y=(0,ze.Z)(Ft),we=_t(),Ae=Yt(),Ye=(0,T.z$)(),jt=(0,T.h_)(W.Dl),vt=(0,T.h_)(z.q3),{state:nt,path:Ke,content:dt}=(0,L.DK)(),[at,Dt]=(0,h.useState)(null),Mt=(0,W.ux)(at),Xt=(0,h.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Lt=>{if(Y)Lt.style.top="0px";else{const Gn=document==null?void 0:document.querySelector(".techdocs-reader-page");var Zt;const ur=(Zt=Gn==null?void 0:Gn.getBoundingClientRect().top)!==null&&Zt!==void 0?Zt:0;var bn;let En=(bn=at.getBoundingClientRect().top)!==null&&bn!==void 0?bn:0;const On=at.querySelector(".md-container > .md-tabs");var zn;const er=(zn=On==null?void 0:On.getBoundingClientRect().height)!==null&&zn!==void 0?zn:0;En<ur&&(En=ur),Lt.style.top=`${Math.max(En,0)+er}px`}Lt.style.setProperty("opacity","1")})},[at,Y]);(0,h.useEffect)(()=>(window.addEventListener("resize",Xt),window.addEventListener("scroll",Xt,!0),()=>{window.removeEventListener("resize",Xt),window.removeEventListener("scroll",Xt,!0)}),[at,Xt]);const en=(0,h.useCallback)(()=>{if(!at)return;const Et=at.querySelector(".md-footer");Et&&(Et.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,h.useEffect)(()=>(window.addEventListener("resize",en),()=>{window.removeEventListener("resize",en)}),[at,en]),(0,h.useEffect)(()=>{Mt||(en(),Xt())},[nt,Mt,en,Xt]);const Ut=(0,h.useCallback)((Et,Lt)=>De(Et,[we,Fn({techdocsStorageApi:jt,entityId:y,path:Lt}),_n(),ut(),Me(),Xe(),wn(vt),Ae]),[y,vt,jt,we,Ae]),zt=(0,h.useCallback)(async Et=>De(Et,[D(),me(),Oe(q),ct({baseUrl:window.location.origin,onClick:(Lt,Zt)=>{var bn;const zn=Lt.ctrlKey||Lt.metaKey,Gn=new URL(Zt),ur=((bn=Lt.target)===null||bn===void 0?void 0:bn.innerText)||Zt,En=Zt.replace(window.location.origin,"");if(Ye.captureEvent("click",ur,{attributes:{to:En}}),Gn.hash)if(zn)window.open(Zt,"_blank");else{var On;Z(Zt),(On=Et==null?void 0:Et.querySelector(`[id="${Gn.hash.slice(1)}"]`))===null||On===void 0||On.scrollIntoView()}else zn?window.open(Zt,"_blank"):Z(Zt)}}),se({onLoading:()=>{},onLoaded:()=>{var Lt;(Lt=Et.querySelector(".md-nav__title"))===null||Lt===void 0||Lt.removeAttribute("for")}}),se({onLoading:()=>{Array.from(Et.querySelectorAll(".md-sidebar")).forEach(Zt=>{Zt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[q,Z,Ye]);return(0,h.useEffect)(()=>{if(!dt)return()=>{};let Et=!0;return Ut(dt,Ke).then(async Lt=>{if(!(Lt!=null&&Lt.innerHTML)||!Et)return;window.scroll({top:0});const Zt=await zt(Lt);Dt(Zt)}),()=>{Et=!1}},[dt,Ke,Ut,zt]),at};var _=r(8560);const J=()=>{const y=(0,W.$L)(),{shadowRoot:Z}=(0,W.x1)(),q=Z==null?void 0:Z.querySelector('[data-md-component="content"]'),Y=Z==null?void 0:Z.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let we=Y==null?void 0:Y.querySelector('[data-techdocs-addons-location="primary sidebar"]');we||(we=document.createElement("div"),we.setAttribute("data-techdocs-addons-location","primary sidebar"),Y==null||Y.prepend(we));const Ae=Z==null?void 0:Z.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ye=Ae==null?void 0:Ae.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ye||(Ye=document.createElement("div"),Ye.setAttribute("data-techdocs-addons-location","secondary sidebar"),Ae==null||Ae.prepend(Ye)),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.Z,{container:we,children:y.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,t.jsx)(_.Z,{container:q,children:y.renderComponentsByLocation(W.oZ.Content)}),(0,t.jsx)(_.Z,{container:Ye,children:y.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},te=(0,H.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),pe=(0,L.m1)(y=>{var Z;const{withSearch:q=!0,onReady:Y}=y,we=te(),{entityMetadata:{value:Ae,loading:Ye},entityRef:jt,setShadowRoot:vt}=(0,W.x1)(),nt=Qt(jt),Ke=(0,h.useCallback)(dt=>{vt(dt),Y instanceof Function&&Y()},[vt,Y]);return Ye===!1&&!Ae?(0,t.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):nt?(0,t.jsx)(g.VY,{children:(0,t.jsxs)(f.Z,{container:!0,children:[(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(oe,{})}),q&&(0,t.jsx)(f.Z,{className:we.search,xs:"auto",item:!0,children:(0,t.jsx)(u.S,{entityId:jt,entityTitle:Ae==null||(Z=Ae.metadata)===null||Z===void 0?void 0:Z.title})}),(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(W.VA,{element:nt,onAppend:Ke,children:(0,t.jsx)(J,{})})})]})}):(0,t.jsx)(g.VY,{children:(0,t.jsx)(f.Z,{container:!0,children:(0,t.jsx)(f.Z,{xs:12,item:!0,children:(0,t.jsx)(oe,{})})})})}),le=null},93225:function(Ct,$e,r){"use strict";r.d($e,{S:function(){return ee}});var t=r(52322),h=r(2784),H=r(18671),f=r(60905),W=r(98069),g=r(60364),u=r(73250),B=r(61886),ve=r(43514),ue=r(25271),V=r(53974),K=r(60871),I=r(76635),w=r(95573);const ie=(0,t.jsx)(W.Z,{animation:"wave",variant:"text",height:40}),ee=ne=>{const{palette:{common:{white:$}}}=(0,g.Z)(),{children:T}=ne,P=(0,B.$L)(),L=(0,K.h_)(K.Ds),{title:O,setTitle:oe,subtitle:Le,setSubtitle:ze,entityRef:z,metadata:{value:yt,loading:ot},entityMetadata:{value:He,loading:st}}=(0,B.x1)();(0,h.useEffect)(()=>{yt&&(oe(yt.site_name),ze(()=>{let{site_description:Se}=yt;return(!Se||Se==="None")&&(Se=""),Se}))},[yt,oe,ze]);const Qe=L.getOptional("app.title")||"Backstage",St=[O,Le,Qe].filter(Boolean).join(" | "),{locationMetadata:It,spec:xt}=He||{},lt=xt==null?void 0:xt.lifecycle,Pt=He?(0,ve.hF)(He,ue.S4):[],Nt=(0,K.tg)(w._Z)(),We=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V.i9,{label:(0,I.capitalize)((He==null?void 0:He.kind)||"entity"),value:(0,t.jsx)(ve.dx,{color:"inherit",entityRef:z,title:He==null?void 0:He.metadata.title,defaultKind:"Component"})}),Pt.length>0&&(0,t.jsx)(V.i9,{label:"Owner",value:(0,t.jsx)(ve.rI,{color:"inherit",entityRefs:Pt,defaultKind:"group"})}),lt?(0,t.jsx)(V.i9,{label:"Lifecycle",value:lt}):null,It&&It.type!=="dir"&&It.type!=="file"?(0,t.jsx)(V.i9,{label:"",value:(0,t.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:$},children:[(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,t.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,t.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:It.target}):null]});return!st&&He===void 0||!ot&&yt===void 0?null:(0,t.jsxs)(V.h4,{type:"Documentation",typeLink:Nt,title:O||ie,subtitle:Le===""?void 0:Le||ie,children:[(0,t.jsx)(H.Z,{titleTemplate:"%s",children:(0,t.jsx)("title",{children:St})}),We,T,P.renderComponentsByLocation(B.oZ.Header)]})}},65124:function(Ct,$e,r){"use strict";r.d($e,{b:function(){return K}});var t=r(52322),h=r(2784),H=r(79692),f=r(15223),W=r(95544),g=r(80030),u=r(61837),B=r(48348),ve=r(47603),ue=r(61886);const V=(0,H.Z)(I=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:I.spacing(3,3,0)}})),K=I=>{const w=V(),[ie,ee]=(0,h.useState)(null),ne=(0,h.useCallback)(Le=>{ee(Le.currentTarget)},[]),$=(0,h.useCallback)(()=>{ee(null)},[]),{entityMetadata:{value:T,loading:P}}=(0,ue.x1)(),L=(0,ue.$L)(),O=L.renderComponentsByLocation(ue.oZ.Subheader),oe=L.renderComponentsByLocation(ue.oZ.Settings);return!O&&!oe||P===!1&&!T?null:(0,t.jsx)(f.Z,{classes:w,...I.toolbarProps,children:(0,t.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[O,oe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.ZP,{title:"Settings",children:(0,t.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ne,children:(0,t.jsx)(ve.Z,{})})}),(0,t.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ie,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ie),onClose:$,keepMounted:!0,children:(0,t.jsx)("div",{children:oe})})]}):null]})})}},95481:function(Ct,$e,r){"use strict";r.d($e,{DK:function(){return K},m1:function(){return w}});var t=r(52322),h=r(2784),H=r(73557),f=r(61886),W=r(60871),g=r(64279),u=r(77446);function B({contentLoading:ie,content:ee,activeSyncState:ne}){return ie||ne==="BUILD_READY_RELOAD"||!ee&&ne==="CHECKING"?"CHECKING":!ee&&ne==="BUILDING"?"INITIAL_BUILD":ee?ne==="BUILDING"?"CONTENT_STALE_REFRESHING":ne==="BUILD_READY"?"CONTENT_STALE_READY":ne==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ve(ie,ee){const ne={...ie};switch(ee.type){case"sync":ee.state==="CHECKING"&&(ne.buildLog=[]),ne.activeSyncState=ee.state,ne.syncError=ee.syncError;break;case"contentLoading":ne.contentLoading=!0,ne.contentError=void 0;break;case"content":typeof ee.path=="string"&&(ne.path=ee.path),ne.contentLoading=!1,ne.content=ee.content,ne.contentError=ee.contentError;break;case"buildLog":ne.buildLog=ne.buildLog.concat(ee.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ne.activeSyncState)&&["contentLoading","content"].includes(ee.type)&&(ne.activeSyncState="UP_TO_DATE",ne.buildLog=[]),ne}function ue(ie,ee,ne,$){var T,P;const[L,O]=(0,h.useReducer)(ve,{activeSyncState:"CHECKING",path:$,contentLoading:!0,buildLog:[]}),oe=(0,W.h_)(f.Dl),{retry:Le}=(0,u.Z)(async()=>{O({type:"contentLoading"});try{const yt=await oe.getEntityDocs({kind:ie,namespace:ee,name:ne},$);return O({type:"content",content:yt,path:$}),yt}catch(yt){O({type:"content",contentError:yt,path:$})}},[oe,ie,ee,ne,$]),ze=(0,h.useRef)({content:void 0,reload:()=>{}});return ze.current={content:L.content,reload:Le},(0,g.default)(async()=>{O({type:"sync",state:"CHECKING"});const yt=setTimeout(()=>{O({type:"sync",state:"BUILDING"})},1e3);try{switch(await oe.syncEntityDocs({kind:ie,namespace:ee,name:ne},He=>{O({type:"buildLog",log:He})})){case"updated":ze.current.content?O({type:"sync",state:"BUILD_READY"}):(ze.current.reload(),O({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":O({type:"sync",state:"UP_TO_DATE"});break;default:O({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ot){O({type:"sync",state:"ERROR",syncError:ot})}finally{clearTimeout(yt)}},[ie,ne,ee,oe,O,ze]),{state:(0,h.useMemo)(()=>B({activeSyncState:L.activeSyncState,contentLoading:L.contentLoading,content:L.content}),[L.activeSyncState,L.content,L.contentLoading]),contentReload:Le,path:L.path,content:L.content,contentErrorMessage:(T=L.contentError)===null||T===void 0?void 0:T.toString(),syncErrorMessage:(P=L.syncError)===null||P===void 0?void 0:P.toString(),buildLog:L.buildLog}}const V=(0,h.createContext)({}),K=()=>(0,h.useContext)(V),I=ie=>{const{children:ee}=ie,{"*":ne=""}=(0,H.UO)(),{entityRef:$}=(0,f.x1)(),{kind:T,namespace:P,name:L}=$,O=ue(T,P,L,ne);return(0,t.jsx)(V.Provider,{value:O,children:ee instanceof Function?ee(O):ee})},w=ie=>ee=>(0,t.jsx)(I,{children:(0,t.jsx)(ie,{...ee})})},95573:function(Ct,$e,r){"use strict";r.d($e,{Fw:function(){return H},_Z:function(){return h},pd:function(){return f}});var t=r(60871);const h=(0,t.NT)({id:"techdocs:index-page"}),H=(0,t.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,t.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Ct,$e,r){"use strict";r.r($e),r.d($e,{TechDocsSearchResultListItem:function(){return ue}});var t=r(52322),h=r(2784),H=r(79692),f=r(49378),W=r(86136),g=r(90436),u=r(53974),B=r(15096);const ve=(0,H.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=V=>{const{result:K,highlight:I,lineClamp:w=5,asListItem:ie=!0,asLink:ee=!0,title:ne,icon:$}=V,T=ve(),P=({children:oe})=>ee?(0,t.jsx)(u.rU,{noTrack:!0,to:K.location,children:oe}):(0,t.jsx)(t.Fragment,{children:oe}),L=()=>{const oe=I!=null&&I.fields.title?(0,t.jsx)(B.FA,{text:I.fields.title,preTag:I.preTag,postTag:I.postTag}):K.title,Le=I!=null&&I.fields.entityTitle?(0,t.jsx)(B.FA,{text:I.fields.entityTitle,preTag:I.preTag,postTag:I.postTag}):K.entityTitle,ze=I!=null&&I.fields.name?(0,t.jsx)(B.FA,{text:I.fields.name,preTag:I.preTag,postTag:I.postTag}):K.name;return K?(0,t.jsx)(f.Z,{className:T.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,t.jsx)(P,{children:ne||(0,t.jsxs)(t.Fragment,{children:[oe," | ",Le!=null?Le:ze," docs"]})}),secondary:(0,t.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:w,overflow:"hidden"},color:"textSecondary",variant:"body2",children:I!=null&&I.fields.text?(0,t.jsx)(B.FA,{text:I.fields.text,preTag:I.preTag,postTag:I.postTag}):K.text})}):null},O=({children:oe})=>ie?(0,t.jsxs)(t.Fragment,{children:[$&&(0,t.jsx)(W.Z,{children:typeof $=="function"?$(K):$}),(0,t.jsx)("div",{className:T.flexContainer,children:oe})]}):(0,t.jsx)(t.Fragment,{children:oe});return(0,t.jsx)(O,{children:(0,t.jsx)(L,{})})}},22478:function(Ct,$e,r){"use strict";r.d($e,{S:function(){return V}});var t=r(52322),h=r(15096),H=r(79692),f=r(27556),W=r(2784),g=r(73557),u=r(55511);const B=(0,H.Z)(K=>({root:{width:"100%"},bar:{padding:K.spacing(1)}})),ve=K=>K==null?void 0:K.document,ue=K=>{const{entityId:I,entityTitle:w,debounceTime:ie=150}=K,[ee,ne]=(0,W.useState)(!1),$=(0,g.s0)(),{setFilters:T,result:{loading:P,value:L}}=(0,h.Rx)(),O=B(),[oe,Le]=(0,W.useState)([]);(0,W.useEffect)(()=>{let He=!0;if(He&&L){const st=L.results.slice(0,10);Le(st)}return()=>{He=!1}},[P,L]);const{kind:ze,name:z,namespace:yt}=I;(0,W.useEffect)(()=>{T(He=>({...He,kind:ze,namespace:yt,name:z}))},[ze,yt,z,T]);const ot=(He,st)=>{if(ve(st)){const{location:Qe}=st.document;$(Qe)}};return(0,t.jsx)(f.Z,{className:O.bar,variant:"outlined",children:(0,t.jsx)(h.qO,{classes:{root:O.root},"data-testid":"techdocs-search-bar",size:"small",open:ee,getOptionLabel:()=>"",filterOptions:He=>He,onClose:()=>{ne(!1)},onFocus:()=>{ne(!0)},onChange:ot,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:oe,renderOption:({document:He,highlight:st})=>(0,t.jsx)(u.TechDocsSearchResultListItem,{result:He,lineClamp:3,asListItem:!1,asLink:!1,title:He.title,highlight:st}),loading:P,inputDebounceTime:ie,inputPlaceholder:`Search ${w||I.name} docs`,freeSolo:!1})})},V=K=>{const I={term:"",types:["techdocs"],pageCursor:"",filters:K.entityId};return(0,t.jsx)(h.Nd,{initialState:I,children:(0,t.jsx)(ue,{...K})})}},53260:function(){}},function(Ct){var $e=function(t){return Ct(Ct.s=t)};Ct.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return $e(6290)});var r=Ct.O()}]);})();
|
|
507
|
-
|
|
508
|
-
//# sourceMappingURL=main.7a6c2e51.js.map
|