@techdocs/cli 1.4.2 → 1.4.3-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/.config-schema.json +1 -1
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.8b636047.chunk.js → 1032.5432dbdc.chunk.js} +1 -1
- package/dist/embedded-app/static/1032.5432dbdc.chunk.js.map +1 -0
- package/dist/embedded-app/static/1049.afc49325.chunk.js +7 -0
- package/dist/embedded-app/static/1049.afc49325.chunk.js.map +1 -0
- package/dist/embedded-app/static/{1105.82a0fd7f.chunk.js → 1105.7118905d.chunk.js} +1 -1
- package/dist/embedded-app/static/{2440.5e8d7e92.chunk.js.map → 1105.7118905d.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.44692312.chunk.js → 184.40770c0f.chunk.js} +1 -1
- package/dist/embedded-app/static/{1105.82a0fd7f.chunk.js.map → 184.40770c0f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.5e8d7e92.chunk.js → 2440.bdaada5b.chunk.js} +1 -1
- package/dist/embedded-app/static/2440.bdaada5b.chunk.js.map +1 -0
- package/dist/embedded-app/static/{5458.b84b2f47.chunk.js → 5458.e13e6e9a.chunk.js} +1 -1
- package/dist/embedded-app/static/5458.e13e6e9a.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.ec9ef0a5.chunk.js} +1 -1
- package/dist/embedded-app/static/9323.ec9ef0a5.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9545.262ef793.chunk.js → 9545.98667b5e.chunk.js} +1 -1
- package/dist/embedded-app/static/9545.98667b5e.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9770.86ef0a38.chunk.js → 9770.250ea1f4.chunk.js} +1 -1
- package/dist/embedded-app/static/9770.250ea1f4.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.1628d687.js +508 -0
- package/dist/embedded-app/static/main.1628d687.js.map +1 -0
- 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.0ec85351.js +51 -0
- package/dist/embedded-app/static/module-material-ui.0ec85351.js.map +1 -0
- package/dist/embedded-app/static/module-octokit.95dab40d.js +5 -0
- package/dist/embedded-app/static/module-octokit.95dab40d.js.map +1 -0
- package/dist/embedded-app/static/{runtime.7a6c2e51.js → runtime.1628d687.js} +2 -2
- package/dist/embedded-app/static/{runtime.7a6c2e51.js.map → runtime.1628d687.js.map} +1 -1
- package/dist/embedded-app/static/vendor.1628d687.js +212 -0
- package/dist/embedded-app/static/vendor.1628d687.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- 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/vendor.7a6c2e51.js +0 -252
- package/dist/embedded-app/static/vendor.7a6c2e51.js.map +0 -1
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(Ct,Be,n){"use strict";n.d(Be,{n3:function(){return g},MS:function(){return ye}});var r=n(87612),p=n(25271),H=n(23054),f=n(96279),W=n.n(f);const g=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function d(ue){return!ue.cursor}function B(ue){return!d(ue)}class ye{async getEntityAncestors(V,Y){const{kind:I,namespace:E,name:oe}=(0,p.of)(V.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(E)}/${encodeURIComponent(oe)}/ancestry`,Y)}async getLocationById(V,Y){return await this.requestOptional("GET",`/locations/${encodeURIComponent(V)}`,Y)}async getEntities(V,Y){const{filter:I=[],fields:E=[],order:oe,offset:ee,limit:te,after:Z}=V!=null?V:{},R=this.getParams(I);if(E.length&&R.push(`fields=${E.map(encodeURIComponent).join(",")}`),oe)for(const se of[oe].flat())se&&R.push(`order=${encodeURIComponent(se.order)}:${encodeURIComponent(se.field)}`);ee!==void 0&&R.push(`offset=${ee}`),te!==void 0&&R.push(`limit=${te}`),Z!==void 0&&R.push(`after=${encodeURIComponent(Z)}`);const P=R.length?`?${R.join("&")}`:"",L=await this.requestRequired("GET",`/entities${P}`,Y),k=(se,Le)=>{var ze,z;if(((ze=se.metadata)===null||ze===void 0?void 0:ze.name)===void 0||se.kind===void 0||((z=Le.metadata)===null||z===void 0?void 0:z.name)===void 0||Le.kind===void 0)return 0;const vt=(0,p.eE)(se),rt=(0,p.eE)(Le);return vt<rt?-1:vt>rt?1:0};return{items:L.sort(k)}}async getEntitiesByRefs(V,Y){var I;const E={entityRefs:V.entityRefs};!((I=V.fields)===null||I===void 0)&&I.length&&(E.fields=V.fields);const ee=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,te=await this.fetchApi.fetch(ee,{headers:{"Content-Type":"application/json",...(Y==null?void 0:Y.token)&&{Authorization:`Bearer ${Y==null?void 0:Y.token}`}},method:"POST",body:JSON.stringify(E)});if(!te.ok)throw await H.VL.fromResponse(te);const{items:Z}=await te.json();return{items:Z.map(R=>R!=null?R:void 0)}}async queryEntities(V={},Y){const I=[];if(d(V)){var E,oe;const{fields:te=[],filter:Z,limit:R,orderFields:P,fullTextFilter:L}=V;I.push(...this.getParams(Z)),R!==void 0&&I.push(`limit=${R}`),P!==void 0&&(Array.isArray(P)?P:[P]).forEach(({field:se,order:Le})=>I.push(`orderField=${se},${Le}`)),te.length&&I.push(`fields=${te.map(encodeURIComponent).join(",")}`);const k=L==null||(E=L.term)===null||E===void 0?void 0:E.trim();k&&I.push(`fullTextFilterTerm=${k}`),!(L==null||(oe=L.fields)===null||oe===void 0)&&oe.length&&I.push(`fullTextFilterFields=${L.fields.join(",")}`)}else{const{fields:te=[],limit:Z,cursor:R}=V;I.push(`cursor=${R}`),Z!==void 0&&I.push(`limit=${Z}`),te.length&&I.push(`fields=${te.map(encodeURIComponent).join(",")}`)}const ee=I.length?`?${I.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${ee}`,Y)}async getEntityByRef(V,Y){const{kind:I,namespace:E,name:oe}=(0,p.of)(V);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(E)}/${encodeURIComponent(oe)}`,Y)}async getEntityByName(V,Y){const{kind:I,namespace:E="default",name:oe}=V;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(I)}/${encodeURIComponent(E)}/${encodeURIComponent(oe)}`,Y)}async refreshEntity(V,Y){const I=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(Y==null?void 0:Y.token)&&{Authorization:`Bearer ${Y==null?void 0:Y.token}`}},method:"POST",body:JSON.stringify({entityRef:V})});if(I.status!==200)throw new Error(await I.text())}async getEntityFacets(V,Y){const{filter:I=[],facets:E}=V,oe=this.getParams(I);for(const te of E)oe.push(`facet=${encodeURIComponent(te)}`);const ee=oe.length?`?${oe.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${ee}`,Y)}async addLocation(V,Y){const{type:I="url",target:E,dryRun:oe}=V,ee=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${oe?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(Y==null?void 0:Y.token)&&{Authorization:`Bearer ${Y==null?void 0:Y.token}`}},method:"POST",body:JSON.stringify({type:I,target:E})});if(ee.status!==201)throw new Error(await ee.text());const{location:te,entities:Z,exists:R}=await ee.json();if(!te)throw new Error(`Location wasn't added: ${E}`);return{location:te,entities:Z,exists:R}}async getLocationByRef(V,Y){return(await this.requestRequired("GET","/locations",Y)).map(E=>E.data).find(E=>V===(0,p.NZ)(E))}async removeLocationById(V,Y){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(V)}`,Y)}async removeEntityByUid(V,Y){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(V)}`,Y)}async validateEntity(V,Y,I){const E=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:Y})});if(E.ok)return{valid:!0};if(E.status!==400)throw await H.VL.fromResponse(E);const{errors:oe=[]}=await E.json();return{valid:!1,errors:oe}}async requestIgnored(V,Y,I){const E=`${await this.discoveryApi.getBaseUrl("catalog")}${Y}`,oe=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(E,{method:V,headers:oe});if(!ee.ok)throw await H.VL.fromResponse(ee)}async requestRequired(V,Y,I){const E=`${await this.discoveryApi.getBaseUrl("catalog")}${Y}`,oe=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(E,{method:V,headers:oe});if(!ee.ok)throw await H.VL.fromResponse(ee);return ee.json()}async requestOptional(V,Y,I){const E=`${await this.discoveryApi.getBaseUrl("catalog")}${Y}`,oe=I!=null&&I.token?{Authorization:`Bearer ${I.token}`}:{},ee=await this.fetchApi.fetch(E,{method:V,headers:oe});if(!ee.ok){if(ee.status===404)return;throw await H.VL.fromResponse(ee)}return await ee.json()}getParams(V=[]){const Y=[];for(const I of[V].flat()){const E=[];for(const[oe,ee]of Object.entries(I))for(const te of[ee].flat())te===g?E.push(encodeURIComponent(oe)):typeof te=="string"&&E.push(`${encodeURIComponent(oe)}=${encodeURIComponent(te)}`);E.length&&Y.push(`filter=${E.join(",")}`)}return Y}constructor(V){(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.discoveryApi=V.discoveryApi,this.fetchApi=V.fetchApi||{fetch:W()}}}},25271:function(Ct,Be,n){"use strict";n.d(Be,{Tf:function(){return H},P1:function(){return dn},q1:function(){return Ln},M6:function(){return we},l2:function(){return p},zG:function(){return r},w$:function(){return $n},nP:function(){return mn},aS:function(){return _n},S4:function(){return Dt},cz:function(){return ct},iB:function(){return bt},CV:function(){return Qe},of:function(){return At},Ou:function(){return ke},eE:function(){return yt},NZ:function(){return Me}});const r="default",p="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 d=n(76635),B=n.n(d);class ye{async enforce(N){return N.metadata.namespace?N:lodash.merge({metadata:{namespace:this.namespace}},N)}constructor(N=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=N}}class ue{static isValidPrefixAndOrSuffix(N,me,$e,Ge){if(typeof N!="string")return!1;const et=N.split(me);return et.length===1?Ge(et[0]):et.length===2?$e(et[0])&&Ge(et[1]):!1}static isJsonSafe(N){try{return B().isEqual(N,JSON.parse(JSON.stringify(N)))}catch{return!1}}static isValidDnsSubdomain(N){return typeof N=="string"&&N.length>=1&&N.length<=253&&N.split(".").every(ue.isValidDnsLabel)}static isValidDnsLabel(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(N)}static isValidTag(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(N)}static isValidUrl(N){if(typeof N!="string")return!1;try{return new URL(N),!0}catch{return!1}}static isValidString(N){var me;return typeof N=="string"&&((me=N==null?void 0:N.trim())===null||me===void 0?void 0:me.length)>=1}static isNonEmptyString(N){var me;return typeof N=="string"&&((me=N==null?void 0:N.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}}}}}'),Y=n(27991),I=n.n(Y),E=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),oe=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),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 te=new Map,Z=[V,E,oe,ee];function R(re){if(!(re!=null&&re.length))throw new TypeError("Unknown error");const N=re[0];throw new TypeError(`${N.instancePath||"<root>"} ${N.message}${N.params?` - ${Object.entries(N.params).map(([me,$e])=>`${me}: ${$e}`).join(", ")}`:""}`)}function P(re,N={}){var me;const $e=(me=N==null?void 0:N.disableCache)!==null&&me!==void 0?me:!1,Ge=$e?"":JSON.stringify(re);if(!$e){const tn=te.get(Ge);if(tn)return tn}const et=L(re),$t=new(I())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});et.length&&$t.addSchema(et,void 0,void 0,!0);const zt=$t.compile(re);return $e||te.set(Ge,zt),zt}function L(re){if(typeof re!="object")return[];const N=new Set;re.$id&&N.add(re.$id);const me=new Array,$e=[re];for(;$e.length;){const Ge=$e.pop();for(const et of k(Ge))if(!N.has(et)){N.add(et);const $t=Z.find(zt=>zt.$id===et);$t&&(me.push($t),$e.push($t))}}return me}function*k(re){const N=[re];for(;N.length;){const me=N.pop();if(typeof me=="object"&&me)for(const[$e,Ge]of Object.entries(me))$e==="$ref"&&typeof Ge=="string"?yield Ge.split("#")[0]:N.push(Ge)}}function se(re){const N=compileAjvSchema(re||entityEnvelopeSchema);return me=>{if(N(me)===!0)return me;throw throwAjvError(N.errors)}}function Le(re){const N=P(re);return me=>{var $e;if(N(me)===!0)return me;const et=($e=N.errors)===null||$e===void 0?void 0:$e.filter($t=>["/kind","/apiVersion"].includes($t.instancePath));if(et!=null&&et.length&&et.every($t=>$t.keyword==="enum"))return!1;throw R(N.errors)}}function ze(re){const N=compileAjvSchema(re||entitySchema);return me=>{if(N(me)===!0)return me;throw throwAjvError(N.errors)}}class z{static isValidApiVersion(N){return ue.isValidPrefixAndOrSuffix(N,"/",ue.isValidDnsSubdomain,me=>me.length>=1&&me.length<=63&&/^[a-z0-9A-Z]+$/.test(me))}static isValidKind(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(N)}static isValidObjectName(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(N)}static isValidNamespace(N){return ue.isValidDnsLabel(N)}static isValidLabelKey(N){return ue.isValidPrefixAndOrSuffix(N,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidLabelValue(N){return N===""||z.isValidObjectName(N)}static isValidAnnotationKey(N){return ue.isValidPrefixAndOrSuffix(N,"/",ue.isValidDnsSubdomain,z.isValidObjectName)}static isValidAnnotationValue(N){return typeof N=="string"}}const vt={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:re=>typeof re=="string"&&re.length>=1&&re.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(re)};function rt(re={}){return{...vt,...re}}class He{async enforce(N){function me(ae,y,$){if(y==null)throw new Error(`${ae} must have a value`);let X;try{X=$(y)}catch(K){throw new Error(`${ae} could not be validated, ${K}`)}if(!X){let K;switch($.name){case"isValidLabelValue":case"isValidObjectName":K="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":K="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":K="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":K="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":K="a string";break;case"isValidKind":K="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":K="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":K="a non empty string";break;default:K=void 0;break}const je=K?` expected ${K} but found "${y}".`:"";throw new Error(`"${ae}" is not valid;${je} 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 $e(ae,y,$){return y===void 0||me(ae,y,$)}me("apiVersion",N.apiVersion,this.validators.isValidApiVersion),me("kind",N.kind,this.validators.isValidKind),me("metadata.name",N.metadata.name,this.validators.isValidEntityName),$e("metadata.namespace",N.metadata.namespace,this.validators.isValidNamespace);var Ge;for(const[ae,y]of Object.entries((Ge=N.metadata.labels)!==null&&Ge!==void 0?Ge:[]))me(`labels.${ae}`,ae,this.validators.isValidLabelKey),me(`labels.${ae}`,y,this.validators.isValidLabelValue);var et;for(const[ae,y]of Object.entries((et=N.metadata.annotations)!==null&&et!==void 0?et:[]))me(`annotations.${ae}`,ae,this.validators.isValidAnnotationKey),me(`annotations.${ae}`,y,this.validators.isValidAnnotationValue);var $t;const zt=($t=N.metadata.tags)!==null&&$t!==void 0?$t:[];for(let ae=0;ae<zt.length;++ae)me(`tags.${ae}`,zt[ae],this.validators.isValidTag);var tn;const q=(tn=N.metadata.links)!==null&&tn!==void 0?tn:[];for(let ae=0;ae<q.length;++ae){var J,ie,pe;me(`links.${ae}.url`,(J=q[ae])===null||J===void 0?void 0:J.url,CommonValidatorFunctions.isValidUrl),$e(`links.${ae}.title`,(ie=q[ae])===null||ie===void 0?void 0:ie.title,CommonValidatorFunctions.isNonEmptyString),$e(`links.${ae}.icon`,(pe=q[ae])===null||pe===void 0?void 0:pe.icon,KubernetesValidatorFunctions.isValidObjectName)}return N}constructor(N=makeValidator()){_define_property(this,"validators",void 0),this.validators=N}}class tt{async enforce(N){if(!this.validate){const Ge=new Ajv({allowUnionTypes:!0});this.validate=Ge.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(N)===!0)return N;const[$e]=this.validate.errors||[];throw $e?new Error(`Malformed envelope, ${$e.instancePath||"<root>"} ${$e.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function Je(re){let N=re.indexOf(":");const me=re.indexOf("/");me!==-1&&me<N&&(N=-1);const $e=N===-1?void 0:re.slice(0,N),Ge=me===-1?void 0:re.slice(N+1,me),et=re.slice(Math.max(N+1,me+1));if($e===""||Ge===""||et==="")throw new TypeError(`Entity reference "${re}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:$e,namespace:Ge,name:et}}function bt(re){return{kind:re.kind,namespace:re.metadata.namespace||r,name:re.metadata.name}}function At(re,N){if(!re)throw new Error("Entity reference must not be empty");const me=N==null?void 0:N.defaultKind,$e=(N==null?void 0:N.defaultNamespace)||r;let Ge,et,$t;if(typeof re=="string"){const ie=Je(re);var zt;Ge=(zt=ie.kind)!==null&&zt!==void 0?zt:me;var tn;et=(tn=ie.namespace)!==null&&tn!==void 0?tn:$e,$t=ie.name}else{var q;Ge=(q=re.kind)!==null&&q!==void 0?q:me;var J;et=(J=re.namespace)!==null&&J!==void 0?J:$e,$t=re.name}if(Ge)if(et){if(!$t){const ie=JSON.stringify(re);throw new Error(`Entity reference ${ie} had missing or empty name`)}}else{const ie=JSON.stringify(re);throw new Error(`Entity reference ${ie} had missing or empty namespace`)}else{const ie=JSON.stringify(re);throw new Error(`Entity reference ${ie} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Ge,namespace:et,name:$t}}function yt(re){let N,me,$e;if("metadata"in re){N=re.kind;var Ge;me=(Ge=re.metadata.namespace)!==null&&Ge!==void 0?Ge:r,$e=re.metadata.name}else{N=re.kind;var et;me=(et=re.namespace)!==null&&et!==void 0?et:r,$e=re.name}return`${N.toLocaleLowerCase("en-US")}:${me.toLocaleLowerCase("en-US")}/${$e.toLocaleLowerCase("en-US")}`}var ot=n(87612);class It{async enforce(N){let me=N;for(const $e of this.policies){const Ge=await $e.enforce(me);if(!Ge)throw new Error(`Policy ${$e.constructor.name} did not return a result`);me=Ge}return me}constructor(N){(0,ot._)(this,"policies",void 0),this.policies=N}}class Mt{async enforce(N){for(const me of this.policies){const $e=await me.enforce(N);if($e)return $e}throw new Error("The entity did not match any known policy")}constructor(N){(0,ot._)(this,"policies",void 0),this.policies=N}}const Ve={allOf(re){return new It(re)},oneOf(re){return new Mt(re)}};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(re){let N;return{async check(me){return N||(N=Le(re)),N(me)===me}}}const Se=ge(_t);var Ne=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 qe=ge(Ne);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 xt=ge(mt);var ut=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(ut);var Kt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const qt=ge(Kt),Dt="ownedBy",hn="ownerOf",Xt="consumesApi",gn="apiConsumedBy",zn="providesApi",Bn="apiProvidedBy",mn="dependsOn",$n="dependencyOf",Wn="parentOf",rn="childOf",Tn="memberOf",Vn="hasMember",ct="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 at=ge(wt);var xn=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 Jt=ge(xn);var pn=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 Rn=ge(pn),dn="backstage.io/managed-by-location",Ln="backstage.io/managed-by-origin-location",we="backstage.io/source-location",le=/^[\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 ke(re){if(typeof re!="string")throw new TypeError(`Unable to parse location ref '${re}', unexpected argument ${typeof re}`);const N=re.indexOf(":");if(N<0)throw new TypeError(`Unable to parse location ref '${re}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const me=re.substring(0,N).trim(),$e=re.substring(N+1).trim();if(!me||!$e)throw new TypeError(`Unable to parse location ref '${re}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(me==="http"||me==="https")throw new TypeError(`Invalid location ref '${re}', please prefix it with 'url:', e.g. 'url:${re}'`);if(le.test($e))throw new TypeError(`Invalid location ref '${re}', target is a javascript: URL`);return{type:me,target:$e}}function Me(re){const{type:N,target:me}=re;if(N){if(!me)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(le.test(me))throw new TypeError(`Invalid location ref '${N}:${me}', target is a javascript: URL`);return`${N}:${me}`}function Qe(re){var N,me,$e,Ge,et;const $t=(et=(N=re.metadata)===null||N===void 0||(me=N.annotations)===null||me===void 0?void 0:me[we])!==null&&et!==void 0?et:($e=re.metadata)===null||$e===void 0||(Ge=$e.annotations)===null||Ge===void 0?void 0:Ge[dn];if(!$t)throw new Error(`Entity '${yt(re)}' is missing location`);return ke($t)}},15332:function(Ct,Be,n){"use strict";n.d(Be,{r:function(){return L}});var r=n(52322),p=n(60871),H=n(86689),f=n(79692),W=n(90436),g=n(72779),d=n.n(g),B=n(76635),ye=n(2784),ue=n(73557),V=n(71597);function Y(){const[k]=(0,ue.is)((0,r.jsx)(ue.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!k.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"}),E=k=>/^([a-z+.-]+):/.test(k),oe=/^[\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 k=function(...Le){const ze=String(Le[0]);if(oe.test(ze))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return ee.apply(this,Le)};k.__backstage=!0,window.open=k}const te=()=>{try{return(0,p.h_)(p.Ds).getOptionalString("app.baseUrl")}catch{return}},Z=()=>{const k="http://sample.dev";var se;const Le=(se=te())!==null&&se!==void 0?se:"/",{pathname:ze}=new URL(Le,k);return(0,B.trimEnd)(ze,"/")},R=k=>{let se=String(k);const Le=Z(),ze=E(se),z=se.startsWith(Le);return!ze&&!z&&(se=Le.concat(se)),se},P=k=>{if(k instanceof Array)return k.map(P).join(" ").trim();if(typeof k=="object"&&k){var se;return P(k==null||(se=k.props)===null||se===void 0?void 0:se.children)}return["string","number"].includes(typeof k)?String(k):""},L=ye.forwardRef(({onClick:k,noTrack:se,...Le},ze)=>{const z=I(),vt=(0,p.z$)(),rt=Y()?R(Le.to):Le.to,He=P(Le.children)||rt,tt=E(rt),Je=tt&&!!/^https?:/.exec(rt);if(oe.test(rt))throw new Error("Link component rejected javascript: URL as a security precaution");const bt=At=>{k==null||k(At),se||vt.captureEvent("click",He,{attributes:{to:rt}})};return tt?(0,r.jsxs)(H.Z,{...Je?{target:"_blank",rel:"noopener"}:{},...Le,...Le["aria-label"]?{"aria-label":`${Le["aria-label"]}, Opens in a new window`}:{},ref:ze,href:rt,onClick:bt,className:d()(z.externalLink,Le.className),children:[Le.children,(0,r.jsx)(W.Z,{component:"span",className:z.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(H.Z,{...Le,ref:ze,component:V.rU,to:rt,onClick:bt})})},53974:function(Ct,Be,n){"use strict";n.d(Be,{Oi:function(){return Le},VY:function(){return Ys},yW:function(){return Gi},XF:function(){return rt},mn:function(){return $n},NX:function(){return It},ub:function(){return le},mf:function(){return Ja},yu:function(){return lt},h4:function(){return Pa},M6:function(){return c},i9:function(){return il},aR:function(){return Js},rJ:function(){return wr},Oh:function(){return hl},hu:function(){return cl},rU:function(){return ue.r},Qj:function(){return Y},nU:function(){return pr},SA:function(){return lo},sk:function(){return et},Or:function(){return Fo},T3:function(){return La},g9:function(){return gl},Ex:function(){return Dr},Gk:function(){return Wt},tn:function(){return Qs},Ph:function(){return xo},YE:function(){return Io},v7:function(){return Gs},R6:function(){return Pi},tR:function(){return ji},uw:function(){return Ui},qt:function(){return gi},iA:function(){return rr},GB:function(){return ht},po:function(){return Er},mZ:function(){return ss},Pf:function(){return Ao}});var r=n(52322),p=n(60871),H=n(19928),f=n(2784);function W(e){const[o,l]=useState([]),u=useApi(alertApiRef),{anchorOrigin:m={vertical:"top",horizontal:"center"},transientTimeoutMs:v}=e,T=v!=null?v:5e3;useEffect(()=>{const M=u.alert$().subscribe(fe=>l(he=>he.concat(fe)));return()=>{M.unsubscribe()}},[u]);const[U]=o;if(useEffect(()=>{if(U&&U.display==="transient"){const M=setTimeout(()=>{l(fe=>{const he=fe.filter(Pe=>Pe!==U);return he.length===fe.length?fe:he})},T);return()=>clearTimeout(M)}},[U,T]),o.length===0)return null;const G=()=>{l(M=>M.filter(fe=>fe!==U))};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:U.severity,children:_jsxs(Typography,{component:"span",children:[String(U.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var g=n(79692);const d=(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:u}=e,m=d();let v={...u};const T={fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight};return l||(v={backgroundColor:stringToColor(o||""),...u}),_jsx(MaterialAvatar,{alt:o,src:l,className:m.avatar,style:v,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:m.avatarText,style:T,children:extractInitials(o)})})}var ye=n(77277),ue=n(15332);const V=f.forwardRef((e,o)=>(0,r.jsx)(ue.r,{ref:o,...e,color:"initial"})),Y=f.forwardRef((e,o)=>(0,r.jsx)(ye.Z,{ref:o,component:V,...e})),I=null;var E=n(95544),oe=n(60364),ee=n(83229),te=n(26639),Z=n(39595),R=n(61837),P=n(80030),L=n(19353),k=n(95074);function se(e){const{text:o,tooltipDelay:l=1e3,tooltipText:u="Text copied to clipboard","aria-label":m="Copy text"}=e,v=(0,p.h_)(p.VE),[T,U]=(0,f.useState)(!1),[{error:G},M]=(0,k.Z)();(0,f.useEffect)(()=>{G&&v.post(G)},[G,v]);const fe=he=>{he.stopPropagation(),U(!0),M(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(P.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:l,onClose:()=>U(!1),open:T,children:(0,r.jsx)(R.Z,{onClick:fe,"aria-label":m,children:(0,r.jsx)(L.Z,{})})})})}function Le(e){const{text:o,language:l,showLineNumbers:u=!1,highlightedNumbers:m,customStyle:v,showCopyCodeButton:T=!1}=e,U=(0,oe.Z)(),G=U.palette.type==="dark"?te.Z:Z.Z,M=U.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(E.Z,{position:"relative",children:[(0,r.jsx)(ee.Z,{customStyle:v,language:l,style:G,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:U.palette.textVerySubtle},lineProps:fe=>m!=null&&m.includes(fe)?{style:{backgroundColor:M}}:{},children:o}),T&&(0,r.jsx)(E.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(se,{text:o})})]})}var ze=n(41156),z=n(71597),vt=n(88188);function rt(e){const{title:o,to:l}=e,u=(0,ze.Z)(m=>m.breakpoints.down("xs"));return l?u?(0,r.jsx)(R.Z,{component:z.rU,color:"primary",title:o,size:"small",to:l,children:(0,r.jsx)(vt.Z,{})}):(0,r.jsx)(ye.Z,{component:z.rU,variant:"contained",color:"primary",to:l,children:o}):null}var He=n(27397),tt=n(11105),Je=n(97963),bt=n(46506),At=n.n(bt),yt=n(54073),ot=n.n(yt),It;(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 u;(function(v){v.NETWORK_SIMPLEX="network-simplex",v.TIGHT_TREE="tight-tree",v.LONGEST_PATH="longest-path"})(u=e.Ranker||(e.Ranker={}));let m;(function(v){v.LEFT="l",v.RIGHT="r",v.CENTER="c"})(m=e.LabelPosition||(e.LabelPosition={}))})(It||(It={}));var Mt=n(10368);const Ve=(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=Ve(),[l,u]=f.useState(0),[m,v]=f.useState(0),T=f.useRef(null);f.useLayoutEffect(()=>{if(T.current){let{height:fe,width:he}=T.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==l)&&(u(he),v(fe))}},[l,m]);const U=10,G=l+U*2,M=m+U*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:o.node,width:G,height:M,rx:10}),(0,r.jsx)("text",{ref:T,className:o.text,y:M/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const ge="arrow-marker",Se="node",Ne="edge",qe="label",mt=(0,Mt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),xt=e=>(0,r.jsx)(_t,{...e});function ut({render:e=xt,setNode:o,node:l}){const{width:u,height:m,x:v=0,y:T=0}=l,U=l,G=mt(),M=f.useRef(null);return f.useLayoutEffect(()=>{if(M.current){let{height:fe,width:he}=M.current.getBBox();fe=Math.round(fe),he=Math.round(he),(fe!==m||he!==u)&&o(l.id,{...l,height:fe,width:he})}},[l,u,m,o]),(0,r.jsx)("g",{ref:M,"data-testid":Se,className:G.node,transform:`translate(${v-u/2},${T-m/2})`,children:e({node:U})})}var Ot=n(76985),Kt=n(39829),qt=n(19574),Dt=n.n(qt);const hn=(0,Mt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Xt({edge:{label:e}}){const o=hn();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const gn=(0,Mt.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"}),zn=e=>(0,r.jsx)(Xt,{...e});function Bn({render:e=zn,setEdge:o,id:l,edge:u,curve:m}){const{x:v=0,y:T=0,width:U,height:G,points:M}=u,fe=u,he=gn(),Pe=f.useRef(null);f.useLayoutEffect(()=>{if(Pe.current){let{height:Xe,width:Gt}=Pe.current.getBBox();Xe=Math.round(Xe),Gt=Math.round(Gt),(Xe!==G||Gt!==U)&&o(l,{...u,height:Xe,width:Gt})}},[u,G,U,o,l]);let Te="";const Ue=f.useMemo(()=>Ot.Z().x(Xe=>Xe.x).y(Xe=>Xe.y).curve(Kt[m]),[m]);if(M){const Xe=M.filter(Gt=>Dt()(Gt.x)&&Dt()(Gt.y));Te=Ue(Xe)||""}return(0,r.jsxs)(r.Fragment,{children:[Te&&(0,r.jsx)("path",{"data-testid":Ne,className:he.path,d:Te}),fe.label?(0,r.jsx)("g",{ref:Pe,"data-testid":qe,className:he.label,transform:`translate(${v},${T})`,children:e({edge:fe})}):null]})}const mn="workspace";function $n(e){var o,l;const{edges:u,nodes:m,renderNode:v,direction:T=It.Direction.TOP_BOTTOM,align:U,nodeMargin:G=50,edgeMargin:M=10,rankMargin:fe=50,paddingX:he=0,paddingY:Pe=0,acyclicer:Te,ranker:Ue=It.Ranker.NETWORK_SIMPLEX,labelPosition:Xe=It.LabelPosition.RIGHT,labelOffset:Gt=10,edgeRanks:un=1,edgeWeight:Nn=1,renderLabel:or,defs:Nt,zoom:ln="enabled",curve:cn="curveMonotoneX",fit:ur="grow",...mr}=e,vr=(0,Je.Z)(),[yr,ps]=f.useState(100),[zr,Xi]=f.useState(100),sn=f.useRef(new(At()).graphlib.Graph),[Bo,ni]=f.useState(((o=sn.current.graph())===null||o===void 0?void 0:o.width)||0),[Wr,qi]=f.useState(((l=sn.current.graph())===null||l===void 0?void 0:l.height)||0),[Un,Tr]=f.useState([]),[no,ro]=f.useState([]),vn=Math.max(Bo,yr),An=Math.max(Wr,zr),$o=Math.min(Wr,zr),oo=ur==="grow"?An:$o,fs=f.useMemo(()=>ot()(Cn=>{if(!Cn)return;const Mn=tt.Z(Cn),yn=tt.Z(Cn.getElementById(mn));function xr(){Mn.call(He.sP().scaleExtent([1,10]).on("zoom",kr=>{kr.transform.x=Math.min(0,Math.max(kr.transform.x,vn-vn*kr.transform.k)),kr.transform.y=Math.min(0,Math.max(kr.transform.y,An-An*kr.transform.k)),yn.attr("transform",kr.transform)}))}ln==="enabled"?xr():ln==="enable-on-click"&&Mn.on("click",()=>xr());const{width:br,height:ri}=Cn.getBoundingClientRect();yr!==br&&ps(br),zr!==ri&&Xi(ri)},100),[zr,yr,vn,An,ln]),Fa=f.useCallback(()=>{const Cn=sn.current.nodes(),Mn=sn.current.edges();Cn.forEach(yn=>{m.some(br=>br.id===yn)||sn.current.removeNode(yn)}),Mn.forEach(yn=>{u.some(br=>br.from===yn.v&&br.to===yn.w)||sn.current.removeEdge(yn.v,yn.w)}),m.forEach(yn=>{const xr=sn.current.nodes().find(br=>yn.id===br);if(xr&&sn.current.node(xr)){const{width:br,height:ri,x:kr,y:Bl}=sn.current.node(xr);sn.current.setNode(xr,{...yn,width:br,height:ri,x:kr,y:Bl})}else sn.current.setNode(yn.id,{...yn,width:0,height:0})}),u.forEach(yn=>{sn.current.setEdge(yn.from,yn.to,{...yn,label:yn.label,width:0,height:0,labelpos:Xe,labeloffset:Gt,weight:Nn,minlen:un})})},[u,m,Xe,Gt,Nn,un]),gs=f.useMemo(()=>ot()(()=>{At().layout(sn.current);const{height:Cn,width:Mn}=sn.current.graph(),yn=Math.max(0,Cn||0),xr=Math.max(0,Mn||0);ni(xr),qi(yn),Tr(sn.current.nodes()),ro(sn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(sn.current.setGraph({rankdir:T,align:U,nodesep:G,edgesep:M,ranksep:fe,marginx:he,marginy:Pe,acyclicer:Te,ranker:Ue}),Fa(),gs(),gs.cancel),[Te,U,T,M,he,Pe,G,fe,Ue,Fa,gs]);function Ol(Cn,Mn){return sn.current.setNode(Cn,Mn),gs(),sn.current}function kl(Cn,Mn){return sn.current.setEdge(Cn,Mn),gs(),sn.current}return(0,r.jsxs)("svg",{ref:fs,...mr,width:"100%",height:oo,viewBox:`0 0 ${vn} ${An}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:ge,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:vr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Nt]}),(0,r.jsx)("g",{id:mn,children:(0,r.jsxs)("svg",{width:Bo,height:Wr,y:An/2-Wr/2,x:vn/2-Bo/2,viewBox:`0 0 ${Bo} ${Wr}`,children:[no.map(Cn=>{const Mn=sn.current.edge(Cn);return Mn?(0,r.jsx)(Bn,{id:Cn,setEdge:kl,render:or,edge:Mn,curve:cn},`${Cn.v}-${Cn.w}`):null}),Un.map(Cn=>{const Mn=sn.current.node(Cn);return Mn?(0,r.jsx)(ut,{setNode:Ol,render:v,node:Mn},Cn):null})]})})]})}var Wn=n(72779),rn=n.n(Wn),Tn,Vn;const ct=(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:(Tn=e.palette.banner.closeButtonColor)!==null&&Tn!==void 0?Tn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(Vn=e.palette.banner.warning)!==null&&Vn!==void 0?Vn:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),_n=e=>{const{variant:o,message:l,id:u,fixed:m=!1}=e,v=ct(),U=useApi(storageApiRef).forBucket("notifications");var G;const M=(G=U.snapshot("dismissedBanners").value)!==null&&G!==void 0?G:[],[fe,he]=useState(new Set(M)),Pe=useObservable(U.observe$("dismissedBanners"));useEffect(()=>{if(Pe!=null&&Pe.value){var Ue;const Xe=(Ue=Pe==null?void 0:Pe.value)!==null&&Ue!==void 0?Ue:[];he(new Set(Xe))}},[Pe==null?void 0:Pe.value]);const Te=()=>{U.set("dismissedBanners",[...fe,u])};return _jsx(Snackbar,{anchorOrigin:m?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!fe.has(u),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=n(60905),at=n(90436),xn=n.p+"static/missingAnnotation.67f79e98..svg",Jt=n.p+"static/noInformation.4b426325..svg",pn=n.p+"static/createComponent.975d1e1e..svg",Rn=n.p+"static/noBuild.1715fa71..svg";const dn=(0,g.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),Ln=({missing:e})=>{const o=dn();switch(e){case"field":return(0,r.jsx)("img",{src:xn,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:Jt,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:pn,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:Rn,alt:"no Build",className:o.generalImg});default:return null}},we=(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 le(e){const{title:o,description:l,missing:u,action:m}=e,v=we();return(0,r.jsxs)(wt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2,children:[(0,r.jsx)(wt.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(wt.Z,{container:!0,direction:"column",children:[(0,r.jsx)(wt.Z,{item:!0,xs:!0,children:(0,r.jsx)(at.Z,{variant:"h5",children:o})}),(0,r.jsx)(wt.Z,{item:!0,xs:!0,children:(0,r.jsx)(at.Z,{variant:"body1",children:l})}),(0,r.jsx)(wt.Z,{item:!0,xs:!0,className:v.action,children:m})]})}),(0,r.jsx)(wt.Z,{item:!0,xs:12,md:6,className:v.imageContainer,children:typeof u=="string"?(0,r.jsx)(Ln,{missing:u}):u.customImage})]})}const ke=`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,Qe=ke.match(Me)[0],re=ke.split(`
|
|
12
|
+
`).findIndex(e=>Me.test(e)),N=(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+re)}function $e(e){const o=e.map(l=>Qe.replace("ANNOTATION",l)).join(`
|
|
13
|
+
`);return ke.replace(Qe,o)}function Ge(e){const o=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,r.jsx)("code",{children:l})).reduce((l,u)=>(0,r.jsxs)(r.Fragment,{children:[l,", ",u]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function et(e){const{annotation:o,readMoreUrl:l}=e,u=Array.isArray(o)?o:[o],m=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",v=N();return(0,r.jsx)(le,{missing:"field",title:"Missing Annotation",description:Ge(u),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(at.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(E.Z,{className:v.code,children:(0,r.jsx)(Le,{text:$e(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:me(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(ye.Z,{color:"primary",component:ue.r,to:m,children:"Read more"})]})})}var $t=n(11776),zt=n(38402),tn=n(49378),q=n(41128),J=n(27616),ie=n(8284),pe=n(70660),ae=n(91750),y=n(38016);const $=(e,o)=>(o.palette.type==="light"?q._j:q.$n)(o.palette[e].light,.6),X=(e,o)=>(o.palette.type==="light"?q.$n:q._j)(o.palette[e].light,.9),K=(0,g.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>$(o,e)}})),je=({severity:e})=>{const o=K({severity:e});return(0,r.jsx)(ae.Z,{classes:o})},Ae=({severity:e})=>{const o=K({severity:e});return(0,r.jsx)(y.Z,{classes:o})},Ke=(0,g.Z)(e=>({panel:{backgroundColor:({severity:o})=>X(o,e),color:({severity:o})=>$(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>$(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>$(o,e),backgroundColor:({severity:o})=>X(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"}),Tt=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function ht(e){const{severity:o="warning",title:l,message:u,children:m,defaultExpanded:v}=e,T=Ke({severity:o}),U=Tt(o)+(l?`: ${l}`:"");return(0,r.jsxs)(J.Z,{defaultExpanded:v!=null?v:!1,className:T.panel,role:"alert",children:[(0,r.jsxs)(ie.Z,{expandIcon:(0,r.jsx)(Ae,{severity:o}),className:T.summary,children:[(0,r.jsx)(je,{severity:o}),(0,r.jsx)(at.Z,{className:T.summaryText,variant:"subtitle1",children:U})]}),(u||m)&&(0,r.jsx)(pe.Z,{children:(0,r.jsxs)(wt.Z,{container:!0,children:[u&&(0,r.jsx)(wt.Z,{item:!0,xs:12,children:(0,r.jsx)(at.Z,{className:T.message,variant:"body1",children:u})}),m&&(0,r.jsx)(wt.Z,{item:!0,xs:12,className:T.details,children:m})]})})]})}const pt=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Ye=({error:e,message:o,stack:l,children:u})=>{const m=pt();return(0,r.jsxs)($t.Z,{dense:!0,children:[(0,r.jsxs)(zt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Error",secondary:e}),(0,r.jsx)(se,{text:e})]}),(0,r.jsxs)(zt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Message",secondary:o}),(0,r.jsx)(se,{text:o})]}),l&&(0,r.jsxs)(zt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(tn.Z,{classes:{secondary:m.text},primary:"Stack Trace",secondary:l}),(0,r.jsx)(se,{text:l})]}),u]})};function lt(e){const{title:o,error:l,defaultExpanded:u,children:m}=e;return(0,r.jsx)(ht,{severity:"error",title:o!=null?o:l.message,defaultExpanded:u,children:(0,r.jsx)(Ye,{error:l.name,message:l.message,stack:l.stack,children:m})})}var st=n(85256);const jt=(0,g.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function Wt(e){var o;const{title:l,error:u,defaultExpanded:m}=e,v=jt();if(u.name!=="ResponseError")return(0,r.jsx)(lt,{title:l!=null?l:u.message,defaultExpanded:m,error:u});const{body:T,cause:U}=u,{request:G,response:M}=T,fe=`${M.statusCode}: ${U.name}`,he=G&&`${G.method} ${G.url}`,Pe=U.message.replace(/\\n/g,`
|
|
14
|
+
`),Te=(o=U.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
+
`),Ue=JSON.stringify(T,void 0,2);return(0,r.jsxs)(lt,{title:l!=null?l:u.message,defaultExpanded:m,error:{name:fe,message:Pe,stack:Te},children:[he&&(0,r.jsxs)(zt.Z,{alignItems:"flex-start",children:[(0,r.jsx)(tn.Z,{classes:{secondary:v.text},primary:"Request",secondary:G?`${he}`:void 0}),(0,r.jsx)(se,{text:he})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(st.Z,{component:"li",className:v.divider}),(0,r.jsx)(zt.Z,{alignItems:"flex-start",children:(0,r.jsx)(tn.Z,{classes:{secondary:v.text},primary:"Full Error as JSON"})}),(0,r.jsx)(Le,{language:"json",text:Ue,showCopyCodeButton:!0})]})]})}var en=n(28316);function nn(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function Zt(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Vt(e){const o=useRef(null);useEffect(function(){const m=document.querySelector(`#${e}`),v=m||nn(e);return m||Zt(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 Pt=null;const Lt="core.calloutSeen";function Ut(){const[e,o]=useState(()=>{const u=localStorage.getItem(Lt);return u?JSON.parse(u):{}}),l=useCallback((u,m)=>{const v=localStorage.getItem(Lt),U={...v?JSON.parse(v):{},[u]:m};o(U),localStorage.setItem(Lt,JSON.stringify(U))},[]);return{states:e,setState:l}}function In(e){const{states:o,setState:l}=Ut(),u=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:u}}function Pn(e){const{seen:o,markSeen:l}=In(e);return{show:o===!1,hide:l}}const Qn=(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 hr(e){const{featureId:o,title:l,description:u,children:m}=e,{show:v,hide:T}=useShowCallout(o),U=usePortal("core.callout"),G=useRef(null),[M,fe]=useState(),he=Qn(),Pe=useCallback(()=>{if(G.current){const Te=G.current.getBoundingClientRect(),Ue=Math.max(Te.width,Te.height),Xe=800,Gt=Te.x-(Ue-Te.width)/2-Xe,un=Te.y-(Ue-Te.height)/2-Xe,Nn=Ue+2*Xe,or=450,Nt=Te.x+Te.width/2-or,ln=Te.y-(Ue-Te.height)/2+Ue+20;fe({dotLeft:Gt,dotTop:un,dotSize:Nn,borderWidth:Xe,textTop:ln,textLeft:Nt,textWidth:or})}},[]);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:T,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:he.dot,"data-testid":"dot",style:{left:M==null?void 0:M.dotLeft,top:M==null?void 0:M.dotTop,width:M==null?void 0:M.dotSize,height:M==null?void 0:M.dotSize,borderWidth:M==null?void 0:M.borderWidth},onClick:T,onKeyDown:T,role:"button",tabIndex:0,children:_jsx(Box,{className:he.pulseCircle})}),_jsxs(Box,{className:he.text,"data-testid":"text",style:{left:M==null?void 0:M.textLeft,top:M==null?void 0:M.textTop,width:M==null?void 0:M.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:u})]})]})})}),U)]}):_jsx(_Fragment,{children:m})}var wn=n(35292);const Dn=(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 sr({color:e="primary",disabled:o=!1,href:l="#",icon:u=(0,r.jsx)(wn.Z,{}),label:m,onClick:v,title:T}){const U=Dn();return o?(0,r.jsxs)(E.Z,{title:T,className:rn()(U.link,U.disabled),children:[u,(0,r.jsx)(at.Z,{variant:"caption",component:"span",className:U.label,children:m})]}):(0,r.jsxs)(ue.r,{title:T,className:rn()(U.link,U[e]),to:l,onClick:v,children:[u,(0,r.jsx)(at.Z,{variant:"caption",component:"span",className:U.label,children:m})]})}const C=(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=C();return(0,r.jsx)("nav",{className:l.links,children:o.map((u,m)=>(0,r.jsx)(sr,{...u},m+1))})}const x=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
|
+
`},A=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:A,height:`calc(100% + ${Q}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Q,background:`linear-gradient(90deg, ${x(e.palette.type)})`},fadeRight:{right:-Q,background:`linear-gradient(270deg, ${x(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Ee(e){const[[o,l],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){u([0,0]);return}const v=()=>{const T=m.scrollLeft,U=m.scrollWidth-m.offsetWidth-m.scrollLeft;u([T,U])};return v(),m.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{m.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e]),[o,l]}function De(e,o,l){const[u,m]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const v=window.performance.now(),T=requestAnimationFrame(U=>{if(!e.current)return;const G=U-v,M=Math.abs(u)*G/o,he=Math.max(l,M)*Math.sign(u);e.current.scrollBy({left:he});const Pe=u-he;Math.sign(u)!==Math.sign(Pe)?m(0):m(Pe)});return()=>cancelAnimationFrame(T)},[e,u,o,l]),m}function dt(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:u=5,children:m,...v}=e,T=be(e),U=React.useRef(),[G,M]=Ee(U),fe=De(U,l,u),he=Pe=>{U.current&&fe(Pe?o:-o)};return _jsxs(Box,{...v,className:T.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:T.container,ref:U,children:m}),_jsx(Box,{className:classNames(T.fade,T.fadeLeft,{[T.fadeHidden]:G===0})}),_jsx(Box,{className:classNames(T.fade,T.fadeRight,{[T.fadeHidden]:M===0})}),G>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>he(!1),className:classNames(T.button,T.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),M>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>he(!0),className:classNames(T.button,T.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Qt=(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 bn(e){const o=Qt(e),{shorthand:l,alpha:u}=e;return l?_jsx(Typography,{component:"span",className:o[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const jn=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function pr(e){const{Progress:o}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(jn,{...e})})}var on=n(28865),so=n(60251);const io=(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"}),ao=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(ao,e):e,Sr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(ao,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},fr={code:({inline:e,className:o,children:l,...u})=>{const m=String(l).replace(/\n+$/,""),v=/language-(\w+)/.exec(o||"");return!e&&v?(0,r.jsx)(Le,{language:v[1],text:m}):(0,r.jsx)("code",{className:o,...u,children:l})},h1:Sr,h2:Sr,h3:Sr,h4:Sr,h5:Sr,h6:Sr};function lo(e){const{content:o,dialect:l="gfm",linkTarget:u,transformLinkUri:m,transformImageUri:v,className:T}=e,U=io();return(0,r.jsx)(on.D,{remarkPlugins:l==="gfm"?[so.Z]:[],className:`${U.markdown} ${T}`,children:o,components:fr,linkTarget:u,transformLinkUri:m,transformImageUri:v})}var co=n(23054);const Do=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),Vr=({request:e,busy:o,setBusy:l})=>{const u=Do(),[m,v]=useState(),T=async()=>{l(!0);try{await e.trigger()}catch(G){v(isError(G)?G.message:"An unspecified error occurred")}finally{l(!1)}},U=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx(U,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:T,children:"Log in"})]})};var Cr=null;const er=(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 Br(e){const o=er(),[l,u]=useState(!1),m=useApi(oauthRequestApiRef),v=useApi(configApiRef);var T;const U=(T=v.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&T!==void 0?T:!1,G=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),M=()=>{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",variantMapping:{h1:"span"},children:"Login Required"}),U?_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:u},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:M,children:"Reject All"})})]})}var $r=n(15277),uo=n.n($r),Zo=n(29862);const Hr=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Fo(e){const[o,l]=(0,f.useState)(!1),u=(0,Zo.t)(),m=Hr(),v=U=>{u()&&l(U)};var T;return(0,r.jsx)(P.ZP,{title:(T=e.title)!==null&&T!==void 0?T:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)(uo(),{text:e.text,line:e.line,onToggled:v,containerClassName:m.container})})}var No=n(67358);function Dr(e){const o=(0,oe.Z)(),[l,u]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>u(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,r.jsx)(No.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(E.Z,{display:"none"})}var Hn=n(94339),Rr=n(14503),Zr=n(24579),ho=n(32552),En=n(15459),Gr=n(27597);const po=(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 Uo(e){const{link:o,title:l,onClick:u}=e,m=po();return(0,r.jsxs)(E.Z,{children:[(0,r.jsx)(st.Z,{}),(0,r.jsx)(ue.r,{to:o,onClick:u,underline:"none",children:(0,r.jsxs)(E.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,r.jsx)(E.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(at.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(Gr.Z,{className:m.arrow})]})})]})}const ir=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(at.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(at.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(Y,{to:o.href,variant:"contained",children:o.name})},Mo=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:u}=this.state;return u?(0,r.jsx)(lt,{title:"Something Went Wrong",error:u,children:(0,r.jsx)(ir,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},fo=(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"}),go=(0,En.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Rr.Z),mo={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 wr(e){const{title:o,subheader:l,divider:u=!0,deepLink:m,slackChannel:v,errorBoundaryProps:T,variant:U,children:G,headerStyle:M,headerProps:fe,icon:he,action:Pe,actionsClassName:Te,actions:Ue,cardClassName:Xe,actionsTopRight:Gt,className:un,noPadding:Nn,titleTypographyProps:or}=e,Nt=fo();let ln={},cn={};U&&U.split(/[\s]+/g).forEach(yr=>{ln={...ln,...mo.card[yr]},cn={...cn,...mo.cardContent[yr]}});const ur=()=>!l&&!he?null:(0,r.jsxs)("div",{className:Nt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:Nt.subheader,children:l}),he]}),mr=T||(v?{slackChannel:v}:{});return(0,r.jsx)(Hn.Z,{style:ln,className:un,children:(0,r.jsxs)(Mo,{...mr,children:[o&&(0,r.jsx)(ho.Z,{classes:{root:Nt.header,title:Nt.headerTitle,subheader:Nt.headerSubheader,avatar:Nt.headerAvatar,action:Nt.headerAction,content:Nt.headerContent},title:o,subheader:ur(),action:Pe,style:{...M},titleTypographyProps:or,...fe}),Gt&&(0,r.jsx)(go,{children:Gt}),u&&(0,r.jsx)(st.Z,{}),(0,r.jsx)(Zr.Z,{className:rn()(Xe,{[Nt.noPadding]:Nn}),style:cn,children:G}),Ue&&(0,r.jsx)(Rr.Z,{className:Te,children:Ue}),m&&(0,r.jsx)(Uo,{...m})]})})}var ms=n(39307);const zo=(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"}),Kr={fractional:!0,inverse:!1,unit:"%",max:100},Wo=({palette:e,value:o,inverse:l,max:u})=>{if(isNaN(o))return"#ddd";const m=u||Kr.max,v=l?m-o:o;return v<m/3?e.status.error:v<m*(2/3)?e.status.warning:e.status.ok};function Vo(e){const[o,l]=useState(null),{getColor:u=Wo}=e,m=zo(e),{palette:v}=useTheme(),{value:T,fractional:U,inverse:G,unit:M,max:fe,description:he}={...Kr,...e},Pe=U?Math.round(T*fe):T,Te=fe!==100?Math.round(T):Pe,[Ue,Xe]=useState(!1);return useEffect(()=>{const Gt=o,un=()=>Xe(!0),Nn=()=>Xe(!1);return Gt&&he?(Gt.addEventListener("mouseenter",un),Gt.addEventListener("mouseleave",Nn),()=>{Gt.removeEventListener("mouseenter",un),Gt.removeEventListener("mouseleave",Nn)}):()=>{Xe(!1)}},[he,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Pe,strokeWidth:12,trailWidth:12,strokeColor:u({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(T)?"N/A":`${Te}${M}`})]})}const Gn=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function Yr(e){const o=Gn(e),{title:l,subheader:u,progress:m,inverse:v,deepLink:T,description:U,icon:G,variant:M,getColor:fe}=e,he={inverse:v,description:U,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:u,deepLink:T,variant:M,icon:G,children:_jsx(Gauge,{...he})})})}function Fr(e){const{value:o,getColor:l=getProgressColor}=e,{palette:u}=useTheme();if(isNaN(o))return null;let m=Math.round(o*100*100)/100;m>100&&(m=100);const v=l({palette:u,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 vs=n(21324),ys=n(7089),vo=n(42494),Ho=n(74603),xs=n(56939),ar=n(12231),Go=n(73698),Kn=n(12420),yo=n(72379);const Ko=(0,g.Z)(e=>(0,Kn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Yo=()=>{const e=Ko();return(0,r.jsx)(yo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Jo=(0,g.Z)(e=>(0,Kn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Qo=()=>{const e=Jo();return(0,r.jsx)(yo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const Qr=(0,En.Z)(e=>(0,Kn.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"})(Ho.Z),Xo=(0,g.Z)(e=>(0,Kn.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 xo(e){const{multiple:o,items:l,label:u,placeholder:m,selected:v,onChange:T,triggerReset:U,native:G=!1,disabled:M=!1,margin:fe}=e,he=Xo(),[Pe,Te]=(0,f.useState)(v||(o?[]:"")),[Ue,Xe]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Te(o?[]:"")},[U,o]),(0,f.useEffect)(()=>{Te(v||(o?[]:""))},[v,o]);const Gt=Nt=>{Te(Nt.target.value),T(Nt.target.value)},un=Nt=>{if(M){Nt.preventDefault();return}Xe(ln=>o&&!(Nt.target instanceof HTMLElement)?!0:!ln)},Nn=()=>{Xe(!1)},or=Nt=>()=>{const ln=Pe.filter(cn=>cn!==Nt);Te(ln),T(ln)};return(0,r.jsx)(E.Z,{className:he.root,children:(0,r.jsxs)(vo.Z,{className:he.formControl,children:[(0,r.jsx)(xs.Z,{className:he.formLabel,children:u}),(0,r.jsxs)(Go.Z,{"aria-label":u,value:Pe,native:G,disabled:M,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Gt,open:Ue,onOpen:un,onClose:Nn,input:(0,r.jsx)(Qr,{}),label:u,tabIndex:0,renderValue:Nt=>{var ln;return o&&Pe.length!==0?(0,r.jsx)(E.Z,{className:he.chips,children:Nt.map(cn=>{var ur,mr;return(0,r.jsx)(ys.Z,{label:(ur=l.find(vr=>vr.value===cn))===null||ur===void 0?void 0:ur.label,clickable:!0,onDelete:or(cn),className:he.chip},(mr=l.find(vr=>vr.value===cn))===null||mr===void 0?void 0:mr.value)})}):(0,r.jsx)(at.Z,{children:Pe.length===0?m||"":(ln=l.find(cn=>cn.value===Nt))===null||ln===void 0?void 0:ln.label})},IconComponent:()=>Ue?(0,r.jsx)(Qo,{}):(0,r.jsx)(Yo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,r.jsx)(ar.Z,{value:[],children:m}),G?l&&l.map(Nt=>(0,r.jsx)("option",{value:Nt.value,children:Nt.label},Nt.value)):l&&l.map(Nt=>(0,r.jsxs)(ar.Z,{value:Nt.value,children:[o&&(0,r.jsx)(vs.Z,{color:"primary",checked:Pe.includes(Nt.value)||!1,className:he.checkbox}),Nt.label]},Nt.value))]})]})})}const bo=()=>{},oi=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:bo,stepHistory:[],setStepHistory:bo,onStepChange:bo});function b(e){const{children:o,elevated:l,onStepChange:u,activeStep:m=0}=e,[v,T]=useState(m),[U,G]=useState([0]);useEffect(()=>{T(m)},[m]);const M=[];let fe;return Children.forEach(o,he=>{isValidElement(he)&&(he.props.end?fe=he:M.push(he))}),_jsxs(_Fragment,{children:[_jsx(oi.Provider,{value:{stepIndex:v,setStepIndex:T,stepHistory:U,setStepHistory:G,onStepChange:u,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:v,orientation:"vertical",elevation:l?2:0,children:M})}),v>=Children.count(o)-1&&fe]})}const j=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),w=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),D=({text:e,handleClick:o,disabled:l,last:u,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(u?"Finish":"Next")}),_=({text:e,handleClick:o,disabled:l,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${u}`,onClick:o,children:e||"Skip"}),de=({text:e,handleClick:o,disabled:l,stepIndex:u})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${u}`,disabled:l,children:e||"Back"}),ce=({actions:e={},children:o})=>{const l=j(),{stepperLength:u,stepIndex:m,setStepIndex:v,stepHistory:T,setStepHistory:U,onStepChange:G}=useContext(VerticalStepperContext),M=(Te,Ue)=>{Ue&&Ue(),G&&G(m,Te),v(Te)},fe=()=>{const Te=e.nextStep?e.nextStep(m,u-1):m+1;M(Te,e.onNext),U([...T,Te])},he=()=>{T.pop(),M(T[T.length-1],e.onBack),U([...T])},Pe=()=>{M(0,e.onRestart),U([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(de,{text:e.backText,handleClick:he,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(_,{text:e.skipText,handleClick:fe,disabled:!!u&&m>=u||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(D,{text:e.nextText,handleClick:fe,disabled:!!u&&m>=u||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(w,{text:e.restartText,handleClick:Pe,stepIndex:m}),o]})},ve=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function Re(e){const{title:o,children:l,end:u,actions:m,...v}=e,T=ve();return u?_jsxs(Box,{className:T.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 Ce=(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 Fe(e){const o=Ce(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Ze(e){const o=Ce(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function it(e){const o=Ce(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function nt(e){const o=Ce(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function _e(e){const o=Ce(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Oe(e){const o=Ce(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var ft=n(74600),kt=n(15584);const fn=e=>(0,Kn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),St={root:{border:"0",verticalAlign:"top"}},Bt=e=>(0,Kn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Ft=e=>(0,Kn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),an=(0,En.Z)(fn,{name:"BackstageMetadataTableTitleCell"})(kt.Z),Sn=(0,En.Z)(St,{name:"BackstageMetadataTableCell"})(kt.Z),Ir=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Nr=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(an,{children:e}),_jsx(Sn,{colSpan:e?1:2,...l,children:o})]}),Pr=(0,En.Z)(Bt,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)($t.Z,{disablePadding:!0,className:e.root,children:o})),Zn=(0,En.Z)(Ft,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(zt.Z,{className:e.root,children:o})),On=(0,Kn.Z)({root:{margin:"0 0",listStyleType:"none"}}),Lr=e=>(0,Kn.Z)({root:{...On.root,paddingLeft:e.spacing(1)}}),qo=(0,En.Z)(On,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(Pr,{classes:e,children:o})),Ss=(0,En.Z)(Lr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(Pr,{classes:e,children:o}));function si(e,o){const l=e.map((u,m)=>_jsx(MetadataListItem,{children:_o(u)},m));return o?_jsx(Ss,{children:l}):_jsx(qo,{children:l})}function ii(e,o,l){const u=Object.keys(e).map(m=>{const v=_o(e[m],!0),T=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${T}: `}),v]},m)});return o?_jsx(Ss,{children:u}):_jsx(qo,{children:u})}function _o(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?ii(e,o,l):Array.isArray(e)?si(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const ai=({value:e,options:o})=>_jsx(Fragment,{children:_o(e,o)}),Cs=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(ai,{value:o,options:l})});function ws(e,o){return Object.keys(e).map(l=>_jsx(Cs,{title:l,value:e[l],options:o},l))}function Or(e){const{metadata:o,dense:l=!0,options:u}=e,m=ws(o,u||{});return _jsx(MetadataTable,{dense:l,children:m})}var lr=n(49429),cr=n(86136),tr=n(79784),Xr=n(76635),li=n(19126),js=n.n(li);function ci(e){return qs.stringify(e,{strictNullHandling:!0})}function es(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Ur(e,o){return es(e)[o]}function Es(e,o,l){const u={...es(e),[o]:l};return ci(u)}function di(e,o=250){const[l,u]=useSearchParams(),m=l.toString(),[v,T]=useState(Ur(m,e));return useEffect(()=>{const U=Ur(m,e);T(G=>isEqual(U,G)?G:U)},[m,T,e]),useDebouncedEffect(()=>{const U=Es(m,e,v);m!==U&&u(U,{replace:!0})},[u,v,m,e],o),[v,T]}const _i={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 qr(){const o=(0,p.I_)().get(p.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return _i;var u;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((u=m.getOptionalConfigArray("links"))!==null&&u!==void 0?u:[]).flatMap(v=>({url:v.getString("url"),title:v.getString("title")}))}))}}var As=n(80079);function nr(e,o){const u=(0,p.qD)().getSystemIcon(e);return u?(0,r.jsx)(u,{...o}):(0,r.jsx)(As.Z,{...o})}function ea(e){return nr("brokenImage",e)}function ta(e){return nr("catalog",e)}function na(e){return nr("chat",e)}function ra(e){return nr("dashboard",e)}function ui(e){return nr("docs",e)}function oa(e){return nr("email",e)}function sa(e){return nr("github",e)}function hi(e){return nr("group",e)}function ts(e){return nr("help",e)}function Na(e){return nr("user",e)}function ia(e){return nr("warning",e)}const pi=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),fi=({icon:e})=>{const o=(0,p.qD)();var l;const u=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:ts;return(0,r.jsx)(u,{})};var ns;const So=({link:e})=>(0,r.jsx)(ue.r,{to:e.url,children:(ns=e.title)!==null&&ns!==void 0?ns:e.url}),Ts=({item:e})=>{var o;return(0,r.jsxs)(zt.Z,{children:[(0,r.jsx)(cr.Z,{children:(0,r.jsx)(fi,{icon:e.icon})}),(0,r.jsx)(tn.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,u,m)=>[...l,m>0&&(0,r.jsx)("br",{},m),(0,r.jsx)(So,{link:u},u.url)],[])})]})};function gi(e){const{title:o,items:l,children:u}=e,{items:m}=qr(),[v,T]=(0,f.useState)(!1),[U,G]=(0,f.useState)(null),M=pi(),fe=(0,ze.Z)(Te=>Te.breakpoints.down("sm")),he=Te=>{G(Te.currentTarget),T(!0)},Pe=()=>{T(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(R.Z,{color:"primary",size:"small",onClick:he,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(ts,{})}):(0,r.jsx)(ye.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:he,startIcon:(0,r.jsx)(ts,{}),children:"Support"})}),(0,r.jsxs)(tr.ZP,{"data-testid":"support-button-popover",open:v,anchorEl:U,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Pe,children:[(0,r.jsxs)($t.Z,{className:M.popoverList,children:[o&&(0,r.jsx)(zt.Z,{alignItems:"flex-start",children:(0,r.jsx)(at.Z,{variant:"subtitle1",children:o})}),f.Children.map(u,(Te,Ue)=>(0,r.jsx)(zt.Z,{alignItems:"flex-start",children:Te},`child-${Ue}`)),(l!=null?l:m).map((Te,Ue)=>(0,r.jsx)(Ts,{item:Te},`item-${Ue}`))]}),(0,r.jsx)(lr.Z,{children:(0,r.jsx)(ye.Z,{color:"primary",onClick:Pe,"aria-label":"Close",children:"Close"})})]})]})}var rs=n(18671),gr=n(73557),jr=n(84800);const Co=72,kn=24,mi=18,Er={drawerWidthClosed:Co,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Co,iconSize:Co-kn*2,iconPadding:kn,selectedIndicatorWidth:3,userBadgePadding:mi,userBadgeDiameter:Co-mi*2,mobileSidebarHeight:56},aa=e=>({...Er,...e,iconContainerWidth:Er.drawerWidthClosed,iconSize:Er.drawerWidthClosed-Er.iconPadding*2,userBadgeDiameter:Er.drawerWidthClosed-Er.userBadgePadding*2}),Rs={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Er.defaultOpenDelayMs+200},la=e=>({...Rs,...e}),Ua="@backstage/core/sidebar-intro-dismissed",Xn=(0,f.createContext)({sidebarConfig:Er,submenuConfig:Rs}),Is=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var wo=n(50023),jo=n(4190),Eo=n(87685),vi=n(44882),_r=n(51837);const os={isOpen:!1,setOpen:()=>{}},Ps=(0,f.createContext)(os),Ls=(0,_r.CT)("sidebar-open-state-context");function Os(e){const{children:o,value:l}=e;return(0,r.jsx)(Ps.Provider,{value:l,children:(0,r.jsx)(Ls.Provider,{value:(0,_r.EI)({1:l}),children:o})})}const ss=()=>{const e=(0,f.useContext)(Ls),o=(0,f.useContext)(Ps);if(e===void 0)return o||os;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var yi=n(57998);const xi={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},ks=(0,f.createContext)(xi),Bs=(0,_r.CT)("sidebar-pin-state-context");function is(e){const{children:o,value:l}=e;return(0,r.jsx)(ks.Provider,{value:l,children:(0,r.jsx)(Bs.Provider,{value:(0,_r.EI)({1:l}),children:o})})}const Ao=()=>{const e=(0,f.useContext)(Bs),o=(0,f.useContext)(ks);if(e===void 0)return o||xi;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},bi=(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"}})),$s=e=>{const{to:o,label:l,icon:u,value:m}=e,{sidebarConfig:v}=(0,f.useContext)(Xn),T=bi({sidebarConfig:v}),U=(0,gr.TH)(),{selectedMenuItemIndex:G,setSelectedMenuItemIndex:M}=(0,f.useContext)(Fs),fe=(Pe,Te)=>{M(Te===G?-1:Te)},he=m===G&&G>=0||m!==G&&!(G>=0)&&o===U.pathname;return(0,r.jsx)(yi.Z,{"aria-label":l,label:l,icon:u,component:ue.r,to:o||U.pathname,onChange:fe,value:m,selected:he,classes:T})},Ds=e=>{const{children:o,to:l,label:u,icon:m,value:v}=e,{isMobile:T}=Ao();return T?(0,r.jsx)($s,{to:l,label:u,icon:m,value:v}):(0,r.jsx)(r.Fragment,{children:o})},Zs=(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`})})),Si=e=>(0,Xr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Ci=f.createElement(Ds).type,ca=({children:e,label:o="Menu",open:l,onClose:u})=>{const{sidebarConfig:m}=(0,f.useContext)(Xn),v=Zs({sidebarConfig:m});return(0,r.jsxs)(jo.ZP,{anchor:"bottom",open:l,onClose:u,ModalProps:{BackdropProps:{classes:{root:v.marginMobileSidebar}}},classes:{root:v.marginMobileSidebar,paperAnchorBottom:v.overlay},children:[(0,r.jsxs)(E.Z,{className:v.overlayHeader,children:[(0,r.jsx)(at.Z,{variant:"h3",children:o}),(0,r.jsx)(R.Z,{onClick:u,classes:{root:v.overlayHeaderClose},children:(0,r.jsx)(Eo.Z,{})})]}),(0,r.jsx)(E.Z,{component:"nav",children:e})]})},Fs=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),wi=e=>{const{sidebarConfig:o}=(0,f.useContext)(Xn),{children:l}=e,u=Zs({sidebarConfig:o}),m=(0,gr.TH)(),[v,T]=(0,f.useState)(-1);(0,f.useEffect)(()=>{T(-1)},[m.pathname]);let U=(0,p.vJ)(l,M=>M.getElements().filter(fe=>fe.type===Ci));if(l)U.length?U=Si(U):U.push((0,r.jsx)(Ds,{icon:(0,r.jsx)(vi.Z,{}),children:l},"default_menu"));else return null;const G=v>=0&&!U[v].props.to;return(0,r.jsx)(Os,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Fs.Provider,{value:{selectedMenuItemIndex:v,setSelectedMenuItemIndex:T},children:[(0,r.jsx)(ca,{label:U[v]&&U[v].props.label,open:G,onClose:()=>T(-1),children:U[v]&&U[v].props.children}),(0,r.jsx)(wo.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:U})]})})};var To;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(To||(To={}));const Ns={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(To.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(To.SIDEBAR_PIN_STATE,JSON.stringify(e))}},Us=(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"}),Ro=(0,f.createContext)({content:{contentRef:void 0}});function ji(e){const[o,l]=(0,f.useState)(()=>Ns.getSidebarPinState()),{sidebarConfig:u}=(0,f.useContext)(Xn),m=(0,f.useRef)(null),v=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Ns.setSidebarPinState(o)},[o]);const T=(0,ze.Z)(M=>M.breakpoints.down("xs"),{noSsr:!0}),U=()=>l(!o),G=Us({isPinned:o,sidebarConfig:u});return(0,r.jsx)(is,{value:{isPinned:o,toggleSidebarPinState:U,isMobile:T},children:(0,r.jsx)(Ro.Provider,{value:v,children:(0,r.jsx)(E.Z,{className:G.root,children:e.children})})})}function Ms(){const{content:e}=(0,f.useContext)(Ro);return{focusContent:(0,f.useCallback)(()=>{var l,u;e==null||(l=e.contentRef)===null||l===void 0||(u=l.current)===null||u===void 0||u.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const zs=(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 Yn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Yn||(Yn={}));const da=e=>{const{sidebarConfig:o}=(0,f.useContext)(Xn),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:u=o.defaultCloseDelayMs,disableExpandOnHover:m,children:v}=e,T=zs({sidebarConfig:o}),U=(0,ze.Z)(un=>un.breakpoints.down("md"),{noSsr:!0}),[G,M]=(0,f.useState)(Yn.Closed),fe=(0,f.useRef)(),{isPinned:he,toggleSidebarPinState:Pe}=Ao(),Te=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G!==Yn.Open&&!U&&(fe.current=window.setTimeout(()=>{fe.current=void 0,M(Yn.Open)},l),M(Yn.Idle)))},Ue=()=>{he||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),G===Yn.Idle?M(Yn.Closed):G===Yn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,M(Yn.Closed)},u)))},Xe=G===Yn.Open&&!U||he,Gt=un=>{un?(M(Yn.Open),Pe()):(M(Yn.Closed),Pe())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(ua,{}),(0,r.jsx)(Os,{value:{isOpen:Xe,setOpen:Gt},children:(0,r.jsx)(E.Z,{className:T.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Te,onFocus:m?()=>{}:Te,onMouseLeave:m?()=>{}:Ue,onBlur:m?()=>{}:Ue,children:(0,r.jsx)(E.Z,{className:rn()(T.drawer,T.drawerWidth,{[T.drawerOpen]:Xe}),children:v})})})]})},Io=e=>{var o;const l=aa((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var u;const m=la((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:v,disableExpandOnHover:T,openDelayMs:U,closeDelayMs:G}=e,{isMobile:M}=Ao();return M?(0,r.jsx)(wi,{children:v}):(0,r.jsx)(Xn.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,r.jsx)(da,{openDelayMs:U,closeDelayMs:G,disableExpandOnHover:T,children:v})})};function ua(){const{sidebarConfig:e}=(0,f.useContext)(Xn),{focusContent:o,contentRef:l}=Ms(),u=zs({sidebarConfig:e});return l!=null&&l.current?(0,r.jsx)(ye.Z,{onClick:o,variant:"contained",className:rn()(u.visuallyHidden),children:"Skip to content"}):null}function Ei(e,o){const l=new URLSearchParams(o.search).toString(),u=js().parse(l),m=new URLSearchParams(e.search).toString(),v=js().parse(m);return(0,Xr.isEqual)(o.pathname,e.pathname)&&(0,Xr.isMatch)(v,u)}const Ai=(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"}),ha=e=>{const{title:o,subtitle:l,to:u,icon:m,dropdownItems:v}=e,T=Ai(),{setIsHoveredOn:U}=useContext(SidebarItemWithSubmenuContext),G=()=>{U(!1)},M=useResolvedPath(u!=null?u:""),fe=useLocation();let he=isLocationMatch(fe,M);const[Pe,Te]=useState(!1),Ue=()=>{Te(!Pe)};return v!==void 0?(v.some(Xe=>{const Gt=resolvePath(Xe.to);return he=isLocationMatch(fe,Gt),he}),_jsxs(Box,{className:T.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Ue,onTouchStart:Xe=>Xe.stopPropagation(),className:classnames(T.item,he?T.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:T.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:T.subtitle,children:l})]}),Pe?_jsx(ArrowDropUpIcon,{className:T.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:T.dropdownArrow})]})}),v&&Pe&&_jsx(Box,{className:T.dropdown,children:v.map((Xe,Gt)=>_jsx(Tooltip,{title:Xe.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Xe.to,underline:"none",className:T.dropdownItem,onClick:G,onTouchStart:un=>un.stopPropagation(),children:_jsx(Typography,{className:T.textContent,children:Xe.title})})},Gt))})]})):_jsx(Box,{className:T.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames(T.item,he?T.selected:void 0),onClick:G,onTouchStart:Xe=>Xe.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:T.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:T.subtitle,children:l})]})]})})})};var Po;const pa=(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:(Po=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Po!==void 0?Po:"#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"}),fa=e=>{const{isOpen:o}=ss(),{sidebarConfig:l,submenuConfig:u}=(0,f.useContext)(Xn),m=o?l.drawerWidthOpen:l.drawerWidthClosed,v=pa({left:m,submenuConfig:u}),{isHoveredOn:T}=(0,f.useContext)(Is),[U,G]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{G(T)},[T]),(0,r.jsxs)(E.Z,{className:rn()(v.drawer,{[v.drawerOpen]:U}),children:[(0,r.jsx)(at.Z,{variant:"h5",className:v.title,children:e.title}),e.children]})};var Ws=n(26739),eo=n(76600),Ti=n(83543),Ri=n(59797),to=n(98989);const ga=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Ma=()=>{const e=ga();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 za=null;const ma=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),va=()=>{const e=ma();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 Jn=null,Vs,as;const ya=e=>(0,g.Z)(o=>{var l,u;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:(Vs=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&Vs!==void 0?Vs:"#404040"}},highlighted:{background:(as=(u=o.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&as!==void 0?as:"#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 ls(e){return(0,f.useMemo)(()=>ya(e),[e])()}const xa=(e,o)=>(0,p.vJ)(e.props.children,l=>{let u=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:v}})=>{if(!u){if(v!=null&&v.length){v.forEach(({to:T})=>u=u||Ei(o,(0,jr.i3)(T)));return}m&&(u=Ei(o,(0,jr.i3)(m)))}}),u},[o.pathname]);function Hs(e){return e.to===void 0}const ba=f.createElement(fa).type,Sa=f.forwardRef(function({to:o,end:l,style:u,className:m,activeStyle:v,caseSensitive:T,activeClassName:U="active","aria-current":G="page",...M},fe){let{pathname:he}=(0,gr.TH)(),{pathname:Pe}=(0,gr.WU)(o);T||(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,r.jsx)(z.rU,{...M,to:o,ref:fe,"aria-current":Ue,style:{...u,...Te?v:void 0},className:rn()([m,Te?U:void 0])})}),Ii=(0,f.forwardRef)((e,o)=>{const{icon:l,text:u,hasNotifications:m=!1,hasSubmenu:v=!1,disableHighlight:T=!1,onClick:U,noTrack:G,children:M,className:fe,...he}=e,{sidebarConfig:Pe}=(0,f.useContext)(Xn),Te=ls(Pe),{isOpen:Ue}=ss(),Xe=!Ue&&v?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Gt=(0,r.jsxs)(E.Z,{style:Xe,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ue&&v?(0,r.jsx)(to.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),un=(0,r.jsx)(Ws.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:rn()({[Te.closedItemIcon]:!Ue}),children:Gt}),Nn=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{"data-testid":"login-button",className:Te.iconContainer,children:un}),u&&(0,r.jsx)(at.Z,{variant:"subtitle2",className:Te.label,children:u}),(0,r.jsx)("div",{className:Te.secondaryAction,children:M})]}),or=Ue?Nn:un,Nt={onClick:U,className:rn()(fe,Te.root,Ue?Te.open:Te.closed,Hs(e)&&Te.buttonItem,{[Te.highlightable]:!T})},ln=(0,p.z$)(),{pathname:cn}=(0,gr.WU)(!Hs(e)&&e.to?e.to:""),ur=(0,f.useCallback)(mr=>{if(!G){const vr="click",yr=u!=null?u:"Sidebar Item",ps=cn?{attributes:{to:cn}}:void 0;ln.captureEvent(vr,yr,ps)}U==null||U(mr)},[ln,u,cn,G,U]);return Hs(e)?(0,r.jsx)(ye.Z,{role:"button","aria-label":u,...Nt,ref:o,onClick:ur,children:or}):(0,r.jsx)(Sa,{...Nt,activeClassName:Te.selected,to:e.to?e.to:"",ref:o,"aria-label":u||e.to,...he,onClick:ur,children:or})}),Ca=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(Xn),u=ls(l),[m,v]=(0,f.useState)(!1),T=(0,gr.TH)(),U=xa(e,T),G=(0,ze.Z)(Pe=>Pe.breakpoints.down("sm")),M=()=>{v(!0)},fe=()=>{v(!1)},he=()=>G?m?(0,r.jsx)(Ri.Z,{fontSize:"small",className:u.submenuArrow}):(0,r.jsx)(Ti.Z,{fontSize:"small",className:u.submenuArrow}):!m&&(0,r.jsx)(to.Z,{fontSize:"small",className:u.submenuArrow});return(0,r.jsx)(Is.Provider,{value:{isHoveredOn:m,setIsHoveredOn:v},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:M,onMouseEnter:M,className:rn()(m&&u.highlighted),children:[(0,r.jsx)(Ii,{hasSubmenu:!0,className:U?u.selected:"",...o,children:he()}),m&&e]})})},Pi=(0,f.forwardRef)((e,o)=>{const[l]=(0,p.vJ)(e.children,u=>u.getElements().filter(m=>m.type===ba));return l?(0,r.jsx)(Ca,{...e,children:l}):(0,r.jsx)(Ii,{...e,ref:o})});function Wa(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,u]=useState(""),m=ls(o),v=e.icon?e.icon:SearchIcon,T=()=>{e.onSearch(l),u("")},U=he=>{he.key==="Enter"&&(he.preventDefault(),T())},G=he=>{u(he.target.value)},M=he=>{he.preventDefault(),he.stopPropagation()},fe=he=>{T(),he.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Pi,{icon:v,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:M,onChange:G,onKeyDown:U,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const Va=(0,eo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ha=(0,eo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Gs=(0,eo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Li=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),wa=(0,eo.Z)("div")(({theme:e})=>{const o=Li(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),ja=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=ls(e),{isOpen:l,setOpen:u}=useSidebarOpenState();if(useMediaQuery(T=>T.breakpoints.down("md"),{noSsr:!0}))return null;const v=()=>{u(!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,{})})})},Oi=(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 ki(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Oi({sidebarConfig:o}),{text:u,onClose:m}=e,v=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_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 Ks=e=>{const{text:o,onDismiss:l}=e,[u,m]=useState(!1),v=()=>{m(!0)};return _jsx(Collapse,{in:!u,onExited:l,children:_jsx(ki,{text:o,onClose:v})})},Bi=null,$i="And your recently viewed plugins will pop up here!";function Ea(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:v,recentlyViewedItemsDismissed:T}=u!=null?u:{},U=()=>{m(M=>({...l,...M,starredItemsDismissed:!0}))},G=()=>{m(M=>({...l,...M,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!v&&_jsxs(_Fragment,{children:[_jsx(Ks,{text:Bi,onDismiss:U}),_jsx(SidebarDivider,{})]}),!T&&_jsx(Ks,{text:$i,onDismiss:G})]}):null}const Aa=(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 Ys(e){const{className:o,stretch:l,noPadding:u,children:m,...v}=e,{contentRef:T}=Ms(),U=Aa();return(0,r.jsx)("article",{ref:T,tabIndex:-1,...v,className:rn()(U.root,o,{[U.stretch]:l,[U.noPadding]:u}),children:m})}var Di=n(6487),Ta=n(99152);const Zi=(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 Js(e){const{tabs:o,onChange:l,selectedIndex:u}=e,[m,v]=(0,f.useState)(u!=null?u:0),T=Zi(),U=(0,f.useCallback)((G,M)=>{u===void 0&&v(M),l&&u!==M&&l(M)},[u,l]);return(0,f.useEffect)(()=>{u!==void 0&&v(u)},[u]),(0,r.jsx)(E.Z,{className:T.tabsWrapper,children:(0,r.jsx)(Ta.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:U,value:m,children:o.map((G,M)=>(0,f.createElement)(Di.Z,{...G.tabProps,"data-testid":`header-tab-${M}`,label:G.label,key:G.id,value:M,className:T.defaultTab,classes:{selected:T.selected,root:T.tabRoot}}))})})}function Fi(e){const o=(0,gr.UO)(),u=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,gr.V$)(u))!==null&&m!==void 0?m:e[0].children;var T;let U=(T=o["*"])!==null&&T!==void 0?T:"";U.startsWith("/")||(U=`/${U}`);var G;const[M]=(G=(0,jr.fp)(u,U))!==null&&G!==void 0?G:[],fe=M?e.findIndex(Pe=>`${Pe.path}/*`===M.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 Qs(e){const{routes:o}=e,l=(0,gr.s0)(),{index:u,route:m,element:v}=Fi(o),T=(0,f.useMemo)(()=>o.map(G=>({id:G.path,label:G.title,tabProps:G.tabProps})),[o]),U=G=>{let{path:M}=o[G];M=M.replace(/\/\*$/,""),M=M.replace(/^\//,""),l(M)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Js,{tabs:T,selectedIndex:u,onChange:U}),(0,r.jsxs)(Ys,{children:[(0,r.jsx)(rs.q,{title:m.title}),v]})]})}const cs=()=>null;(0,p.R5)(cs,"core.gatherMountPoints",!0);function Xs(e){const o=(0,r.jsx)(cs,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return Xs(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:m,children:v,tabProps:T}=l.props;return[{path:u,title:m,children:v,tabProps:T}]})}function Ni(e){const o=Xs(e.children);return(0,r.jsx)(Qs,{routes:o})}Ni.Route=cs;const dr=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Ui(e){const{value:o,subvalue:l}=e,u=dr();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Z,{className:u.value,children:o}),(0,r.jsx)(E.Z,{className:u.subvalue,children:l})]})}var Lo=n(67222),Mi=n(21070),_s=n(90324),zi=n(98281),Wi=n(48049),ei=n(51209),ti=n(33375),Ra=n(44233),Vi=n(27604),i=n(36444),t=n(37971),s=n(59709),a=n(17373),h=n(3702),S=n(93111);const O=(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"}),F=e=>{var o;const l=O(),{onChangeFilters:u}=e,[m,v]=(0,f.useState)({...e.selectedFilters}),[T,U]=(0,f.useState)(!1),G=()=>{v({}),U(M=>!M)};return(0,f.useEffect)(()=>{u(m)},[m,u]),(0,r.jsxs)(E.Z,{className:l.root,children:[(0,r.jsxs)(E.Z,{className:l.header,children:[(0,r.jsx)(E.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ye.Z,{color:"primary",onClick:G,children:"Clear all"})]}),(0,r.jsx)(E.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(M=>(0,r.jsx)(xo,{triggerReset:T,...M.element,selected:m[M.element.label],onChange:fe=>v({...m,[M.element.label]:fe})},M.element.label))})]})},ne={Add:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Mi.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,r.jsx)(zi.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ti.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ra.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Vi.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,r.jsx)(h.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,r.jsx)(i.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(t.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(s.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Wi.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ti.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,r.jsx)(i.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,r.jsx)(_s.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,r.jsx)(a.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,r.jsx)(S.Z,{...e,ref:o}))};function xe(e,o){const l=o.split(".");let u=e[l[0]];for(let m=1;m<l.length;++m){if(u===void 0)return u;const v=l[m];u=u[v]}return u}const Ie=(0,En.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"})(Lo.W$),We=(0,En.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"})(Lo.UW),gt=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Et=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Rt(e,o){return e.map(l=>{var u;const m=(u=l.headerStyle)!==null&&u!==void 0?u:{};let v=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof v=="object")v.fontWeight=o.typography.fontWeightBold;else{const T=v;v=(U,G,M)=>({...T(U,G,M),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:v}})}function Yt(e,o){return(0,Xr.transform)(e,(l,u,m)=>{(0,Xr.isEqual)(u,o[m])||(l[m]=u)})}const Ht={search:"",filtersOpen:!1,filters:{}};function Fn(e){const{toolbarRef:o,setSearch:l,hasFilters:u,selectedFiltersLength:m,toggleFilters:v}=e,T=gt(),U=(0,f.useCallback)(G=>{e.onSearchChanged(G),l(G)},[e,l]);return u?(0,r.jsxs)(E.Z,{className:T.root,children:[(0,r.jsxs)(E.Z,{className:T.root,children:[(0,r.jsx)(R.Z,{onClick:v,"aria-label":"filter list",children:(0,r.jsx)(i.Z,{})}),(0,r.jsxs)(at.Z,{className:T.title,children:["Filters (",m,")"]})]}),(0,r.jsx)(We,{...e,ref:o,onSearchChanged:U})]}):(0,r.jsx)(We,{...e,ref:o,onSearchChanged:U})}function rr(e){const{data:o,columns:l,options:u,title:m,subtitle:v,filters:T,initialState:U,emptyContent:G,onStateChange:M,components:fe,...he}=e,Pe=Et(),Te=(0,oe.Z)(),Ue={...Ht,...U},[Xe,Gt]=(0,f.useState)(Ue.filtersOpen),un=(0,f.useCallback)(()=>Gt(Un=>!Un),[Gt]),[Nn,or]=(0,f.useState)(0),[Nt,ln]=(0,f.useState)(o),[cn,ur]=(0,f.useState)(Ue.filters),mr=Rt(l,Te),[vr,yr]=(0,f.useState)(Ue.search);(0,f.useEffect)(()=>{if(M){const Un=Yt({search:vr,filtersOpen:Xe,filters:cn},Ht);M(Un)}},[vr,Xe,cn,M]);const ps={headerStyle:{textTransform:"uppercase"}},zr=(0,f.useCallback)(Un=>{var Tr;return(Tr=l.find(no=>no.title===Un))===null||Tr===void 0?void 0:Tr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!cn){ln(o);return}const Un=Object.values(cn);if(o&&Un.flat().length){const Tr=o.filter(no=>!!Object.entries(cn).filter(([,ro])=>!!ro.length).every(([ro,vn])=>{const An=xe(no,zr(ro));return Array.isArray(An)&&Array.isArray(vn)?An.some($o=>vn.includes($o)):Array.isArray(An)?An.includes(vn):Array.isArray(vn)?vn.includes(An):An===vn}));ln(Tr)}else ln(o);or(Un.flat().length)},[o,cn,zr]);const Xi=(Un,Tr)=>{const no=vn=>{const An=new Set,$o=oo=>{oo!=null&&An.add(oo)};return Tr&&Tr.forEach(oo=>{const fs=xe(oo,zr(vn));Array.isArray(fs)?fs.forEach($o):$o(fs)}),An},ro=vn=>({placeholder:"All results",label:vn.column,multiple:vn.type==="multiple-select",items:[...no(vn.column)].sort().map(An=>({label:An,value:An}))});return Un.map(vn=>({type:vn.type,element:ro(vn)}))},sn=!!(T!=null&&T.length),Bo=(0,f.useCallback)(Un=>(0,r.jsx)(Fn,{setSearch:yr,hasFilters:sn,selectedFiltersLength:Nn,toggleFilters:un,...Un}),[un,sn,Nn,yr]),ni=typeof o!="function"&&o.length===0,Wr=l.length,qi=(0,f.useCallback)(Un=>G&&ni?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Wr,children:G})})}):(0,r.jsx)(Lo.os,{...Un}),[ni,G,Wr]);return(0,r.jsxs)(E.Z,{className:Pe.root,children:[Xe&&o&&typeof o!="function"&&(T==null?void 0:T.length)&&(0,r.jsx)(F,{filters:Xi(T,o),selectedFilters:cn,onChangeFilters:ur}),(0,r.jsx)(Lo.ZP,{components:{Header:Ie,Toolbar:Bo,Body:qi,...fe},options:{...ps,...u},columns:mr,icons:ne,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(at.Z,{variant:"h5",component:"h2",children:m}),v&&(0,r.jsx)(at.Z,{color:"textSecondary",variant:"body1",children:v})]}),data:typeof o=="function"?o:Nt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...he})]})}rr.icons=Object.freeze(ne);var Ar=n(44311);function Oo(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 Ia(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:Oo(e.data,o)})]})}const Hi=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"}),ds=({title:e="Unknown page",className:o})=>(0,r.jsx)(at.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Gi(e){const{description:o,title:l,titleComponent:u=void 0,children:m,textAlign:v="left"}=e,T=Hi({textAlign:v})(),U=u||(0,r.jsx)(ds,{title:l,className:T.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs.q,{title:l}),(0,r.jsxs)(E.Z,{className:T.container,children:[(0,r.jsxs)(E.Z,{className:T.leftItemsBox,children:[U,o&&(0,r.jsx)(at.Z,{className:T.description,variant:"body2",children:o})]}),(0,r.jsx)(E.Z,{className:T.rightItemsBox,children:m})]})]})}var Mr=n.p+"static/mic-drop.fe3ef4d0..svg";const Ga=(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"}),Ka=()=>{const e=Ga();return(0,r.jsx)("img",{src:Mr,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ya=(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 Ja(e){const{status:o,statusMessage:l,additionalInfo:u,supportUrl:m}=e,v=Ya(),T=(0,gr.s0)(),U=qr();return(0,r.jsxs)(wt.Z,{container:!0,spacing:0,className:v.container,children:[(0,r.jsxs)(wt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(at.Z,{"data-testid":"error",variant:"body1",className:v.subtitle,children:["ERROR ",o,": ",l]}),(0,r.jsx)(at.Z,{variant:"body1",className:v.subtitle,children:u}),(0,r.jsx)(at.Z,{variant:"h2",className:v.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(at.Z,{variant:"h6",children:[(0,r.jsx)(ue.r,{to:"#","data-testid":"go-back-link",onClick:()=>T(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(ue.r,{to:m||U.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(Ka,{})]})}var Qa=n(16173);const Xa=(0,En.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(at.Z),Ki=(0,En.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(E.Z);function qa(e){const{children:o,...l}=e,[u,m]=f.useState(null),v=f.Children.toArray(o),[T,U,...G]=v,M=G.length?G.pop():v[v.length-1],fe=v.length>3,he=Ue=>{m(Ue.currentTarget)},Pe=()=>{m(null)},Te=Boolean(u);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Qa.Z,{"aria-label":"breadcrumb",...l,children:[v.length>1&&(0,r.jsx)(Ki,{clone:!0,children:T}),v.length>2&&(0,r.jsx)(Ki,{clone:!0,children:U}),fe&&(0,r.jsx)(Xa,{onClick:he,children:"..."}),(0,r.jsx)(E.Z,{style:{fontStyle:"italic"},children:M})]}),(0,r.jsx)(tr.ZP,{open:Te,anchorEl:u,onClose:Pe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)($t.Z,{children:G.map((Ue,Xe)=>(0,r.jsx)(zt.Z,{button:!0,children:(0,r.jsx)(Ki,{clone:!0,children:Ue})},Xe))})})]})}const _a=(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"}),el=({type:e,typeLink:o,classes:l,pageTitle:u})=>e?o?(0,r.jsxs)(qa,{className:l.breadcrumb,children:[(0,r.jsx)(ue.r,{to:o,children:e}),(0,r.jsx)(at.Z,{children:u})]}):(0,r.jsx)(at.Z,{className:l.type,children:e}):null,tl=({pageTitle:e,classes:o,tooltip:l})=>{const u=(0,r.jsx)(at.Z,{className:o.title,variant:"h1",children:e});return l?(0,r.jsx)(P.ZP,{title:l,placement:"top-start",children:u}):u},nl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(at.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function Pa(e){const{children:o,pageTitleOverride:l,style:u,subtitle:m,title:v,tooltip:T,type:U,typeLink:G}=e,M=_a(),he=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Pe=l||v,Te=v||l,Ue=`${Pe} | %s | ${he}`,Xe=`${Pe} | ${he}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs.q,{titleTemplate:Ue,defaultTitle:Xe}),(0,r.jsxs)("header",{style:u,className:M.header,children:[(0,r.jsxs)(E.Z,{className:M.leftItemsBox,children:[(0,r.jsx)(el,{classes:M,type:U,typeLink:G,pageTitle:Te}),(0,r.jsx)(tl,{classes:M,pageTitle:Te,tooltip:T}),(0,r.jsx)(nl,{classes:M,subtitle:m})]}),(0,r.jsx)(wt.Z,{container:!0,className:M.rightItemsBox,spacing:4,children:o})]})]})}const rl=({label:e,secondaryLabel:o,icon:l,disabled:u=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,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,[u,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:u,anchorEl:v.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((T,U)=>_jsx(rl,{...T},`header-action-menu-${U}`))})})]})}const ol=(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,q.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),sl=({value:e,className:o})=>(0,r.jsx)(at.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function il(e){const{label:o,value:l,url:u}=e,m=ol(),v=(0,r.jsx)(sl,{className:m.value,value:l||"<Unknown>"});return(0,r.jsx)(wt.Z,{item:!0,children:(0,r.jsxs)(at.Z,{component:"span",className:m.root,children:[(0,r.jsx)(at.Z,{className:m.label,children:o}),u?(0,r.jsx)(ue.r,{to:u,children:v}):v]})})}const al=e=>(0,Kn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),ll=(0,g.Z)(al,{name:"BackstageItemCardHeader"});function cl(e){const{title:o,subtitle:l,children:u}=e,m=ll(e);return(0,r.jsxs)(E.Z,{className:m.root,children:[l&&(0,r.jsx)(at.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,r.jsx)(at.Z,{variant:"h6",component:"h4",children:o}),u]})}function Dl(e){const{description:o,tags:l,title:u,type:m,subtitle:v,label:T,onClick:U,href:G}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:u,subtitle:v||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((M,fe)=>_jsx(Chip,{size:"small",label:M},fe))}):null,o]}),_jsxs(CardActions,{children:[!G&&_jsx(LinkButton,{to:"#",onClick:U,color:"primary",children:T}),G&&_jsx(LinkButton,{to:G,color:"primary",children:T})]})]})}const dl=e=>(0,Kn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),ul=(0,g.Z)(dl,{name:"BackstageItemCardGrid"});function hl(e){const{children:o,...l}=e,u=ul(l);return(0,r.jsx)(E.Z,{className:u.root,...l,children:o})}var pl=n(41547);const fl=(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 La(e){const{themeId:o,children:l}=e,u=fl();return(0,r.jsx)(pl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:u.root,children:l})})}function gl(e){const{themeId:o,children:l,...u}=e;return(0,r.jsxs)(La,{themeId:o,children:[(0,r.jsx)(Pa,{...u}),l]})}var qn=n(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())})})}),Oa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function ml(e){const o=new Date(Date.now()+Oa.defaultTokenExpiryMillis);if(!e)return o;const[l,u,m]=e.split("."),v=JSON.parse(window.atob(u));return typeof v.exp!="number"?o:new Date(v.exp*1e3-Oa.tokenExpiryMarginMillis)}class Fl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!u)throw new TypeError(`Invalid user entity reference "${l}"`);return u[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:ml(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});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,u=new Headers(l);u.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,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 Nl=e=>{const o=useApi(discoveryApiRef),[{status:l,error:u},{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,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},vl=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Yi=({children:e})=>{const o=vl();return(0,r.jsx)(wt.Z,{component:"li",item:!0,classes:o,children:e})};var us=n(87612);class Ji{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 yl(e){const[o,l,u]=e.split(".");return JSON.parse(window.atob(l))}class Qi{getUserId(){return this.result.userId}static fromResult(o){return new Qi(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:u}=yl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:u!=null?u:[]}}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,us._)(this,"result",void 0),this.result=o}}class hs{static createGuest(){return new Ji}static fromLegacy(o){return Qi.fromResult(o)}static create(o){return new hs(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,u){(0,us._)(this,"identity",void 0),(0,us._)(this,"authApi",void 0),(0,us._)(this,"profile",void 0),(0,us._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=u}}const xl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:u})=>{const{apiRef:m,title:v,message:T}=e,U=(0,p.h_)(m),G=(0,p.h_)(p.VE),M=async()=>{try{o();const fe=await U.getBackstageIdentity({instantPopup:!0});if(!fe)throw u(),new Error(`The ${v} provider is not configured to support sign-in`);const he=await U.getProfile();l(hs.create({identity:fe.identity,profile:he,authApi:U}))}catch(fe){u(),G.post(new co.SP("Login failed",fe))}};return(0,r.jsx)(Yi,{children:(0,r.jsx)(wr,{variant:"fullHeight",title:v,actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:M,children:"Sign In"}),children:(0,r.jsx)(at.Z,{variant:"body1",children:T})})})},loader:async(e,o)=>{const l=e.get(o),u=await l.getBackstageIdentity({optional:!0});if(!u)return;const m=await l.getProfile();return hs.create({identity:u.identity,profile:m,authApi:l})}},bl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(Yi,{children:(0,r.jsx)(wr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new Ji)},children:"Enter"}),children:(0,r.jsxs)(at.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new Ji};var Sl=n(63955),ka=n(86619),Ba=n(74828),Cl=n(45455),wl=n.n(Cl);const jl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,El=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),$a=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},Al={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=El(),{register:u,handleSubmit:m,formState:v}=(0,Sl.cI)({mode:"onChange"}),{errors:T}=v,U=({userId:G,idToken:M})=>{e(),o(hs.fromLegacy({userId:G,getIdToken:M!==void 0?async()=>M:void 0,profile:{email:`${G}@example.com`}}))};return(0,r.jsx)(Yi,{children:(0,r.jsxs)(wr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(at.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:l.form,onSubmit:m(U),children:[(0,r.jsxs)(vo.Z,{children:[(0,r.jsx)(ka.Z,{...$a(u("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(T.userId)}),T.userId&&(0,r.jsx)(Ba.Z,{error:!0,children:T.userId.message})]}),(0,r.jsxs)(vo.Z,{children:[(0,r.jsx)(ka.Z,{...$a(u("idToken",{required:!1,validate:G=>!G||jl.test(G)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(T.idToken)}),T.idToken&&(0,r.jsx)(Ba.Z,{error:!0,children:T.idToken.message})]}),(0,r.jsx)(ye.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(v!=null&&v.isDirty)||!wl()(T),children:"Continue"})]})]})})},loader:async()=>{}},ko="@backstage/core:SignInPage:provider",Da={guest:bl,custom:Al,common:xl};function Za(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,u)=>{if(typeof u=="string")return Za(u,l),l[u]={components:Da[u],id:u},l;const{id:m}=u;return Za(m,l),l[m]={components:Da.common,id:m,config:u},l},{})}const Kl=(e,o)=>{const l=useApi(errorApiRef),u=useApiHolder(),[m,v]=useState(!0),T=useCallback(G=>{o(IdentityApiSignOutProxy.from({identityApi:G,signOut:async()=>{var M;localStorage.removeItem(ko),await((M=G.signOut)===null||M===void 0?void 0:M.call(G))}}))},[o]);useLayoutEffect(()=>{var G;if(!m)return;const M=localStorage.getItem(ko);if(M===null){v(!1);return}const fe=e[M];if(!fe){v(!1);return}let he=!1;return fe.components.loader(u,(G=fe.config)===null||G===void 0?void 0:G.apiRef).then(Pe=>{if(he){localStorage.removeItem(ko);return}Pe?T(Pe):v(!1)}).catch(Pe=>{localStorage.removeItem(ko),!he&&(l.post(Pe),v(!1))}),()=>{he=!0}},[m,l,o,u,e,T]);const U=useMemo(()=>Object.keys(e).map(G=>{const M=e[G],{Component:fe}=M.components,he=Ue=>{T(Ue)},Pe=()=>{var Ue;localStorage.setItem(ko,(M==null||(Ue=M.config)===null||Ue===void 0?void 0:Ue.id)||M.id)},Te=()=>{localStorage.removeItem(ko)};return _jsx(fe,{config:M.config,onSignInStarted:Pe,onSignInSuccess:he,onSignInFailure:Te},M.id)}),[e,T]);return[m,U]},Tl=({onSignInSuccess:e,providers:o=[],title:l,align:u="left"})=>{const m=useApi(configApiRef),v=useStyles(),T=getSignInProviders(o),[U,G]=useSignInProviders(T,e);return U?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:v,children:G})]})]})},Rl=({provider:e,auto:o,onSignInSuccess:l})=>{const u=useStyles(),m=useApi(e.apiRef),v=useApi(configApiRef),[T,U]=useState(),[G,M]=useState(!1),fe=async({checkExisting:he,showPopup:Pe})=>{try{let Te;if(he&&(Te=await m.getBackstageIdentity({optional:!0})),!Te&&(Pe||o)&&(M(!0),Te=await m.getBackstageIdentity({instantPopup:!0}),!Te))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Te){M(!0);return}const Ue=await m.getProfile();l(UserIdentity.create({identity:Te.identity,authApi:m,profile:Ue}))}catch(Te){U(Te),M(!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:u,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}),T&&T.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:T.message})]})})})})]}):_jsx(Progress,{})};function Yl(e){return"provider"in e?_jsx(Rl,{...e}):_jsx(Tl,{...e})}const Il=(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"}),Pl=(0,En.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(ho.Z);function Jl(e){const{slackChannel:o,errorBoundaryProps:l,children:u,title:m,deepLink:v,value:T,onChange:U}=e,G=Il(),[M,fe]=useState(0),he=U||((Ue,Xe)=>fe(Xe));let Pe;T?React.Children.map(u,Ue=>{if(React.isValidElement(Ue)&&(Ue==null?void 0:Ue.props.value)===T){var Xe;Pe=Ue==null||(Xe=Ue.props)===null||Xe===void 0?void 0:Xe.children}}):React.Children.map(u,(Ue,Xe)=>{React.isValidElement(Ue)&&Xe===M&&(Pe=Ue==null?void 0:Ue.props.children)});const Te=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Te,children:[m&&_jsx(Pl,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:G,value:T||M,onChange:he,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Pe}),v&&_jsx(BottomLink,{...v})]})})}const Ll=(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,u=Ll();return _jsx(Tab,{disableRipple:!0,classes:u,...l})}},60871:function(Ct,Be,n){"use strict";n.d(Be,{fC:function(){return g},CL:function(){return Je},sM:function(){return oe},$v:function(){return ze},v_:function(){return z},hg:function(){return vt},uB:function(){return Le},R5:function(){return qe},bq:function(){return k},Km:function(){return se},Ds:function(){return rt},ni:function(){return E},T0:function(){return I},CO:function(){return at},x8:function(){return Wn},rx:function(){return Ln},YO:function(){return xn},P4:function(){return wt},NT:function(){return qt},NW:function(){return He},VE:function(){return tt},W0:function(){return bt},gP:function(){return At},IY:function(){return mt},F4:function(){return te},ux:function(){return R},Kp:function(){return ee},$4:function(){return yt},p_:function(){return P},ZM:function(){return ot},D:function(){return Z},gW:function(){return L},E6:function(){return It},z$:function(){return _t},h_:function(){return ye},I_:function(){return B},qD:function(){return ge},vJ:function(){return Rn},tg:function(){return Tn},Oi:function(){return Vn}});var r=n(52322),p=n(51837),H=n(2784);const f=(0,p.CT)("analytics-context"),W=()=>{const we=(0,H.useContext)(f);if(we===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const le=we.atVersion(1);if(le===void 0)throw new Error("No context found for version 1.");return le},g=we=>{const{attributes:le,children:ke}=we,Qe={...W(),...le},re=(0,p.EI)({1:Qe});return(0,r.jsx)(f.Provider,{value:re,children:ke})};function d(we,le){const ke=Me=>_jsx(g,{attributes:le,children:_jsx(we,{...Me})});return ke.displayName=`WithAnalyticsContext(${we.displayName||we.name||"Component"})`,ke}function B(){const we=(0,p.Vt)("api-context");if(!we)throw new Error("API context is not available");const le=we.atVersion(1);if(!le)throw new Error("ApiContext v1 not available");return le}function ye(we){const ke=B().get(we);if(!ke)throw new Error(`No implementation available for ${we}`);return ke}function ue(we){return function(ke){const Me=re=>{const N=B(),me={};for(const $e in we)if(we.hasOwnProperty($e)){const Ge=we[$e],et=N.get(Ge);if(!et)throw new Error(`No implementation available for ${Ge}`);me[$e]=et}return _jsx(ke,{...re,...me})},Qe=ke.displayName||ke.name||"Component";return Me.displayName=`withApis(${Qe})`,Me}}var V=n(87612);class Y{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(le){if((0,V._)(this,"config",void 0),this.config=le,!le.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 '${le.id}'`)}}function I(we){return new Y(we)}function E(we,le){return"id"in we?{api:we,deps:{},factory:()=>le}:we}var oe;(function(we){we.SignedIn="SignedIn",we.SignedOut="SignedOut"})(oe||(oe={}));const ee=I({id:"core.auth.google"}),te=I({id:"core.auth.github"}),Z=I({id:"core.auth.okta"}),R=I({id:"core.auth.gitlab"}),P=I({id:"core.auth.microsoft"}),L=I({id:"core.auth.onelogin"}),k=I({id:"core.auth.bitbucket"}),se=I({id:"core.auth.bitbucket-server"}),Le=I({id:"core.auth.atlassian"}),ze=I({id:"core.alert"}),z=I({id:"core.analytics"}),vt=I({id:"core.apptheme"}),rt=I({id:"core.config"}),He=I({id:"core.discovery"}),tt=I({id:"core.error"});var Je;(function(we){we[we.None=0]="None",we[we.Active=1]="Active"})(Je||(Je={}));const bt=I({id:"core.featureflags"}),At=I({id:"core.fetch"}),yt=I({id:"core.identity"}),ot=I({id:"core.oauthrequest"}),It=I({id:"core.storage"});class Mt{setContext(le){this.context=le}captureEvent(le,ke,{value:Me,attributes:Qe}={}){try{this.analyticsApi.captureEvent({action:le,subject:ke,value:Me,attributes:Qe,context:this.context})}catch(re){console.warn("Error during analytics event capture. %o",re)}}constructor(le,ke={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=le,this.context=ke}}function Ve(){try{return ye(z)}catch{return{captureEvent:()=>{}}}}function _t(){const we=(0,H.useRef)(null),le=W(),ke=Ve();function Me(){return we.current===null&&(we.current=new Mt(ke)),we.current}const Qe=Me();return Qe.setContext(le),Qe}const ge=()=>{const we=(0,p.Vt)("app-context");if(!we)throw new Error("App context is not available");const le=we.atVersion(1);if(!le)throw new Error("AppContext v1 not available");return le},Se=(0,p.uW)("component-data-store",()=>new WeakMap),Ne="__backstage_data";function qe(we,le,ke){const Me=we;var Qe;let re=(Qe=Me[Ne])!==null&&Qe!==void 0?Qe:Se.get(we);if(re||(re={map:new Map},Object.defineProperty(Me,Ne,{enumerable:!1,configurable:!0,writable:!1,value:re}),Se.set(we,re)),re.map.has(le)){const N=we.displayName||we.name;throw new Error(`Attempted to attach duplicate data "${le}" to component "${N}"`)}re.map.set(le,ke)}function mt(we,le){if(!we)return;const ke=we.type;if(!ke)return;var Me;const Qe=(Me=ke[Ne])!==null&&Me!==void 0?Me:Se.get(ke);if(Qe)return Qe.map.get(le)}const xt=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let ut=xt,Ot=ut;class Kt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(le,ke){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Ot,void 0),this.id=le,this.params=ke,this[ut]="absolute"}}function qt(we){var le;return new Kt(we.id,(le=we.params)!==null&&le!==void 0?le:[])}const Dt=/^\w+$/;let hn=null,Xt=null;class gn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(le,ke,Me,Qe){_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,Xt,void 0),this.id=le,this.path=ke,this.parent=Me,this.params=Qe,this[hn]="sub"}}function zn(we){const{id:le,path:ke,parent:Me}=we,Qe=ke.split("/").filter(me=>me.startsWith(":")).map(me=>me.substring(1)),re=[...Me.params,...Qe];if(Me.params.some(me=>Qe.includes(me)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!ke.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${ke}'`);if(ke.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${ke}'`);for(const me of Qe)if(!Dt.test(me))throw new Error(`SubRouteRef path has invalid param, got '${me}'`);return new gn(le,ke,Me,re)}let Bn=xt,mn=Bn;class $n{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(le,ke,Me){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,mn,void 0),this.id=le,this.params=ke,this.optional=Me,this[Bn]="external"}}function Wn(we){var le;return new $n(we.id,(le=we.params)!==null&&le!==void 0?le:[],Boolean(we.optional))}var rn=n(73557);function Tn(we){const{pathname:le}=(0,rn.TH)(),ke=(0,p.Vt)("routing-context");if(!ke)throw new Error("Routing context is not available");const Me=ke.atVersion(1),Qe=(0,H.useMemo)(()=>Me&&Me.resolve(we,{pathname:le}),[Me,we,le]);if(!ke)throw new Error("useRouteRef used outside of routing context");if(!Me)throw new Error("RoutingContext v1 not available");const re="optional"in we&&we.optional;if(!Qe&&!re)throw new Error(`No path for ${we}`);return Qe}function Vn(we){return(0,rn.UO)()}class ct extends H.Component{static getDerivedStateFromError(le){return{error:le}}render(){const{error:le}=this.state,{app:ke,plugin:Me}=this.props,{ErrorBoundaryFallback:Qe}=ke.getComponents();return le?(0,r.jsx)(Qe,{error:le,resetError:this.handleErrorReset,plugin:Me}):this.props.children}constructor(...le){super(...le),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var _n=n(64355);function wt(we){const{component:le,mountPoint:ke,name:Me}=we;return xn({component:{lazy:()=>le().then(Qe=>{const re=me=>{try{Tn(ke)}catch($e){if(typeof $e=="object"&&$e!==null){const{message:Ge}=$e;if(typeof Ge=="string"&&Ge.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${ke} 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 $e}return(0,r.jsx)(Qe,{...me})},N=Me||Qe.displayName||Qe.name||"LazyComponent";return re.displayName=`RoutableExtension(${N})`,re},Qe=>N=>{const me=ge(),{BootErrorPage:$e}=me.getComponents();return(0,r.jsx)($e,{step:"load-chunk",error:Qe})})},data:{"core.mountPoint":ke},name:Me})}function at(we){const{component:le,name:ke}=we;return xn({component:le,name:ke})}function xn(we){const{data:le={},name:ke}=we;ke||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 we.component){const re=we.component.lazy;Me=(0,H.lazy)(()=>re().then(N=>({default:N})))}else Me=we.component.sync;const Qe=ke||Me.displayName||Me.name||"Component";return{expose(re){const N=me=>{const $e=ge(),{Progress:Ge}=$e.getComponents(),et=le==null?void 0:le["core.mountPoint"];return(0,r.jsx)(H.Suspense,{fallback:(0,r.jsx)(Ge,{}),children:(0,r.jsx)(ct,{app:$e,plugin:re,children:(0,r.jsx)(g,{attributes:{pluginId:re.getId(),...ke&&{extension:ke},...et&&{routeRef:et.id}},children:(0,r.jsx)(_n.o,{plugin:re,children:(0,r.jsx)(Me,{...me})})})})})};qe(N,"core.plugin",re),qe(N,"core.extensionName",ke);for(const[me,$e]of Object.entries(le))qe(N,me,$e);return N.displayName=`Extension(${Qe})`,N}}}function Jt(we,le,ke,Me){return H.Children.toArray(we).flatMap(Qe=>{if(!(0,H.isValidElement)(Qe))return[];if(Qe.type===H.Fragment)return Jt(Qe.props.children,le,ke,Me);if(mt(Qe,"core.featureFlagged")){const re=Qe.props;return("with"in re?le.isActive(re.with):!le.isActive(re.without))?Jt(Qe.props.children,le,ke,Me):[]}if(ke===void 0||ke(Qe))return[Qe];if(Me)throw new Error(Me);return Jt(Qe.props.children,le,ke,Me)})}class pn{selectByComponentData(le){const ke=Jt(this.node,this.featureFlagsApi,Me=>mt(Me,le.key)!==void 0,le.withStrictError);return new pn(ke,this.featureFlagsApi)}findComponentData(le){return Jt(this.node,this.featureFlagsApi,Me=>mt(Me,le.key)!==void 0).map(Me=>mt(Me,le.key)).filter(Me=>Me!==void 0)}getElements(){return Jt(this.node,this.featureFlagsApi)}constructor(le,ke){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=le,this.featureFlagsApi=ke}}function Rn(we,le,ke=[]){const Me=ye(bt),Qe=new pn(we,Me);return(0,H.useMemo)(()=>le(Qe),[we,...ke])}class dn{getId(){return this.config.id}getApis(){var le;return(le=this.config.apis)!==null&&le!==void 0?le:[]}getFeatureFlags(){var le,ke;return(ke=(le=this.config.featureFlags)===null||le===void 0?void 0:le.slice())!==null&&ke!==void 0?ke:[]}get routes(){var le;return(le=this.config.routes)!==null&&le!==void 0?le:{}}get externalRoutes(){var le;return(le=this.config.externalRoutes)!==null&&le!==void 0?le:{}}provide(le){return le.expose(this)}__experimentalReconfigure(le){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(le))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var le;return(le=this.options)!==null&&le!==void 0?le:{}}toString(){return`plugin{${this.config.id}}`}constructor(le){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=le,this.options=void 0}}function Ln(we){return new dn(we)}},64355:function(Ct,Be,n){"use strict";n.d(Be,{o:function(){return W},y:function(){return g}});var r=n(52322),p=n(51837),H=n(2784);const f="plugin-context",W=d=>{const{children:B,plugin:ye}=d,{Provider:ue}=(0,p.CT)(f);return(0,r.jsx)(ue,{value:(0,p.EI)({1:{plugin:ye}}),children:B})};function g(){const d=(0,p.Vt)(f);if(!d)throw new Error("Plugin Options context is not available");const B=d.atVersion(1);if(!B)throw new Error("Plugin Options v1 is not available");return B.plugin.getPluginOptions()}},23054:function(Ct,Be,n){"use strict";n.d(Be,{SP:function(){return ee},dR:function(){return Y},VL:function(){return Z},BD:function(){return p}});function r(R){if(typeof R!="object"||R===null||Array.isArray(R))return!1;const P=R;return!(typeof P.name!="string"||P.name===""||typeof P.message!="string")}function p(R){if(typeof R!="object"||R===null||Array.isArray(R))throw new Error(`Encountered invalid error, not an object, got '${R}'`);const P=R;if(typeof P.name!="string"||P.name==="")throw new Error(`Encountered error object without a name, got '${R}'`);if(typeof P.message!="string")throw new Error(`Encountered error object without a message, got '${R}'`)}var H=n(87612),f=n(24852);function W(R,P){const k={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(R)};return P!=null&&P.includeStack||delete k.stack,k}function g(R){const P=(0,f.deserializeError)(R);return R.stack||(P.stack=void 0),P}function d(R){if(r(R)){const P=String(R);return P!=="[object Object]"?P:`${R.name}: ${R.message}`}return`unknown error '${R}'`}class B extends Error{constructor(P,L){var k;let se=P;if(L!==void 0){const Le=d(L);se?se+=`; caused by ${Le}`:se=`caused by ${Le}`}super(se),(0,H._)(this,"cause",void 0),(k=Error.captureStackTrace)===null||k===void 0||k.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=r(L)?L:void 0}}class ye extends null{}class ue extends null{}class V extends null{}class Y extends B{}class I extends null{}class E extends null{}class oe extends null{}class ee extends B{constructor(P,L){super(P,L),this.name=r(L)?L.name:"Error"}}async function te(R){try{const L=await R.text();if(L){var P;if(!((P=R.headers.get("content-type"))===null||P===void 0)&&P.startsWith("application/json"))try{const k=JSON.parse(L);if(k.error&&k.response)return k}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}, ${L}`},response:{statusCode:R.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}`},response:{statusCode:R.status}}}class Z extends Error{static async fromResponse(P){const L=await te(P),k=L.response.statusCode||P.status,se=L.error.name||P.statusText,Le=`Request failed with ${k} ${se}`,ze=g(L.error);return new Z({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,Be,n){"use strict";n.d(Be,{nW:function(){return ee},ae:function(){return V},q3:function(){return Y}});var r=n(60871);const p=(0,r.T0)({id:"core.scmauth"});var H=new WeakMap;class f{async getCredentials(Z){const R=new URL(Z.url),P=_class_private_field_get(this,H).find(L=>L.isUrlSupported(R));if(!P)throw new Error(`No auth provider available for '${Z.url}', see https://backstage.io/link?scm-auth`);return P.getCredentials(Z)}constructor(Z){_class_private_field_init(this,H,{writable:!0,value:void 0}),_class_private_field_set(this,H,Z)}}var W=new WeakMap,g=new WeakMap,d=new WeakMap,B=new WeakMap;class ye{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:Z,gitlab:R,azure:P,bitbucket:L})=>ye.merge(ye.forGithub(Z),ye.forGitlab(R),ye.forAzure(P),ye.forBitbucket(L))})}static forAuthApi(Z,R){return new ye("generic",Z,R.host,R.scopeMapping)}static forGithub(Z,R){var P;const L=(P=R==null?void 0:R.host)!==null&&P!==void 0?P:"github.com";return new ye("github",Z,L,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(Z,R){var P;const L=(P=R==null?void 0:R.host)!==null&&P!==void 0?P:"gitlab.com";return new ye("gitlab",Z,L,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(Z,R){var P;const L=(P=R==null?void 0:R.host)!==null&&P!==void 0?P:"dev.azure.com";return new ye("azure",Z,L,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(Z,R){var P;const L=(P=R==null?void 0:R.host)!==null&&P!==void 0?P:"bitbucket.org";return new ye("bitbucket",Z,L,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...Z){return new f(Z)}isUrlSupported(Z){return Z.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider(Z){var R;if(!(Z!=null&&Z.customScopes)||_class_private_field_get(this,B)==="generic")return[];var P;return(P=(R=Z.customScopes)===null||R===void 0?void 0:R[_class_private_field_get(this,B)])!==null&&P!==void 0?P:[]}async getCredentials(Z){const{url:R,additionalScope:P,...L}=Z,k=_class_private_field_get(this,d).default.slice();P!=null&&P.repoWrite&&k.push(..._class_private_field_get(this,d).repoWrite);const se=this.getAdditionalScopesForProvider(P);se.length&&k.push(...se);const Le=[...new Set(k)],ze=await _class_private_field_get(this,W).getAccessToken(Le,L);return{token:ze,headers:{Authorization:`Bearer ${ze}`}}}constructor(Z,R,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,d,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,W,R),_class_private_field_set(this,g,P),_class_private_field_set(this,d,L),_class_private_field_set(this,B,Z)}}var ue=n(79158);class V{static fromConfig(Z){return ue.Lx.fromConfig(Z)}}const Y=(0,r.T0)({id:"integration.scmintegrations"});var I=n(52322),E=n(73250),oe=n(2784);const ee=te=>{const{type:Z}=te,R=(0,r.qD)(),P=E.Z;var L;const k=Z&&(L=R.getSystemIcon(Z))!==null&&L!==void 0?L:P;return(0,I.jsx)(k,{})}},79158:function(Ct,Be,n){"use strict";n.d(Be,{Lx:function(){return sr},BT:function(){return lt}});var r=n(87612),p=n(82717),H=n.n(p),f=n(76635);function W(C){const c=new URL("http://example.com");return c.host=C,c.host===C}function g(C){try{return new URL(C),!0}catch{return!1}}function d(C,c){return{list(){return C},byUrl(x){try{const A=typeof x=="string"?new URL(x):x;return C.find(Q=>c(Q)===A.host)}catch{return}},byHost(x){return C.find(A=>c(A)===x)}}}function B(C){const{url:c,base:x,lineNumber:A}=C;try{return new URL(c),c}catch{}let Q;if(c.startsWith("/")){const{filepath:be}=H()(x);Q=new URL(x);const Ee=(0,f.trimEnd)(Q.pathname.substring(0,Q.pathname.length-be.length),"/");Q.pathname=`${Ee}${c}`}else Q=new URL(c,x);return Q.search=new URL(x).search,A&&(Q.hash=`L${A}`),Q.toString()}function ye(C){beforeAll(()=>C.listen({onUnhandledRequest:"error"})),afterAll(()=>C.close()),afterEach(()=>C.resetHandlers())}const ue="amazonaws.com";function V(C){const c=C.getOptionalString("endpoint");var x;const A=(x=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&x!==void 0?x:!1;let Q,be;if(c){try{const bn=new URL(c);Q=bn.host,be=bn.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 Ee=C.getOptionalString("accessKeyId"),De=C.getOptionalString("secretAccessKey"),dt=C.getOptionalString("roleArn"),Qt=C.getOptionalString("externalId");return{host:Q,endpoint:c,s3ForcePathStyle:A,accessKeyId:Ee,secretAccessKey:De,roleArn:dt,externalId:Qt}}function Y(C){const c=C.map(V);return c.some(x=>x.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,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(I,"factory",({config:C})=>{var c;const x=Y((c=C.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return d(x.map(A=>new I(A)),A=>A.config.host)});var E=n(88412),oe=n(50629),ee=n(80956);const te="GB";var Z=new WeakMap,R=new WeakMap,P=new WeakMap,L=new WeakMap,k=new WeakMap,se=new WeakMap,Le=new WeakMap;class ze{static fromRepoUrl(c){const x=new URL(c);let A,Q,be;const Ee=x.pathname.split("/").map(jn=>decodeURIComponent(jn));if(Ee[2]==="_git"?(A=Ee[1],Q=be=Ee[3]):Ee[3]==="_git"?(A=Ee[1],Q=Ee[2],be=Ee[4]):Ee[4]==="_git"&&(A=`${Ee[1]}/${Ee[2]}`,Q=Ee[3],be=Ee[5]),!A||!Q||!be)throw new Error("Azure URL must point to a git repository");var De;const dt=(De=x.searchParams.get("path"))!==null&&De!==void 0?De:void 0;let Qt;const bn=x.searchParams.get("version");if(bn){if(bn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Qt=bn.slice(2)}return new ze(x.origin,A,Q,be,dt,Qt)}toRepoUrl(){let c;return(0,E._)(this,P)===(0,E._)(this,L)?c=(0,E._)(this,Le).call(this,(0,E._)(this,R),"_git",(0,E._)(this,L)):c=(0,E._)(this,Le).call(this,(0,E._)(this,R),(0,E._)(this,P),"_git",(0,E._)(this,L)),(0,E._)(this,k)&&c.searchParams.set("path",(0,E._)(this,k)),(0,E._)(this,se)&&c.searchParams.set("version",te+(0,E._)(this,se)),c.toString()}toFileUrl(){if(!(0,E._)(this,k))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,E._)(this,Le).call(this,(0,E._)(this,R),(0,E._)(this,P),"_apis","git","repositories",(0,E._)(this,L),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,E._)(this,k)),(0,E._)(this,se)&&c.searchParams.set("version",(0,E._)(this,se)),c.toString()}toArchiveUrl(){const c=(0,E._)(this,Le).call(this,(0,E._)(this,R),(0,E._)(this,P),"_apis","git","repositories",(0,E._)(this,L),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,E._)(this,k)&&c.searchParams.set("scopePath",(0,E._)(this,k)),(0,E._)(this,se)&&c.searchParams.set("version",(0,E._)(this,se)),c.toString()}toCommitsUrl(){const c=(0,E._)(this,Le).call(this,(0,E._)(this,R),(0,E._)(this,P),"_apis","git","repositories",(0,E._)(this,L),"commits");return c.searchParams.set("api-version","6.0"),(0,E._)(this,se)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,E._)(this,se)),c.toString()}getOwner(){return(0,E._)(this,R)}getProject(){return(0,E._)(this,P)}getRepo(){return(0,E._)(this,L)}getPath(){return(0,E._)(this,k)}getRef(){return(0,E._)(this,se)}constructor(c,x,A,Q,be,Ee){(0,oe._)(this,Z,{writable:!0,value:void 0}),(0,oe._)(this,R,{writable:!0,value:void 0}),(0,oe._)(this,P,{writable:!0,value:void 0}),(0,oe._)(this,L,{writable:!0,value:void 0}),(0,oe._)(this,k,{writable:!0,value:void 0}),(0,oe._)(this,se,{writable:!0,value:void 0}),(0,oe._)(this,Le,{writable:!0,value:(...De)=>{const dt=new URL((0,E._)(this,Z));return dt.pathname=De.map(Qt=>encodeURIComponent(Qt)).join("/"),dt}}),(0,ee._)(this,Z,c),(0,ee._)(this,R,x),(0,ee._)(this,P,A),(0,ee._)(this,L,Q),(0,ee._)(this,k,be),(0,ee._)(this,se,Ee)}}const z="dev.azure.com";function vt(C){var c;const x=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:z,A=C.getOptionalString("token");if(!W(x))throw new Error(`Invalid Azure integration config, '${x}' is not a valid host`);return{host:x,token:A}}function rt(C){const c=C.map(vt);return c.some(x=>x.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:x,base:A}=c;if(g(x))return x;try{const be=ze.fromRepoUrl(A),Ee=new URL(A);var Q;const De=new URL(`https://a.com${(Q=be.getPath())!==null&&Q!==void 0?Q:""}`),dt=new URL(x,De).pathname;return Ee.searchParams.set("path",dt),c.lineNumber&&(Ee.searchParams.set("line",String(c.lineNumber)),Ee.searchParams.set("lineEnd",String(c.lineNumber+1)),Ee.searchParams.set("lineStartColumn","1"),Ee.searchParams.set("lineEndColumn","1")),Ee.toString()}catch{return new URL(x,A).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(He,"factory",({config:C})=>{var c;const x=rt((c=C.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return d(x.map(A=>new He(A)),A=>A.config.host)});var tt=n(48834).lW;function Je(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function bt(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function At(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}function yt(C,c){const x=c?{...c}:{};if(C.token){const A=tt.from(`:${C.token}`,"utf8");x.Authorization=`Basic ${A.toString("base64")}`}return{headers:x}}const ot="bitbucket.org",It="https://api.bitbucket.org/2.0";function Mt(C){var c;const x=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:ot;let A=C.getOptionalString("apiBaseUrl");const Q=C.getOptionalString("token"),be=C.getOptionalString("username"),Ee=C.getOptionalString("appPassword");if(!W(x))throw new Error(`Invalid Bitbucket integration config, '${x}' is not a valid host`);return A?A=(0,f.trimEnd)(A,"/"):x===ot?A=It:A=`https://${x}/rest/api/1.0`,{host:x,apiBaseUrl:A,token:Q,username:be,appPassword:Ee}}function Ve(C){const c=C.map(Mt);return c.some(x=>x.host===ot)||c.push({host:ot,apiBaseUrl:It}),c}class _t{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=B(c);if(!c.lineNumber)return x;const A=new URL(x);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${c.lineNumber}`:A.hash=`${c.lineNumber}`,A.toString()}resolveEditUrl(c){const x=H()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",x.ref),A.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(_t,"factory",({config:C})=>{var c,x,A;const Q=Ve((A=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(x=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&x!==void 0?x:[]]);return d(Q.map(be=>new _t(be)),be=>be.config.host)});var ge=n(96279),Se=n(48834).lW;async function Ne(C,c){const{name:x,owner:A,resource:Q}=parseGitUrl(C),be=Q==="bitbucket.org";let Ee=be?`${c.apiBaseUrl}/repositories/${A}/${x}`:`${c.apiBaseUrl}/projects/${A}/repos/${x}/default-branch`,De=await fetch(Ee,xt(c));if(De.status===404&&!be&&(Ee=`${c.apiBaseUrl}/projects/${A}/repos/${x}/branches/default`,De=await fetch(Ee,xt(c))),!De.ok){const Qt=`Failed to retrieve default branch from ${Ee}, ${De.status} ${De.statusText}`;throw new Error(Qt)}let dt;if(be)dt=(await De.json()).mainbranch.name;else{const{displayId:Qt}=await De.json();dt=Qt}if(!dt)throw new Error(`Failed to read default branch from ${Ee}. Response ${De.status} ${De.json()}`);return dt}async function qe(C,c){const{name:x,owner:A,ref:Q,protocol:be,resource:Ee,filepath:De}=parseGitUrl(C),dt=Ee==="bitbucket.org";let Qt=Q;Qt||(Qt=await Ne(C,c));const bn=De?`&path=${encodeURIComponent(decodeURIComponent(De))}`:"";return dt?`${be}://${Ee}/${A}/${x}/get/${Qt}.tar.gz`:`${c.apiBaseUrl}/projects/${A}/repos/${x}/archive?format=tgz&at=${Qt}&prefix=${A}-${x}${bn}`}function mt(C,c){try{const{owner:x,name:A,ref:Q,filepathtype:be,filepath:Ee}=parseGitUrl(C);if(!x||!A||be!=="browse"&&be!=="raw"&&be!=="src")throw new Error("Invalid Bitbucket URL or file path");const De=Ee.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${x}/${A}/src/${Q}/${De}`}return`${c.apiBaseUrl}/projects/${x}/repos/${A}/raw/${De}?at=${Q}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function xt(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const x=Se.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}const ut="bitbucket.org",Ot="https://api.bitbucket.org/2.0";function Kt(C){const c=ut,x=Ot,A=C.getString("username"),Q=C.getString("appPassword");return{host:c,apiBaseUrl:x,username:A,appPassword:Q}}function qt(C){const c=C.map(Kt);return c.length===0&&c.push({host:ut,apiBaseUrl:Ot}),c}class Dt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=B(c);if(c.lineNumber){const A=new URL(x);return A.hash=`lines-${c.lineNumber}`,A.toString()}return x}resolveEditUrl(c){const x=H()(c),A=new URL(c);return A.searchParams.set("mode","edit"),A.searchParams.set("at",x.ref),A.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Dt,"factory",({config:C})=>{var c;const x=qt((c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return d(x.map(A=>new Dt(A)),A=>A.config.host)});var hn=n(48834).lW;async function Xt(C,c){const{name:x,owner:A}=parseGitUrl(C),Q=`${c.apiBaseUrl}/repositories/${A}/${x}`,be=await fetch(Q,Bn(c));if(!be.ok){const dt=`Failed to retrieve default branch from ${Q}, ${be.status} ${be.statusText}`;throw new Error(dt)}const De=(await be.json()).mainbranch.name;if(!De)throw new Error(`Failed to read default branch from ${Q}. Response ${be.status} ${be.json()}`);return De}async function gn(C,c){const{name:x,owner:A,ref:Q,protocol:be,resource:Ee}=parseGitUrl(C);let De=Q;return De||(De=await Xt(C,c)),`${be}://${Ee}/${A}/${x}/get/${De}.tar.gz`}function zn(C,c){try{const{owner:x,name:A,ref:Q,filepathtype:be,filepath:Ee}=parseGitUrl(C);if(!x||!A||be!=="src"&&be!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const De=Ee.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${x}/${A}/src/${Q}/${De}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function Bn(C){const c={};if(C.username&&C.appPassword){const x=hn.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}function mn(C){const c=C.getString("host");let x=C.getOptionalString("apiBaseUrl");const A=C.getOptionalString("token"),Q=C.getOptionalString("username"),be=C.getOptionalString("password");if(!W(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:x,token:A,username:Q,password:be}}function $n(C){return C.map(mn)}class Wn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const x=B(c);if(c.lineNumber){const A=new URL(x);return A.hash=c.lineNumber.toString(),A.toString()}return x}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Wn,"factory",({config:C})=>{var c;const x=$n((c=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return d(x.map(A=>new Wn(A)),A=>A.config.host)});var rn=n(48834).lW;async function Tn(C,c){const{name:x,owner:A}=parseGitUrl(C);let Q=`${c.apiBaseUrl}/projects/${A}/repos/${x}/default-branch`,be=await fetch(Q,_n(c));if(be.status===404&&(Q=`${c.apiBaseUrl}/projects/${A}/repos/${x}/branches/default`,be=await fetch(Q,_n(c))),!be.ok){const dt=`Failed to retrieve default branch from ${Q}, ${be.status} ${be.statusText}`;throw new Error(dt)}const{displayId:Ee}=await be.json(),De=Ee;if(!De)throw new Error(`Failed to read default branch from ${Q}. Response ${be.status} ${be.json()}`);return De}async function Vn(C,c){const{name:x,owner:A,ref:Q,filepath:be}=parseGitUrl(C);let Ee=Q;Ee||(Ee=await Tn(C,c));const De=be?`&path=${encodeURIComponent(decodeURIComponent(be))}`:"";return`${c.apiBaseUrl}/projects/${A}/repos/${x}/archive?format=tgz&at=${Ee}&prefix=${A}-${x}${De}`}function ct(C,c){try{const{owner:x,name:A,ref:Q,filepathtype:be,filepath:Ee}=parseGitUrl(C);if(!x||!A||be!=="browse"&&be!=="raw"&&be!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const De=Ee.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${x}/repos/${A}/raw/${De}?at=${Q}`}catch(x){throw new Error(`Incorrect URL: ${C}, ${x}`)}}function _n(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const x=rn.from(`${C.username}:${C.password}`,"utf8");c.Authorization=`Basic ${x.toString("base64")}`}return{headers:c}}function wt(C){const c=C.getString("host");let x=C.getOptionalString("baseUrl"),A=C.getOptionalString("cloneUrl"),Q=C.getOptionalString("gitilesBaseUrl");const be=C.getOptionalString("username"),Ee=C.getOptionalString("password");if(W(c)){if(x&&!g(x))throw new Error(`Invalid Gerrit integration config, '${x}' is not a valid baseUrl`);if(A&&!g(A))throw new Error(`Invalid Gerrit integration config, '${A}' 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 x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}`,Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,A?A=(0,f.trimEnd)(A,"/"):A=x,{host:c,baseUrl:x,cloneUrl:A,gitilesBaseUrl:Q,username:be,password:Ee}}function at(C){return C.map(wt)}var xn=n(48834).lW;const Jt=")]}'";function pn(C,c){const A=c.replace(C.gitilesBaseUrl,"").split("/").filter(Qt=>!!Qt),Q=A.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${c}`);const be=(0,f.trimStart)(A.slice(0,Q).join("/"),"/"),Ee=A.indexOf("heads");if(Ee<=0)throw new Error(`Unable to parse branch from url: ${c}`);const De=A[Ee+1],dt=A.slice(Ee+2).join("/");return{branch:De,filePath:dt===""?"/":dt,project:be}}function Rn(C,c,x,A){return`${C.gitilesBaseUrl}/${c}/+/refs/heads/${x}/${(0,f.trimStart)(A,"/")}`}function dn(C){return C.password?"/a/":"/"}function Ln(C,c){const{branch:x,project:A}=pn(C,c);return`${C.baseUrl}${dn(C)}projects/${encodeURIComponent(A)}/branches/${x}`}function we(C,c){const{project:x}=pn(C,c);return`${C.cloneUrl}${dn(C)}${x}`}function le(C,c){const{branch:x,filePath:A,project:Q}=pn(C,c);return`${C.baseUrl}${dn(C)}projects/${encodeURIComponent(Q)}/branches/${x}/files/${encodeURIComponent(A)}/content`}function ke(C){return`${C.baseUrl}${dn(C)}projects/`}function Me(C){const c={};if(!C.password)return c;const x=xn.from(`${C.username}:${C.password}`,"utf8");return c.Authorization=`Basic ${x.toString("base64")}`,{headers:c}}async function Qe(C){const c=await C.text();if(c.startsWith(Jt))try{return JSON.parse(c.slice(Jt.length))}catch(x){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${x}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class re{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:x,base:A,lineNumber:Q}=c;let be;if(x.startsWith("/")){const{branch:Ee,project:De}=pn(this.config,A);return Rn(this.config,De,Ee,x)}return x?be=new URL(x,A):be=new URL(A),Q&&(be.hash=Q.toString()),be.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(re,"factory",({config:C})=>{var c;const x=at((c=C.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return d(x.map(A=>new re(A)),A=>A.config.host)});function N(C){const c=C.getString("host");let x=C.getOptionalString("baseUrl");const A=C.getOptionalString("username"),Q=C.getOptionalString("password");if(!W(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return x?x=(0,f.trimEnd)(x,"/"):x=`https://${c}`,{host:c,baseUrl:x,username:A,password:Q}}var me=n(48834).lW;function $e(C,c){try{var x;const A=(x=C.baseUrl)!==null&&x!==void 0?x:`https://${C.host}`,[Q,be,Ee,De,dt,Qt,...bn]=c.replace(A,"").split("/"),jn=bn.join("/").replace(/^\//,"");return`${A}/${be}/${Ee}/_edit/${Qt}/${jn}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function Ge(C,c){try{var x;const A=(x=C.baseUrl)!==null&&x!==void 0?x:`https://${C.host}`,[Q,be,Ee,De,dt,Qt,...bn]=c.replace(A,"").split("/"),jn=bn.join("/").replace(/^\//,"");return`${A}/api/v1/repos/${be}/${Ee}/contents/${jn}?ref=${Qt}`}catch(A){throw new Error(`Incorrect URL: ${c}, ${A}`)}}function et(C){const c={},{username:x,password:A}=C;return A?(x?c.Authorization=`basic ${me.from(`${x}:${A}`).toString("base64")}`:c.Authorization=`token ${A}`,{headers:c}):c}class $t{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return B(c)}resolveEditUrl(c){return $e(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)($t,"factory",({config:C})=>{var c;const A=((c=C.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(Q=>N(Q));return d(A.map(Q=>new $t(Q)),Q=>Q.config.host)});const zt="github.com",tn="https://api.github.com",q="https://raw.githubusercontent.com";function J(C){var c,x;const A=(x=C.getOptionalString("host"))!==null&&x!==void 0?x:zt;let Q=C.getOptionalString("apiBaseUrl"),be=C.getOptionalString("rawBaseUrl");const Ee=C.getOptionalString("token"),De=(c=C.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(dt=>({appId:dt.getNumber("appId"),clientId:dt.getString("clientId"),clientSecret:dt.getString("clientSecret"),webhookSecret:dt.getString("webhookSecret"),privateKey:dt.getString("privateKey"),allowedInstallationOwners:dt.getOptionalStringArray("allowedInstallationOwners")}));if(!W(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return Q?Q=(0,f.trimEnd)(Q,"/"):A===zt&&(Q=tn),be?be=(0,f.trimEnd)(be,"/"):A===zt&&(be=q),{host:A,apiBaseUrl:Q,rawBaseUrl:be,token:Ee,apps:De}}function ie(C){const c=C.map(J);return c.some(x=>x.host===zt)||c.push({host:zt,apiBaseUrl:tn,rawBaseUrl:q}),c}function pe(C,c,x){try{const{owner:A,name:Q,ref:be,filepathtype:Ee,filepath:De}=parseGitUrl(C);if(!A||!Q||!be||Ee!=="blob"&&Ee!=="raw"&&Ee!=="tree")throw new Error("Invalid GitHub URL or file path");const dt=De.replace(/^\//,"");return y(c,x)==="api"?`${c.apiBaseUrl}/repos/${A}/${Q}/contents/${dt}?ref=${be}`:`${c.rawBaseUrl}/${A}/${Q}/${be}/${dt}`}catch(A){throw new Error(`Incorrect URL: ${C}, ${A}`)}}function ae(C,c){const x={};return y(C,c)==="api"&&(x.Accept="application/vnd.github.v3.raw"),c.token&&(x.Authorization=`token ${c.token}`),{headers:x}}function y(C,c){return C.apiBaseUrl&&(c.token||!C.rawBaseUrl)?"api":"raw"}var $=n(35355),X=n(89393),K=n(26228);class je{async getOrCreateToken(c,x,A){let Q=this.tokenCache.get(c);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await A(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(c,Q)),!this.appliesToRepo(Q,x))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${x}`);return{accessToken:Q.token}}appliesToRepo(c,x){return x===void 0?!0:c.repositories!==void 0?c.repositories.includes(x):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>K.ou.local()>c)}}const Ae={Accept:"application/vnd.github.machine-man-preview+json"};class Ke{async getInstallationCredentials(c,x){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,x,async()=>{const{installationId:Q,suspended:be}=await this.getInstallationData(c);if(be)throw new Error(`The GitHub application for ${c} is suspended`);const Ee=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:Ae});let De;if(Ee.data.repository_selection==="selected"){const Qt=new X.v({baseUrl:this.baseUrl,auth:Ee.data.token}),bn=await Qt.paginate(Qt.apps.listReposAccessibleToInstallation);var dt;De=((dt=bn.repositories)!==null&&dt!==void 0?dt:bn).map(pr=>pr.name)}return{token:Ee.data.token,expiresAt:K.ou.fromISO(Ee.data.expires_at),repositories:De}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const A=(await this.getInstallations()).find(be=>{var Ee,De;return((Ee=be.account)===null||Ee===void 0||(De=Ee.login)===null||De===void 0?void 0:De.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const Q=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(c,x){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new je),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=x,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
+
`)},this.appClient=new X.v({baseUrl:x,headers:Ae,authStrategy:$.i,auth:this.baseAuthConfig})}}class Tt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(x=>x.getInstallations()))).flat():[]}async getAppToken(c,x){if(this.apps.length===0)return;const A=await Promise.all(this.apps.map(De=>De.getInstallationCredentials(c,x).then(dt=>({credentials:dt,error:void 0}),dt=>({credentials:void 0,error:dt})))),Q=A.find(De=>{var dt;return(dt=De.credentials)===null||dt===void 0?void 0:dt.accessToken});if(Q)return Q.credentials.accessToken;const Ee=A.map(De=>De.error).find(De=>(De==null?void 0:De.name)!=="NotFoundError");if(Ee)throw Ee}constructor(c){var x;(0,r._)(this,"apps",void 0);var A;this.apps=(A=(x=c.apps)===null||x===void 0?void 0:x.map(Q=>new Ke(Q,c.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class ht{async getCredentials(c){const x=H()(c.url),A=x.owner||x.name,Q=x.owner?x.name:void 0;let be="app",Ee=await this.githubAppCredentialsMux.getAppToken(A,Q);return Ee||(be="token",Ee=this.token),{headers:Ee?{Authorization:`Bearer ${Ee}`}:void 0,token:Ee,type:be}}constructor(c,x){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=x}}(0,r._)(ht,"create",C=>new ht(new Tt(C),C.token));class pt{static fromIntegrations(c){const x=new Map;return c.github.list().forEach(A=>{const Q=SingleInstanceGithubCredentialsProvider.create(A.config);x.set(A.config.host,Q)}),new pt(x)}async getCredentials(c){const x=new URL(c.url),A=this.providers.get(x.host);if(!A)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return A.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ye{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return lt(B(c),"tree")}resolveEditUrl(c){return lt(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ye,"factory",({config:C})=>{var c;const x=ie((c=C.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return d(x.map(A=>new Ye(A)),A=>A.config.host)});function lt(C,c){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(x,A,Q,be)=>`//${A}/${Q}/${be}/${c}/`)}const st=null;class jt extends Ye{get config(){return super.config}constructor(c){super(c)}}(0,r._)(jt,"factory",Ye.factory);const Wt=null,en=null,nn=null,Zt="gitlab.com",Vt="https://gitlab.com/api/v4";function Pt(C){const c=C.getString("host");let x=C.getOptionalString("apiBaseUrl");const A=C.getOptionalString("token");let Q=C.getOptionalString("baseUrl");if(x?x=(0,f.trimEnd)(x,"/"):c===Zt&&(x=Vt),Q?Q=(0,f.trimEnd)(Q,"/"):Q=`https://${c}`,W(c)){if(!x||!g(x))throw new Error(`Invalid GitLab integration config, '${x}' 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:A,apiBaseUrl:x,baseUrl:Q}}function Lt(C){const c=C.map(Pt);return c.some(x=>x.host===Zt)||c.push({host:Zt,apiBaseUrl:Vt,baseUrl:`https://${Zt}`}),c}function Ut(C){let c="";return C.host!==Zt&&(c=new URL(C.baseUrl).pathname),trimEnd(c,"/")}async function In(C,c){const x=await hr(C,c);return Qn(C,x,c).toString()}function Pn(C){const{token:c=""}=C;return{headers:{"PRIVATE-TOKEN":c}}}function Qn(C,c,x){try{const A=new URL(C),Q=A.pathname.split("/blob/").slice(1).join("/blob/"),[be,...Ee]=Q.split("/"),De=getGitLabIntegrationRelativePath(x);return A.pathname=[...De?[De]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(Ee.join("/"))),"raw"].join("/"),A.search=`?ref=${be}`,A}catch(A){throw new Error(`Incorrect url: ${C}, ${A}`)}}async function hr(C,c){const x=new URL(C);if(!x.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=x.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(c);Q&&(A=A.replace(Q,""));const be=new URL(`${x.origin}${Q}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),Ee=await fetch(be.toString(),Pn(c)),De=await Ee.json();if(!Ee.ok)throw new Error(`GitLab Error '${De.error}', ${De.error_description}`);return Number(De.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${C}, ${A}`)}}class wn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return B(c)}resolveEditUrl(c){return Dn(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(wn,"factory",({config:C})=>{var c;const x=Lt((c=C.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return d(x.map(A=>new wn(A)),A=>A.config.host)});function Dn(C,c){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class sr{static fromConfig(c){return new sr({awsS3:I.factory({config:c}),azure:He.factory({config:c}),bitbucket:_t.factory({config:c}),bitbucketCloud:Dt.factory({config:c}),bitbucketServer:Wn.factory({config:c}),gerrit:re.factory({config:c}),github:Ye.factory({config:c}),gitlab:wn.factory({config:c}),gitea:$t.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 x=Object.values(this.byType).map(A=>A.byUrl(c)).filter(Boolean);if(x.length>1){const A=x.filter(Q=>!(Q instanceof _t));A.length!==0&&(x=A)}return x[0]}byHost(c){return Object.values(this.byType).map(x=>x.byHost(c)).find(Boolean)}resolveUrl(c){const x=this.byUrl(c.base);return x?x.resolveUrl(c):B(c)}resolveEditUrl(c){const x=this.byUrl(c);return x?x.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},30966:function(Ct,Be,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return L.s4}});var p=n(52322),H=n(2784),f=n(28316),W=n(73557),g=n(60871);const d=(0,g.T0)({id:"plugin.techdocs.storageservice"}),B=(0,g.T0)({id:"plugin.techdocs.service"});var ye=n(92077),ue=n(95481),V=n(7476),Y=n(93225),I=n(86317),E=n(65124),oe=n(22478),ee=n(85478),te=n(68435),Z=n(3482),R=n(42081),P=n(48431),L=n(89258),k=n(52943),se=n(61886),Le=n(13980),ze=n.n(Le),z=n(87612);class vt{get(t){for(const s of this.holders){const a=s.get(t);if(a)return a}}constructor(...t){(0,z._)(this,"holders",void 0),this.holders=t}}var rt=n(51837);const He=(0,rt.CT)("api-context"),tt=i=>{var t;const{apis:s,children:a}=i,h=(t=(0,H.useContext)(He))===null||t===void 0?void 0:t.atVersion(1),S=h?new vt(s,h):s;return(0,p.jsx)(He.Provider,{value:(0,rt.EI)({1:S}),children:a})};tt.propTypes={apis:ze().shape({get:ze().func.isRequired}).isRequired,children:ze().node};class Je{static validateFactories(t,s){for(const a of s){const h=[a],S=new Set;for(;h.length;){const O=h.shift(),F=t.get(O);if(F)for(const ne of Object.values(F.deps)){if(ne.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);S.has(ne)||(S.add(ne),h.push(ne))}}}}get(t){return this.load(t)}load(t,s=[]){const a=this.apis.get(t.id);if(a)return a;const h=this.factories.get(t);if(!h)return;if(s.includes(h.api))throw new Error(`Circular dependency of api factory for ${h.api}`);const S=this.loadDeps(t,h.deps,[...s,h.api]),O=h.factory(S);return this.apis.set(t.id,O),O}loadDeps(t,s,a){const h={};for(const S in s)if(s.hasOwnProperty(S)){const O=s[S],F=this.load(O,a);if(!F)throw new Error(`No API factory available for dependency ${O} of dependent ${t}`);h[S]=F}return h}constructor(t){(0,z._)(this,"factories",void 0),(0,z._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var bt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(bt||(bt={}));class At{register(t,s){const a=bt[t],h=this.factories.get(s.api.id);return h&&h.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(t){const s=this.factories.get(t.id);if(s)return s.factory}getAllApis(){const t=new Set;for(const{factory:s}of this.factories.values())t.add(s.api);return t}constructor(){(0,z._)(this,"factories",new Map)}}function yt(i){return new Promise((t,s)=>{const a=i.width||500,h=i.height||700,S=window.screen.width/2-a/2,O=window.screen.height/2-h/2,F=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${h},top=${O},left=${S}`);let ne="";if(!F||typeof F.closed=="undefined"||F.closed){const gt=new Error("Failed to open auth popup.");gt.name="PopupRejectedError",s(gt);return}const xe=gt=>{if(gt.source!==F||gt.origin!==i.origin)return;const{data:Et}=gt;if(Et.type==="config_info"){ne=Et.targetOrigin;return}if(Et.type!=="authorization_response")return;const Rt=Et;if("error"in Rt){const Yt=new Error(Rt.error.message);Yt.name=Rt.error.name,s(Yt)}else t(Rt.response);We()},Ie=setInterval(()=>{if(F.closed){const gt=`Login failed, ${ne&&ne!==window.location.origin?`Incorrect app origin, expected ${ne}`:"popup was closed"}`,Et=new Error(gt);Et.name="PopupClosedError",s(Et),We()}},100);function We(){window.removeEventListener("message",xe),clearInterval(Ie)}window.addEventListener("message",xe)})}let ot=!1;function It(i){return[...i].join(" ")}class Mt{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(h=>{throw new Error(`Auth refresh request failed, ${h}`)});if(!s.ok){const h=new Error(`Auth refresh request failed, ${s.statusText}`);throw h.status=s.status,h}const a=await s.json();if(a.error){const h=new Error(a.error.message);throw a.error.name&&(h.name=a.error.name),h}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!t.ok){const s=new Error(`Logout request failed, ${t.statusText}`);throw s.status=t.status,s}}async showPopup(t){const s=this.joinScopesFunc(t),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),h=await yt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(h)}async executeRedirect(t){const s=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,s){const a=await this.discoveryApi.getBaseUrl("auth"),h=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${t}${h}`}buildQueryString(t){if(!t)return"";const s=Object.entries(t).map(([a,h])=>{if(typeof h=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(h)}`;if(h)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(t){(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:h,provider:S,joinScopes:O=It,oauthRequestApi:F,sessionTransform:ne=Ie=>Ie}=t;!ot&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),ot=!0);var xe;this.enableExperimentalRedirectFlow=s&&(xe=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&xe!==void 0?xe:!1,this.authRequester=F.createAuthRequester({provider:S,onAuthRequest:async Ie=>this.enableExperimentalRedirectFlow?this.executeRedirect(Ie):this.showPopup(Ie)}),this.discoveryApi=a,this.environment=h,this.provider=S,this.joinScopesFunc=O,this.sessionTransform=ne}}function Ve(i,t){for(const s of t)if(!i.has(s))return!1;return!0}class _t{sessionExistsAndHasScope(t,s){if(!t)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return Ve(a,s)}getExtendedScope(t,s){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const h=this.options.sessionScopes(t);for(const S of h)a.add(S)}if(s)for(const h of s)a.add(h);return a}constructor(t){(0,z._)(this,"options",void 0),this.options=t}}var ge=n(82394),Se=n.n(ge);let Ne=Symbol.observable;class qe{[Ne](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(){(0,z._)(this,"isClosed",!1),(0,z._)(this,"terminatingError",void 0),(0,z._)(this,"observable",new(Se())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,z._)(this,"subscribers",new Set)}}let mt=Symbol.observable;class xt{[mt](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(t){(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=t,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 ut{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,z._)(this,"subject",new xt(g.sM.SignedOut)),(0,z._)(this,"signedIn",!1)}}class Ot{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),h=this.sessionScopesFunc(this.currentSession),S=this.sessionScopesFunc(a);return Ve(S,h)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const s=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=s,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(t){(0,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 ut),(0,z._)(this,"refreshPromise",void 0),(0,z._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h,sessionShouldRefresh:S}=t;this.connector=s,this.sessionScopesFunc=h,this.sessionShouldRefreshFunc=S,this.helper=new _t({sessionScopes:h,defaultScopes:a})}}class Kt{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h}=t;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:h,defaultScopes:a})}}const qt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Dt{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:S=qt,oauthRequestApi:O,defaultScopes:F=[],scopeTransform:ne=We=>We}=t,xe=new Mt({configApi:s,discoveryApi:a,environment:h,provider:S,oauthRequestApi:O,sessionTransform(We){return{...We,providerInfo:{idToken:We.providerInfo.idToken,accessToken:We.providerInfo.accessToken,scopes:Dt.normalizeScopes(ne,We.providerInfo.scope),expiresAt:new Date(Date.now()+We.providerInfo.expiresInSeconds*1e3)}}}}),Ie=new Ot({connector:xe,defaultScopes:new Set(F),sessionScopes:We=>We.providerInfo.scopes,sessionShouldRefresh:We=>(We.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Dt({sessionManager:Ie,scopeTransform:ne})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,s){const a=Dt.normalizeScopes(this.scopeTransform,t),h=await this.sessionManager.getSession({...s,scopes:a});var S;return(S=h==null?void 0:h.providerInfo.accessToken)!==null&&S!==void 0?S:""}async getIdToken(t={}){const s=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}static normalizeScopes(t,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,z._)(this,"sessionManager",void 0),(0,z._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const hn={id:"github",title:"GitHub",icon:()=>null};class Xt{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:S=hn,oauthRequestApi:O,defaultScopes:F=["read:user"]}=t;return Dt.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:S,environment:h,defaultScopes:F})}}const gn={id:"gitlab",title:"GitLab",icon:()=>null};class zn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:S=gn,oauthRequestApi:O,defaultScopes:F=["read_user"]}=t;return Dt.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:S,environment:h,defaultScopes:F})}}const Bn={id:"google",title:"Google",icon:()=>null},mn="https://www.googleapis.com/auth/";class $n{static create(t){const{configApi:s,discoveryApi:a,oauthRequestApi:h,environment:S="development",provider:O=Bn,defaultScopes:F=["openid",`${mn}userinfo.email`,`${mn}userinfo.profile`]}=t;return Dt.create({configApi:s,discoveryApi:a,oauthRequestApi:h,provider:O,environment:S,defaultScopes:F,scopeTransform(ne){return ne.map(xe=>xe==="openid"?xe:xe==="profile"||xe==="email"?`${mn}userinfo.${xe}`:xe.startsWith(mn)?xe:`${mn}${xe}`)}})}}const Wn={id:"okta",title:"Okta",icon:()=>null},rn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Tn="okta.";class Vn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:S=Wn,oauthRequestApi:O,defaultScopes:F=["openid","email","profile","offline_access"]}=t;return Dt.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:S,environment:h,defaultScopes:F,scopeTransform(ne){return ne.map(xe=>rn.has(xe)||xe.startsWith(Tn)?xe:`${Tn}${xe}`)}})}}var ct=n(30195);const _n=ct.z.object({profile:ct.z.object({email:ct.z.string().optional(),displayName:ct.z.string().optional(),picture:ct.z.string().optional()}),backstageIdentity:ct.z.object({token:ct.z.string(),identity:ct.z.object({type:ct.z.literal("user"),userEntityRef:ct.z.string(),ownershipEntityRefs:ct.z.array(ct.z.string())})})}),wt={id:"saml",title:"SAML",icon:()=>null};class at{static create(t){const{discoveryApi:s,environment:a="development",provider:h=wt}=t,S=new DirectAuthConnector({discoveryApi:s,environment:a,provider:h}),O=new StaticAuthSessionManager({connector:S}),F=new AuthSessionStore({manager:O,storageKey:`${h.id}Session`,schema:samlSessionSchema});return new at(F)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const xn={id:"microsoft",title:"Microsoft",icon:()=>null};class Jt{static create(t){return new Jt(t)}microsoftGraph(){return this.oauth2[Jt.MicrosoftGraphID]}static resourceForScopes(t){const s=[...new Set(t.split(" ").map(Jt.resourceForScope).filter(S=>S!=="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 h=(a=s[0])!==null&&a!==void 0?a:Jt.MicrosoftGraphID;return Promise.resolve(h)}static resourceForScope(t){var s;const a=(s=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:h}=a;return h.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Jt.MicrosoftGraphID}}async getAccessToken(t,s){const a=t===void 0?Jt.MicrosoftGraphID:await Jt.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=Dt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,s)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,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:h=xn,oauthRequestApi:S,discoveryApi:O,defaultScopes:F=["openid","offline_access","profile","email","User.Read"],scopeTransform:ne=xe=>xe.concat("offline_access")}=t;this.configApi=s,this.environment=a,this.provider=h,this.oauthRequestApi=S,this.discoveryApi=O,this.scopeTransform=ne,this.oauth2={[Jt.MicrosoftGraphID]:Dt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:F})}}}(0,z._)(Jt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const pn={id:"onelogin",title:"onelogin",icon:()=>null},Rn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),dn="onelogin.";class Ln{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:S=pn,oauthRequestApi:O}=t;return Dt.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:S,environment:h,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(ne=>Rn.has(ne)||ne.startsWith(dn)?ne:`${dn}${ne}`)}})}}const we={id:"bitbucket",title:"Bitbucket",icon:()=>null};class le{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:S=we,oauthRequestApi:O,defaultScopes:F=["team"]}=t;return Dt.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:S,environment:h,defaultScopes:F})}}const ke={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Me{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:S=ke,oauthRequestApi:O,defaultScopes:F=["PROJECT_ADMIN"]}=t;return Dt.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:S,environment:h,defaultScopes:F})}}const Qe={id:"atlassian",title:"Atlassian",icon:()=>null};class re{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:S=Qe,oauthRequestApi:O}=t;return Dt.create({configApi:s,discoveryApi:a,oauthRequestApi:O,provider:S,environment:h})}}class N{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,z._)(this,"subject",new qe)}}class me{captureEvent(t){}}const $e="theme";class Ge{static createWithStorage(t){const s=new Ge(t);if(!window.localStorage)return s;var a;const h=(a=window.localStorage.getItem($e))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(h),s.activeThemeId$().subscribe(S=>{S?window.localStorage.setItem($e,S):window.localStorage.removeItem($e)}),window.addEventListener("storage",S=>{if(S.key===$e){var O;const F=(O=localStorage.getItem($e))!==null&&O!==void 0?O:void 0;s.setActiveThemeId(F)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,z._)(this,"themes",void 0),(0,z._)(this,"activeThemeId",void 0),(0,z._)(this,"subject",void 0),this.themes=t,this.subject=new xt(void 0)}}var et=n(9850),$t=n.n(et),zt=n(12782),tn=n.n(zt);const q=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function J(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ie(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const pe={type(i,t,s,a){return`Invalid type in config for key '${i}' in '${t}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,s){return`Unable to convert config value for key '${i}' in '${t}' to a ${s}`}};class ae{static fromConfigs(t){return t.length===0?new ae(void 0):t.reduce((s,{data:a,context:h,filteredKeys:S,deprecatedKeys:O})=>{const F=new ae(a,h,s);if(F.filteredKeys=S,O)for(const{key:ne,description:xe}of O)console.warn(`The configuration key '${ne}' of ${h} is deprecated and may be removed soon. ${xe||""}`);return F},void 0)}has(t){var s;if(this.readValue(t)!==void 0)return!0;var h;return(h=(s=this.fallback)===null||s===void 0?void 0:s.has(t))!==null&&h!==void 0?h:!1}keys(){var t;const s=this.data?Object.keys(this.data):[];var a;const h=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...h])]}get(t){const s=this.getOptional(t);if(s===void 0)throw new Error(pe.missing(this.fullKey(t!=null?t:"")));return s}getOptional(t){var s;const a=$t()(this.readValue(t)),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(t);if(a===void 0){if(!1)var S;return h}else if(h===void 0)return a;return tn()({},{value:h},{value:a},(O,F)=>!J(F)||!J(O)?F:void 0).value}getConfig(t){const s=this.getOptionalConfig(t);if(s===void 0)throw new Error(pe.missing(this.fullKey(t)));return s}getOptionalConfig(t){var s;const a=this.readValue(t),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(t);if(J(a))return this.copy(a,t,h);if(a!==void 0)throw new TypeError(pe.type(this.fullKey(t),this.context,ie(a),"object"));return h}getConfigArray(t){const s=this.getOptionalConfigArray(t);if(s===void 0)throw new Error(pe.missing(this.fullKey(t)));return s}getOptionalConfigArray(t){const s=this.readConfigValue(t,h=>{if(!Array.isArray(h))return{expected:"object-array"};for(const[S,O]of h.entries())if(!J(O))return{expected:"object-array",value:O,key:`${t}[${S}]`};return!0});if(!s){if(!1)var a;return}return s.map((h,S)=>this.copy(h,`${t}[${S}]`))}getNumber(t){const s=this.getOptionalNumber(t);if(s===void 0)throw new Error(pe.missing(this.fullKey(t)));return s}getOptionalNumber(t){const s=this.readConfigValue(t,h=>typeof h=="number"||typeof h=="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(t),this.context,"number"));return a}getBoolean(t){const s=this.getOptionalBoolean(t);if(s===void 0)throw new Error(pe.missing(this.fullKey(t)));return s}getOptionalBoolean(t){const s=this.readConfigValue(t,h=>typeof h=="boolean"||typeof h=="number"||typeof h=="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(t),this.context,"boolean"))}getString(t){const s=this.getOptionalString(t);if(s===void 0)throw new Error(pe.missing(this.fullKey(t)));return s}getOptionalString(t){return this.readConfigValue(t,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(t){const s=this.getOptionalStringArray(t);if(s===void 0)throw new Error(pe.missing(this.fullKey(t)));return s}getOptionalStringArray(t){return this.readConfigValue(t,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,h]of s.entries())if(typeof h!="string"||h==="")return{expected:"string-array",value:h,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,s,a){const h=new ae(t,this.context,a,this.fullKey(s));return h.filteredKeys=this.filteredKeys,h}readConfigValue(t,s){const a=this.readValue(t);if(a===void 0){var h;if(!1)var S;return(h=this.fallback)===null||h===void 0?void 0:h.readConfigValue(t,s)}const O=s(a);if(O!==!0){const{key:F=t,value:ne=a,expected:xe}=O;throw new TypeError(pe.type(this.fullKey(F),this.context,ie(ne),xe))}return a}readValue(t){const s=t?t.split("."):[];for(const h of s)if(!q.test(h))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[h,S]of s.entries())if(J(a))a=a[S];else if(a!==void 0){const O=this.fullKey(s.slice(0,h).join("."));throw new TypeError(pe.type(O,this.context,ie(a),"object"))}return a}constructor(t,s="mock-config",a,h=""){(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=t,this.context=s,this.fallback=a,this.prefix=h,this.notifiedFilteredKeys=new Set}}const y="Invalid discovery URL pattern,";class ${static compile(t){const s=t.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let h;try{h=new URL(a)}catch{throw new Error(`${y} URL '${a}' is invalid`)}if(h.hash)throw new Error(`${y} URL must not have a hash`);if(h.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 $(s)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,z._)(this,"parts",void 0),this.parts=t}}class X{post(t,s){return s!=null&&s.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,s)}error$(){return this.errorApi.error$()}constructor(t,s){(0,z._)(this,"alertApi",void 0),(0,z._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=s}}class K{post(t,s){this.subject.next({error:t,context:s})}error$(){return this.subject}constructor(){(0,z._)(this,"subject",new qe)}}class je{static forward(t,s){window.addEventListener("unhandledrejection",a=>{t.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 Ke{registerFlag(t){Ae(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===g.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,h]of Object.entries(t.states))this.flags.set(a,h);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 t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const s=JSON.parse(t);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([h,S])=>(Ae(h),S===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,z._)(this,"registeredFeatureFlags",[]),(0,z._)(this,"flags",void 0)}}function Tt(i){let t=i.baseImplementation||n.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const h of a)t=h.apply(t);return{fetch:t}}class ht{static create(t){var s,a;const h=pt(t),S=((s=t.header)===null||s===void 0?void 0:s.name)||"authorization",O=((a=t.header)===null||a===void 0?void 0:a.value)||(F=>`Bearer ${F}`);return new ht(t.identityApi,h,S,O)}apply(t){return async(s,a)=>{const h=new Request(s,a),{token:S}=await this.identityApi.getCredentials();return h.headers.get(this.headerName)||typeof S!="string"||!S||!this.allowUrl(h.url)?t(s,a):(h.headers.set(this.headerName,this.headerValue(S)),t(h))}}constructor(t,s,a,h){(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=t,this.allowUrl=s,this.headerName=a,this.headerValue=h}}function pt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?Ye(i.urlPrefixAllowlist):i.config?Ye([i.config.getString("backend.baseUrl")]):()=>!1}function Ye(i){const t=i.map(s=>s.replace(/\/$/,""));return s=>t.some(a=>s===a||s.startsWith(`${a}/`))}function lt(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class st{apply(t){return async(s,a)=>{const h=new Request(s,a),S="plugin://";if(!h.url.startsWith(S))return t(s,a);const{hostname:O,pathname:F,search:ne,hash:xe,username:Ie,password:We}=new URL(`http://${h.url.substring(S.length)}`);let gt=await this.discoveryApi.getBaseUrl(O);if(Ie||We){const Rt=new URL(gt),Yt=`${Ie}${We?`:${We}`:""}@`;gt=`${Rt.protocol}//${Yt}${Rt.host}${Rt.pathname}`}const Et=`${lt(gt,F)}${ne}${xe}`;return t(Et,typeof s=="string"||jt(s)?a:s)}}constructor(t){(0,z._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function jt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Wt{static resolvePluginProtocol(t){return new st(t.discoveryApi)}static injectIdentityAuth(t){return ht.create(t)}constructor(){}}function en(i,t){for(const s of t)if(!i.has(s))return!1;return!0}function nn(i,...t){const s=new Set(i);for(const a of t)for(const h of a)s.add(h);return s}class Zt{request(t){return new Promise((s,a)=>{this.requests.push({scopes:t,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,s){this.requests=this.requests.filter(a=>en(t,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(s=>s.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>nn(s,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:s=>{t&&this.resolve(t,s)},reject:s=>{t&&this.reject(s)}}}constructor(){(0,z._)(this,"requests",[]),(0,z._)(this,"subject",new xt(this.getCurrentPending()))}}class Vt{createAuthRequester(t){const s=new Zt,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:h=>{const S=this.currentRequests.slice(),O=this.makeAuthRequest(h,t);O?S[a]=O:delete S[a],this.currentRequests=S,this.subject.next(S.filter(Boolean))}}),h=>s.request(h)}makeAuthRequest(t,s){const{scopes:a}=t;if(a)return{provider:s.provider,trigger:async()=>{const h=await s.onAuthRequest(a);t.resolve(h)},reject:()=>{const h=new Error("Login failed, rejected by user");h.name="RejectedError",t.reject(h)}}}authRequest$(){return this.subject}constructor(){(0,z._)(this,"subject",new xt([])),(0,z._)(this,"currentRequests",[]),(0,z._)(this,"handlerCount",0)}}const Pt=new Map;class Lt{static create(t){var s;return new Lt((s=t.namespace)!==null&&s!==void 0?s:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,h]of Pt.entries()){var s;!((s=t.key)===null||s===void 0)&&s.startsWith(a)&&h.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let s,a="absent";try{const h=localStorage.getItem(this.getKeyName(t));h&&(s=JSON.parse(h,(S,O)=>(typeof O=="object"&&O!==null&&Object.freeze(O),O)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:s,presence:a}}forBucket(t){const s=`${this.namespace}/${t}`;return Pt.has(s)||Pt.set(s,new Lt(s,this.errorApi)),Pt.get(s)}async set(t,s){localStorage.setItem(this.getKeyName(t),JSON.stringify(s)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return Lt.hasSubscribed||(Lt.addStorageEventListener(),Lt.hasSubscribed=!0),this.observable.filter(({key:s})=>s===t)}handleStorageChange(t){if(!(t!=null&&t.startsWith(this.namespace)))return;const s=t==null?void 0:t.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const s=this.snapshot(t);for(const a of this.subscribers)a.next(s)}constructor(t,s){(0,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=t,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 Ut=(0,H.createContext)(void 0);function In(){const[i]=(0,W.is)((0,p.jsx)(W.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var Pn=n(84800);const Qn=(i,t)=>{try{var s;const a=(0,Pn.fp)(t,{pathname:i}),h=a==null?void 0:a.filter(ne=>{var xe;return((xe=ne==null?void 0:ne.route.routeRefs)===null||xe===void 0?void 0:xe.size)>0}).pop(),S=h==null?void 0:h.route;if(!S)return;let O;S.routeRefs.size===1&&(O=S.routeRefs.values().next().value);const F=Object.entries((h==null?void 0:h.params)||{}).reduce((ne,[xe,Ie])=>(Ie!==void 0&&(ne[xe]=Ie),ne),{});return{extension:"App",pluginId:((s=S.plugin)===null||s===void 0?void 0:s.getId())||"root",...O?{routeRef:O.id}:{},params:F}}catch{return}},hr=({pathname:i,search:t,hash:s,attributes:a})=>{const h=(0,g.z$)();return(0,H.useEffect)(()=>{h.captureEvent("navigate",`${i}${t}${s}`,{attributes:a})},[h,i,t,s,a]),null},wn=({routeObjects:i})=>{const{pathname:t,search:s,hash:a}=(0,W.TH)(),{params:h,...S}=Qn(t,i)||{params:{}};return(0,p.jsx)(g.fC,{attributes:S,children:(0,p.jsx)(hr,{pathname:t,search:s,hash:a,attributes:h})})};function Dn(i){return In()?sr(i):""}function sr(i){var t;let{pathname:s}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function C({component:i,appIdentityProxy:t,children:s}){const[a,h]=(0,H.useState)(),S=(0,g.h_)(g.Ds),O=Dn(S);return a?(t.setTarget(a,{signOutTargetUrl:O||"/"}),(0,p.jsx)(p.Fragment,{children:s})):(0,p.jsx)(i,{onSignInSuccess:h})}function c(i){const{Router:t,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),h=sr(a),S=`${h}/*`,O=(0,H.useContext)(Ut);if(!O)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:F,appIdentityProxy:ne}=O;return s?In()?(0,p.jsxs)(t,{children:[(0,p.jsx)(wn,{routeObjects:F}),(0,p.jsx)(C,{component:s,appIdentityProxy:ne,children:(0,p.jsx)(W.Z5,{children:(0,p.jsx)(W.AW,{path:S,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(wn,{routeObjects:F}),(0,p.jsx)(C,{component:s,appIdentityProxy:ne,children:i.children})]}):(ne.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:h||"/"}),In()?(0,p.jsxs)(t,{children:[(0,p.jsx)(wn,{routeObjects:F}),(0,p.jsx)(W.Z5,{children:(0,p.jsx)(W.AW,{path:S,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(wn,{routeObjects:F}),i.children]}))}var x=n(88412),A=n(50629),Q=n(80956),be=n(64279);function Ee(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const s=[{node:H.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:h,contexts:S}=s.shift();H.Children.forEach(a,O=>{if(!(0,H.isValidElement)(O))return;const F={};for(const ne in t)if(t.hasOwnProperty(ne)){const xe=t[ne];F[ne]=xe.visit(xe.accumulator,O,h,S[ne])}for(const ne of i.discoverers){const xe=ne(O);xe&&s.push({node:xe,parent:O,contexts:F})}})}return Object.fromEntries(Object.entries(t).map(([a,h])=>[a,h.accumulator]))}function De(i,t){return()=>({accumulator:i(),visit:t})}function dt(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function Qt(i){var t,s;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const bn=De(()=>new Set,(i,t)=>{const s=(0,g.IY)(t,"core.plugin");s&&i.add(s)}),jn=i=>{const{children:t}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,g.R5)(jn,"core.featureFlagged",!0);const pr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function on(i){const t=i;if(t!=null&&t.type){var s,a;return(a=(s=t.type.displayName)!==null&&s!==void 0?s:t.type.name)!==null&&a!==void 0?a:String(t.type)}return String(t)}function so(i,t=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 h=(0,g.IY)(s,"core.plugin");t.push({routeRef:a,plugin:h})}so(s.props.children,t)}),t}const io=De(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,S;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===t)return{...a,isElementAncestor:!0};const O=(h=t.props)===null||h===void 0?void 0:h.path,F=(0,g.IY)(t,"core.mountPoint");if(F&&O)throw new Error(`Path property may not be set directly on a routable extension "${on(t)}"`);var ne;const xe=(ne=a==null||(S=a.obj)===null||S===void 0?void 0:S.children)!==null&&ne!==void 0?ne:i.objects;if(O!==void 0){if(typeof O!="string")throw new Error(`Element path must be a string at "${on(t)}"`);const Et=O.startsWith("/")?O.slice(1):O,Rt=t.props.element;if((0,g.IY)(t,"core.gatherMountPoints")){var Ie;if(Rt)throw new Error(`Mount point gatherers may not have an element prop "${on(t)}"`);const Yt={path:Et,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ie=t.props)===null||Ie===void 0?void 0:Ie.caseSensitive),children:[pr],plugin:void 0};return xe.push(Yt),{obj:Yt,gatherPath:Et,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(Rt){var We;const[Yt,...Ht]=so(Rt);if(Ht.length>0)throw new Error(`Route element with path "${O}" may not contain multiple routable extensions`);if(!Yt)return a;const{routeRef:Fn,plugin:rr}=Yt,Ar={path:Et,element:"mounted",routeRefs:new Set([Fn]),caseSensitive:Boolean((We=t.props)===null||We===void 0?void 0:We.caseSensitive),children:[pr],plugin:rr};return xe.push(Ar),i.paths.set(Fn,Et),i.parents.set(Fn,a==null?void 0:a.routeRef),{obj:Ar,routeRef:Fn!=null?Fn:a==null?void 0:a.routeRef,gatherPath:Et,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(F){var gt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${on(t)}" with mount point "${F}" must be assigned a path`);return a==null||(gt=a.obj)===null||gt===void 0||gt.routeRefs.add(F),i.paths.set(F,a.gatherPath),i.parents.set(F,a==null?void 0:a.gatherRouteRef),{...a,routeRef:F}}return a}),ao=De(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,S,O;if((s==null?void 0:s.props.element)===t)return a;let F=a==null?void 0:a.obj,ne=a==null?void 0:a.routeRef,xe=a==null?void 0:a.sticky;const Ie=(h=t.props)===null||h===void 0?void 0:h.path;var We;const gt=(We=F==null?void 0:F.children)!==null&&We!==void 0?We:i.objects,Et=Boolean((S=t.props)===null||S===void 0?void 0:S.caseSensitive);let Rt=a==null?void 0:a.path;if((0,g.IY)(t,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");Rt=Ie}const Yt=(O=t.props)===null||O===void 0?void 0:O.element;let Ht=(0,g.IY)(t,"core.mountPoint");if(!Ht&&(0,H.isValidElement)(Yt)&&(Ht=(0,g.IY)(Yt,"core.mountPoint")),Ht){let Ar=Ie;if(Rt&&(Ar?Rt=void 0:Ar=Rt),!Ar)throw new Error("Mounted routable extension must have a path");i.paths.set(Ht,Ar),ne&&xe?(i.parents.set(Ht,ne),Ie&&(ne=Ht,xe=!1)):(i.parents.set(Ht,ne),ne=Ht),Ie?(F={caseSensitive:Et,path:Ie,element:"mounted",routeRefs:new Set([Ht]),children:[pr],plugin:(0,g.IY)(t.props.element,"core.plugin")},gt.push(F)):F==null||F.routeRefs.add(Ht)}if((0,g.IY)(t,"core.gatherMountPoints")&&(xe=!0),(0,g.IY)(t,"core.gatherMountPoints")){if(!Ie)throw new Error("Mount point gatherer must have a path");if(!Ht){var rr;F={caseSensitive:Et,path:Ie,element:"gathered",routeRefs:new Set,children:[pr],plugin:a==null||(rr=a.obj)===null||rr===void 0?void 0:rr.plugin},gt.push(F)}}return{obj:F,path:Rt,routeRef:ne,sticky:xe}}),Sr=De(()=>new Set,(i,t)=>{if(t.type===jn){const s=t.props;i.add("with"in s?s.with:s.without)}}),fr=(0,rt.uW)("route-ref-type",()=>Symbol("route-ref-type"));function lo(i){return i[fr]==="absolute"}function co(i){return i[fr]==="sub"}function Do(i){return i[fr]==="external"}function Vr(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Cr(i,t,s){let a,h="";if(lo(i))a=i;else if(co(i))a=i.parent,h=i.path;else if(Do(i)){const F=s.get(i);if(!F)return[void 0,""];if(lo(F))a=F;else if(co(F))a=F.parent,h=F.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${F}`)}else throw i[fr]?new Error(`Unknown or invalid route ref type, ${i[fr]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const S=t.get(a);if(S===void 0)return[void 0,""];const O=Vr(S,h);return[a,O]}function er(i,t,s,a,h){var S;const O=(S=(0,Pn.fp)(h,t))!==null&&S!==void 0?S:[],F=Array();let ne=-1;for(let We=i;We&&(ne=O.findIndex(gt=>gt.route.routeRefs.has(We)),ne===-1);We=a.get(We))F.unshift(We);F.length===0&&(ne-=1);const xe=ne===-1?"":O[ne].pathname,Ie=F.slice(0,-1).map(We=>{const gt=s.get(We);if(gt===void 0)throw new Error(`No path for ${We}`);if(gt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${We} as it has parameters`);return gt});return`${Vr(xe,...Ie)}/`}class Br{resolve(t,s){const[a,h]=Cr(t,this.routePaths,this.routeBindings);if(!a)return;let S;typeof s=="string"?S=this.trimPath(s):s.pathname?S={...s,pathname:this.trimPath(s.pathname)}:S=s;const O=this.appBasePath+er(a,S,this.routePaths,this.routeParents,this.routeObjects);return(...[ne])=>Vr(O,(0,Pn.Gn)(h,ne))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,s,a,h,S){(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=t,this.routeParents=s,this.routeObjects=a,this.routeBindings=h,this.appBasePath=S}}const $r=(0,rt.CT)("routing-context"),uo=({routePaths:i,routeParents:t,routeObjects:s,routeBindings:a,basePath:h="",children:S})=>{const O=new Br(i,t,s,a,h),F=(0,rt.EI)({1:O});return(0,p.jsx)($r.Provider,{value:F,children:S})};function Zo(i,t){const s=new Set(t.values());s.delete(void 0);for(const a of t.keys()){if(s.has(a))continue;let h=a,S="";for(;h;){const F=i.get(h);if(F===void 0)throw new Error(`No path for ${h}`);S=Vr(F,S),h=t.get(h)}const O=S.match(/:(\w+)/g);if(O){for(let F=0;F<O.length;F++)for(let ne=F+1;ne<O.length;ne++)if(O[ne]===O[F])throw new Error(`Parameter ${O[ne]} is duplicated in path ${S}`)}}}function Hr(i,t){for(const s of t)if(s.externalRoutes){for(const[a,h]of Object.entries(s.externalRoutes))if(!h.optional&&!i.has(h))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 Fo=(0,rt.CT)("app-context"),No=({appContext:i,children:t})=>{const s=(0,rt.EI)({1:i});return(0,p.jsx)(Fo.Provider,{value:s,children:t})};function Dr(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Hn(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Rr{setTarget(t,s){this.target=t,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw Dr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Hn("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Dr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Hn("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(s=>s.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Hn("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.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(t=>{this.resolveTarget=t})}}var Zr=n(72164);function ho(i,t,s){if(i!==void 0){const h=s.find(S=>S.id===i);if(h)return h}if(t){const h=s.find(S=>S.variant==="dark");if(h)return h}const a=s.find(h=>h.variant==="light");return a||s[0]}const En=()=>{const i=(0,H.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,s]=(0,H.useState)(i.matches);return(0,H.useEffect)(()=>{const a=h=>{s(h.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Gr({children:i}){const t=(0,g.h_)(g.hg),s=(0,Zr.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?En():!1,h=ho(s,a,t.getInstalledThemes());if(!h)throw new Error("App has no themes");return(0,p.jsx)(h.Provider,{children:i})}const po=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const s=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const h=JSON.parse(i);Array.isArray(h)?s.push(...h):s.push({data:h,context:"env"})}catch(h){throw new Error(`Failed to load runtime configuration, ${h}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class Uo{add(t,s){return this.apis.push([t.id,s]),s}build(){return new ir(new Map(this.apis))}constructor(){(0,z._)(this,"apis",[])}}class ir{static builder(){return new Uo}static from(t){return new ir(new Map(t.map(([s,a])=>[s.id,a])))}static with(t,s){return new ir(new Map([[t.id,s]]))}with(t,s){return new ir(new Map([...this.apis,[t.id,s]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,z._)(this,"apis",void 0),this.apis=t}}function Mo(i){const t=new Map;return i&&i({bind:(a,h)=>{for(const[S,O]of Object.entries(h)){const F=a[S];if(!F)throw new Error(`Key ${S} is not an existing external route`);if(!O&&!F.optional)throw new Error(`External route ${S} is required but was undefined`);O&&t.set(F,O)}}}),t}function fo(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function go(i,t,s){var a;const h=Boolean(i),S=(0,be.default)(i||(()=>Promise.resolve([])));let O;if(h&&S.loading){const{Progress:xe}=t;O=(0,p.jsx)(xe,{})}else if(S.error){const{BootErrorPage:xe}=t;O=(0,p.jsx)(xe,{step:"load-config",error:S.error})}const{ThemeProvider:F=Gr}=t;if(O)return{node:(0,p.jsx)(tt,{apis:ir.with(g.hg,s),children:(0,p.jsx)(F,{children:O})})};let ne;if(!((a=S.value)===null||a===void 0)&&a.length){const xe=ae.fromConfigs(S.value),Ie=xe.getOptionalString("app.baseUrl"),We=xe.getOptionalString("backend.baseUrl");let gt=S.value;const Et={data:{},context:"relative-resolver"};if(Ie&&We){const Rt=new URL(Ie).origin,Yt=new URL(We).origin;if(Rt===Yt){const Ht=fo(We);We!==Ht&&(Et.data.backend={baseUrl:Ht})}}if(Ie){const Rt=fo(Ie);Ie!==Rt&&(Et.data.app={baseUrl:Rt})}Object.keys(Et.data).length&&(gt=gt.concat([Et])),ne=ae.fromConfigs(gt)}else ne=ae.fromConfigs([]);return{api:ne}}class mo{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,z._)(this,"app",void 0),this.app=t}}var wr=new WeakMap;class ms{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const s=this.getProvider();return()=>(0,p.jsx)(s,{children:t})}getProvider(){if((0,x._)(this,wr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q._)(this,wr,!0);const t=new mo(this);let s=!1;return({children:h})=>{const S=(0,H.useRef)(!0),O=(0,H.useMemo)(()=>Ge.createWithStorage(this.themes),[]),{routing:F,featureFlags:ne,routeBindings:xe}=(0,H.useMemo)(()=>{const Et=Ee({root:h,discoverers:[dt,Qt],collectors:{routing:In()?ao:io,collectedPlugins:bn,featureFlags:Sr}});return Et.collectedPlugins.forEach(Rt=>this.plugins.add(Rt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Et,routeBindings:Mo(this.bindRoutes)}},[h]);s||(s=!0,Zo(F.paths,F.parents),Hr(xe,this.plugins));const Ie=go(this.configLoader,this.components,O),We="api"in Ie;if(We){const{api:Et}=Ie;this.configApi=Et}if("node"in Ie)return Ie.node;if(We&&S.current){S.current=!1;const Et=this.getApiHolder().get(g.W0);if(Et){for(const Ht of this.featureFlags)Et.registerFlag({...Ht,pluginId:""});for(const Ht of this.plugins.values())if("getFeatureFlags"in Ht)for(const Fn of Ht.getFeatureFlags())Et.registerFlag({name:Fn.name,pluginId:Ht.getId()});else for(const Fn of Ht.output())Fn.type==="feature-flag"&&Et.registerFlag({name:Fn.name,pluginId:Ht.getId()});const Rt=Et.getRegisteredFlags(),Yt=new Set(Rt.map(Ht=>Ht.name));for(const Ht of ne)Yt.has(Ht)||Et.registerFlag({name:Ht,pluginId:""})}}const{ThemeProvider:gt=Gr}=this.components;return(0,p.jsx)(tt,{apis:this.getApiHolder(),children:(0,p.jsx)(No,{appContext:t,children:(0,p.jsx)(gt,{children:(0,p.jsx)(uo,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:xe,basePath:Dn(Ie.api),children:(0,p.jsx)(Ut.Provider,{value:{routeObjects:F.objects,appIdentityProxy:this.appIdentityProxy},children:h})})})})})}}getRouter(){return c}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const s of t.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Je.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>Ge.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 Ke});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const s of t.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return Je.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Je(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const s=new Set;for(const a of t){const h=a.getId();if(s.has(h))throw new Error(`Duplicate plugin found '${h}'`);s.add(h)}}constructor(t){(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 Rr),(0,z._)(this,"apiFactoryRegistry",void 0),(0,A._)(this,wr,{writable:!0,value:!1});var s;this.apis=(s=t.apis)!==null&&s!==void 0?s:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var h;this.featureFlags=(h=t.featureFlags)!==null&&h!==void 0?h:[],this.components=t.components,this.themes=t.themes;var S;this.configLoader=(S=t.configLoader)!==null&&S!==void 0?S:po;var O;this.defaultApis=(O=t.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new At}}function zo(i){return new ms(i)}let Kr=!1;const Wo=i=>{const t=(0,g.qD)(),{NotFoundErrorPage:s}=t.getComponents(),a=(0,H.useMemo)(()=>In(),[]),S=[...(0,g.vJ)(i.children,O=>O.getElements().flatMap(F=>{let ne=F.props.path;if(ne==="")return[];var xe;ne=(xe=ne==null?void 0:ne.replace(/\/\*$/,""))!==null&&xe!==void 0?xe:"/";let Ie=a?F:F.props.element;return!a&&!Ie&&(Ie=F,Kr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),Kr=!0)),[{path:ne,element:Ie,children:F.props.children?[{path:ne==="/"?"/":"*",element:F.props.children}]:void 0}]}).sort((F,ne)=>ne.path.localeCompare(F.path)).map(F=>({...F,path:F.path==="/"?"/":`${F.path}/*`}))),{path:"*",element:(0,p.jsx)(s,{})}];return(0,W.V$)(S)},Vo=(0,g.T0)({id:"plugin.permission.api"});var Gn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(Gn||(Gn={}));function Yr(i,t){return i.name===t.name}function Fr(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function vs(i){return i.attributes.action==="create"}function ys(i){return i.attributes.action==="read"}function vo(i){return i.attributes.action==="update"}function Ho(i){return i.attributes.action==="delete"}function xs(i){return{authorize:async(t,s)=>await i.authorize(t,s),authorizeConditional(t,s){const a=t;return i.authorize(a,s)}}}function ar({name:i,attributes:t,resourceType:s}){return s?{type:"resource",name:i,attributes:t,resourceType:s}:{type:"basic",name:i,attributes:t}}var Go=n(23054),Kn=n(96279),yo=n.n(Kn),Ko=n(9571);const Jr=ct.z.lazy(()=>ct.z.object({rule:ct.z.string(),resourceType:ct.z.string(),params:ct.z.record(ct.z.any()).optional()}).or(ct.z.object({anyOf:ct.z.array(Jr).nonempty()})).or(ct.z.object({allOf:ct.z.array(Jr).nonempty()})).or(ct.z.object({not:Jr}))),Yo=ct.z.object({result:ct.z.literal(Gn.ALLOW).or(ct.z.literal(Gn.DENY))}),Jo=ct.z.union([ct.z.object({result:ct.z.literal(Gn.ALLOW).or(ct.z.literal(Gn.DENY))}),ct.z.object({result:ct.z.literal(Gn.CONDITIONAL),pluginId:ct.z.string(),resourceType:ct.z.string(),conditions:Jr})]),bs=(i,t)=>ct.z.object({items:ct.z.array(ct.z.intersection(ct.z.object({id:ct.z.string()}),i)).refine(s=>s.length===t.size&&s.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class Qo{async authorize(t,s){return this.makeRequest(t,Yo,s)}async authorizeConditional(t,s){return this.makeRequest(t,Jo,s)}async makeRequest(t,s,a){if(!this.enabled)return t.map(Ie=>({result:Gn.ALLOW}));const h={items:t.map(Ie=>({id:Ko.Z(),...Ie}))},S=await this.discovery.getBaseUrl("permission"),O=await yo()(`${S}/authorize`,{method:"POST",body:JSON.stringify(h),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!O.ok)throw await Go.VL.fromResponse(O);const F=await O.json(),xe=bs(s,new Set(h.items.map(({id:Ie})=>Ie))).parse(F).items.reduce((Ie,We)=>(Ie[We.id]=We,Ie),{});return h.items.map(Ie=>xe[Ie.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,z._)(this,"enabled",void 0),(0,z._)(this,"discovery",void 0),this.discovery=t.discovery;var s;this.enabled=(s=t.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class Qr{static create(t){const{config:s,discovery:a,identity:h}=t,S=new Qo({discovery:a,config:s});return new Qr(S,h)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,s){(0,z._)(this,"permissionClient",void 0),(0,z._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=s}}var Xo=n(69984);function xo(i){const t=(0,g.h_)(Vo),{data:s,error:a}=(0,Xo.ZP)(i,async h=>{if(Fr(h.permission)&&!h.resourceRef)return Gn.DENY;const{result:S}=await t.authorize(h);return S});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===Gn.ALLOW}}const bo=i=>{const{permission:t,resourceRef:s,errorComponent:a,...h}=i,S=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),O=useApp(),{NotFoundErrorPage:F}=O.getComponents();let ne=a===void 0?_jsx(F,{}):a;return S.loading?ne=null:S.allowed&&(ne=i.element),_jsx(Route,{...h,element:ne})};function oi(i){const{permission:t,resourceRef:s}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),h=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:S}=h.getComponents();return _jsx(S,{})}const b=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>$.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new N}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new me}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const t=new X(i,new K);return je.forward(t,{hidden:!1}),t}}),(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:t,discoveryApi:s})=>Tt({middleware:[Wt.resolvePluginProtocol({discoveryApi:s}),Wt.injectIdentityAuth({identityApi:t,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new Vt}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>$n.create({configApi:s,discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>Jt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>Xt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>Vn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>zn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>Ln.create({configApi:s,discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>le.create({configApi:s,discoveryApi:i,oauthRequestApi:t,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:t,configApi:s})=>Me.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>re.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Vo,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:t,identity:s})=>Qr.create({config:i,discovery:t,identity:s})})];var j=n(77277),w=n(53974),D=n(71597);function _({children:i}){return(0,W.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(W.VA,{children:i})}const de=()=>(0,p.jsx)(w.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),ce=({step:i,error:t})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(_,{children:(0,p.jsx)(w.mf,{status:"501",statusMessage:s})})},ve=({error:i,resetError:t,plugin:s})=>(0,p.jsx)(w.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(j.Z,{variant:"outlined",onClick:t,children:"Retry"})}),Re={Progress:w.Ex,Router:D.VK,NotFoundErrorPage:de,BootErrorPage:ce,ErrorBoundaryFallback:ve};var Ce=n(43642),Fe=n(80079),Ze=n(90941),it=n(32915),nt=n(40562),_e=n(21853),Oe=n(60744),ft=n(66569),kt=n(30254),fn=n(13384),St=n(15933),Bt=n(58838),Ft=n(86737),an=n(4989),Sn=n(44407),Ir=n(18628),Nr=n(84219),Pr=n(98685),Zn=n(39781),On=n(39412);const Lr={brokenImage:Fe.Z,catalog:Ir.Z,scaffolder:it.Z,techdocs:nt.Z,search:_e.Z,chat:Oe.Z,dashboard:ft.Z,docs:kt.Z,email:fn.Z,github:Bt.Z,group:Nr.Z,help:Ft.Z,"kind:api":St.Z,"kind:component":Sn.Z,"kind:domain":Ce.Z,"kind:group":Nr.Z,"kind:location":an.Z,"kind:system":Ze.Z,"kind:user":Pr.Z,"kind:resource":On.Z,user:Pr.Z,warning:Zn.Z};var qo=n(73689),Ss=n(4707);function si(i,t){if(!t||typeof t=="string")return;const s=typeof t=="function"?t(i):t;if(s)return{"@global":s}}function ii(i,t){if(!(!t||typeof t=="string"))return typeof t=="object"?Object.fromEntries(Object.entries(t).map(([s,a])=>typeof a=="function"?[s,a({theme:i})]:[s,a])):t}const _o=/^&.Mui-([\w-]+)$/;function ai(i){let t=i;if(!i||typeof i!="object")return t;for(const s of Object.keys(i)){const a=i[s];if(!(!a||typeof a!="object"))for(const h of Object.keys(a)){const S=h,O=S.match(_o);if(O){const[,F]=O,{[S]:ne,...xe}=a;ne&&(t={...t,[s]:xe,[F]:ne})}}}return t}function Cs(i,t={}){const s={},a={};for(const h of Object.keys(t)){const S=t[h];S&&("styleOverrides"in S&&(h==="MuiCssBaseline"?s[h]=si(i,S.styleOverrides):s[h]=ai(ii(i,S.styleOverrides))),"defaultProps"in S&&(a[h]=S.defaultProps))}return{overrides:s,props:a}}var ws=n(47591);const Or={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,ws._j)(i.palette.link,.3),background:(0,ws.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]}),outlined:({theme:i})=>({color:i.palette.text.primary}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({color:i.palette.grey[500],width:i.spacing(3),height:i.spacing(3),margin:`0 ${i.spacing(.75)} 0 -${i.spacing(.75)}`}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:`0 ${i.spacing(.5)} 0 -${i.spacing(.5)}`})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}}},lr={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")`},cr={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 tr(i){const{colors:t,shape:s,options:a}=i,S=`linear-gradient(90deg, ${(t.length===1?[t[0],t[0]]:t).join(", ")})`,O=`${s}, ${S}`;var F;const ne=(F=a==null?void 0:a.fontColor)!==null&&F!==void 0?F:"#FFFFFF";return{colors:t,shape:s,backgroundImage:O,fontColor:ne}}const Xr={home:tr({colors:cr.teal,shape:lr.wave}),documentation:tr({colors:cr.pinkSea,shape:lr.wave2}),tool:tr({colors:cr.purpleSky,shape:lr.round}),service:tr({colors:cr.marineBlue,shape:lr.wave}),website:tr({colors:cr.veryBlue,shape:lr.wave}),library:tr({colors:cr.rubyRed,shape:lr.wave}),other:tr({colors:cr.darkGrey,shape:lr.wave}),app:tr({colors:cr.toastyOrange,shape:lr.wave}),apis:tr({colors:cr.teal,shape:lr.wave2}),card:tr({colors:cr.greens,shape:lr.wave})},li=16,js='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',ci="home";function es(i){const{palette:t,htmlFontSize:s=li,fontFamily:a=js,defaultPageTheme:h=ci,pageTheme:S=Xr}=i;if(!S[h])throw new Error(`${h} is not defined in pageTheme.`);var O;return{palette:t,typography:{htmlFontSize:s,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}},page:S[h],getPageTheme:({themeId:F})=>(O=S[F])!==null&&O!==void 0?O:S[h]}}var Ur=new WeakMap;class Es{getTheme(t){return(0,x._)(this,Ur).get(t)}constructor(t,s){(0,A._)(this,Ur,{writable:!0,value:new Map}),(0,Q._)(this,Ur,new Map),t&&(0,x._)(this,Ur).set("v4",t),s&&(0,x._)(this,Ur).set("v5",s)}}function di(i){const t=es(i),s={...Or,...i.components},a=(0,Ss.Z)({...t,components:s}),h=Cs(a,s),S={...(0,qo.Z)(t),...h};return new Es(S,a)}function _i(i){const t=adaptV4Theme(i),s=createTheme(i);return new Es(s,t)}const qr={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},As={light:di({palette:qr.light}),dark:di({palette:qr.dark})};var nr=n(68542);nr.Z.configure(i=>`v5-${i}`);var ea=n(41547),ta=n(3493),na=n(76919),ra=n(91994);function ui(i){const{children:t,theme:s,noCssBaseline:a=!1}=i,h=s.getTheme("v4"),S=s.getTheme("v5");let O;a||(O=(0,p.jsx)(ra.ZP,{}));let F=(0,p.jsxs)(p.Fragment,{children:[O,t]});return h&&(F=(0,p.jsx)(ea.Z,{theme:h,children:F})),S&&(F=(0,p.jsx)(ta.Z,{injectFirst:!0,children:(0,p.jsx)(na.Z,{theme:S,children:F})})),F}function oa(i){var t,s;return{props:{MuiGrid:Or==null||(t=Or.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:Or==null||(s=Or.MuiSwitch)===null||s===void 0?void 0:s.defaultProps},...es(i)}}function sa(i){return Cs(i,Or).overrides}function hi(i){const t=oa(i),s=(0,qo.Z)(t),a=sa(s);return{...s,overrides:a}}const ts=hi({palette:qr.light}),Na=hi({palette:qr.dark});var ia=n(98192),pi=n(15222);const fi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(pi.Z,{}),Provider:({children:i})=>(0,p.jsx)(ui,{theme:As.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(ia.Z,{}),Provider:({children:i})=>(0,p.jsx)(ui,{theme:As.dark,children:i})}];function ns(i){var t,s,a,h;return zo({...i,apis:(t=i==null?void 0:i.apis)!==null&&t!==void 0?t:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...Re,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:b,icons:{...Lr,...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:(h=i==null?void 0:i.themes)!==null&&h!==void 0?h:fi})}var So=n(25271),Ts=n(76635);async function gi({storageApi:i}){const t=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,Ts.isArray)(a))return;var h;const S=new Set((h=s.snapshot("entityRefs").value)!==null&&h!==void 0?h:[]);a.filter(Ts.isString).map(O=>O.split(":")).filter(O=>O.length===4&&O[0]==="entity").map(([O,F,ne,xe])=>(0,So.eE)({kind:F,namespace:ne,name:xe})).forEach(O=>S.add(O)),await s.set("entityRefs",Array.from(S)),await t.remove("starredEntities")}class rs{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,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)}))),gi(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var h;this.starredEntities=new Set((h=a.value)!==null&&h!==void 0?h:[]),this.notifyChanges()}})}}var gr=n(33414),jr=n(79692),Co=n(12420),kn=n(43514),mi=n(19928);function Er(){const i=useApi(catalogApiRef),{error:t,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(S=>{var O;return((O=S.facets.kind)===null||O===void 0?void 0:O.map(F=>F.value).sort())||[]}),[i]);return{loading:s,error:t,allKinds:a!=null?a:[]}}function aa(i,t,s){let a=i;return t&&(a=a.filter(S=>t.some(O=>O.toLocaleLowerCase("en-US")===S.toLocaleLowerCase("en-US")))),s&&!i.some(S=>S.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((S,O)=>(S[O.toLocaleLowerCase("en-US")]=O,S),{})}const Rs=(0,jr.Z)(i=>(0,Co.Z)({root:{...i.typography.h4}}));function la(i){var t;const{initialFilter:s="component",allowedKinds:a}=i,h=Rs(),{allKinds:S}=useAllKinds(),{filters:O,updateFilters:F,queryParameters:{kind:ne}}=useEntityList(),xe=useMemo(()=>[ne].flat()[0],[ne]);var Ie;const[We,gt]=useState((Ie=xe!=null?xe:(t=O.kind)===null||t===void 0?void 0:t.value)!==null&&Ie!==void 0?Ie:s);useEffect(()=>{xe&>(xe)},[xe]),useEffect(()=>{var Rt;if(!((Rt=O.kind)===null||Rt===void 0)&&Rt.value){var Yt;gt((Yt=O.kind)===null||Yt===void 0?void 0:Yt.value)}},[O.kind]),useEffect(()=>{F({kind:We?new EntityKindFilter(We):void 0})},[We,F]);const Et=filterKinds(S,a,We);return _jsx(Select,{input:_jsx(InputBase,{}),value:We.toLocaleLowerCase("en-US"),onChange:Rt=>gt(Rt.target.value),classes:h,children:Object.keys(Et).map(Rt=>_jsx(MenuItem,{value:Rt,children:`${pluralize(Et[Rt])}`},Rt))})}var Ua=n(86359),Xn=n(95544),Is=n(99688),wo=n(12231),jo=n(86136),Eo=n(49378),vi=n(85256),_r=n(80030),os=n(61837),Ps=n(79784),Ls=n(50758),Os=n(31654),ss=n(43054),yi=n(65759),xi=n(49280),ks=n(96641);function Bs(i){const{entity:t,loading:s,error:a}=(0,ks.ce)(),{allowed:h,loading:S,error:O}=xo({permission:i,resourceRef:t?(0,So.eE)(t):void 0});return s||S?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:h,error:O}}const is="catalog-entity",Ao=ar({name:"catalog.entity.read",attributes:{action:"read"},resourceType:is}),bi=ar({name:"catalog.entity.create",attributes:{action:"create"}}),$s=ar({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:is}),Ds=ar({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:is}),Zs=ar({name:"catalog.location.read",attributes:{action:"read"}}),Si=ar({name:"catalog.location.create",attributes:{action:"create"}}),Ci=ar({name:"catalog.location.delete",attributes:{action:"delete"}}),ca=[Ao,bi,$s,Ds,Zs,Si,Ci];var Fs=n(49166);function wi(i){const{unregisterEntityOptions:t,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:h}=i,S=typeof(t==null?void 0:t.disableUnregister)=="boolean";var O;const F=(O=!s||(S?!!(t!=null&&t.disableUnregister):(t==null?void 0:t.disableUnregister)==="disable"))!==null&&O!==void 0?O:!1;let ne=(0,p.jsx)(p.Fragment,{});return(t==null?void 0:t.disableUnregister)!=="hidden"&&(ne=(0,p.jsxs)(wo.Z,{onClick:()=>{h(),a()},disabled:F,children:[(0,p.jsx)(jo.Z,{children:(0,p.jsx)(Fs.Z,{fontSize:"small"})}),(0,p.jsx)(Eo.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:ne})}const To=(0,jr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Ns(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:h}=i,[S,O]=(0,H.useState)(),F=To(),xe=Bs($s).allowed,Ie=Yt=>{O(Yt.currentTarget)},We=()=>{O(void 0)},gt=(0,g.h_)(g.$v),Et=(0,H.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>gt.post({message:"Copied!",severity:"info",display:"transient"}))},[gt]),Rt=t&&[...t.map(Yt=>(0,p.jsxs)(wo.Z,{onClick:()=>{We(),Yt.onClick()},children:[(0,p.jsx)(jo.Z,{children:(0,p.jsx)(Yt.Icon,{fontSize:"small"})}),(0,p.jsx)(Eo.Z,{primary:Yt.title})]},Yt.title)),(0,p.jsx)(vi.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(_r.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(os.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!S,role:"button",onClick:Ie,"data-testid":"menu-button",className:F.button,id:"long-menu",children:(0,p.jsx)(ss.Z,{})})}),(0,p.jsx)(Ps.ZP,{open:Boolean(S),onClose:We,anchorEl:S,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(Ls.Z,{children:[Rt,(0,p.jsx)(wi,{unregisterEntityOptions:s,isUnregisterAllowed:xe,onUnregisterEntity:a,onClose:We}),(0,p.jsxs)(wo.Z,{onClick:()=>{We(),h()},children:[(0,p.jsx)(jo.Z,{children:(0,p.jsx)(Os.Z,{fontSize:"small"})}),(0,p.jsx)(Eo.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(wo.Z,{onClick:()=>{We(),Et()},children:[(0,p.jsx)(jo.Z,{children:(0,p.jsx)(yi.Z,{fontSize:"small"})}),(0,p.jsx)(Eo.Z,{primary:"Copy entity URL"})]})]})})]})}const Us="plugin.catalog.entityLayoutRoute",Ro=()=>null;(0,g.R5)(Ro,Us,!0),(0,g.R5)(Ro,"core.gatherMountPoints",!0);function ji(i){const{entity:t,title:s}=i;return(0,p.jsxs)(Xn.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(Xn.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),t&&(0,p.jsx)(kn.LH,{entity:t})]})}function Ms(i,t,s,a){var h;const S=(h=i!=null?i:a==null?void 0:a.kind)!==null&&h!==void 0?h:"";var O;const F=(O=t!=null?t:a==null?void 0:a.metadata.namespace)!==null&&O!==void 0?O:"";var ne,xe,Ie;return{headerTitle:`${(Ie=(xe=(ne=a==null?void 0:a.metadata.title)!==null&&ne!==void 0?ne:s)!==null&&xe!==void 0?xe:a==null?void 0:a.metadata.name)!==null&&Ie!==void 0?Ie:""}${F&&F!==So.zG?` in ${F}`:""}`,headerType:(()=>{let gt=S.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(gt+=" \u2014 ",gt+=a.spec.type.toLocaleLowerCase("en-US")),gt})()}}function zs(i){var t;const{entity:s}=i,a=(0,kn.hF)(s,So.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(w.i9,{label:"Owner",value:(0,p.jsx)(kn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=s.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(w.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Yn=i=>{var t,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,children:S,NotFoundComponent:O}=i,{kind:F,namespace:ne,name:xe}=(0,g.Oi)(kn.wi),{entity:Ie,loading:We,error:gt}=(0,kn.ce)(),Et=(0,W.TH)(),Rt=(0,g.vJ)(S,Gi=>Gi.selectByComponentData({key:Us,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Mr})=>{if(Ie){if(Mr.if&&!Mr.if(Ie))return[]}else return[];return[{path:Mr.path,title:Mr.title,children:Mr.children,tabProps:Mr.tabProps}]}),[Ie]),{headerTitle:Yt,headerType:Ht}=Ms(F,ne,xe,Ie),[Fn,rr]=(0,H.useState)(!1),[Ar,Oo]=(0,H.useState)(!1),Ia=(0,W.s0)(),Hi=async()=>{rr(!1),Oo(!1),Ia("/")};(0,H.useEffect)(()=>{rr(!1),Oo(!1)},[Et.pathname]);var ds;return(0,p.jsxs)(w.T3,{themeId:(ds=Ie==null||(t=Ie.spec)===null||t===void 0||(s=t.type)===null||s===void 0?void 0:s.toString())!==null&&ds!==void 0?ds:"home",children:[(0,p.jsx)(w.h4,{title:(0,p.jsx)(ji,{title:Yt,entity:Ie}),pageTitleOverride:Yt,type:Ht,children:Ie&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zs,{entity:Ie}),(0,p.jsx)(Ns,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,onUnregisterEntity:()=>rr(!0),onInspectEntity:()=>Oo(!0)})]})}),We&&(0,p.jsx)(w.Ex,{}),Ie&&(0,p.jsx)(w.tn,{routes:Rt}),gt&&(0,p.jsx)(w.VY,{children:(0,p.jsx)(Is.Z,{severity:"error",children:gt.toString()})}),!We&&!gt&&!Ie&&(0,p.jsx)(w.VY,{children:O||(0,p.jsxs)(w.GB,{title:"Entity not found",children:["There is no ",F," with the requested"," ",(0,p.jsx)(w.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(kn.pp,{open:Fn,entity:Ie,onConfirm:Hi,onClose:()=>rr(!1)}),(0,p.jsx)(kn.U_,{open:Ar,entity:Ie,onClose:()=>Oo(!1)})]})};Yn.Route=Ro;function da(i){const{open:t,onClose:s,onConfirm:a,entity:h}=i,[S,O]=useState(!1),F=useApi(catalogApiRef),ne=useApi(alertApiRef),xe=async()=>{O(!0);try{const Ie=h.metadata.uid;await F.removeEntityByUid(Ie),a()}catch(Ie){assertError(Ie),ne.post({message:Ie.message})}finally{O(!1)}};return _jsxs(Dialog,{open:t,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:S,onClick:xe,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var Io=n(19625);function ua(i){var t,s;return(i==null||(t=i.metadata)===null||t===void 0||(s=t.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function Ei(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:h}=useEntity(),S=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:h,onConfirm:S,onClose:()=>a(!1)})]})}var Ai=n(4791);const ha=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Po(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(h=>{var S,O;return{errors:((O=(S=h.entity.status)===null||S===void 0?void 0:S.items)!==null&&O!==void 0?O:[]).filter(ha).map(xe=>xe.error).filter(xe=>Boolean(xe)),entity:h.entity}}).filter(h=>h.errors.length>0)}}async function pa(i,t){const s=t.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Po(stringifyEntityRef(i),s)).items.length>0}function fa(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:h,value:S}=useAsync(async()=>Po(t,s),[t,s]);return h?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:h})}):a||!S?null:_jsx(_Fragment,{children:S.items.map((O,F)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(O.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:O.entity})]}),O.errors.map((ne,xe)=>_jsx(ResponseErrorPanel,{error:ne},xe))]},F))})}const Ws="core.backstage.entitySwitch",eo=i=>null;(0,g.R5)(eo,Ws,!0);const Ti=i=>{var t;const{entity:s,loading:a}=(0,kn.ce)(),h=(0,g.I_)(),S=(0,g.vJ)(i.children,ne=>ne.selectByComponentData({key:Ws,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(xe=>{if(a)return[];const{if:Ie,children:We}=xe.props;return s?[{if:Ie==null?void 0:Ie(s,{apis:h}),children:We}]:[{if:Ie===void 0,children:We}]}),[h,s,a]);if(S.some(ne=>typeof ne.if=="object"&&"then"in ne.if))return(0,p.jsx)(Ri,{results:S,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ne=S.filter(xe=>xe.if).map(xe=>xe.children);return ne.length===0?to(S):(0,p.jsx)(p.Fragment,{children:ne})}var F;return(F=(t=S.find(ne=>ne.if))===null||t===void 0?void 0:t.children)!==null&&F!==void 0?F:to(S)};function Ri({results:i,renderMultipleMatches:t}){const{loading:s,value:a}=(0,be.default)(async()=>{const h=i.map(async({if:O,children:F})=>{try{if(await O)return F}catch{}return null});if(t==="all"){const O=(await Promise.all(h)).filter(Boolean);return O.length===0?to(i):(0,p.jsx)(p.Fragment,{children:O})}var S;return(S=(await Promise.all(h)).find(Boolean))!==null&&S!==void 0?S:to(i)},[i]);return s||!a?null:a}function to(i){var t,s;return(s=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&s!==void 0?s:null}Ti.Case=eo;const ga=null,Ma=kn._i.Filters,za=kn._i.Content;var ma=n(85877),va=n(15096);const Jn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:kn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:t})=>new Ai.MS({discoveryApi:i,fetchApi:t})}),(0,g.ni)({api:kn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new rs({storageApi:i})})],routes:{catalogIndex:Io._Z,catalogEntity:kn.wi},externalRoutes:{createComponent:Io.yw,viewTechDoc:Io.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Vs=Jn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:Io._Z})),as=Jn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:kn.wi})),ya=Jn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,33414)).then(i=>i.AboutCard)}})),ls=Jn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),xa=Jn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),Hs=Jn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),ba=Jn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Sa=Jn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Ii=Jn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),Ca=Jn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),Pi=Jn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Wa=Jn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),Va=Jn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),Ha=Jn.provide((0,va.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Gs=n(32838);class Li{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,s){const h=`${await this.getApiOrigin()}/${s}`,S=await fetch(`${h.endsWith("/")?h:`${h}/`}index.html`);if(S.status===404)throw new Error("Page not found");return S.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,s,a){const h=await this.getApiOrigin();return new URL(t,`${h}/${a}`).toString()}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}class wa{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,z._)(this,"configApi",void 0),(0,z._)(this,"discoveryApi",void 0),(0,z._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}const ja=[(0,g.ni)({api:se.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Li({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:se.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new wa({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:Gs.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>Gs.ae.fromConfig(i)})],Oi={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},ki={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function Ks(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Bi(){const i=await po(),t=await Ks();return[...i,{context:"detected",data:t?Oi:ki}]}var $i=n(58845);const Ea=(0,jr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Ys=()=>{const i=Ea();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Di=(0,jr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Zi=()=>{const i=Di();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const Js=(0,jr.Z)({root:{width:w.po.drawerWidthClosed,height:3*w.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:w.po.drawerWidthClosed,marginLeft:24}}),Fi=()=>{const i=Js(),{isOpen:t}=(0,w.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(w.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(Ys,{}):(0,p.jsx)(Zi,{})})})},Qs=({children:i})=>(0,p.jsxs)(w.tR,{children:[(0,p.jsxs)(w.YE,{children:[(0,p.jsx)(Fi,{}),(0,p.jsx)(w.v7,{}),(0,p.jsx)(w.R6,{icon:$i.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var cs=n(32388),Xs=n(4142);const Ni=(0,jr.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 dr;(function(i){i.LIGHT="light",i.DARK="dark"})(dr||(dr={}));const Ui=()=>{const i=(0,g.h_)(g.hg),t=Ni(),[s,a]=(0,H.useState)(i.getActiveThemeId()===dr.DARK?dr.DARK:dr.LIGHT),h={[dr.LIGHT]:{icon:Xs.Z,title:"Dark theme"},[dr.DARK]:{icon:cs.Z,title:"Light theme"}},{title:S,icon:O}=h[s],F=()=>{a(ne=>{const xe=ne===dr.LIGHT?dr.DARK:dr.LIGHT;return i.setActiveThemeId(xe),xe})};return(0,p.jsx)(Xn.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(_r.ZP,{title:S,arrow:!0,children:(0,p.jsx)(os.Z,{size:"small",onClick:F,children:(0,p.jsx)(O,{className:t.headerIcon})})})})},Lo=()=>(0,p.jsxs)(L.I6,{children:[(0,p.jsx)(Y.S,{}),(0,p.jsx)(I.F,{withSearch:!1})]}),Mi=(0,p.jsx)(Lo,{}),_s=ns({apis:ja,configLoader:Bi,plugins:Object.values(r)}),zi=_s.getProvider(),Wi=_s.getRouter(),ei=L.s4.provide((0,se.KY)({name:"ThemeToggleAddon",component:Ui,location:se.oZ.Header})),ti=(0,p.jsxs)(Wo,{children:[(0,p.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(as,{})}),(0,p.jsx)(W.AW,{path:"/docs",element:(0,p.jsx)(L.Jl,{}),children:(0,p.jsx)(Z.u,{})}),(0,p.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(L.I6,{}),children:[Mi,(0,p.jsx)(se.DR,{children:(0,p.jsx)(ei,{})})]})]});var Vi=()=>(0,p.jsx)(zi,{children:(0,p.jsx)(Wi,{children:(0,p.jsx)(Qs,{children:ti})})});f.render((0,p.jsx)(Vi,{}),document.getElementById("root"))},51837:function(Ct,Be,n){"use strict";n.d(Be,{CT:function(){return g},EI:function(){return ye},uW:function(){return f},Vt:function(){return d}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=r(),H=ue=>`__@backstage/${ue}__`;function f(ue,V){const Y=H(ue);let I=p[Y];return I||(I=V(),p[Y]=I,I)}var W=n(2784);function g(ue){return f(ue,()=>(0,W.createContext)(void 0))}function d(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 ye(ue){Object.freeze(ue);const V={atVersion(Y){return ue[Y]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return ue}}),V}},96641:function(Ct,Be,n){"use strict";n.d(Be,{X2:function(){return ye},ce:function(){return ue},h$:function(){return d}});var r=n(52322),p=n(25271),H=n(60871),f=n(51837),W=n(2784);const g=(0,f.CT)("entity-context"),d=V=>{const{children:Y,entity:I,loading:E,error:oe,refresh:ee}=V,te={entity:I,loading:E,error:oe,refresh:ee};return(0,r.jsx)(g.Provider,{value:(0,f.EI)({1:te}),children:(0,r.jsx)(H.fC,{attributes:{...I?{entityRef:(0,p.eE)(I)}:void 0},children:Y})})},B=V=>_jsx(d,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function ye(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const Y=V.atVersion(1);if(!Y)throw new Error("EntityContext v1 not available");if(!Y.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:Y.entity}}function ue(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const Y=V.atVersion(1);if(!Y)throw new Error("EntityContext v1 not available");const{entity:I,loading:E,error:oe,refresh:ee}=Y;return{entity:I,loading:E,error:oe,refresh:ee}}},43514:function(Ct,Be,n){"use strict";n.d(Be,{h$:function(){return yt.h$},n3:function(){return r.n3},_i:function(){return R},tW:function(){return _n},df:function(){return Me},UO:function(){return qe},ph:function(){return bo},dq:function(){return q},nl:function(){return Xo},dx:function(){return $},rI:function(){return K},u3:function(){return Zt},xE:function(){return sr},sL:function(){return C},LH:function(){return Ee},U_:function(){return vs},pp:function(){return Go},EW:function(){return Jo},Ah:function(){return H},wi:function(){return pe},hF:function(){return se.hF},CV:function(){return se.CV},$3:function(){return Ge},p3:function(){return f},ce:function(){return yt.ce},X2:function(){return yt.X2},wp:function(){return mt},ZW:function(){return rn},eK:function(){return Xt},CR:function(){return Bn}});var r=n(4791),p=n(60871);const H=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var W=n(82394);class g{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const w of this.subscribers)w.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)})))}}var d=n(52322),B=n(2784),ye=n(41156),ue=n(60364),V=n(77277),Y=n(4190),I=n(95544),E=n(90436),oe=n(60905),ee=n(36444);const te=b=>{const j=(0,ye.Z)(de=>de.breakpoints.down("md")),w=(0,ue.Z)(),[D,_]=(0,B.useState)(!1);return j?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(V.Z,{style:{marginTop:w.spacing(1),marginLeft:w.spacing(1)},onClick:()=>_(!0),startIcon:(0,d.jsx)(ee.Z,{}),children:"Filters"}),(0,d.jsx)(Y.ZP,{open:D,onClose:()=>_(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,d.jsxs)(I.Z,{m:2,children:[(0,d.jsx)(E.Z,{variant:"h6",component:"h2",style:{marginBottom:w.spacing(1)},children:"Filters"}),b.children]})})]}):(0,d.jsx)(oe.Z,{item:!0,lg:2,children:b.children})},Z=b=>(0,d.jsx)(oe.Z,{item:!0,xs:12,lg:10,children:b.children}),R=b=>(0,d.jsx)(oe.Z,{container:!0,style:{position:"relative"},children:b.children});R.Filters=te,R.Content=Z;var P=n(53974),L=n(87612),k=n(25271),se=n(49280);class Le{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,L._)(this,"value",void 0),this.value=j}}class ze{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,L._)(this,"value",void 0),this.value=j}}class z{filterEntity(j){var w;return this.values.every(D=>((w=j.metadata.tags)!==null&&w!==void 0?w:[]).includes(D))}toQueryValue(){return this.values}constructor(j){(0,L._)(this,"values",void 0),this.values=j}}class vt{filterEntity(j){const w=this.toUpperArray(this.value.split(/\s/)),D=this.toUpperArray([j.metadata.tags]),_=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const de of w)if(D.every(ce=>ce!==de)&&_.every(ce=>!ce.includes(de)))return!1;return!0}toUpperArray(j){return j.flat().filter(w=>Boolean(w)).map(w=>w.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class rt{filterEntity(j){return this.values.some(w=>(0,se.hF)(j,k.S4).some(D=>(0,k.eE)(D)===w))}toQueryValue(){return this.values}constructor(j){(0,L._)(this,"values",void 0),this.values=j.reduce((w,D)=>{try{return w.push((0,k.eE)((0,k.of)(D,{defaultKind:"Group"}))),w}catch{return w}},[])}}class He{filterEntity(j){return this.values.some(w=>{var D;return((D=j.spec)===null||D===void 0?void 0:D.lifecycle)===w})}toQueryValue(){return this.values}constructor(j){(0,L._)(this,"values",void 0),this.values=j}}class tt{filterEntity(j){return this.values.some(w=>j.metadata.namespace===w)}toQueryValue(){return this.values}constructor(j){(0,L._)(this,"values",void 0),this.values=j}}class Je{filterEntity(j){switch(this.value){case"owned":return this.isOwnedEntity(j);case"starred":return this.isStarredEntity(j);default:return!0}}toQueryValue(){return this.value}constructor(j,w,D){(0,L._)(this,"value",void 0),(0,L._)(this,"isOwnedEntity",void 0),(0,L._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=w,this.isStarredEntity=D}}class bt{filterEntity(j){var w;const D=(w=j.metadata.annotations)===null||w===void 0?void 0:w["backstage.io/orphan"];return D!==void 0&&this.value.toString()===D}constructor(j){(0,L._)(this,"value",void 0),this.value=j}}class At{filterEntity(j){var w,D;const _=(j==null||(w=j.status)===null||w===void 0||(D=w.items)===null||D===void 0?void 0:D.length)>0;return _!==void 0&&this.value===_}constructor(j){(0,L._)(this,"value",void 0),this.value=j}}var yt=n(96641),ot=n(76635),It=n(19126),Mt=n.n(It),Ve=n(73557),_t=n(69294),ge=n(48760),Se=n(90736);const Ne=(0,B.createContext)(void 0),qe=b=>{const j=(0,Se.default)(),w=(0,p.h_)(H),[D,_]=(0,B.useState)({}),de=(0,Ve.TH)();var ce;const ve=(0,B.useMemo)(()=>(ce=Mt().parse(de.search,{ignoreQueryPrefix:!0}).filters)!==null&&ce!==void 0?ce:{},[de]),[Re,Ce]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Fe,error:Ze},it]=(0,_t.default)(async()=>{const Oe=(0,ot.compact)(Object.values(D)),ft=(0,se.Gz)(Oe),kt=(0,se.wq)(Oe),fn=(0,se.wq)((0,ot.compact)(Object.values(Re.appliedFilters))),St=Object.keys(D).reduce((Ft,an)=>{const Sn=D[an];return Sn!=null&&Sn.toQueryValue&&(Ft[an]=Sn.toQueryValue()),Ft},{});if((0,ot.isEqual)(fn,kt))Ce({appliedFilters:D,backendEntities:Re.backendEntities,entities:Re.backendEntities.filter(ft)});else{const Ft=await w.getEntities({filter:kt});Ce({appliedFilters:D,backendEntities:Ft.items,entities:Ft.items.filter(ft)})}if(j()){var Bt;const Ft=Mt().parse(de.search,{ignoreQueryPrefix:!0}),an=Mt().stringify({...Ft,filters:St},{addQueryPrefix:!0,arrayFormat:"repeat"}),Sn=`${window.location.pathname}${an}`;(Bt=window.history)===null||Bt===void 0||Bt.replaceState(null,document.title,Sn)}},[w,ve,D,Re],{loading:!0});(0,ge.Z)(it,10,[D]);const nt=(0,B.useCallback)(Oe=>{_(ft=>{const kt=typeof Oe=="function"?Oe(ft):Oe;return{...ft,...kt}})},[]),_e=(0,B.useMemo)(()=>({filters:Re.appliedFilters,entities:Re.entities,backendEntities:Re.backendEntities,updateFilters:nt,queryParameters:ve,loading:Fe,error:Ze}),[Re,nt,ve,Fe,Ze]);return(0,d.jsx)(Ne.Provider,{value:_e,children:b.children})};function mt(){const b=(0,B.useContext)(Ne);if(!b)throw new Error("useEntityList must be used within EntityListProvider");return b}var xt=n(64279),ut=n(18149),Ot=n.n(ut),Kt=n(829),qt=n.n(Kt);function Dt(){const b=(0,p.h_)(H),{filters:{kind:j,type:w},queryParameters:{type:D},updateFilters:_}=mt(),de=(0,B.useMemo)(()=>[D].flat().filter(Boolean),[D]);var ce;const[ve,Re]=(0,B.useState)(de.length?de:(ce=w==null?void 0:w.getTypes())!==null&&ce!==void 0?ce:[]);(0,B.useEffect)(()=>{de.length&&Re(de)},[de]);const[Ce,Fe]=(0,B.useState)([]),Ze=(0,B.useMemo)(()=>j==null?void 0:j.value,[j]),{error:it,loading:nt,value:_e}=(0,xt.default)(async()=>Ze?await b.getEntityFacets({filter:{kind:Ze},facets:["spec.type"]}).then(kt=>kt.facets["spec.type"]||[]):[],[Ze,b]),Oe=(0,B.useRef)(_e);return(0,B.useEffect)(()=>{const ft=Oe.current;if(Oe.current=_e,nt||!Ze||ft===_e||!_e)return;const kt=[...new Set(qt()(_e,St=>-St.count).map(St=>St.value.toLocaleLowerCase("en-US")))];Fe(kt);const fn=ve.filter(St=>kt.includes(St));Ot()(ve,fn)||Re(fn)},[nt,Ze,ve,Re,_e]),(0,B.useEffect)(()=>{_({type:ve.length?new ze(ve):void 0})},[ve,_]),{loading:nt,error:it,availableTypes:Ce,selectedTypes:ve,setSelectedTypes:Re}}const hn=20;function Xt(b,j){var w,D;const _=j==null||(w=j.type)===null||w===void 0?void 0:w.toLocaleLowerCase("en-US"),de=j==null||(D=j.kind)===null||D===void 0?void 0:D.toLocaleLowerCase("en-US"),ce=(0,p.h_)(H),{loading:ve,value:Re,error:Ce}=(0,xt.default)(async()=>{var Fe;const Ze=(Fe=b.relations)===null||Fe===void 0?void 0:Fe.map(Oe=>({type:Oe.type,target:(0,k.of)(Oe.targetRef)})).filter(Oe=>(!_||Oe.type.toLocaleLowerCase("en-US")===_)&&(!de||Oe.target.kind===de));if(!Ze)return[];const it=Object.values((0,ot.groupBy)(Ze,({target:Oe})=>`${Oe.kind}:${Oe.namespace}`.toLocaleLowerCase("en-US"))),nt=[];for(const Oe of it)nt.push({kind:Oe[0].target.kind,namespace:Oe[0].target.namespace,nameBatches:(0,ot.chunk)(Oe.map(ft=>ft.target.name),hn)});return(await Promise.all(nt.flatMap(Oe=>Oe.nameBatches.map(ft=>ce.getEntities({filter:{kind:Oe.kind,"metadata.namespace":Oe.namespace,"metadata.name":ft}}))))).flatMap(Oe=>Oe.items)},[b,_,de]);return{entities:Re,loading:ve,error:Ce}}var gn=n(72164);function zn(b){return typeof b=="string"?b:(0,k.eE)(b)}function Bn(){const b=(0,p.h_)(f),j=(0,gn.Z)(b.starredEntitie$(),new Set),w=(0,B.useCallback)(_=>j.has(zn(_)),[j]),D=(0,B.useCallback)(_=>b.toggleStarred(zn(_)).then(),[b]);return{starredEntities:j,toggleStarredEntity:D,isStarredEntity:w}}function mn(b){return typeof b=="string"?b:(0,k.eE)(b)}function $n(b){const j=(0,p.h_)(f),[w,D]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const de=j.starredEntitie$().subscribe({next(ce){D(ce.has(mn(b)))}});return()=>{de.unsubscribe()}},[b,j]),{toggleStarredEntity:(0,B.useCallback)(()=>j.toggleStarred(mn(b)).then(),[b,j]),isStarredEntity:w}}var Wn=n(75435);function rn(){const b=(0,p.h_)(p.$4),{loading:j,value:w}=(0,xt.default)(async()=>{const{ownershipEntityRefs:_}=await b.getBackstageIdentity();return _},[]),D=(0,B.useMemo)(()=>{const _=new Set(w!=null?w:[]);return de=>{const ce=(0,Wn.h)(de,k.S4).map(k.eE);for(const ve of ce)if(_.has(ve))return!0;return!1}},[w]);return(0,B.useMemo)(()=>({loading:j,isOwnedEntity:D}),[j,D])}function Tn(){const b=(0,p.h_)(H),{error:j,loading:w,value:D}=(0,xt.default)(async()=>await b.getEntityFacets({facets:["kind"]}).then(de=>{var ce;return((ce=de.facets.kind)===null||ce===void 0?void 0:ce.map(ve=>ve.value).sort())||[]}),[b]);return{loading:w,error:j,allKinds:D!=null?D:[]}}function Vn(b,j,w){let D=b;return j&&(D=D.filter(de=>j.some(ce=>ce.toLocaleLowerCase("en-US")===de.toLocaleLowerCase("en-US")))),w&&!b.some(de=>de.toLocaleLowerCase("en-US")===w.toLocaleLowerCase("en-US"))&&(D=D.concat([w])),D.sort().reduce((de,ce)=>(de[ce.toLocaleLowerCase("en-US")]=ce,de),{})}function ct(b){var j;const{filters:w,queryParameters:{kind:D},updateFilters:_}=mt(),de=(0,B.useMemo)(()=>[D].flat()[0],[D]);var ce;const[ve,Re]=(0,B.useState)((ce=de!=null?de:(j=w.kind)===null||j===void 0?void 0:j.value)!==null&&ce!==void 0?ce:b.initialFilter);(0,B.useEffect)(()=>{de&&Re(de)},[de]),(0,B.useEffect)(()=>{var it;if(!((it=w.kind)===null||it===void 0)&&it.value){var nt;Re((nt=w.kind)===null||nt===void 0?void 0:nt.value)}},[w.kind]),(0,B.useEffect)(()=>{_({kind:ve?new Le(ve):void 0})},[ve,_]);const{allKinds:Ce,loading:Fe,error:Ze}=Tn();return{loading:Fe,error:Ze,allKinds:Ce!=null?Ce:[],selectedKind:ve,setSelectedKind:Re}}const _n=b=>{const{allowedKinds:j,hidden:w,initialFilter:D="component"}=b,_=(0,p.h_)(p.$v),{error:de,allKinds:ce,selectedKind:ve,setSelectedKind:Re}=ct({initialFilter:D});if((0,B.useEffect)(()=>{de&&_.post({message:"Failed to load entity kinds",severity:"error"})},[de,_]),de)return null;const Ce=Vn(ce,j,ve),Fe=Object.keys(Ce).map(Ze=>({value:Ze,label:Ce[Ze]}));return w?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsx)(P.Ph,{label:"Kind",items:Fe,selected:ve.toLocaleLowerCase("en-US"),onChange:Ze=>Re(String(Ze))})})};var wt=n(79692),at=n(5806),xn=n(21324),Jt=n(86619),pn=n(19996),Rn=n(25505),dn=n(38016),Ln=n(88013);const we=(0,wt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),le=(0,d.jsx)(Rn.Z,{fontSize:"small"}),ke=(0,d.jsx)(pn.Z,{fontSize:"small"}),Me=b=>{var j;const{initialFilter:w=[]}=b,D=we(),{updateFilters:_,backendEntities:de,filters:ce,queryParameters:{lifecycles:ve}}=mt(),Re=(0,B.useMemo)(()=>[ve].flat().filter(Boolean),[ve]);var Ce;const[Fe,Ze]=(0,B.useState)(Re.length?Re:(Ce=(j=ce.lifecycles)===null||j===void 0?void 0:j.values)!==null&&Ce!==void 0?Ce:w);(0,B.useEffect)(()=>{Re.length&&Ze(Re)},[Re]);const it=(0,B.useMemo)(()=>[...new Set(de.map(nt=>{var _e;return(_e=nt.spec)===null||_e===void 0?void 0:_e.lifecycle}).filter(Boolean))].sort(),[de]);return(0,B.useEffect)(()=>{_({lifecycles:Fe.length&&it.length?new He(Fe):void 0})},[Fe,_,it]),it.length?(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(E.Z,{variant:"button",component:"label",children:["Lifecycle",(0,d.jsx)(Ln.ZP,{multiple:!0,disableCloseOnSelect:!0,options:it,value:Fe,onChange:(nt,_e)=>Ze(_e),renderOption:(nt,{selected:_e})=>(0,d.jsx)(at.Z,{control:(0,d.jsx)(xn.Z,{icon:le,checkedIcon:ke,checked:_e}),onClick:Oe=>Oe.preventDefault(),label:nt}),size:"small",popupIcon:(0,d.jsx)(dn.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:nt=>(0,d.jsx)(Jt.Z,{...nt,className:D.input,variant:"outlined"})})]})}):null};var Qe=n(6232),re=n(98685),N=n(62367),me=n(72579),$e=n.n(me);function Ge(b,j){const w=j==null?void 0:j.defaultKind;let D,_,de;return"metadata"in b?(D=b.kind,_=b.metadata.namespace,de=b.metadata.name):(D=b.kind,_=b.namespace,de=b.name),(_===void 0||_==="")&&(_=k.zG),(j==null?void 0:j.defaultNamespace)!==void 0?(j==null?void 0:j.defaultNamespace)===_&&(_=void 0):_===k.zG&&(_=void 0),D=D.toLocaleLowerCase("en-US"),D=w&&w.toLocaleLowerCase("en-US")===D?void 0:D,`${D?`${D}:`:""}${_?`${_}/`:""}${de}`}function et(b,j){for(const w of["spec.profile.displayName","metadata.title"]){const D=$e()(b,w);if(D&&typeof D=="string")return D}return j}const $t=(0,wt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),zt=(0,d.jsx)(Rn.Z,{fontSize:"small"}),tn=(0,d.jsx)(pn.Z,{fontSize:"small"}),q=()=>{var b,j;const w=$t(),{updateFilters:D,filters:_,queryParameters:{owners:de}}=mt(),ce=(0,p.h_)(H),[ve,Re]=(0,B.useState)(""),[{value:Ce,loading:Fe},Ze]=(0,_t.default)(async St=>{const Bt=St,Ft=St,an=20;if(Ft.cursor){const Sn=await ce.queryEntities({cursor:Ft.cursor,limit:an});return{...Sn,items:[...Ft.prev,...Sn.items]}}return ce.queryEntities({fullTextFilter:{term:Bt.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:an})},[ve]);(0,Qe.b)(()=>Ze({text:ve}),[ve],250);const it=(Ce==null?void 0:Ce.items)||[],nt=(0,B.useMemo)(()=>[de].flat().filter(Boolean),[de]);var _e;const[Oe,ft]=(0,B.useState)(nt.length?nt:(_e=(b=_.owners)===null||b===void 0?void 0:b.values)!==null&&_e!==void 0?_e:[]),{getEntity:kt,setEntity:fn}=J(Oe);return(0,B.useEffect)(()=>{if(nt.length){const St=new rt(nt);ft(St.values)}},[nt]),(0,B.useEffect)(()=>{D({owners:Oe.length?new rt(Oe):void 0})},[Oe,D]),["user","group"].includes(((j=_.kind)===null||j===void 0?void 0:j.value.toLocaleLowerCase("en-US"))||"")?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(E.Z,{variant:"button",component:"label",children:["Owner",(0,d.jsx)(Ln.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:Fe,options:it,value:Oe,getOptionSelected:(St,Bt)=>typeof Bt=="string"?(0,k.eE)(St)===Bt:St===Bt,getOptionLabel:St=>{const Bt=typeof St=="string"&&kt(St)||St;return typeof Bt=="string"?Bt:et(Bt,Bt.metadata.name)},onChange:(St,Bt)=>{Re(""),ft(Bt.map(Ft=>{const an=typeof Ft=="string"?Ft:(0,k.eE)(Ft);return typeof Ft!="string"&&fn(Ft),an}))},filterOptions:St=>St,renderOption:(St,{selected:Bt})=>{const Ft=St.kind==="Group";return(0,d.jsx)(at.Z,{control:(0,d.jsx)(xn.Z,{icon:zt,checkedIcon:tn,checked:Bt}),onClick:an=>an.preventDefault(),label:(0,d.jsxs)(I.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Ft?(0,d.jsx)(N.Z,{fontSize:"small"}):(0,d.jsx)(re.Z,{fontSize:"small"}),"\xA0",et(St,St.metadata.name)]})})},size:"small",popupIcon:(0,d.jsx)(dn.Z,{"data-testid":"owner-picker-expand"}),renderInput:St=>(0,d.jsx)(Jt.Z,{...St,className:w.input,onChange:Bt=>{Re(Bt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:St=>{const Bt=St.currentTarget;Math.abs(Bt.scrollHeight-Bt.clientHeight-Bt.scrollTop)<1&&(Ce!=null&&Ce.pageInfo.nextCursor)&&Ze({cursor:Ce.pageInfo.nextCursor,prev:Ce.items})},"data-testid":"owner-picker-listbox"}})]})})};function J(b){const j=(0,B.useRef)({}),w=(0,p.h_)(H);return(0,xt.default)(async()=>{if(b.length===0)return;(await w.getEntitiesByRefs({entityRefs:b})).items.forEach(_=>{_&&(j.current[(0,k.eE)(_)]=_)})},[]),{getEntity:D=>j.current[D],setEntity:D=>{j.current[(0,k.eE)(D)]=D}}}var ie=n(51837);const pe=(0,ie.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function ae(b){var j,w;return{kind:b.kind.toLocaleLowerCase("en-US"),namespace:(w=(j=b.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&w!==void 0?w:DEFAULT_NAMESPACE,name:b.metadata.name}}var y=n(80030);const $=(0,B.forwardRef)((b,j)=>{const{entityRef:w,defaultKind:D,title:_,children:de,...ce}=b,ve=(0,p.tg)(pe);let Re,Ce,Fe;if(typeof w=="string"){const Oe=(0,k.of)(w);Re=Oe.kind,Ce=Oe.namespace,Fe=Oe.name}else"metadata"in w?(Re=w.kind,Ce=w.metadata.namespace,Fe=w.metadata.name):(Re=w.kind,Ce=w.namespace,Fe=w.name);Re=Re.toLocaleLowerCase("en-US");var Ze;Ce=(Ze=Ce==null?void 0:Ce.toLocaleLowerCase("en-US"))!==null&&Ze!==void 0?Ze:k.zG;const it={kind:Re,namespace:Ce,name:Fe},nt=Ge({kind:Re,namespace:Ce,name:Fe},{defaultKind:D}),_e=(0,d.jsxs)(P.rU,{...ce,ref:j,to:ve(it),children:[de,!de&&(_!=null?_:nt)]});return _?(0,d.jsx)(y.ZP,{title:nt,children:_e}):_e});function X(b){const{entityRefs:j,defaultKind:w,getTitle:D,..._}=b,de=(0,p.h_)(H),{value:ce=new Array,loading:ve,error:Re}=(0,xt.default)(async()=>{const Ce=j.reduce((Ze,it)=>typeof it=="object"&&"metadata"in it?Ze:[...Ze,(0,k.of)(it)],new Array),Fe=j.filter(Ze=>typeof Ze=="object"&&"metadata"in Ze);return Ce.length>0?[...(await de.getEntities({filter:Ce.map(Ze=>({kind:Ze.kind,"metadata.namespace":Ze.namespace,"metadata.name":Ze.name}))})).items,...Fe]:Fe},[j]);return ve?(0,d.jsx)(P.Ex,{}):Re?(0,d.jsx)(P.yu,{error:Re}):(0,d.jsx)(d.Fragment,{children:ce.map((Ce,Fe)=>(0,d.jsxs)(B.Fragment,{children:[Fe>0&&", ",(0,d.jsx)($,{..._,defaultKind:w,entityRef:Ce,title:D(Ce)})]},Fe))})}function K(b){const{entityRefs:j,defaultKind:w,fetchEntities:D,getTitle:_,...de}=b;return D?(0,d.jsx)(X,{...de,defaultKind:w,entityRefs:j,getTitle:_}):(0,d.jsx)(d.Fragment,{children:j.map((ce,ve)=>(0,d.jsxs)(B.Fragment,{children:[ve>0&&", ",(0,d.jsx)($,{...de,defaultKind:w,entityRef:ce,title:_?_(ce):void 0})]},ve))})}const je=b=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(b.entity)),children:_jsx(InfoIcon,{})})},Ae=b=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${b.email}`,to:`mailto:${b.email}`,children:_jsx(EmailIcon,{})}),Ke=b=>{var j;const w=(j=b.entity.spec.profile)===null||j===void 0?void 0:j.email;return w?_jsx(EmailCardAction,{email:w}):null},Tt=b=>{var j;const w=(j=b.entity.spec.profile)===null||j===void 0?void 0:j.email;return w?_jsx(EmailCardAction,{email:w}):null},ht=(0,wt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),pt=4,Ye=b=>{var j,w,D;const{entityRef:_,children:de,delayTime:ce=500}=b,ve=ht(),Re=useApiHolder(),Ce=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Fe,Ze]=useState(!1),it=useMemo(()=>debounce(()=>Ze(!0),ce),[ce]),[{loading:nt,error:_e,value:Oe},ft]=useAsyncFn(async()=>{const fn=Re.get(catalogApiRef);if(fn){const St=await fn.getEntityByRef(_);if(!St)throw new Error(`${_} not found`);return St}},[Re,_]),kt=()=>{Ze(!1),it.cancel()};return useEffect(()=>{Ce.isOpen&&!Oe&&!_e&&!nt&&ft()},[Ce.isOpen,ft,Oe,_e,nt]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:it,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Ce),children:de})}),Fe&&_jsx(HoverPopover,{PaperProps:{className:ve.popoverPaper},...bindPopover(Ce),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:kt,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[_e&&_jsx(ResponseErrorPanel,{error:_e}),nt&&_jsx(Progress,{}),Oe&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:Oe.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:Oe.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:Oe.kind}),Oe.metadata.description&&_jsx(Typography,{className:ve.descriptionTypography,paragraph:!0,children:Oe.metadata.description}),_jsx(Typography,{children:(j=Oe.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[(Oe.metadata.tags||[]).slice(0,pt).map(fn=>_jsx(Chip,{size:"small",label:fn},fn)),((w=Oe.metadata.tags)===null||w===void 0?void 0:w.length)&&((D=Oe.metadata.tags)===null||D===void 0?void 0:D.length)>pt&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!_e&&Oe&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(Oe)&&_jsx(UserCardActions,{entity:Oe}),isGroupEntity(Oe)&&_jsx(GroupCardActions,{entity:Oe}),_jsx(EntityCardActions,{entity:Oe})]})})]})})]})},lt=(0,wt.Z)(b=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),st=()=>{var b;const j=lt(),{filters:w,updateFilters:D}=useEntityList();var _;const[de,ce]=useState((_=(b=w.text)===null||b===void 0?void 0:b.value)!==null&&_!==void 0?_:"");return useDebounce(()=>{D({text:de.length?new EntityTextFilter(de):void 0})},250,[de,D]),_jsx(Toolbar,{className:j.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:j.input,placeholder:"Search",autoComplete:"off",onChange:ve=>ce(ve.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:()=>ce(""),edge:"end",disabled:de.length===0,children:_jsx(Clear,{})})})})})})},jt=Object.freeze({createEntityRefColumn(b){const{defaultKind:j}=b;function w(D){var _;return((_=D.metadata)===null||_===void 0?void 0:_.title)||Ge(D,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(D,_){return w(_).includes(D)},customSort(D,_){return w(D).localeCompare(w(_))},render:D=>{var _;return(0,d.jsx)($,{entityRef:D,defaultKind:j,title:(_=D.metadata)===null||_===void 0?void 0:_.title})}}},createEntityRelationColumn(b){const{title:j,relation:w,defaultKind:D,filter:_}=b;function de(ve){return(0,se.hF)(ve,w,_)}function ce(ve){return de(ve).map(Re=>Ge(Re,{defaultKind:D})).join(", ")}return{title:j,customFilterAndSearch(ve,Re){return ce(Re).includes(ve)},customSort(ve,Re){return ce(ve).localeCompare(ce(Re))},render:ve=>(0,d.jsx)(K,{entityRefs:de(ve),defaultKind:D})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:k.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:k.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:k.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:b=>(0,d.jsx)(P.Or,{text:b.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Wt=[jt.createEntityRefColumn({defaultKind:"system"}),jt.createDomainColumn(),jt.createOwnerColumn(),jt.createMetadataDescriptionColumn()],en=[jt.createEntityRefColumn({defaultKind:"component"}),jt.createSystemColumn(),jt.createOwnerColumn(),jt.createSpecTypeColumn(),jt.createSpecLifecycleColumn(),jt.createMetadataDescriptionColumn()],nn=(0,wt.Z)(b=>({empty:{padding:b.spacing(2),display:"flex",justifyContent:"center"}})),Zt=b=>{const{entities:j,title:w,emptyContent:D,variant:_="gridItem",columns:de}=b,ce=nn(),ve={minWidth:"0",width:"100%"};return _==="gridItem"&&(ve.height="calc(100% - 10px)"),(0,d.jsx)(P.iA,{columns:de,title:w,style:ve,emptyContent:D&&(0,d.jsx)("div",{className:ce.empty,children:D}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:j})};Zt.columns=jt,Zt.systemEntityColumns=Wt,Zt.componentEntityColumns=en;const Vt=(0,d.jsx)(Rn.Z,{fontSize:"small"}),Pt=(0,d.jsx)(pn.Z,{fontSize:"small"});function Lt({selected:b}){return(0,d.jsx)(xn.Z,{icon:Vt,checkedIcon:Pt,checked:b})}const Ut=(0,B.memo)(b=>{const{selected:j,value:w,availableOptions:D,showCounts:_}=b,de=_?`${w} (${D==null?void 0:D[w]})`:w;return(0,d.jsx)(at.Z,{control:(0,d.jsx)(Lt,{selected:j}),label:de,onClick:ce=>ce.preventDefault()})});var In=n(72779),Pn=n.n(In);const Qn=(0,wt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function hr(b){const j=Qn();return(0,d.jsx)(Jt.Z,{variant:"outlined",...b,className:Pn()(j.input,b.className)})}function wn(b){var j;const{label:w,name:D,path:_,showCounts:de,Filter:ce,InputProps:ve}=b,{updateFilters:Re,filters:Ce,queryParameters:{[D]:Fe}}=mt(),Ze=(0,p.h_)(H),{value:it}=(0,xt.default)(async()=>{var Bt;const Ft=_,{facets:an}=await Ze.getEntityFacets({facets:[Ft],filter:(Bt=Ce.kind)===null||Bt===void 0?void 0:Bt.getCatalogFilters()});return Object.fromEntries(an[Ft].map(({value:Sn,count:Ir})=>[Sn,Ir]))},[Ce.kind]),nt=(0,B.useMemo)(()=>[Fe].flat().filter(Boolean),[Fe]);var _e;const[Oe,ft]=(0,B.useState)(nt.length?nt:(_e=(j=Ce[D])===null||j===void 0?void 0:j.values)!==null&&_e!==void 0?_e:[]);(0,B.useEffect)(()=>{nt.length&&ft(nt)},[nt]);const kt=Object.keys(it!=null?it:{}),fn=Oe.length&&kt.length;(0,B.useEffect)(()=>{Re({[D]:fn?new ce(Oe):void 0})},[D,fn,Oe,ce,Re]);const St=Ce[D];return St&&typeof St=="object"&&!("values"in St)||!kt.length||kt.length<=1?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(E.Z,{variant:"button",component:"label",children:[w,(0,d.jsx)(Ln.ZP,{multiple:!0,disableCloseOnSelect:!0,options:kt,value:Oe,onChange:(Bt,Ft)=>ft(Ft),renderOption:(Bt,{selected:Ft})=>(0,d.jsx)(Ut,{selected:Ft,value:Bt,availableOptions:it,showCounts:!!de}),size:"small",popupIcon:(0,d.jsx)(dn.Z,{"data-testid":`${String(D)}-picker-expand`}),renderInput:Bt=>(0,d.jsx)(hr,{...Bt,...ve})})]})})}const Dn=(0,wt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),sr=b=>{const j=Dn();return(0,d.jsx)(wn,{label:"Tags",name:"tags",path:"metadata.tags",Filter:z,showCounts:b.showCounts,InputProps:{className:j.input}})},C=b=>{const{hidden:j,initialFilter:w}=b,D=(0,p.h_)(p.$v),{error:_,availableTypes:de,selectedTypes:ce,setSelectedTypes:ve}=Dt();if((0,B.useEffect)(()=>{_&&D.post({message:"Failed to load entity types",severity:"error"}),w&&ve([w])},[_,D,w,ve]),de.length===0||_)return null;const Re=[{value:"all",label:"all"},...de.map(Fe=>({value:Fe,label:Fe}))];var Ce;return j?null:(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsx)(P.Ph,{label:"Type",items:Re,selected:(Ce=Re.length>1?ce[0]:void 0)!==null&&Ce!==void 0?Ce:"all",onChange:Fe=>ve(Fe==="all"?[]:[String(Fe)])})})};var c=n(15459),x=n(61837),A=n(11640),Q=n(28347);const be=(0,c.Z)({root:{color:"#f3ba37"}})(A.Z),Ee=b=>{const{toggleStarredEntity:j,isStarredEntity:w}=$n(b.entity);return(0,d.jsx)(x.Z,{"aria-label":"favorite",color:"inherit",...b,onClick:()=>j(),children:(0,d.jsx)(y.ZP,{title:w?"Remove from favorites":"Add to favorites",children:w?(0,d.jsx)(be,{}):(0,d.jsx)(Q.Z,{})})})};var De=n(8629),dt=n(79249),Qt=n(38724),bn=n(99152),jn=n(6487),pr=n(49429),on=n(55999),so=n(39412);const io=so.Z;function ao(b,j){if(b)return b.toLocaleLowerCase("en-US");if(j)try{return(0,k.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function Sr(b,j){const w=(0,p.qD)(),D=ao(b,j);return D&&w.getSystemIcon(`kind:${D}`)||io}function fr(b){const{kind:j,entityRef:w,...D}=b,_=Sr(j,w);return(0,d.jsx)(_,{...D})}const lo=(0,wt.Z)(b=>({node:{fill:b.palette.grey[300],stroke:b.palette.grey[300],"&.primary":{fill:b.palette.primary.light,stroke:b.palette.primary.light},"&.secondary":{fill:b.palette.secondary.light,stroke:b.palette.secondary.light}},text:{fill:b.palette.getContrastText(b.palette.grey[300]),"&.primary":{fill:b.palette.primary.contrastText},"&.secondary":{fill:b.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function co(b){const j=(0,p.h_)(H),w=(0,k.eE)(b),{loading:D,error:_,value:de}=(0,xt.default)(async()=>{const ce=await j.getEntityAncestors({entityRef:w}),ve=new Array,Re=new Array;for(const Ce of ce.items){const Fe=(0,k.eE)(Ce.entity),Ze=Fe===ce.rootEntityRef;ve.push({id:Fe,root:Ze,...Ce.entity});for(const it of Ce.parentEntityRefs)Re.push({from:Fe,to:it})}return{nodes:ve,edges:Re}},[w]);return{loading:D,error:_,nodes:(de==null?void 0:de.nodes)||[],edges:(de==null?void 0:de.edges)||[]}}function Do({node:b}){const j=lo(),w=(0,Ve.s0)(),D=(0,p.tg)(pe),[_,de]=(0,B.useState)(0),[ce,ve]=(0,B.useState)(0),Re=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Re.current){let{height:ft,width:kt}=Re.current.getBBox();ft=Math.round(ft),kt=Math.round(kt),(ft!==ce||kt!==_)&&(de(kt),ve(ft))}},[_,ce]);const Ce=10,Fe=ce,Ze=Fe+Ce,it=Ze+_+Ce*2,nt=ce+Ce*2,_e=b.metadata.title||(b.kind&&b.metadata.name&&b.metadata.namespace?Ge({kind:b.kind,name:b.metadata.name,namespace:b.metadata.namespace||""}):b.id),Oe=()=>{w(D({kind:b.kind,namespace:b.metadata.namespace||k.zG,name:b.metadata.name}))};return(0,d.jsxs)("g",{onClick:Oe,className:j.clickable,children:[(0,d.jsx)("rect",{className:Pn()(j.node,b.root?"secondary":"primary"),width:it,height:nt,rx:10}),(0,d.jsx)(fr,{kind:b.kind,y:Ce,x:Ce,width:Fe,height:Fe,className:Pn()(j.text,b.root?"secondary":"primary")}),(0,d.jsx)("text",{ref:Re,className:Pn()(j.text,b.root?"secondary":"primary"),y:nt/2,x:Ze+(_+Ce*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:_e})]})}function Vr(b){const{loading:j,error:w,nodes:D,edges:_}=co(b.entity);return j?(0,d.jsx)(P.Ex,{}):w?(0,d.jsx)(P.Gk,{error:w}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(on.Z,{variant:"h2",children:"Ancestry"}),(0,d.jsxs)(on.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,d.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,d.jsx)(I.Z,{mt:4,children:(0,d.jsx)(P.mn,{nodes:D,edges:_,renderNode:Do,direction:P.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Cr=n(11776),er=n(38402),Br=n(86136),$r=n(99688),uo=n(49378),Zo=n(54506),Hr=n(94339),Fo=n(24579),No=n(27685);const Dr=(0,wt.Z)(b=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:b.spacing(2)},helpIcon:{marginLeft:b.spacing(1),color:b.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Hn(b){const j=Dr();return(0,d.jsx)(uo.Z,{...b,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Rr(b){const j=Dr();return(0,d.jsx)(Zo.Z,{className:j.monospace,children:b.children})}function Zr(b){return(0,d.jsx)(I.Z,{mt:2,children:(0,d.jsx)(Hr.Z,{variant:"outlined",children:(0,d.jsxs)(Fo.Z,{children:[(0,d.jsxs)(E.Z,{variant:"h6",gutterBottom:!0,children:[b.title,b.helpLink&&(0,d.jsx)(Gr,{to:b.helpLink})]}),b.children]})})})}function ho(b){if(b.match(/^url:https?:\/\//))return b.slice(4);if(b.match(/^https?:\/\//))return b}function En(b){const[j,w]=b.entry,D=ho(w);return(0,d.jsxs)(er.Z,{children:[b.indent&&(0,d.jsx)(Br.Z,{}),(0,d.jsx)(Hn,{primary:j,secondary:D?(0,d.jsx)(P.rU,{to:D,children:w}):w})]})}function Gr(b){const j=Dr();return(0,d.jsx)(P.rU,{to:b.to,className:j.helpIcon,children:(0,d.jsx)(No.Z,{fontSize:"inherit"})})}const po=(0,wt.Z)({root:{display:"flex",flexDirection:"column"}});function Uo(b){var j,w;const D=(0,p.h_)(H),_=(0,k.eE)(b),de=(j=b.metadata.annotations)===null||j===void 0?void 0:j[k.P1],ce=(w=b.metadata.annotations)===null||w===void 0?void 0:w[k.q1],{loading:ve,error:Re,value:Ce}=(0,xt.default)(async()=>!de&&!ce?[]:(await D.getEntities({filter:[...de?[{[`metadata.annotations.${k.P1}`]:de}]:[],...ce?[{[`metadata.annotations.${k.q1}`]:ce}]:[]]})).items,[de,ce]);return{loading:ve,error:Re,location:de,originLocation:ce,colocatedEntities:Ce==null?void 0:Ce.filter(Fe=>(0,k.eE)(Fe)!==_)}}function ir(b){return(0,d.jsxs)(Cr.Z,{dense:!0,children:[b.header&&(0,d.jsx)(En,{entry:b.header},"header"),b.entities.map(j=>(0,d.jsxs)(er.Z,{children:[(0,d.jsx)(Br.Z,{children:(0,d.jsx)(fr,{kind:j.kind})}),(0,d.jsx)(Hn,{primary:(0,d.jsx)($,{entityRef:j})})]},(0,k.eE)(j)))]})}function Mo(b){const{entity:j}=b,{loading:w,error:D,location:_,originLocation:de,colocatedEntities:ce}=Uo(j);if(w)return(0,d.jsx)(P.Ex,{});if(D)return(0,d.jsx)(P.Gk,{error:D});if(!_&&!de)return(0,d.jsx)($r.Z,{severity:"warning",children:"Entity had no location information."});if(!(ce!=null&&ce.length))return(0,d.jsx)($r.Z,{severity:"info",children:"There were no other entities on this location."});if(_===de)return(0,d.jsx)(ir,{entities:ce});const ve=ce.filter(Ce=>{var Fe;return((Fe=Ce.metadata.annotations)===null||Fe===void 0?void 0:Fe[k.P1])===_}),Re=ce.filter(Ce=>{var Fe;return((Fe=Ce.metadata.annotations)===null||Fe===void 0?void 0:Fe[k.q1])===de});return(0,d.jsxs)(d.Fragment,{children:[ve.length>0&&(0,d.jsx)(ir,{entities:ve,header:["At the same location",_]}),Re.length>0&&(0,d.jsx)(ir,{entities:Re,header:["At the same origin",de]})]})}function fo(b){const j=po();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(on.Z,{variant:"h2",children:"Colocated"}),(0,d.jsx)(on.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,d.jsx)("div",{className:j.root,children:(0,d.jsx)(Mo,{entity:b.entity})})]})}function go(b){return Object.fromEntries([...Object.entries(b)].sort((j,w)=>j[0]<w[0]?-1:1))}function mo(b){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(on.Z,{variant:"h2",children:"Entity as JSON"}),(0,d.jsx)(on.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,d.jsx)(on.Z,{children:(0,d.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,d.jsx)(P.Oi,{text:JSON.stringify(go(b.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var wr=n(3440),ms=n.n(wr);const zo=(0,wt.Z)({root:{display:"flex",flexDirection:"column"}});function Kr(b){var j,w;const D=zo(),{apiVersion:_,kind:de,metadata:ce,spec:ve,relations:Re=[],status:Ce={}}=b.entity,Fe=ms()(qt()(Re,Ze=>Ze.targetRef),"type");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(on.Z,{variant:"h2",children:"Overview"}),(0,d.jsxs)("div",{className:D.root,children:[(0,d.jsx)(Zr,{title:"Identity",children:(0,d.jsxs)(Cr.Z,{dense:!0,children:[(0,d.jsx)(er.Z,{children:(0,d.jsx)(Hn,{primary:"apiVersion",secondary:_})}),(0,d.jsx)(er.Z,{children:(0,d.jsx)(Hn,{primary:"kind",secondary:de})}),(ve==null?void 0:ve.type)&&(0,d.jsx)(er.Z,{children:(0,d.jsx)(Hn,{primary:"spec.type",secondary:ve.type})}),ce.uid&&(0,d.jsx)(er.Z,{children:(0,d.jsx)(Hn,{primary:"uid",secondary:ce.uid})}),ce.etag&&(0,d.jsx)(er.Z,{children:(0,d.jsx)(Hn,{primary:"etag",secondary:ce.etag})})]})}),(0,d.jsxs)(Zr,{title:"Metadata",children:[!!Object.keys(ce.annotations||{}).length&&(0,d.jsx)(Cr.Z,{dense:!0,subheader:(0,d.jsxs)(Rr,{children:["Annotations",(0,d.jsx)(Gr,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ce.annotations).map(Ze=>(0,d.jsx)(En,{indent:!0,entry:Ze},Ze[0]))}),!!Object.keys(ce.labels||{}).length&&(0,d.jsx)(Cr.Z,{dense:!0,subheader:(0,d.jsx)(Rr,{children:"Labels"}),children:Object.entries(ce.labels).map(Ze=>(0,d.jsx)(En,{indent:!0,entry:Ze},Ze[0]))}),!!(!((j=ce.tags)===null||j===void 0)&&j.length)&&(0,d.jsx)(Cr.Z,{dense:!0,subheader:(0,d.jsx)(Rr,{children:"Tags"}),children:ce.tags.map((Ze,it)=>(0,d.jsxs)(er.Z,{children:[(0,d.jsx)(Br.Z,{}),(0,d.jsx)(Hn,{primary:Ze})]},`${Ze}-${it}`))})]}),!!Re.length&&(0,d.jsx)(Zr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Fe).map(([Ze,it],nt)=>(0,d.jsx)("div",{children:(0,d.jsx)(Cr.Z,{dense:!0,subheader:(0,d.jsx)(Rr,{children:Ze}),children:it.map(_e=>(0,d.jsxs)(er.Z,{children:[(0,d.jsx)(Br.Z,{children:(0,d.jsx)(fr,{entityRef:_e.targetRef})}),(0,d.jsx)(Hn,{primary:(0,d.jsx)($,{entityRef:_e.targetRef})})]},_e.targetRef))})},nt))}),!!(!((w=Ce.items)===null||w===void 0)&&w.length)&&(0,d.jsx)(Zr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ce.items.map((Ze,it)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)(E.Z,{children:[Ze.level,": ",Ze.type]}),(0,d.jsx)(I.Z,{ml:2,children:Ze.message})]},it))})]})]})}var Wo=n(72847);function Vo(b){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(on.Z,{variant:"h2",children:"Entity as YAML"}),(0,d.jsx)(on.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,d.jsx)(on.Z,{children:(0,d.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,d.jsx)(P.Oi,{text:Wo.ZP.stringify(go(b.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Gn=(0,wt.Z)(b=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:b.palette.background.paper},tabs:{borderRight:`1px solid ${b.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Yr(b){const{children:j,value:w,index:D,..._}=b,de=Gn();return(0,d.jsx)("div",{role:"tabpanel",hidden:w!==D,id:`vertical-tabpanel-${D}`,"aria-labelledby":`vertical-tab-${D}`,className:de.tabContents,..._,children:w===D&&(0,d.jsx)(I.Z,{pl:3,pr:3,children:j})})}function Fr(b){return{id:`vertical-tab-${b}`,"aria-controls":`vertical-tabpanel-${b}`}}function vs(b){const j=Gn(),[w,D]=B.useState(0);return(0,B.useEffect)(()=>{D(0)},[b.open]),b.entity?(0,d.jsxs)(De.Z,{fullWidth:!0,maxWidth:"xl",open:b.open,onClose:b.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,d.jsx)(dt.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,d.jsx)(Qt.Z,{dividers:!0,children:(0,d.jsxs)("div",{className:j.root,children:[(0,d.jsxs)(bn.Z,{orientation:"vertical",variant:"scrollable",value:w,onChange:(_,de)=>D(de),"aria-label":"Inspector options",className:j.tabs,children:[(0,d.jsx)(jn.Z,{label:"Overview",...Fr(0)}),(0,d.jsx)(jn.Z,{label:"Ancestry",...Fr(1)}),(0,d.jsx)(jn.Z,{label:"Colocated",...Fr(2)}),(0,d.jsx)(jn.Z,{label:"Raw JSON",...Fr(3)}),(0,d.jsx)(jn.Z,{label:"Raw YAML",...Fr(4)})]}),(0,d.jsx)(Yr,{value:w,index:0,children:(0,d.jsx)(Kr,{entity:b.entity})}),(0,d.jsx)(Yr,{value:w,index:1,children:(0,d.jsx)(Vr,{entity:b.entity})}),(0,d.jsx)(Yr,{value:w,index:2,children:(0,d.jsx)(fo,{entity:b.entity})}),(0,d.jsx)(Yr,{value:w,index:3,children:(0,d.jsx)(mo,{entity:b.entity})}),(0,d.jsx)(Yr,{value:w,index:4,children:(0,d.jsx)(Vo,{entity:b.entity})})]})}),(0,d.jsx)(pr.Z,{children:(0,d.jsx)(V.Z,{onClick:b.onClose,color:"primary",children:"Close"})})]}):null}var ys=n(85256);function vo(b){var j;const w=(0,p.h_)(H),D=(j=b.metadata.annotations)===null||j===void 0?void 0:j[k.q1],_=b.metadata.uid,de=D==="bootstrap:bootstrap",ce=(0,xt.default)(async()=>{const _e=w.getLocationByRef(D);let Oe;if(!D)Oe=Promise.resolve([]);else{const ft=`metadata.annotations.${k.q1}`;Oe=w.getEntities({filter:{[ft]:D},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(kt=>kt.items)}return Promise.all([_e,Oe]).then(([ft,kt])=>({location:ft,colocatedEntities:kt}))},[w,b]),ve=(0,B.useCallback)(async function(){const{location:Oe}=ce.value;await w.removeLocationById(Oe.id)},[w,ce]),Re=(0,B.useCallback)(async function(){await w.removeEntityByUid(_)},[w,_]);if(de)return{type:"bootstrap",location:D,deleteEntity:Re};const{loading:Ce,error:Fe,value:Ze}=ce;if(Ce)return{type:"loading"};if(Fe)return{type:"error",error:Fe};const{location:it,colocatedEntities:nt}=Ze;return it?{type:"unregister",location:D,colocatedEntities:nt.map(k.iB),unregisterLocation:ve,deleteEntity:Re}:{type:"only-delete",deleteEntity:Re}}var Ho=n(23054);const xs=(0,wt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ar=({entity:b,onConfirm:j,onClose:w})=>{const D=(0,p.h_)(p.$v),_=(0,p.h_)(p.Ds),de=xs(),ce=vo(b),[ve,Re]=(0,B.useState)(!1),[Ce,Fe]=(0,B.useState)(!1);var Ze;const it=(Ze=_.getOptionalString("app.title"))!==null&&Ze!==void 0?Ze:"Backstage",nt=(0,B.useCallback)(async function(){if("unregisterLocation"in ce){Fe(!0);try{await ce.unregisterLocation(),j()}catch(kt){(0,Ho.BD)(kt),D.post({message:kt.message})}finally{Fe(!1)}}},[D,j,ce]),_e=(0,B.useCallback)(async function(){if("deleteEntity"in ce){Fe(!0);try{await ce.deleteEntity(),j()}catch(kt){(0,Ho.BD)(kt),D.post({message:kt.message})}finally{Fe(!1)}}},[D,j,ce]),Oe=()=>(0,d.jsx)(pr.Z,{className:de.dialogActions,children:(0,d.jsx)(V.Z,{onClick:w,color:"primary",children:"Cancel"})});return ce.type==="loading"?(0,d.jsx)(P.Ex,{}):ce.type==="error"?(0,d.jsx)(P.Gk,{error:ce.error}):ce.type==="bootstrap"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)($r.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',ce.location,'"). If you believe this is in error, please contact the ',it," ","integrator."]}),(0,d.jsxs)(I.Z,{marginTop:2,children:[!ve&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Re(!0),children:"Advanced Options"}),(0,d.jsx)(Oe,{})]}),ve&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(on.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Ce,onClick:_e,children:"Delete Entity"}),(0,d.jsx)(Oe,{})]})]})]}):ce.type==="only-delete"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(on.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Ce,onClick:_e,children:"Delete Entity"}),(0,d.jsx)(Oe,{})]}):ce.type==="unregister"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(on.Z,{children:"This action will unregister the following entities:"}),(0,d.jsx)(on.Z,{component:"ul",children:ce.colocatedEntities.map(ft=>(0,d.jsx)("li",{children:(0,d.jsx)($,{entityRef:ft})},`${ft.kind}:${ft.namespace}/${ft.name}`))}),(0,d.jsx)(on.Z,{children:"Located at the following location:"}),(0,d.jsx)(on.Z,{component:"ul",children:(0,d.jsx)("li",{children:ce.location})}),(0,d.jsxs)(on.Z,{children:["To undo, just re-register the entity in ",it,"."]}),(0,d.jsxs)(I.Z,{marginTop:2,children:[(0,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Ce,onClick:nt,children:"Unregister Location"}),!ve&&(0,d.jsx)(I.Z,{component:"span",marginLeft:2,children:(0,d.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:de.advancedButton,onClick:()=>Re(!0),children:"Advanced Options"})})]}),ve&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(I.Z,{paddingTop:4,paddingBottom:4,children:(0,d.jsx)(ys.Z,{})}),(0,d.jsx)(on.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,d.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Ce,onClick:_e,children:"Delete Entity"})]})]}):(0,d.jsx)($r.Z,{severity:"error",children:"Internal error: Unknown state"})},Go=b=>{const{open:j,onConfirm:w,onClose:D,entity:_}=b;return(0,d.jsxs)(De.Z,{open:j,onClose:D,children:[(0,d.jsx)(dt.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,d.jsx)(Qt.Z,{children:(0,d.jsx)(ar,{entity:_,onConfirm:w,onClose:D})})]})};var Kn=n(12231),yo=n(9520),Ko=n(47603);const Jr=(0,wt.Z)(b=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:b.spacing(1,0,1,0)},title:{margin:b.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:b.palette.text.primary},menuItem:{minHeight:b.spacing(6)},groupWrapper:{margin:b.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Yo(b){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Ko.Z},{id:"starred",label:"Starred",icon:A.Z}]},{name:b!=null?b:"Company",items:[{id:"all",label:"All"}]}]}const Jo=b=>{const{initialFilter:j,availableFilters:w}=b,D=Jr(),_=(0,p.h_)(p.Ds);var de;const ce=(de=_.getOptionalString("organization.name"))!==null&&de!==void 0?de:"Company",{filters:ve,updateFilters:Re,backendEntities:Ce,queryParameters:{kind:Fe,user:Ze},loading:it}=mt(),nt=["starred","all"],_e=Yo(ce).map(Zn=>({...Zn,items:Zn.items.filter(({id:On})=>["group","user"].some(Lr=>Lr===Fe)?nt.includes(On):!w||w.includes(On))})).filter(({items:Zn})=>!!Zn.length),{isStarredEntity:Oe}=Bn(),{isOwnedEntity:ft,loading:kt}=rn(),fn=it||kt,St=(0,B.useMemo)(()=>new Je("owned",ft,Oe),[ft,Oe]),Bt=(0,B.useMemo)(()=>new Je("starred",ft,Oe),[ft,Oe]),Ft=(0,B.useMemo)(()=>[Ze].flat()[0],[Ze]),[an,Sn]=(0,B.useState)(Ft!=null?Ft:j),Ir=(0,B.useMemo)(()=>Ce.filter((0,se.Gz)((0,ot.compact)(Object.values({...ve,user:void 0})))),[ve,Ce]),Nr=(0,B.useMemo)(()=>({all:Ir.length,starred:Ir.filter(Zn=>Bt.filterEntity(Zn)).length,owned:Ir.filter(Zn=>St.filterEntity(Zn)).length}),[Ir,Bt,St]);(0,B.useEffect)(()=>{Ft&&Sn(Ft)},[Ft]),(0,B.useEffect)(()=>{!fn&&an&&an!=="all"&&Nr[an]===0&&Sn("all")},[fn,Nr,an,Sn]),(0,B.useEffect)(()=>{Re({user:an?new Je(an,ft,Oe):void 0})},[an,ft,Oe,Re]);var Pr;return(0,d.jsx)(Hr.Z,{className:D.root,children:_e.map(Zn=>(0,d.jsxs)(B.Fragment,{children:[(0,d.jsx)(E.Z,{variant:"subtitle2",component:"span",className:D.title,children:Zn.name}),(0,d.jsx)(Hr.Z,{className:D.groupWrapper,children:(0,d.jsx)(Cr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Zn.name,children:Zn.items.map(On=>{var Lr;return(0,d.jsxs)(Kn.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Sn(On.id),selected:On.id===((Lr=ve.user)===null||Lr===void 0?void 0:Lr.value),className:D.menuItem,disabled:Nr[On.id]===0,"data-testid":`user-picker-${On.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[On.icon&&(0,d.jsx)(Br.Z,{className:D.listIcon,children:(0,d.jsx)(On.icon,{fontSize:"small"})}),(0,d.jsx)(uo.Z,{children:(0,d.jsxs)(E.Z,{variant:"body1",children:[On.label," "]})}),(0,d.jsx)(yo.Z,{children:(Pr=Nr[On.id])!==null&&Pr!==void 0?Pr:"-"})]},On.id)})})})]},Zn.name))})},bs=(0,wt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Qo=(0,d.jsx)(Rn.Z,{fontSize:"small"}),Qr=(0,d.jsx)(pn.Z,{fontSize:"small"}),Xo=()=>{const b=bs(),{updateFilters:j}=mt(),[w,D]=(0,B.useState)([]);function _(ve){j({orphan:ve?new bt(ve):void 0})}function de(ve){j({error:ve?new At(ve):void 0})}const ce=["Is Orphan","Has Error"];return(0,d.jsx)(I.Z,{pb:1,pt:1,children:(0,d.jsxs)(E.Z,{variant:"button",component:"label",children:["Processing Status",(0,d.jsx)(Ln.ZP,{multiple:!0,disableCloseOnSelect:!0,options:ce,value:w,onChange:(ve,Re)=>{D(Re),_(Re.includes("Is Orphan")),de(Re.includes("Has Error"))},renderOption:(ve,{selected:Re})=>(0,d.jsx)(at.Z,{control:(0,d.jsx)(xn.Z,{icon:Qo,checkedIcon:Qr,checked:Re}),onClick:Ce=>Ce.preventDefault(),label:ve}),size:"small",popupIcon:(0,d.jsx)(dn.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ve=>(0,d.jsx)(Jt.Z,{...ve,className:b.input,variant:"outlined"})})]})})},xo=(0,wt.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),bo=()=>{const b=xo();return(0,d.jsx)(wn,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:tt,InputProps:{className:b.input}})};function oi(b){const{children:j,value:w}=b;var D;const[_,de]=useState((D=w==null?void 0:w.filters)!==null&&D!==void 0?D:{}),ce=useCallback(_e=>{de(Oe=>{const ft=typeof _e=="function"?_e(Oe):_e;return{...Oe,...ft}})},[]),ve=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Re,Ce,Fe,Ze,it;const nt=useMemo(()=>({entities:(Re=w==null?void 0:w.entities)!==null&&Re!==void 0?Re:ve.entities,backendEntities:(Ce=w==null?void 0:w.backendEntities)!==null&&Ce!==void 0?Ce:ve.backendEntities,updateFilters:(Fe=w==null?void 0:w.updateFilters)!==null&&Fe!==void 0?Fe:ce,filters:_,loading:(Ze=w==null?void 0:w.loading)!==null&&Ze!==void 0?Ze:!1,queryParameters:(it=w==null?void 0:w.queryParameters)!==null&&it!==void 0?it:ve.queryParameters,error:w==null?void 0:w.error}),[w,ve,_,ce]);return _jsx(EntityListContext.Provider,{value:nt,children:j})}},75435:function(Ct,Be,n){"use strict";n.d(Be,{h:function(){return p}});var r=n(25271);function p(H,f,W){var g;let d=(H==null||(g=H.relations)===null||g===void 0?void 0:g.filter(B=>B.type===f).map(B=>(0,r.of)(B.targetRef)))||[];return W!=null&&W.kind&&(d=d.filter(B=>B.kind.toLocaleLowerCase("en-US")===W.kind.toLocaleLowerCase("en-US"))),d}},49280:function(Ct,Be,n){"use strict";n.d(Be,{hF:function(){return H.h},CV:function(){return W},wq:function(){return r},Gz:function(){return p}});function r(d){return d.reduce((B,ye)=>({...B,...ye.getCatalogFilters?ye.getCatalogFilters():{}}),{})}function p(d){return B=>d.every(ye=>!ye.filterEntity||ye.filterEntity(B))}var H=n(75435),f=n(25271);function W(d,B){var ye;const ue=(ye=d.metadata.annotations)===null||ye===void 0?void 0:ye[f.M6];if(ue)try{const V=(0,f.Ou)(ue),Y=B.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:Y==null?void 0:Y.type}}catch{return}}function g(d,B){const ye=new Set([...getEntityRelations(d,RELATION_MEMBER_OF,{kind:"group"}),...d?[getCompoundEntityRef(d)]:[]].map(stringifyEntityRef)),ue=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of ue)if(ye.has(V))return!0;return!1}},33414:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{AboutCard:function(){return rt},AboutContent:function(){return z},AboutField:function(){return k}});var r=n(52322),p=n(25271),H=n(53974),f=n(60871),W=n(32838),g=n(43514),d=n(79692),B=n(94339),ye=n(32552),ue=n(61837),V=n(85256),Y=n(24579),I=n(52866),E=n(30254),oe=n(27604),ee=n(2784),te=n(19625),Z=n(60905),R=n(7089),P=n(90436);const L=(0,d.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 k(He){const{label:tt,value:Je,gridSizes:bt,children:At}=He,yt=L(),ot=(0,f.vJ)(At,Mt=>Mt.getElements()),It=ot.length>0?ot:(0,r.jsx)(P.Z,{variant:"body2",className:yt.value,children:Je||"unknown"});return(0,r.jsxs)(Z.Z,{item:!0,...bt,children:[(0,r.jsx)(P.Z,{variant:"h2",className:yt.label,children:tt}),It]})}var se=n(24851);const Le=(0,d.Z)({description:{wordBreak:"break-word"}});function ze(He,tt,Je){if(tt==="url"||He.includes("://"))return He;const bt=Je.type==="file"?`file://${Je.target}`:Je.target;return tt==="file"||Je.type==="file"?new URL(He,bt).href:bt}function z(He){var tt,Je,bt,At,yt,ot,It,Mt;const{entity:Ve}=He,_t=Le(),ge=Ve.kind.toLocaleLowerCase("en-US")==="system",Se=Ve.kind.toLocaleLowerCase("en-US")==="resource",Ne=Ve.kind.toLocaleLowerCase("en-US")==="component",qe=Ve.kind.toLocaleLowerCase("en-US")==="api",mt=Ve.kind.toLocaleLowerCase("en-US")==="template",xt=Ve.kind.toLocaleLowerCase("en-US")==="location",ut=Ve.kind.toLocaleLowerCase("en-US")==="group",Ot=(0,g.hF)(Ve,p.cz,{kind:"system"}),Kt=(0,g.hF)(Ve,p.cz,{kind:"component"}),qt=(0,g.hF)(Ve,p.cz,{kind:"domain"}),Dt=(0,g.hF)(Ve,p.S4);let hn;try{hn=(0,p.CV)(Ve)}catch{hn=void 0}return(0,r.jsxs)(Z.Z,{container:!0,children:[(0,r.jsx)(k,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(H.SA,{className:_t.description,content:(Ve==null||(tt=Ve.metadata)===null||tt===void 0?void 0:tt.description)||"No description"})}),(0,r.jsx)(k,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Dt.length>0&&(0,r.jsx)(g.rI,{entityRefs:Dt,defaultKind:"group"})}),(ge||qt.length>0)&&(0,r.jsx)(k,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:qt.length>0&&(0,r.jsx)(g.rI,{entityRefs:qt,defaultKind:"domain"})}),(qe||Ne||Se||Ot.length>0)&&(0,r.jsx)(k,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Ot.length>0&&(0,r.jsx)(g.rI,{entityRefs:Ot,defaultKind:"system"})}),Ne&&Kt.length>0&&(0,r.jsx)(k,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(g.rI,{entityRefs:Kt,defaultKind:"component"})}),(qe||Ne||Se||mt||ut||xt||typeof(Ve==null||(Je=Ve.spec)===null||Je===void 0?void 0:Je.type)=="string")&&(0,r.jsx)(k,{label:"Type",value:Ve==null||(bt=Ve.spec)===null||bt===void 0?void 0:bt.type,gridSizes:{xs:12,sm:6,lg:4}}),(qe||Ne||typeof(Ve==null||(At=Ve.spec)===null||At===void 0?void 0:At.lifecycle)=="string")&&(0,r.jsx)(k,{label:"Lifecycle",value:Ve==null||(yt=Ve.spec)===null||yt===void 0?void 0:yt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(k,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Ve==null||(ot=Ve.metadata)===null||ot===void 0?void 0:ot.tags)||[]).map(Xt=>(0,r.jsx)(R.Z,{size:"small",label:Xt},Xt))}),xt&&((Ve==null||(It=Ve.spec)===null||It===void 0?void 0:It.targets)||(Ve==null||(Mt=Ve.spec)===null||Mt===void 0?void 0:Mt.target))&&(0,r.jsx)(k,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(se.s,{cols:1,items:(Ve.spec.targets||[Ve.spec.target]).map(Xt=>Xt).map(Xt=>{var gn;return{text:Xt,href:ze(Xt,(Ve==null||(gn=Ve.spec)===null||gn===void 0?void 0:gn.type)||"unknown",hn)}})})})]})}const vt=(0,d.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 rt(He){var tt,Je,bt;const{variant:At}=He,yt=vt(),{entity:ot}=(0,g.X2)(),It=(0,f.h_)(W.q3),Mt=(0,f.h_)(g.Ah),Ve=(0,f.h_)(f.$v),_t=(0,f.h_)(f.VE),ge=(0,f.tg)(te.jU),Se=(0,g.CV)(ot,It),Ne=(tt=ot.metadata.annotations)===null||tt===void 0?void 0:tt[p.Tf],qe={label:"View Source",disabled:!Se,icon:(0,r.jsx)(W.nW,{type:Se==null?void 0:Se.integrationType}),href:Se==null?void 0:Se.locationTargetUrl},mt={label:"View TechDocs",disabled:!(!((Je=ot.metadata.annotations)===null||Je===void 0)&&Je["backstage.io/techdocs-ref"])||!ge,icon:(0,r.jsx)(E.Z,{}),href:ge&&ge({namespace:ot.metadata.namespace||p.zG,kind:ot.kind,name:ot.metadata.name})};let xt="";At==="gridItem"?xt=yt.gridItemCard:At==="fullHeight"&&(xt=yt.fullHeightCard);let ut="";At==="gridItem"?ut=yt.gridItemCardContent:At==="fullHeight"&&(ut=yt.fullHeightCardContent);const Ot=(bt=ot.metadata.annotations)===null||bt===void 0?void 0:bt[p.P1],Kt=(Ot==null?void 0:Ot.startsWith("url:"))||(Ot==null?void 0:Ot.startsWith("file:")),qt=(0,ee.useCallback)(async()=>{try{await Mt.refreshEntity((0,p.eE)(ot)),Ve.post({message:"Refresh scheduled",severity:"info"})}catch(Dt){_t.post(Dt)}},[Mt,Ve,_t,ot]);return(0,r.jsxs)(B.Z,{className:xt,children:[(0,r.jsx)(ye.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[Kt&&(0,r.jsx)(ue.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:qt,children:(0,r.jsx)(I.Z,{})}),(0,r.jsx)(ue.Z,{component:H.rU,"aria-label":"Edit",disabled:!Ne,title:"Edit Metadata",to:Ne!=null?Ne:"#",children:(0,r.jsx)(oe.Z,{})})]}),subheader:(0,r.jsx)(H.M6,{links:[qe,mt]})}),(0,r.jsx)(V.Z,{}),(0,r.jsx)(Y.Z,{className:ut,children:(0,r.jsx)(z,{entity:ot})})]})}},86359:function(Ct,Be,n){"use strict";n.d(Be,{E:function(){return te}});var r=n(52322),p=n(25271),H=n(53974),f=n(43514),W=n(90436),g=n(15459),d=n(27604),B=n(2997),ye=n(11640),ue=n(28347),V=n(76635),Y=n(2784),I=n(7089);const E=Object.freeze({createNameColumn(Z){function R(P){var L;return((L=P.metadata)===null||L===void 0?void 0:L.title)||(0,f.$3)(P,{defaultKind:Z==null?void 0:Z.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:L}){return R(P).localeCompare(R(L))},render:({entity:P})=>{var L;return(0,r.jsx)(f.dx,{entityRef:P,defaultKind:(Z==null?void 0:Z.defaultKind)||"Component",title:(L=P.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:Z})=>(0,r.jsx)(f.rI,{entityRefs:Z.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:Z})=>(0,r.jsx)(f.rI,{entityRefs:Z.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:Z})=>{var R,P;return(0,r.jsx)(r.Fragment,{children:((Z==null||(R=Z.spec)===null||R===void 0?void 0:R.targets)||(Z==null||(P=Z.spec)===null||P===void 0?void 0:P.target))&&(0,r.jsx)(H.Or,{text:(Z.spec.targets||[Z.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:Z})=>(0,r.jsx)(H.Or,{text:Z.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:Z})=>(0,r.jsx)(r.Fragment,{children:Z.metadata.tags&&Z.metadata.tags.map(R=>(0,r.jsx)(I.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(Z){return{title:"Title",field:"entity.metadata.title",hidden:Z==null?void 0:Z.hidden,searchable:!0}},createLabelColumn(Z,R){return{title:(R==null?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var L;const k=(L=P.metadata)===null||L===void 0?void 0:L.labels,se=k&&k[Z]||(R==null?void 0:R.defaultValue);return(0,r.jsx)(r.Fragment,{children:se&&(0,r.jsx)(I.Z,{label:se,size:"small",variant:"outlined"},se)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}}),oe=(0,g.Z)({root:{color:"#f3ba37"}})(ye.Z),ee=(Z,R)=>{const P=L=>L.metadata.title||(0,f.$3)(L,{defaultKind:"Component"});return P(Z).localeCompare(P(R))},te=Z=>{var R,P;const{columns:L,actions:k,tableOptions:se,subtitle:Le,emptyContent:ze}=Z,{isStarredEntity:z,toggleStarredEntity:vt}=(0,f.CR)(),{loading:rt,error:He,entities:tt,filters:Je}=(0,f.wp)(),bt=(0,Y.useMemo)(()=>{var ge;return[E.createTitleColumn({hidden:!0}),E.createNameColumn({defaultKind:(ge=Je.kind)===null||ge===void 0?void 0:ge.value}),...Se(),E.createMetadataDescriptionColumn(),E.createTagsColumn()];function Se(){var Ne;const qe=[E.createSystemColumn(),E.createOwnerColumn(),E.createSpecTypeColumn(),E.createSpecLifecycleColumn()];switch((Ne=Je.kind)===null||Ne===void 0?void 0:Ne.value){case"user":return[];case"domain":case"system":return[E.createOwnerColumn()];case"group":case"template":return[E.createSpecTypeColumn()];case"location":return[E.createSpecTypeColumn(),E.createSpecTargetsColumn()];default:return tt.every(mt=>mt.metadata.namespace==="default")?qe:[...qe,E.createNamespaceColumn()]}}},[(R=Je.kind)===null||R===void 0?void 0:R.value,tt]),At=Je.type===void 0;var yt;const ot=(0,V.capitalize)((yt=(P=Je.user)===null||P===void 0?void 0:P.value)!==null&&yt!==void 0?yt:"all");if(He)return(0,r.jsx)("div",{children:(0,r.jsx)(H.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(H.Oi,{language:"text",text:He.toString()})})});const It=[({entity:ge})=>{var Se;const Ne=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[p.l2],qe="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.Z,{variant:"srOnly",children:qe}),(0,r.jsx)(B.Z,{fontSize:"small"})]}),tooltip:qe,disabled:!Ne,onClick:()=>{Ne&&window.open(Ne,"_blank")}}},({entity:ge})=>{var Se;const Ne=(Se=ge.metadata.annotations)===null||Se===void 0?void 0:Se[p.Tf],qe="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.Z,{variant:"srOnly",children:qe}),(0,r.jsx)(d.Z,{fontSize:"small"})]}),tooltip:qe,disabled:!Ne,onClick:()=>{Ne&&window.open(Ne,"_blank")}}},({entity:ge})=>{const Se=z(ge),Ne=Se?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.Z,{variant:"srOnly",children:Ne}),Se?(0,r.jsx)(oe,{}):(0,r.jsx)(ue.Z,{})]}),tooltip:Ne,onClick:()=>vt(ge)}}],Mt=tt.sort(ee).map(ge=>{const Se=(0,f.hF)(ge,p.cz,{kind:"system"}),Ne=(0,f.hF)(ge,p.S4);return{entity:ge,resolved:{name:(0,f.$3)(ge,{defaultKind:"Component"}),ownedByRelationsTitle:Ne.map(qe=>(0,f.$3)(qe,{defaultKind:"group"})).join(", "),ownedByRelations:Ne,partOfSystemRelationTitle:Se.map(qe=>(0,f.$3)(qe,{defaultKind:"system"})).join(", "),partOfSystemRelations:Se}}}),Ve=(L||bt).find(ge=>ge.title==="Type");Ve&&(Ve.hidden=!At);const _t=Mt.length>20;return(0,r.jsx)(H.iA,{isLoading:rt,columns:L||bt,options:{paging:_t,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!rt,padding:"dense",pageSizeOptions:[20,50,100],...se},title:`${ot} (${tt.length})`,data:Mt,actions:k||It,subtitle:Le,emptyContent:ze})};te.columns=E},85877:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{EntityLabelsCard:function(){return Y},hasLabels:function(){return I}});var r=n(52322),p=n(43514),H=n(2784),f=n(53974),W=n(79692),g=n(90436),d=n(77277);const B=`metadata:
|
|
34
|
+
name: example
|
|
35
|
+
labels:
|
|
36
|
+
javaVersion: 1.2.3`,ye=(0,W.Z)(E=>({code:{borderRadius:6,margin:`${E.spacing(2)}px 0px`,background:E.palette.type==="dark"?"#444":E.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function ue(){const E=ye();return(0,r.jsxs)(r.Fragment,{children:[(0,r.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,r.jsx)("div",{className:E.code,children:(0,r.jsx)(f.Oi,{text:B,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(d.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)(E=>({key:{fontWeight:"bold"}})),Y=E=>{var oe;const{variant:ee,title:te}=E,{entity:Z}=(0,p.X2)(),R=V(),P=[{render:k=>(0,r.jsx)(g.Z,{className:R.key,variant:"body2",children:k.key})},{field:"value"}],L=Z==null||(oe=Z.metadata)===null||oe===void 0?void 0:oe.labels;return(0,r.jsx)(f.rJ,{title:te||"Labels",variant:ee,children:!L||Object.keys(L).length===0?(0,r.jsx)(ue,{}):(0,r.jsx)(f.iA,{columns:P,data:Object.keys(L).map(k=>({key:k,value:L[k]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(L).length>5}})})};function I(E){var oe,ee;return!(E==null||(oe=E.metadata)===null||oe===void 0)&&oe.labels?Object.keys(E==null||(ee=E.metadata)===null||ee===void 0?void 0:ee.labels).some(Boolean):!1}},24851:function(Ct,Be,n){"use strict";n.d(Be,{s:function(){return oe}});var r=n(52322),p=n(90348),H=n(11861),f=n(2784),W=n(79692),g=n(95544),d=n(90436),B=n(52160),ye=n(53974);const ue=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function V(ee){const{href:te,text:Z,Icon:R}=ee,P=ue();return(0,r.jsxs)(g.Z,{display:"flex",children:[(0,r.jsx)(g.Z,{mr:1,className:P.svgIcon,children:(0,r.jsx)(d.Z,{component:"div",children:R?(0,r.jsx)(R,{}):(0,r.jsx)(B.Z,{})})}),(0,r.jsx)(g.Z,{flexGrow:"1",children:(0,r.jsx)(ye.rU,{to:te,target:"_blank",rel:"noopener",children:Z||te})})]})}var Y=n(41156);const I={xs:1,sm:1,md:1,lg:2,xl:3};function E(ee){const te=[(0,Y.Z)(L=>L.breakpoints.up("xl"))?"xl":null,(0,Y.Z)(L=>L.breakpoints.up("lg"))?"lg":null,(0,Y.Z)(L=>L.breakpoints.up("md"))?"md":null,(0,Y.Z)(L=>L.breakpoints.up("sm"))?"sm":null,(0,Y.Z)(L=>L.breakpoints.up("xs"))?"xs":null];let Z=1;if(typeof ee=="number")Z=ee;else{var R;const L=(R=te.find(k=>k!==null))!==null&&R!==void 0?R:"xs";var P;Z=(P=ee==null?void 0:ee[L])!==null&&P!==void 0?P:I[L]}return Z}function oe(ee){const{items:te,cols:Z=void 0}=ee,R=E(Z);return(0,r.jsx)(p.Z,{rowHeight:"auto",cols:R,children:te.map(({text:P,href:L,Icon:k},se)=>(0,r.jsx)(H.Z,{children:(0,r.jsx)(V,{href:L,text:P!=null?P:L,Icon:k})},se))})}},19625:function(Ct,Be,n){"use strict";n.d(Be,{_Z:function(){return f},jU:function(){return H},yw:function(){return p}});var r=n(60871);const p=(0,r.x8)({id:"create-component",optional:!0}),H=(0,r.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,r.NT)({id:"catalog"})},15096:function(Ct,Be,n){"use strict";n.d(Be,{FA:function(){return ye},qO:function(){return yt},Nd:function(){return z},E5:function(){return $t},Rx:function(){return L}});var r=n(60871);const p=(0,r.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=n(52322),W=n(2784),g=n(38402),d=n(79692);const B=(0,d.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ye=q=>{const{text:J,preTag:ie,postTag:pe}=q,ae=B(),y=(0,W.useMemo)(()=>J.split(new RegExp(`(${ie}.+?${pe})`)),[pe,ie,J]);return(0,f.jsx)(f.Fragment,{children:y.map(($,X)=>$.includes(ie)?(0,f.jsx)("mark",{className:ae.highlight,children:$.replace(new RegExp(`${ie}|${pe}`,"g"),"")},X):$)})};var ue=n(50581),V=n(61837),Y=n(86619),I=n(77277),E=n(21853),oe=n(48760),ee=n(76635),te=n(64279),Z=n(1849),R=n(51837);const P=(0,R.CT)("search-context"),L=()=>{const q=(0,W.useContext)(P);if(!q)throw new Error("useSearch must be used within a SearchContextProvider");const J=q.atVersion(1);if(!J)throw new Error("No SearchContext v1 found");return J},k=()=>(0,W.useContext)(P)!==void 0,se={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},Le=(q=se)=>{var J,ie,pe,ae;const y=(0,r.h_)(p),[$,X]=(0,W.useState)(q.term),[K,je]=(0,W.useState)(q.types),[Ae,Ke]=(0,W.useState)(q.filters),[Tt,ht]=(0,W.useState)(q.pageLimit),[pt,Ye]=(0,W.useState)(q.pageCursor),lt=(0,Z.Z)($),st=(0,Z.Z)(Ae),jt=(0,te.default)(()=>y.query({term:$,types:K,filters:Ae,pageLimit:Tt,pageCursor:pt}),[$,K,Ae,Tt,pt]),Wt=!jt.loading&&!jt.error&&((J=jt.value)===null||J===void 0?void 0:J.nextPageCursor),en=!jt.loading&&!jt.error&&((ie=jt.value)===null||ie===void 0?void 0:ie.previousPageCursor),nn=(0,W.useCallback)(()=>{var Pt;Ye((Pt=jt.value)===null||Pt===void 0?void 0:Pt.nextPageCursor)},[(pe=jt.value)===null||pe===void 0?void 0:pe.nextPageCursor]),Zt=(0,W.useCallback)(()=>{var Pt;Ye((Pt=jt.value)===null||Pt===void 0?void 0:Pt.previousPageCursor)},[(ae=jt.value)===null||ae===void 0?void 0:ae.previousPageCursor]);return(0,W.useEffect)(()=>{lt!==void 0&&$!==lt&&Ye(void 0)},[$,lt,Ye]),(0,W.useEffect)(()=>{st!==void 0&&!(0,ee.isEqual)(Ae,st)&&Ye(void 0)},[Ae,st,Ye]),{result:jt,term:$,setTerm:X,types:K,setTypes:je,filters:Ae,setFilters:Ke,pageLimit:Tt,setPageLimit:ht,pageCursor:pt,setPageCursor:Ye,fetchNextPage:Wt?nn:void 0,fetchPreviousPage:en?Zt:void 0}},ze=q=>{const{initialState:J,children:ie}=q,pe=Le(J);return(0,f.jsx)(r.fC,{attributes:{searchTypes:pe.types.sort().join(",")},children:(0,f.jsx)(P.Provider,{value:(0,R.EI)({1:pe}),children:ie})})},z=q=>{const{initialState:J,inheritParentContextIfAvailable:ie,children:pe}=q;return k()&&ie?(0,f.jsx)(f.Fragment,{children:pe}):(0,f.jsx)(ze,{initialState:J,children:pe})},vt=({children:q})=>{var J;const ie=Ae=>(0,Z.Z)(Ae)!==Ae,pe=(0,r.z$)(),{term:ae,result:y}=L();var $;const X=($=(J=y.value)===null||J===void 0?void 0:J.numberOfResults)!==null&&$!==void 0?$:void 0,je=ie(y.loading)&&!y.loading;return(0,W.useEffect)(()=>{ae&&je&&pe.captureEvent("search",ae,{value:X})},[pe,ae,X,je]),(0,f.jsx)(f.Fragment,{children:q})};function rt(q){return(0,W.forwardRef)((J,ie)=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(q,{...J,ref:ie})}))}const He=rt((0,W.forwardRef)((q,J)=>{const{onChange:ie,onKeyDown:pe=()=>{},onClear:ae=()=>{},onSubmit:y=()=>{},debounceTime:$=200,clearButton:X=!0,fullWidth:K=!0,value:je,label:Ae,placeholder:Ke,inputProps:Tt={},InputProps:ht={},endAdornment:pt,...Ye}=q,lt=(0,r.h_)(r.Ds),[st,jt]=(0,W.useState)("");(0,W.useEffect)(()=>{jt(Ut=>Ut!==je?String(je):Ut)},[je]),(0,oe.Z)(()=>ie(st),$,[st]);const Wt=(0,W.useCallback)(Ut=>{jt(Ut.target.value)},[jt]),en=(0,W.useCallback)(Ut=>{pe&&pe(Ut),y&&Ut.key==="Enter"&&y()},[pe,y]),nn=(0,W.useCallback)(()=>{ie(""),ae&&ae()},[ie,ae]),Zt=Ae?void 0:"Search",Vt=Ke!=null?Ke:`Search in ${lt.getOptionalString("app.title")||"Backstage"}`,Pt=(0,f.jsx)(ue.Z,{position:"start",children:(0,f.jsx)(V.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(E.Z,{})})}),Lt=(0,f.jsx)(ue.Z,{position:"end",children:(0,f.jsx)(I.Z,{"aria-label":"Clear",size:"small",onClick:nn,onKeyDown:Ut=>{Ut.key==="Enter"&&Ut.stopPropagation()},children:"Clear"})});return(0,f.jsx)(vt,{children:(0,f.jsx)(Y.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:J,value:st,label:Ae,placeholder:Vt,InputProps:{startAdornment:Pt,endAdornment:X?Lt:pt,...ht},inputProps:{"aria-label":Zt,...Tt},fullWidth:K,onChange:Wt,onKeyDown:en,...Ye})})})),tt=rt((0,W.forwardRef)((q,J)=>{const{value:ie="",onChange:pe,...ae}=q,{term:y,setTerm:$}=L();(0,W.useEffect)(()=>{ie&&$(String(ie))},[ie,$]);const X=(0,W.useCallback)(K=>{pe?pe(K):$(K)},[pe,$]);return(0,f.jsx)(r.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(He,{...ae,ref:J,value:y,onChange:X})})}));var Je=n(4614),bt=n(88013);const yt=(q=>J=>(0,f.jsx)(z,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(q,{...J})}))(function(J){const{loading:ie,value:pe,onChange:ae=()=>{},options:y=[],getOptionLabel:$=Wt=>String(Wt),inputPlaceholder:X,inputDebounceTime:K,freeSolo:je=!0,fullWidth:Ae=!0,clearOnBlur:Ke=!1,"data-testid":Tt="search-autocomplete",...ht}=J,{setTerm:pt}=L(),Ye=(0,W.useCallback)(Wt=>Wt?typeof Wt=="string"?Wt:$(Wt):"",[$]),lt=(0,W.useMemo)(()=>Ye(pe),[pe,Ye]),st=(0,W.useCallback)((Wt,en,nn,Zt)=>{pt(Ye(en)),ae(Wt,en,nn,Zt)},[Ye,pt,ae]),jt=(0,W.useCallback)(({InputProps:{ref:Wt,endAdornment:en},InputLabelProps:nn,...Zt})=>(0,f.jsx)(tt,{...Zt,ref:Wt,clearButton:!1,value:lt,placeholder:X,debounceTime:K,endAdornment:ie?(0,f.jsx)(Je.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):en}),[ie,lt,X,K]);return(0,f.jsx)(bt.ZP,{...ht,"data-testid":Tt,value:pe,onChange:st,options:y,getOptionLabel:$,renderInput:jt,freeSolo:je,fullWidth:Ae,clearOnBlur:Ke})}),ot=q=>{const{icon:J,primaryText:ie,primaryTextTypographyProps:pe,secondaryText:ae,secondaryTextTypographyProps:y,disableTextTypography:$}=q;return _jsxs(_Fragment,{children:[J?_jsx(ListItemIcon,{children:J}):null,_jsx(ListItemText,{primary:ie,primaryTypographyProps:pe,secondary:ae,secondaryTypographyProps:y,disableTypography:$})]})};var It=n(42494),Mt=n(84899),Ve=n(5806),_t=n(21324),ge=n(56939),Se=n(73698),Ne=n(12231),qe=n(90436),mt=n(7089),xt=n(69294);const ut=(q,J,ie=[],pe=250)=>{const ae=(0,W.useRef)({}),y=q||(()=>Promise.resolve([])),[$,X]=(0,xt.default)(y,[J],{loading:!0});if((0,oe.Z)(()=>{ae.current[J]===void 0&&(ae.current[J]=X(J).then(je=>(ae.current[J]=je,je)))},pe,[X,J]),ie.length)return{loading:!1,value:ie};const K=ae.current[J];return Array.isArray(K)?{loading:!1,value:K}:$},Ot=(q,J)=>{const{setFilters:ie}=L();(0,W.useEffect)(()=>{J&&[J].flat().length>0&&ie(pe=>({...pe,[q]:J}))},[])},Kt=q=>{const{className:J,defaultValue:ie,name:pe,values:ae,valuesDebounceMs:y,label:$,filterSelectedOptions:X,limitTags:K,multiple:je}=q,[Ae,Ke]=(0,W.useState)("");Ot(pe,ie);const Tt=typeof ae=="function"?ae:void 0,ht=typeof ae=="function"?void 0:ae,{value:pt,loading:Ye}=ut(Tt,Ae,ht,y),{filters:lt,setFilters:st}=L(),jt=lt[pe]||(je?[]:null),Wt=(Zt,Vt)=>{st(Pt=>{const{[pe]:Lt,...Ut}=Pt;return Vt?{...Ut,[pe]:Vt}:{...Ut}})},en=Zt=>(0,f.jsx)(Y.Z,{...Zt,name:"search",variant:"outlined",label:$,fullWidth:!0}),nn=(Zt,Vt)=>Zt.map((Pt,Lt)=>(0,f.jsx)(mt.Z,{label:Pt,color:"primary",...Vt({index:Lt})}));return(0,f.jsx)(bt.ZP,{filterSelectedOptions:X,limitTags:K,multiple:je,className:J,id:`${je?"multi-":""}select-filter-${pe}--select`,options:pt||[],loading:Ye,value:jt,onChange:Wt,onInputChange:(Zt,Vt)=>Ke(Vt),renderInput:en,renderTags:nn})},qt=(0,d.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),Dt=q=>{const{className:J,defaultValue:ie,label:pe,name:ae,values:y=[],valuesDebounceMs:$}=q,X=qt(),{filters:K,setFilters:je}=L();Ot(ae,ie);const Ae=typeof y=="function"?y:void 0,Ke=typeof y=="function"?void 0:y,{value:Tt=[],loading:ht}=ut(Ae,"",Ke,$),pt=lt=>{const{target:{value:st,checked:jt}}=lt;je(Wt=>{const{[ae]:en,...nn}=Wt,Zt=(en||[]).filter(Pt=>Pt!==st),Vt=jt?[...Zt,st]:Zt;return Vt.length?{...nn,[ae]:Vt}:nn})};var Ye;return(0,f.jsxs)(It.Z,{className:J,disabled:ht,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[pe?(0,f.jsx)(Mt.Z,{className:X.label,children:pe}):null,Tt.map(lt=>(0,f.jsx)(Ve.Z,{classes:{root:X.checkboxWrapper,label:X.textWrapper},label:lt,control:(0,f.jsx)(_t.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":lt},value:lt,name:lt,onChange:pt,checked:((Ye=K[ae])!==null&&Ye!==void 0?Ye:[]).includes(lt)})},lt))]})},hn=q=>{const{className:J,defaultValue:ie,label:pe,name:ae,values:y,valuesDebounceMs:$}=q,X=qt();Ot(ae,ie);const K=typeof y=="function"?y:void 0,je=typeof y=="function"?void 0:y,{value:Ae=[],loading:Ke}=ut(K,"",je,$),{filters:Tt,setFilters:ht}=L(),pt=Ye=>{const{target:{value:lt}}=Ye;ht(st=>{const{[ae]:jt,...Wt}=st;return lt?{...Wt,[ae]:lt}:Wt})};return(0,f.jsxs)(It.Z,{disabled:Ke,className:J,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[pe?(0,f.jsx)(ge.Z,{className:X.label,margin:"dense",children:pe}):null,(0,f.jsxs)(Se.Z,{variant:"outlined",value:Tt[ae]||"",onChange:pt,children:[(0,f.jsx)(Ne.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),Ae.map(Ye=>(0,f.jsx)(Ne.Z,{value:Ye,children:(0,f.jsx)(qe.Z,{variant:"inherit",noWrap:!0,children:Ye})},Ye))]})]})},Xt=q=>{const{component:J,...ie}=q;return(0,f.jsx)(J,{...ie})};Xt.Checkbox=q=>(0,f.jsx)(Xt,{...q,component:Dt}),Xt.Select=q=>(0,f.jsx)(Xt,{...q,component:hn}),Xt.Autocomplete=q=>(0,f.jsx)(Xt,{...q,component:Kt});var gn=n(48834).lW;const zn=q=>gn.from(q.toString(),"utf-8").toString("base64"),Bn=q=>q?Number(gn.from(q,"base64").toString("utf-8")):0,mn=q=>{const{total:J=-1,cursor:ie,hasNextPage:pe,onCursorChange:ae,limit:y=25,limitLabel:$="Results per page:",limitText:X=({from:pt,to:Ye})=>J>0?`of ${J}`:`${pt}-${Ye}`,limitOptions:K,onLimitChange:je,...Ae}=q,Ke=useMemo(()=>Bn(ie),[ie]),Tt=useCallback((pt,Ye)=>{ae==null||ae(zn(Ye))},[ae]),ht=useCallback(pt=>{const Ye=pt.target.value;je==null||je(parseInt(Ye,10))},[je]);return _jsx(TablePagination,{...Ae,component:"div",count:J,page:Ke,nextIconButtonProps:{...pe!==void 0&&{disabled:!pe}},onPageChange:Tt,rowsPerPage:y,labelRowsPerPage:$,labelDisplayedRows:X,rowsPerPageOptions:K,onRowsPerPageChange:ht})},$n=q=>{const{pageLimit:J,setPageLimit:ie,pageCursor:pe,setPageCursor:ae,fetchNextPage:y}=useSearch(),$=useCallback(X=>{ie(X),ae(void 0)},[ie,ae]);return _jsx(mn,{...q,hasNextPage:!!y,limit:J,onLimitChange:$,cursor:pe,onCursorChange:ae})};var Wn=n(53974);const rn=q=>{const{children:J}=q,ie=useSearch(),{result:pe,...ae}=ie;return J(pe,ae)},Tn=q=>{const{query:J,children:ie}=q,pe=useApi(searchApiRef),ae=useAsync(()=>{const{term:y="",types:$=[],filters:X={},...K}=J;return pe.query({...K,term:y,types:$,filters:X})},[J]);return ie(ae,J)},Vn=q=>{const{query:J,children:ie}=q;return J?_jsx(Tn,{query:J,children:ie}):_jsx(rn,{children:ie})},ct=q=>{const{query:J,children:ie,noResultsComponent:pe=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ae}=q;return _jsx(Vn,{query:J,children:({loading:y,error:$,value:X})=>y?_jsx(Progress,{}):$?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:$}):X!=null&&X.results.length?isFunction(ie)?ie(X):_jsx(SearchResultListItemExtensions,{...ae,results:X.results,children:ie}):pe})},_n=q=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(ct,{...q})}),wt=({result:q,highlight:J,icon:ie,secondaryAction:pe,lineClamp:ae=5})=>q?_jsxs(_Fragment,{children:[ie&&_jsx(ListItemIcon,{children:ie}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:q.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)||""}):q.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ae,overflow:"hidden"},color:"textSecondary",variant:"body2",children:J!=null&&J.fields.text?_jsx(HighlightedSearchResultText,{text:J.fields.text,preTag:J.preTag,postTag:J.postTag}):q.text})}),pe&&_jsx(Box,{alignItems:"flex-end",children:pe})]}):null,at=q=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(wt,{...q})}),xn=q=>{const{error:J,loading:ie,resultItems:pe,renderResultItem:ae=K=>_jsx(DefaultResultListItem,{result:K.document},K.document.location),disableRenderingWithNoResults:y,noResultsComponent:$=y?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...X}=q;return ie?_jsx(Progress,{}):J?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:J}):pe!=null&&pe.length?_jsx(List,{...X,children:pe.map(ae)}):_jsx(_Fragment,{children:$})},Jt=q=>{const{query:J,renderResultItem:ie,children:pe,...ae}=q,y=useSearchResultListItemExtensions(pe);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:J,children:({loading:$,error:X,value:K})=>_jsx(xn,{...ae,error:X,loading:$,resultItems:K==null?void 0:K.results,renderResultItem:ie!=null?ie:y})})})};var pn=n(19126);const Rn=(0,d.Z)(q=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:q.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:q.palette.text.secondary,margin:q.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:q.palette.text.secondary,margin:q.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:q.spacing(.5)}})),dn=q=>{const J=Rn(),{label:ie,children:pe,...ae}=q;return _jsx(Chip,{...ae,className:J.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[ie,": ",pe]})})},Ln=()=>null,we=(0,d.Z)(q=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:q.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:q.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),le=q=>{const J=we(),{label:ie,value:pe="None",onChange:ae,onDelete:y}=q,$=useCallback(X=>{ae(X.target.value)},[ae]);return _jsx(dn,{label:ie,onDelete:y,children:_jsx(Typography,{role:"textbox",component:"span",className:J.root,onChange:$,contentEditable:!0,suppressContentEditableWarning:!0,children:pe})})},ke=(0,d.Z)(q=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:q.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Me=q=>{const J=ke(),{label:ie,value:pe="none",onChange:ae,onDelete:y,children:$}=q,X=useCallback(K=>{ae(K.target.value)},[ae]);return _jsx(dn,{label:ie,onDelete:y,children:_jsxs(Select,{className:J.root,value:pe,onChange:X,input:_jsx(InputBase,{}),IconComponent:Ln,children:[_jsx(MenuItem,{value:"none",children:"None"}),$]})})};function Qe(q){const J=Rn(),[ie,pe]=useState(null),{error:ae,loading:y,icon:$,title:X,titleProps:K={},link:je=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:J.listSubheaderLinkIcon})]}),linkProps:Ae={},filterOptions:Ke,renderFilterOption:Tt=Vt=>_jsx(MenuItem,{value:String(Vt),children:Vt},String(Vt)),filterFields:ht,renderFilterField:pt,resultItems:Ye,renderResultItem:lt=Vt=>_jsx(DefaultResultListItem,{result:Vt.document},Vt.document.location),disableRenderingWithNoResults:st,noResultsComponent:jt=st?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Wt}=q,en=useCallback(Vt=>{pe(Vt.currentTarget)},[]),nn=useCallback(()=>{pe(null)},[]);if(y)return _jsx(Progress,{});if(ae)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ae});if(!(Ye!=null&&Ye.length))return _jsx(_Fragment,{children:jt});var Zt;return _jsxs(List,{...Wt,children:[_jsxs(ListSubheader,{className:J.listSubheader,children:[$,_jsx(Typography,{className:J.listSubheaderName,component:"strong",...K,children:X}),Ke?_jsx(Chip,{className:J.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:en}):null,Ke?_jsx(Menu,{id:"filters-menu",anchorEl:ie,open:Boolean(ie),onClose:nn,onClick:nn,keepMounted:!0,children:Ke.map(Tt)}):null,ht==null?void 0:ht.map(Vt=>(Zt=pt==null?void 0:pt(Vt))!==null&&Zt!==void 0?Zt:null),_jsx(Link,{className:J.listSubheaderLink,to:"/search",...Ae,children:je})]}),Ye.map(lt)]})}function re(q){const{query:J,children:ie,renderResultItem:pe,linkProps:ae={},...y}=q,$=useSearchResultListItemExtensions(ie);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:J,children:({loading:X,error:K,value:je},{term:Ae,types:Ke,pageCursor:Tt,filters:ht={}})=>{const pt=`/search?${qs.stringify({term:Ae,types:Ke,filters:ht,pageCursor:Tt,query:Ae},{arrayFormat:"brackets"})}`;return _jsx(Qe,{...y,error:K,loading:X,linkProps:{to:pt,...ae},filterFields:Object.keys(ht),resultItems:je==null?void 0:je.results,renderResultItem:pe!=null?pe:$})}})})}const N=(0,d.Z)(q=>({root:{display:"flex",justifyContent:"space-between",gap:q.spacing(2),margin:q.spacing(2,0)}})),me=()=>{const{fetchNextPage:q,fetchPreviousPage:J}=useSearch(),ie=N();return!q&&!J?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:ie.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!J,onClick:J,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!q,onClick:q,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},$e="search.results.list.items.extensions.v1",Ge=(q,J)=>{for(const ie of q){if(!isValidElement(ie))continue;const pe=getComponentData(ie,$e);if(pe!=null&&pe(J))return cloneElement(ie,{rank:J.rank,highlight:J.highlight,result:J.document,...ie.props})}return null},et=q=>{const{rank:J,result:ie,noTrack:pe,children:ae,alignItems:y="flex-start",...$}=q,X=(0,r.z$)(),K=(0,W.useCallback)(()=>{pe||ie&&X.captureEvent("discover",ie.title,{attributes:{to:ie.location},value:J})},[J,ie,pe,X]);return(0,f.jsx)(g.Z,{divider:!0,alignItems:y,onClickCapture:K,...$,children:ae})},$t=q=>{const{name:J,component:ie,predicate:pe=()=>!0}=q;return(0,r.YO)({name:J,component:{lazy:()=>ie().then(ae=>y=>(0,f.jsx)(et,{rank:y.rank,result:y.result,noTrack:y.noTrack,children:(0,W.createElement)(ae,y)}))},data:{[$e]:pe}})},zt=q=>{const J=useElementFilter(q,ie=>ie.selectByComponentData({key:$e}).getElements(),[q]);return useCallback((ie,pe)=>{const ae=Ge(J,ie);return _jsx(Fragment,{children:ae!=null?ae:_jsx(et,{rank:ie.rank,result:ie.document,children:_jsx(DefaultResultListItem,{rank:ie.rank,highlight:ie.highlight,result:ie.document})})},pe)},[J])},tn=q=>{const{results:J,children:ie,...pe}=q,ae=zt(ie);return _jsx(List,{...pe,children:J.map(ae)})}},61886:function(Ct,Be,n){"use strict";n.d(Be,{Ox:function(){return Je},jM:function(){return W},Zz:function(){return g},oZ:function(){return z},DR:function(){return d},ZS:function(){return Le},VA:function(){return yt},KY:function(){return ye},gT:function(){return E},Dl:function(){return oe},ux:function(){return At},$L:function(){return I},x1:function(){return ze}});var r=n(52322),p=n(2784),H=n(73557),f=n(60871);const W="techdocs.addons.addon.v1",g="techdocs.addons.wrapper.v1",d=()=>null;(0,f.R5)(d,g,!0);const B=ge=>`${W}.${ge.toLocaleLowerCase("en-US")}`;function ye(ge){const{name:Se,component:Ne}=ge;return(0,f.YO)({name:Se,component:{sync:qe=>(0,r.jsx)(Ne,{...qe})},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}),Y=ge=>ge.selectByComponentData({key:g}).findComponentData({key:W}),I=()=>{const ge=(0,H.pC)(),Se=(0,f.vJ)(ge,V),Ne=(0,f.vJ)(ge,Y),qe=(0,p.useCallback)(ut=>{if(!Se||!ut)return null;const Ot=B(ut.name);var Kt;return(Kt=ue(Se,Ot))!==null&&Kt!==void 0?Kt:null},[Se]),mt=(0,p.useCallback)(ut=>{const Ot=Ne.find(Kt=>Kt.name===ut);return Ot?qe(Ot):null},[Ne,qe]),xt=(0,p.useCallback)(ut=>{const Ot=Ne.filter(Kt=>Kt.location===ut);return Ot.length?Ot.map(qe):null},[Ne,qe]);return{renderComponentByName:mt,renderComponentsByLocation:xt}},E=(0,f.T0)({id:"plugin.techdocs.service"}),oe=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ee=n(64279),te=n(77446),Z=n(25271),R=n(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,Z.eE)(ge)===(0,Z.eE)(Se),k={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},se=(0,R.CT)("techdocs-reader-page-context"),Le=(0,p.memo)(ge=>{const{entityRef:Se,children:Ne}=ge,qe=(0,f.h_)(E),mt=(0,f.h_)(f.Ds),xt=(0,ee.default)(async()=>qe.getEntityMetadata(Se),[Se]),ut=(0,te.Z)(async()=>qe.getTechDocsMetadata(Se),[Se]),[Ot,Kt]=(0,p.useState)(k.title),[qt,Dt]=(0,p.useState)(k.subtitle),[hn,Xt]=(0,p.useState)(k.shadowRoot);(0,p.useEffect)(()=>{hn&&!ut.value&&!ut.loading&&ut.retry()},[ut.value,ut.loading,hn,ut.retry,ut]);const gn={metadata:ut,entityRef:P(Se,mt),entityMetadata:xt,shadowRoot:hn,setShadowRoot:Xt,title:Ot,setTitle:Kt,subtitle:qt,setSubtitle:Dt},zn=(0,R.EI)({1:gn});return(0,r.jsx)(f.fC,{attributes:{entityRef:(0,Z.eE)(Se)},children:(0,r.jsx)(se.Provider,{value:zn,children:Ne instanceof Function?Ne(gn):Ne})})},(ge,Se)=>L(ge.entityRef,Se.entityRef)),ze=()=>{const ge=(0,p.useContext)(se);if(ge===void 0)return k;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 vt=n(70882),rt=n(50236),He=n(19219),tt=n(53974);const Je="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",bt=ge=>{(0,p.useEffect)(()=>{if(!ge)return()=>{};const Se=ge.querySelectorAll('head > link[rel="stylesheet"]');var Ne;let qe=(Ne=Se==null?void 0:Se.length)!==null&&Ne!==void 0?Ne:0;const mt=new CustomEvent(Je);if(!qe)return ge.dispatchEvent(mt),()=>{};const xt=()=>{--qe===0&&ge.dispatchEvent(mt)};return Se==null||Se.forEach(ut=>{ut.addEventListener("load",xt)}),()=>{Se==null||Se.forEach(ut=>{ut.removeEventListener("load",xt)})}},[ge])},At=ge=>{const[Se,Ne]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(!ge)return()=>{};Ne(!0);const qe=ge.style;qe.setProperty("opacity","0");const mt=()=>{Ne(!1),qe.setProperty("opacity","1")};return ge.addEventListener(Je,mt),()=>{ge.removeEventListener(Je,mt)}},[ge]),Se},yt=ge=>{const{element:Se,onAppend:Ne,children:qe}=ge,[mt,xt]=(0,p.useState)((0,vt.Ue)({...(0,rt.Z)(),insertionPoint:void 0}));bt(Se);const ut=At(Se),Ot=(0,p.useCallback)(Kt=>{if(!Se||!Kt)return;xt((0,vt.Ue)({...(0,rt.Z)(),insertionPoint:Se.querySelector("head")||void 0}));let qt=Kt.shadowRoot;qt||(qt=Kt.attachShadow({mode:"open"})),qt.replaceChildren(Se),typeof Ne=="function"&&Ne(qt)},[Se,Ne]);return(0,r.jsxs)(r.Fragment,{children:[ut&&(0,r.jsx)(tt.Ex,{}),(0,r.jsxs)(He.ZP,{jss:mt,sheetsManager:new Map,children:[(0,r.jsx)("div",{ref:Ot,"data-testid":"techdocs-native-shadowroot"}),qe]})]})};var ot=n(54073);const It=()=>{const{shadowRoot:ge}=useTechDocsReaderPage();return ge},Mt=ge=>{const Se=It();return Se?ge.map(Ne=>Se==null?void 0:Se.querySelectorAll(Ne)).filter(Ne=>Ne.length).map(Ne=>Array.from(Ne)).flat():[]},Ve=ge=>ge.toString()&&ge.rangeCount&&ge.getRangeAt(0).getBoundingClientRect().top,_t=(ge=0)=>{const Se=It(),[Ne,qe]=useState(null),mt=useMemo(()=>debounce(()=>{const xt=Se,ut=xt.getSelection?xt.getSelection():document.getSelection();ut&&Ve(ut)?qe(ut):qe(null)},ge),[Se,qe,ge]);return useEffect(()=>(window.document.addEventListener("selectionchange",mt),()=>{mt.cancel(),window.document.removeEventListener("selectionchange",mt)}),[mt]),Ne}},52943:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{EmbeddedDocsRouter:function(){return ee},Router:function(){return oe},isTechDocsAvailable:function(){return E}});var r=n(52322),p=n(2784),H=n(73557),f=n(43514),W=n(53974),g=n(25271),d=n(89258),B=n(65124),ye=n(86317);const ue=({entity:te})=>{const Z=(0,g.iB)(te);return(0,r.jsxs)(d.I6,{entityRef:Z,children:[(0,r.jsx)(B.b,{}),(0,r.jsx)(ye.F,{withSearch:!1})]})};var V=n(18662),Y=n(7476);const I="backstage.io/techdocs-ref",E=te=>{var Z,R;return Boolean(te==null||(Z=te.metadata)===null||Z===void 0||(R=Z.annotations)===null||R===void 0?void 0:R[I])},oe=()=>(0,r.jsxs)(H.Z5,{children:[(0,r.jsx)(H.AW,{path:"/",element:(0,r.jsx)(V.TechDocsIndexPage,{})}),(0,r.jsx)(H.AW,{path:"/:namespace/:kind/:name/*",element:(0,r.jsx)(Y.TechDocsReaderPage,{})})]}),ee=te=>{var Z;const{children:R}=te,{entity:P}=(0,f.X2)(),L=(0,H.V$)([{path:"/*",element:(0,r.jsx)(ue,{entity:P}),children:[{path:"*",element:R}]}]);return((Z=P.metadata.annotations)===null||Z===void 0?void 0:Z[I])?L:(0,r.jsx)(W.sk,{annotation:I})}},92077:function(Ct,Be,n){"use strict";n.d(Be,{k:function(){return g},p:function(){return W}});var r=n(87612),p=n(23054),H=n(54847),f=n.n(H);class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(B){const{kind:ye,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/techdocs/${ue}/${ye}/${V}`,E=await this.fetchApi.fetch(`${I}`);if(!E.ok)throw await p.VL.fromResponse(E);return await E.json()}async getEntityMetadata(B){const{kind:ye,namespace:ue,name:V}=B,I=`${await this.getApiOrigin()}/metadata/entity/${ue}/${ye}/${V}`,E=await this.fetchApi.fetch(`${I}`);if(!E.ok)throw await p.VL.fromResponse(E);return await E.json()}constructor(B){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(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,ye){const{kind:ue,namespace:V,name:Y}=B,E=`${await this.getStorageUrl()}/${V}/${ue}/${Y}/${ye}`,oe=await this.fetchApi.fetch(`${E.endsWith("/")?E:`${E}/`}index.html`);let ee="";switch(oe.status){case 404:throw ee="Page not found. ",ye||(ee+="This could be because there is no index.md file in the root of the docs directory of this repository."),new p.dR(ee);case 500:throw ee="Could not generate documentation or an error in the TechDocs backend. ",new Error(ee);default:break}return oe.text()}async syncEntityDocs(B,ye=()=>{}){const{kind:ue,namespace:V,name:Y}=B,E=`${await this.getApiOrigin()}/sync/${V}/${ue}/${Y}`,{token:oe}=await this.identityApi.getCredentials();return new Promise((ee,te)=>{const Z=new H.EventSourcePolyfill(E,{withCredentials:!0,headers:oe?{Authorization:`Bearer ${oe}`}:{}});Z.addEventListener("log",R=>{R.data&&ye(JSON.parse(R.data))}),Z.addEventListener("finish",R=>{let P=!1;R.data&&({updated:P}=JSON.parse(R.data)),ee(P?"updated":"cached")}),Z.onerror=R=>{switch(Z.close(),R.status){case 404:te(new p.dR(R.message));return;default:te(new Error(R.data));return}}})}async getBaseUrl(B,ye,ue){const{kind:V,namespace:Y,name:I}=ye,oe=`${await this.getApiOrigin()}/static/docs/${Y}/${V}/${I}/${ue}`;return new URL(B,oe.endsWith("/")?oe:`${oe}/`).toString()}constructor(B){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"identityApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.identityApi=B.identityApi,this.fetchApi=B.fetchApi}}},51953:function(Ct,Be,n){"use strict";n.d(Be,{D:function(){return r}});function r(p,H){return H.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?p:p.toLocaleLowerCase("en-US")}},3482:function(Ct,Be,n){"use strict";n.d(Be,{u:function(){return B}});var r=n(52322),p=n(2784),H=n(53974),f=n(43514),W=n(42081),g=n(48431),d=n(68435);const B=ye=>{const{initialFilter:ue="owned",columns:V,actions:Y}=ye;return(0,r.jsx)(W.j,{children:(0,r.jsxs)(H.VY,{children:[(0,r.jsx)(H.yW,{title:"",children:(0,r.jsx)(H.qt,{children:"Discover documentation in your ecosystem."})}),(0,r.jsx)(f.UO,{children:(0,r.jsxs)(f._i,{children:[(0,r.jsxs)(f._i.Filters,{children:[(0,r.jsx)(g.f,{}),(0,r.jsx)(f.EW,{initialFilter:ue}),(0,r.jsx)(f.dq,{}),(0,r.jsx)(f.xE,{})]}),(0,r.jsx)(f._i.Content,{children:(0,r.jsx)(d.n,{actions:Y,columns:V})})]})})]})})}},85478:function(Ct,Be,n){"use strict";n.d(Be,{f:function(){return V}});var r=n(52322),p=n(95573),H=n(51953),f=n(60871),W=n(53974),g=n(94339),d=n(16111),B=n(24579),ye=n(14503),ue=n(2784);const V=ee=>{const{entities:te}=ee,Z=(0,f.tg)(p.Fw),R=(0,f.h_)(f.Ds);if(!te)return null;var P,L;return(0,r.jsx)(W.Oh,{"data-testid":"docs-explore",children:te!=null&&te.length?te.map((k,se)=>(0,r.jsxs)(g.Z,{children:[(0,r.jsx)(d.Z,{children:(0,r.jsx)(W.hu,{title:(P=k.metadata.title)!==null&&P!==void 0?P:k.metadata.name})}),(0,r.jsx)(B.Z,{children:k.metadata.description}),(0,r.jsx)(ye.Z,{children:(0,r.jsx)(W.Qj,{to:Z({namespace:(0,H.D)((L=k.metadata.namespace)!==null&&L!==void 0?L:"default",R),kind:(0,H.D)(k.kind,R),name:(0,H.D)(k.metadata.name,R)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},se)):null})};var Y=n(43514);const I={title:"All Documentation",filterPredicate:()=>!0},E=ee=>{const{entities:te,group:Z}=ee,{loading:R,isOwnedEntity:P}=useEntityOwnership(),L=te.filter(se=>Z.filterPredicate==="ownedByUser"?R?!1:P(se):typeof Z.filterPredicate=="function"&&Z.filterPredicate(se)),k=(()=>typeof Z.title=="string"?_jsx(ContentHeader,{title:Z.title}):Z.title)();return L.length===0?null:_jsxs(Content,{children:[k,_jsx(DocsCardGrid,{entities:L})]})},oe=ee=>{const{loading:te,error:Z,entities:R}=useEntityList();if(Z)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:Z.toString()})});if(te)return _jsx(Progress,{});if(R.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 R.sort((k,se)=>((P=k.metadata.title)!==null&&P!==void 0?P:k.metadata.name).localeCompare((L=se.metadata.title)!==null&&L!==void 0?L:se.metadata.name)),_jsx(Content,{children:(ee.groups||[I]).map((k,se)=>_jsx(E,{entities:R,group:k},`${k.title}-${se}`))})}},68435:function(Ct,Be,n){"use strict";n.d(Be,{H:function(){return R},n:function(){return P}});var r=n(52322),p=n(2784),H=n(95074),f=n(76635),W=n(53974),g=n(43514),d=n(60871),B=n(25271),ye=n(95573),ue=n(39981),V=n(2337),Y=n(11640),I=n(28347);const E=(0,V.Z)({root:{color:"#f3ba37"}})(Y.Z),oe={createCopyDocsUrlAction(L){return k=>({icon:()=>(0,r.jsx)(ue.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>L(`${window.location.origin}${k.resolved.docsUrl}`)})},createStarEntityAction(L,k){return se=>{const Le=se.entity,ze=L(Le);return{cellStyle:{paddingLeft:"1em"},icon:()=>ze?(0,r.jsx)(E,{}):(0,r.jsx)(I.Z,{}),tooltip:ze?"Remove from favorites":"Add to favorites",onClick:()=>k(Le)}}}};function ee(L){return L.metadata.title||L.metadata.name}const te={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:L=>(0,r.jsx)(W.uw,{value:(0,r.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,r.jsx)(g.rI,{entityRefs:L.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var Z=n(51953);const R=L=>{const{entities:k,title:se,loading:Le,columns:ze,actions:z,options:vt}=L,[,rt]=(0,H.Z)(),He=(0,d.tg)(ye.Fw),tt=(0,d.h_)(d.Ds);if(!k)return null;const Je=k.map(yt=>{const ot=(0,g.hF)(yt,B.S4);var It;return{entity:yt,resolved:{docsUrl:He({namespace:(0,Z.D)((It=yt.metadata.namespace)!==null&&It!==void 0?It:"default",tt),kind:(0,Z.D)(yt.kind,tt),name:(0,Z.D)(yt.metadata.name,tt)}),ownedByRelations:ot,ownedByRelationsTitle:ot.map(Mt=>(0,g.$3)(Mt,{defaultKind:"group"})).join(", ")}}}),bt=[te.createNameColumn(),te.createOwnerColumn(),te.createTypeColumn()],At=[oe.createCopyDocsUrlAction(rt)];return(0,r.jsx)(r.Fragment,{children:Le||Je&&Je.length>0?(0,r.jsx)(W.iA,{isLoading:Le,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...vt},data:Je,columns:ze||bt,actions:z||At,title:se?`${se} (${Je.length})`:`All (${Je.length})`}):(0,r.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,r.jsx)(W.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};R.columns=te,R.actions=oe;const P=L=>{var k;const{columns:se,actions:Le,options:ze}=L,{loading:z,error:vt,entities:rt,filters:He}=(0,g.wp)(),{isStarredEntity:tt,toggleStarredEntity:Je}=(0,g.CR)(),[,bt]=(0,H.Z)();var At;const yt=(0,f.capitalize)((At=(k=He.user)===null||k===void 0?void 0:k.value)!==null&&At!==void 0?At:"all"),ot=[oe.createCopyDocsUrlAction(bt),oe.createStarEntityAction(tt,Je)];return vt?(0,r.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(W.Oi,{language:"text",text:vt.toString()})}):(0,r.jsx)(R,{title:yt,entities:rt,loading:z,actions:Le||ot,columns:se,options:ze})};P.columns=te,P.actions=oe},18662:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{TechDocsIndexPage:function(){return W}});var r=n(52322),p=n(2784),H=n(73557),f=n(3482);const W=g=>(0,H.pC)()||(0,r.jsx)(f.u,{...g})},42081:function(Ct,Be,n){"use strict";n.d(Be,{j:function(){return W}});var r=n(52322),p=n(2784),H=n(53974),f=n(60871);const W=g=>{const{children:d}=g,B=(0,f.h_)(f.Ds);var ye;const ue=`Documentation available in ${(ye=B.getOptionalString("organization.name"))!==null&&ye!==void 0?ye:"Backstage"}`;return(0,r.jsx)(H.g9,{title:"Documentation",subtitle:ue,themeId:"documentation",children:d})}},48431:function(Ct,Be,n){"use strict";n.d(Be,{f:function(){return f}});var r=n(2784),p=n(43514);class H{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":p.n3}}}const f=()=>{const{updateFilters:W}=(0,p.wp)();return(0,r.useEffect)(()=>{W({techdocs:new H})},[W]),null}},89258:function(Ct,Be,n){"use strict";n.d(Be,{I6:function(){return V},Jl:function(){return ue},s4:function(){return g}});var r=n(61886),p=n(92077),H=n(95573),f=n(60871),W=n(15096);const g=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:r.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:I,discoveryApi:E,identityApi:oe,fetchApi:ee})=>new p.k({configApi:I,discoveryApi:E,identityApi:oe,fetchApi:ee})}),(0,f.ni)({api:r.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:I,discoveryApi:E,fetchApi:oe})=>new p.p({configApi:I,discoveryApi:E,fetchApi:oe})})],routes:{root:H._Z,docRoot:H.Fw,entityContent:H.pd}}),d=g.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(I=>I.Router),mountPoint:H._Z})),B=g.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(I=>I.EmbeddedDocsRouter),mountPoint:H.pd})),ye=g.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(I=>I.TechDocsCustomHome),mountPoint:H._Z})),ue=g.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(I=>I.TechDocsIndexPage),mountPoint:H._Z})),V=g.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(I=>I.TechDocsReaderPage),mountPoint:H.Fw})),Y=g.provide((0,W.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(I=>I.TechDocsSearchResultListItem),predicate:I=>I.type==="techdocs"}))},7476:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{TechDocsReaderLayout:function(){return V},TechDocsReaderPage:function(){return Y}});var r=n(52322),p=n(2784),H=n(73557),f=n(53974),W=n(61886),g=n(86317),d=n(93225),B=n(65124),ye=n(95573),ue=n(60871);const V=I=>{const{withSearch:E,withHeader:oe=!0}=I;return(0,r.jsxs)(f.T3,{themeId:"documentation",children:[oe&&(0,r.jsx)(d.S,{}),(0,r.jsx)(B.b,{}),(0,r.jsx)(g.F,{withSearch:E})]})},Y=I=>{const{kind:E,name:oe,namespace:ee}=(0,ue.Oi)(ye.Fw),{children:te,entityRef:Z={kind:E,name:oe,namespace:ee}}=I,R=(0,H.pC)();if(!te){const L=R?p.Children.toArray(R.props.children):[];var P;const se=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,r.jsx)(W.ZS,{entityRef:Z,children:se||(0,r.jsx)(V,{})})}return(0,r.jsx)(W.ZS,{entityRef:Z,children:({metadata:L,entityMetadata:k,onReady:se})=>(0,r.jsx)("div",{className:"techdocs-reader-page",children:(0,r.jsx)(f.T3,{themeId:"documentation",children:te instanceof Function?te({entityRef:Z,techdocsMetadataValue:L.value,entityMetadataValue:k.value,onReady:se}):te})})})}},86317:function(Ct,Be,n){"use strict";n.d(Be,{F:function(){return pe}});var r=n(52322),p=n(2784),H=n(79692),f=n(60905),W=n(61886),g=n(53974),d=n(22478),B=n(4614),ye=n(77277),ue=n(99688),V=n(12420),Y=n(90436),I=n(61837),E=n(4190),oe=n(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}})),te=({buildLog:y,onClose:$})=>{const X=ee(),K=y.length===0?"Waiting for logs...":y.join(`
|
|
37
|
+
`);return(0,r.jsxs)(f.Z,{container:!0,direction:"column",className:X.root,spacing:0,wrap:"nowrap",children:[(0,r.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,r.jsx)(Y.Z,{variant:"h5",children:"Build Details"}),(0,r.jsx)(I.Z,{title:"Close the drawer",onClick:$,color:"inherit",children:(0,r.jsx)(oe.Z,{})},"dismiss")]}),(0,r.jsx)(f.Z,{item:!0,xs:!0,children:(0,r.jsx)(g.nU,{text:K,classes:{root:X.logs}})})]})},Z=({buildLog:y})=>{const $=ee(),[X,K]=(0,p.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ye.Z,{color:"inherit",onClick:()=>K(!0),children:"Show Build Logs"}),(0,r.jsx)(E.ZP,{classes:{paper:$.paper},anchor:"right",open:X,onClose:()=>K(!1),children:(0,r.jsx)(te,{buildLog:y,onClose:()=>K(!1)})})]})};var R=n(60871);const P=({errorMessage:y})=>{const $=(0,R.h_)(R.Ds).getOptionalString("techdocs.builder");let X="";return $!=="local"&&(X="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,r.jsx)(g.mf,{status:"404",statusMessage:y||"Documentation not found",additionalInfo:X})};var L=n(95481);const k=(0,H.Z)(y=>({root:{marginBottom:y.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),se=()=>{let y=null;const $=k(),{state:X,contentReload:K,contentErrorMessage:je,syncErrorMessage:Ae,buildLog:Ke}=(0,L.DK)();return X==="INITIAL_BUILD"&&(y=(0,r.jsx)(ue.Z,{classes:{root:$.root},variant:"outlined",severity:"info",icon:(0,r.jsx)(B.Z,{size:"24px"}),action:(0,r.jsx)(Z,{buildLog:Ke}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),X==="CONTENT_STALE_REFRESHING"&&(y=(0,r.jsx)(ue.Z,{variant:"outlined",severity:"info",icon:(0,r.jsx)(B.Z,{size:"24px"}),action:(0,r.jsx)(Z,{buildLog:Ke}),classes:{root:$.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),X==="CONTENT_STALE_READY"&&(y=(0,r.jsx)(ue.Z,{variant:"outlined",severity:"success",action:(0,r.jsx)(ye.Z,{color:"inherit",onClick:()=>K(),children:"Refresh"}),classes:{root:$.root},children:"A newer version of this documentation is now available, please refresh to view."})),X==="CONTENT_STALE_ERROR"&&(y=(0,r.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(Z,{buildLog:Ke}),classes:{root:$.root,message:$.message},children:["Building a newer version of this documentation failed."," ",Ae]})),X==="CONTENT_NOT_FOUND"&&(y=(0,r.jsxs)(r.Fragment,{children:[Ae&&(0,r.jsxs)(ue.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(Z,{buildLog:Ke}),classes:{root:$.root,message:$.message},children:["Building a newer version of this documentation failed."," ",Ae]}),(0,r.jsx)(P,{errorMessage:je})]})),y};var Le=n(60364),ze=n(41156),z=n(32838),vt=n(35368),rt=n.n(vt);const He=/main\.[A-Fa-f0-9]{8}\.min\.css$/,tt=/^https:\/\/fonts\.googleapis\.com/,Je=/^https:\/\/fonts\.gstatic\.com/,bt=y=>y.nodeName==="LINK",At=y=>{const $=(y==null?void 0:y.getAttribute("href"))||"",X=$.match(He),K=$.match(tt),je=$.match(Je);return X||K||je},yt=y=>(bt(y)&&!At(y)&&y.remove(),y),ot=y=>y.nodeName==="IFRAME",It=(y,$)=>{const X=y.getAttribute("src")||"";try{const{host:K}=new URL(X);return $.includes(K)}catch{return!1}},Mt=y=>$=>(ot($)&&!It($,y)&&$.remove(),$),Ve=()=>{const y=(0,R.h_)(R.Ds);return(0,p.useMemo)(()=>y.getOptionalConfig("techdocs.sanitizer"),[y])},_t=()=>{const y=Ve();return(0,p.useCallback)(async $=>{const X=y==null?void 0:y.getOptionalStringArray("allowedIframeHosts");rt().addHook("beforeSanitizeElements",yt);const K=["link"];return X&&(K.push("iframe"),rt().addHook("beforeSanitizeElements",Mt(X))),rt().sanitize($.outerHTML,{ADD_TAGS:K,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[y])};var ge=n(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
|
+
`,Ne=({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 qe="224px";var mt=({theme:y,sidebar:$})=>`
|
|
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: ${$.isPinned?`calc(-12.1rem + ${qe})`:"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 xt=["h1","h2","h3","h4","h5","h6"];var ut=({theme:y})=>`
|
|
361
|
+
/*================== Typeset ==================*/
|
|
362
|
+
|
|
363
|
+
.md-typeset {
|
|
364
|
+
font-size: var(--md-typeset-font-size);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
${xt.reduce(($,X)=>{var K;const je=(K=y.typography.htmlFontSize)!==null&&K!==void 0?K:16,Ae=y.typography[X],{lineHeight:Ke,fontFamily:Tt,fontWeight:ht,fontSize:pt}=Ae,Ye=lt=>{let st=1;return typeof lt=="number"&&(st=lt/je*.6),typeof lt=="string"&&(st=lt.replace("rem","")),`calc(${st} * var(--md-typeset-font-size))`};return $.concat(`
|
|
368
|
+
.md-typeset ${X} {
|
|
369
|
+
color: var(--md-default-fg-color);
|
|
370
|
+
line-height: ${Ke};
|
|
371
|
+
font-family: ${Tt};
|
|
372
|
+
font-weight: ${ht};
|
|
373
|
+
font-size: ${Ye(pt)};
|
|
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
|
+
`,Kt=({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 qt=[Se,Ne,mt,ut,Ot,Kt],Dt=()=>(0,g.Pf)(),hn=()=>{const y=Dt(),$=(0,Le.Z)();return(0,p.useMemo)(()=>{const X={theme:$,sidebar:y};return qt.reduce((K,je)=>K+je(X),"")},[$,y])},Xt=()=>{const y=hn();return(0,p.useCallback)($=>($.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${y}</style>`),$),[y])},gn=(y,$,X)=>{const K=y==="src"&&$.endsWith(".svg"),je=!$.match(/^([a-z]*:)?\/\//i),Ae=$.startsWith(X);return K&&(je||Ae)},zn=({techdocsStorageApi:y,entityId:$,path:X})=>async K=>{const je=await y.getApiOrigin(),Ae=async(Ke,Tt)=>{for(const ht of Ke)if(ht.hasAttribute(Tt)){const pt=ht.getAttribute(Tt);if(!pt)return;const Ye=await y.getBaseUrl(pt,$,X);if(gn(Tt,pt,je))try{const st=await(await fetch(Ye,{credentials:"include"})).text();ht.setAttribute(Tt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(st)))}`)}catch{ht.setAttribute("alt",`Error: ${pt}`)}else ht.setAttribute(Tt,Ye)}};return await Promise.all([Ae(K.querySelectorAll("img"),"src"),Ae(K.querySelectorAll("script"),"src"),Ae(K.querySelectorAll("source"),"src"),Ae(K.querySelectorAll("link"),"href"),Ae(K.querySelectorAll("a[download]"),"href")]),K};var Bn=n(79158),mn=n(67097),$n=n(28316),Wn=n(82717),rn=n.n(Wn);const Tn=y=>$=>{var X;const K=$.querySelector('[title="Edit this page"]');if(!K||!K.href)return $;const je=new URL(K.href),Ae=y.byUrl(je);if((Ae==null?void 0:Ae.type)!=="github"&&(Ae==null?void 0:Ae.type)!=="gitlab")return $;const Ke=((X=$.querySelector("article>h1"))===null||X===void 0?void 0:X.childNodes[0].textContent)||"",Tt=encodeURIComponent(`Documentation Feedback: ${Ke}`),ht=encodeURIComponent(`Page source:
|
|
504
|
+
${K.href}
|
|
505
|
+
|
|
506
|
+
Feedback:`),pt=(Ae==null?void 0:Ae.type)==="github"?(0,Bn.BT)(je.href,"blob"):je.href,Ye=rn()(pt),lt=`/${Ye.organization}/${Ye.name}`,st=K.cloneNode();switch(Ae==null?void 0:Ae.type){case"gitlab":st.href=`${je.origin}${lt}/issues/new?issue[title]=${Tt}&issue[description]=${ht}`;break;case"github":st.href=`${je.origin}${lt}/issues/new?title=${Tt}&body=${ht}`;break;default:return $}return $n.render(p.createElement(mn.Z),st),st.style.paddingLeft="5px",st.title="Leave feedback for this page",st.id="git-feedback-link",K==null||K.insertAdjacentElement("beforebegin",st),$};var Vn=n(44882);const ct=()=>y=>{const $=y.querySelector('.md-header label[for="__drawer"]'),X=y.querySelector("article");if(!$||!X)return y;const K=$.cloneNode();return $n.render(p.createElement(Vn.Z),K),K.id="toggle-sidebar",K.title="Toggle Sidebar",K.classList.add("md-content__button"),K.style.setProperty("padding","0 0 0 5px"),K.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),X==null||X.prepend(K),y},_n=()=>y=>(((X,K)=>{Array.from(X).filter(je=>je.hasAttribute(K)).forEach(je=>{const Ae=je.getAttribute(K);if(Ae){Ae.match(/^https?:\/\//i)&&je.setAttribute("target","_blank");try{const Ke=wt(window.location.href);je.setAttribute(K,new URL(Ae,Ke).toString())}catch{je.replaceWith(je.textContent||Ae)}}})})(Array.from(y.getElementsByTagName("a")),"href"),y);function wt(y){const $=new URL(y);return!$.pathname.endsWith("/")&&!$.pathname.endsWith(".html")&&($.pathname+="/"),$.toString()}const at=({baseUrl:y,onClick:$})=>X=>(Array.from(X.getElementsByTagName("a")).forEach(K=>{K.addEventListener("click",je=>{const Ke=K.getAttribute("href");Ke&&Ke.startsWith(y)&&!K.hasAttribute("download")&&(je.preventDefault(),$(je,Ke))})}),X);var xn=n(15459),Jt=n(80030),pn=n(72379),Rn=n(41547),dn=n(95074);const Ln=(0,xn.Z)(y=>({tooltip:{fontSize:"inherit",color:y.palette.text.primary,margin:0,padding:y.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Jt.ZP),we=()=>(0,r.jsx)(pn.Z,{children:(0,r.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),le=({text:y})=>{const[$,X]=(0,p.useState)(!1),[,K]=(0,dn.Z)(),je=(0,p.useCallback)(()=>{K(y),X(!0)},[y,K]),Ae=(0,p.useCallback)(()=>{X(!1)},[X]);return(0,r.jsx)(Ln,{title:"Copied to clipboard",placement:"left",open:$,onClose:Ae,leaveDelay:1e3,children:(0,r.jsx)(I.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:je,children:(0,r.jsx)(we,{})})})},ke=y=>$=>{const X=$.querySelectorAll("pre > code");for(const je of X){var K;const Ae=je.textContent||"",Ke=document.createElement("div");je==null||(K=je.parentElement)===null||K===void 0||K.prepend(Ke),$n.render((0,r.jsx)(Rn.Z,{theme:y,children:(0,r.jsx)(le,{text:Ae})}),Ke)}return $},Me=()=>y=>{var $;return($=y.querySelector(".md-header"))===null||$===void 0||$.remove(),y},Qe=()=>y=>{var $,X;return($=y.querySelector(".md-footer .md-copyright"))===null||$===void 0||$.remove(),(X=y.querySelector(".md-footer-copyright"))===null||X===void 0||X.remove(),y},re=({onLoading:y,onLoaded:$})=>X=>(y(),X.addEventListener(W.Ox,function K(){$(),X.removeEventListener(W.Ox,K)}),X),N=()=>y=>(y.addEventListener(W.Ox,function $(){if(window.location.hash){var X;const K=window.location.hash.slice(1);(X=y==null?void 0:y.querySelector(`[id="${K}"]`))===null||X===void 0||X.scrollIntoView()}y.removeEventListener(W.Ox,$)}),y),me=()=>y=>(setTimeout(()=>{const $=y==null?void 0:y.querySelectorAll("li.md-nav__item--active");$.length!==0&&($.forEach(K=>{const je=K==null?void 0:K.querySelector("input");je!=null&&je.checked||je==null||je.click()}),$[$.length-1].scrollIntoView())},200),y),$e=async(y,$)=>{let X;if(typeof y=="string")X=new DOMParser().parseFromString(y,"text/html").documentElement;else if(y instanceof Element)X=y;else throw new Error("dom is not a recognized type");for(const K of $)X=await K(X);return X};var Ge=n(73557);function et(y,$){const X=new URL($),K=`${X.origin}${X.pathname.replace(/\/$/,"")}`,je=y.replace(K,"").replace(/^\/+/,""),Ae=new URL(`http://localhost/${je}`);return`${Ae.pathname}${Ae.search}${Ae.hash}`}function $t(){const y=(0,Ge.s0)(),X=(0,R.h_)(R.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(je=>{let Ae=je;if(X)try{Ae=et(je,X)}catch{}y(Ae)},[y,X])}const zt="screen and (max-width: 76.1875em)",tn=y=>{const $=$t(),X=(0,Le.Z)(),K=(0,ze.Z)(zt),je=_t(),Ae=Xt(),Ke=(0,R.z$)(),Tt=(0,R.h_)(W.Dl),ht=(0,R.h_)(z.q3),{state:pt,path:Ye,content:lt}=(0,L.DK)(),[st,jt]=(0,p.useState)(null),Wt=(0,W.ux)(st),en=(0,p.useCallback)(()=>{if(!st)return;st.querySelectorAll(".md-sidebar").forEach(Lt=>{if(K)Lt.style.top="0px";else{const Qn=document==null?void 0:document.querySelector(".techdocs-reader-page");var Ut;const hr=(Ut=Qn==null?void 0:Qn.getBoundingClientRect().top)!==null&&Ut!==void 0?Ut:0;var In;let wn=(In=st.getBoundingClientRect().top)!==null&&In!==void 0?In:0;const Dn=st.querySelector(".md-container > .md-tabs");var Pn;const sr=(Pn=Dn==null?void 0:Dn.getBoundingClientRect().height)!==null&&Pn!==void 0?Pn:0;wn<hr&&(wn=hr),Lt.style.top=`${Math.max(wn,0)+sr}px`}Lt.style.setProperty("opacity","1")})},[st,K]);(0,p.useEffect)(()=>(window.addEventListener("resize",en),window.addEventListener("scroll",en,!0),()=>{window.removeEventListener("resize",en),window.removeEventListener("scroll",en,!0)}),[st,en]);const nn=(0,p.useCallback)(()=>{if(!st)return;const Pt=st.querySelector(".md-footer");Pt&&(Pt.style.width=`${st.getBoundingClientRect().width}px`)},[st]);(0,p.useEffect)(()=>(window.addEventListener("resize",nn),()=>{window.removeEventListener("resize",nn)}),[st,nn]),(0,p.useEffect)(()=>{Wt||(nn(),en())},[pt,Wt,nn,en]);const Zt=(0,p.useCallback)((Pt,Lt)=>$e(Pt,[je,zn({techdocsStorageApi:Tt,entityId:y,path:Lt}),_n(),ct(),Me(),Qe(),Tn(ht),Ae]),[y,ht,Tt,je,Ae]),Vt=(0,p.useCallback)(async Pt=>$e(Pt,[N(),me(),ke(X),at({baseUrl:window.location.origin,onClick:(Lt,Ut)=>{var In;const Pn=Lt.ctrlKey||Lt.metaKey,Qn=new URL(Ut),hr=((In=Lt.target)===null||In===void 0?void 0:In.innerText)||Ut,wn=Ut.replace(window.location.origin,"");if(Ke.captureEvent("click",hr,{attributes:{to:wn}}),Qn.hash)if(Pn)window.open(Ut,"_blank");else{var Dn;$(Ut),(Dn=Pt==null?void 0:Pt.querySelector(`[id="${Qn.hash.slice(1)}"]`))===null||Dn===void 0||Dn.scrollIntoView()}else Pn?window.open(Ut,"_blank"):$(Ut)}}),re({onLoading:()=>{},onLoaded:()=>{var Lt;(Lt=Pt.querySelector(".md-nav__title"))===null||Lt===void 0||Lt.removeAttribute("for")}}),re({onLoading:()=>{Array.from(Pt.querySelectorAll(".md-sidebar")).forEach(Ut=>{Ut.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[X,$,Ke]);return(0,p.useEffect)(()=>{if(!lt)return()=>{};let Pt=!0;return Zt(lt,Ye).then(async Lt=>{if(!(Lt!=null&&Lt.innerHTML)||!Pt)return;window.scroll({top:0});const Ut=await Vt(Lt);jt(Ut)}),()=>{Pt=!1}},[lt,Ye,Zt,Vt]),st};var q=n(8560);const J=()=>{const y=(0,W.$L)(),{shadowRoot:$}=(0,W.x1)(),X=$==null?void 0:$.querySelector('[data-md-component="content"]'),K=$==null?void 0:$.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let je=K==null?void 0:K.querySelector('[data-techdocs-addons-location="primary sidebar"]');je||(je=document.createElement("div"),je.setAttribute("data-techdocs-addons-location","primary sidebar"),K==null||K.prepend(je));const Ae=$==null?void 0:$.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ke=Ae==null?void 0:Ae.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ke||(Ke=document.createElement("div"),Ke.setAttribute("data-techdocs-addons-location","secondary sidebar"),Ae==null||Ae.prepend(Ke)),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(q.Z,{container:je,children:y.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,r.jsx)(q.Z,{container:X,children:y.renderComponentsByLocation(W.oZ.Content)}),(0,r.jsx)(q.Z,{container:Ke,children:y.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},ie=(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 $;const{withSearch:X=!0,onReady:K}=y,je=ie(),{entityMetadata:{value:Ae,loading:Ke},entityRef:Tt,setShadowRoot:ht}=(0,W.x1)(),pt=tn(Tt),Ye=(0,p.useCallback)(lt=>{ht(lt),K instanceof Function&&K()},[ht,K]);return Ke===!1&&!Ae?(0,r.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):pt?(0,r.jsx)(g.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(se,{})}),X&&(0,r.jsx)(f.Z,{className:je.search,xs:"auto",item:!0,children:(0,r.jsx)(d.S,{entityId:Tt,entityTitle:Ae==null||($=Ae.metadata)===null||$===void 0?void 0:$.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(W.VA,{element:pt,onAppend:Ye,children:(0,r.jsx)(J,{})})})]})}):(0,r.jsx)(g.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(se,{})})})})}),ae=null},93225:function(Ct,Be,n){"use strict";n.d(Be,{S:function(){return ee}});var r=n(52322),p=n(2784),H=n(18671),f=n(60905),W=n(98069),g=n(60364),d=n(73250),B=n(61886),ye=n(43514),ue=n(25271),V=n(53974),Y=n(60871),I=n(76635),E=n(95573);const oe=(0,r.jsx)(W.Z,{animation:"wave",variant:"text",height:40}),ee=te=>{const{palette:{common:{white:Z}}}=(0,g.Z)(),{children:R}=te,P=(0,B.$L)(),L=(0,Y.h_)(Y.Ds),{title:k,setTitle:se,subtitle:Le,setSubtitle:ze,entityRef:z,metadata:{value:vt,loading:rt},entityMetadata:{value:He,loading:tt}}=(0,B.x1)();(0,p.useEffect)(()=>{vt&&(se(vt.site_name),ze(()=>{let{site_description:Se}=vt;return(!Se||Se==="None")&&(Se=""),Se}))},[vt,se,ze]);const Je=L.getOptional("app.title")||"Backstage",bt=[k,Le,Je].filter(Boolean).join(" | "),{locationMetadata:At,spec:yt}=He||{},ot=yt==null?void 0:yt.lifecycle,It=He?(0,ye.hF)(He,ue.S4):[],Mt=(0,Y.tg)(E._Z)(),Ve=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.i9,{label:(0,I.capitalize)((He==null?void 0:He.kind)||"entity"),value:(0,r.jsx)(ye.dx,{color:"inherit",entityRef:z,title:He==null?void 0:He.metadata.title,defaultKind:"Component"})}),It.length>0&&(0,r.jsx)(V.i9,{label:"Owner",value:(0,r.jsx)(ye.rI,{color:"inherit",entityRefs:It,defaultKind:"group"})}),ot?(0,r.jsx)(V.i9,{label:"Lifecycle",value:ot}):null,At&&At.type!=="dir"&&At.type!=="file"?(0,r.jsx)(V.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:Z},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(d.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:At.target}):null]});return!tt&&He===void 0||!rt&&vt===void 0?null:(0,r.jsxs)(V.h4,{type:"Documentation",typeLink:Mt,title:k||oe,subtitle:Le===""?void 0:Le||oe,children:[(0,r.jsx)(H.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:bt})}),Ve,R,P.renderComponentsByLocation(B.oZ.Header)]})}},65124:function(Ct,Be,n){"use strict";n.d(Be,{b:function(){return Y}});var r=n(52322),p=n(2784),H=n(79692),f=n(15223),W=n(95544),g=n(80030),d=n(61837),B=n(48348),ye=n(47603),ue=n(61886);const V=(0,H.Z)(I=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:I.spacing(3,3,0)}})),Y=I=>{const E=V(),[oe,ee]=(0,p.useState)(null),te=(0,p.useCallback)(Le=>{ee(Le.currentTarget)},[]),Z=(0,p.useCallback)(()=>{ee(null)},[]),{entityMetadata:{value:R,loading:P}}=(0,ue.x1)(),L=(0,ue.$L)(),k=L.renderComponentsByLocation(ue.oZ.Subheader),se=L.renderComponentsByLocation(ue.oZ.Settings);return!k&&!se||P===!1&&!R?null:(0,r.jsx)(f.Z,{classes:E,...I.toolbarProps,children:(0,r.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[k,se?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.ZP,{title:"Settings",children:(0,r.jsx)(d.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:te,children:(0,r.jsx)(ye.Z,{})})}),(0,r.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:oe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(oe),onClose:Z,keepMounted:!0,children:(0,r.jsx)("div",{children:se})})]}):null]})})}},95481:function(Ct,Be,n){"use strict";n.d(Be,{DK:function(){return Y},m1:function(){return E}});var r=n(52322),p=n(2784),H=n(73557),f=n(61886),W=n(60871),g=n(64279),d=n(77446);function B({contentLoading:oe,content:ee,activeSyncState:te}){return oe||te==="BUILD_READY_RELOAD"||!ee&&te==="CHECKING"?"CHECKING":!ee&&te==="BUILDING"?"INITIAL_BUILD":ee?te==="BUILDING"?"CONTENT_STALE_REFRESHING":te==="BUILD_READY"?"CONTENT_STALE_READY":te==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ye(oe,ee){const te={...oe};switch(ee.type){case"sync":ee.state==="CHECKING"&&(te.buildLog=[]),te.activeSyncState=ee.state,te.syncError=ee.syncError;break;case"contentLoading":te.contentLoading=!0,te.contentError=void 0;break;case"content":typeof ee.path=="string"&&(te.path=ee.path),te.contentLoading=!1,te.content=ee.content,te.contentError=ee.contentError;break;case"buildLog":te.buildLog=te.buildLog.concat(ee.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(te.activeSyncState)&&["contentLoading","content"].includes(ee.type)&&(te.activeSyncState="UP_TO_DATE",te.buildLog=[]),te}function ue(oe,ee,te,Z){var R,P;const[L,k]=(0,p.useReducer)(ye,{activeSyncState:"CHECKING",path:Z,contentLoading:!0,buildLog:[]}),se=(0,W.h_)(f.Dl),{retry:Le}=(0,d.Z)(async()=>{k({type:"contentLoading"});try{const vt=await se.getEntityDocs({kind:oe,namespace:ee,name:te},Z);return k({type:"content",content:vt,path:Z}),vt}catch(vt){k({type:"content",contentError:vt,path:Z})}},[se,oe,ee,te,Z]),ze=(0,p.useRef)({content:void 0,reload:()=>{}});return ze.current={content:L.content,reload:Le},(0,g.default)(async()=>{k({type:"sync",state:"CHECKING"});const vt=setTimeout(()=>{k({type:"sync",state:"BUILDING"})},1e3);try{switch(await se.syncEntityDocs({kind:oe,namespace:ee,name:te},He=>{k({type:"buildLog",log:He})})){case"updated":ze.current.content?k({type:"sync",state:"BUILD_READY"}):(ze.current.reload(),k({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":k({type:"sync",state:"UP_TO_DATE"});break;default:k({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(rt){k({type:"sync",state:"ERROR",syncError:rt})}finally{clearTimeout(vt)}},[oe,te,ee,se,k,ze]),{state:(0,p.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:(R=L.contentError)===null||R===void 0?void 0:R.toString(),syncErrorMessage:(P=L.syncError)===null||P===void 0?void 0:P.toString(),buildLog:L.buildLog}}const V=(0,p.createContext)({}),Y=()=>(0,p.useContext)(V),I=oe=>{const{children:ee}=oe,{"*":te=""}=(0,H.UO)(),{entityRef:Z}=(0,f.x1)(),{kind:R,namespace:P,name:L}=Z,k=ue(R,P,L,te);return(0,r.jsx)(V.Provider,{value:k,children:ee instanceof Function?ee(k):ee})},E=oe=>ee=>(0,r.jsx)(I,{children:(0,r.jsx)(oe,{...ee})})},95573:function(Ct,Be,n){"use strict";n.d(Be,{Fw:function(){return H},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),H=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Ct,Be,n){"use strict";n.r(Be),n.d(Be,{TechDocsSearchResultListItem:function(){return ue}});var r=n(52322),p=n(2784),H=n(79692),f=n(49378),W=n(86136),g=n(90436),d=n(53974),B=n(15096);const ye=(0,H.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ue=V=>{const{result:Y,highlight:I,lineClamp:E=5,asListItem:oe=!0,asLink:ee=!0,title:te,icon:Z}=V,R=ye(),P=({children:se})=>ee?(0,r.jsx)(d.rU,{noTrack:!0,to:Y.location,children:se}):(0,r.jsx)(r.Fragment,{children:se}),L=()=>{const se=I!=null&&I.fields.title?(0,r.jsx)(B.FA,{text:I.fields.title,preTag:I.preTag,postTag:I.postTag}):Y.title,Le=I!=null&&I.fields.entityTitle?(0,r.jsx)(B.FA,{text:I.fields.entityTitle,preTag:I.preTag,postTag:I.postTag}):Y.entityTitle,ze=I!=null&&I.fields.name?(0,r.jsx)(B.FA,{text:I.fields.name,preTag:I.preTag,postTag:I.postTag}):Y.name;return Y?(0,r.jsx)(f.Z,{className:R.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(P,{children:te||(0,r.jsxs)(r.Fragment,{children:[se," | ",Le!=null?Le:ze," docs"]})}),secondary:(0,r.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:E,overflow:"hidden"},color:"textSecondary",variant:"body2",children:I!=null&&I.fields.text?(0,r.jsx)(B.FA,{text:I.fields.text,preTag:I.preTag,postTag:I.postTag}):Y.text})}):null},k=({children:se})=>oe?(0,r.jsxs)(r.Fragment,{children:[Z&&(0,r.jsx)(W.Z,{children:typeof Z=="function"?Z(Y):Z}),(0,r.jsx)("div",{className:R.flexContainer,children:se})]}):(0,r.jsx)(r.Fragment,{children:se});return(0,r.jsx)(k,{children:(0,r.jsx)(L,{})})}},22478:function(Ct,Be,n){"use strict";n.d(Be,{S:function(){return V}});var r=n(52322),p=n(15096),H=n(79692),f=n(27556),W=n(2784),g=n(73557),d=n(55511);const B=(0,H.Z)(Y=>({root:{width:"100%"},bar:{padding:Y.spacing(1)}})),ye=Y=>Y==null?void 0:Y.document,ue=Y=>{const{entityId:I,entityTitle:E,debounceTime:oe=150}=Y,[ee,te]=(0,W.useState)(!1),Z=(0,g.s0)(),{setFilters:R,result:{loading:P,value:L}}=(0,p.Rx)(),k=B(),[se,Le]=(0,W.useState)([]);(0,W.useEffect)(()=>{let He=!0;if(He&&L){const tt=L.results.slice(0,10);Le(tt)}return()=>{He=!1}},[P,L]);const{kind:ze,name:z,namespace:vt}=I;(0,W.useEffect)(()=>{R(He=>({...He,kind:ze,namespace:vt,name:z}))},[ze,vt,z,R]);const rt=(He,tt)=>{if(ye(tt)){const{location:Je}=tt.document;Z(Je)}};return(0,r.jsx)(f.Z,{className:k.bar,variant:"outlined",children:(0,r.jsx)(p.qO,{classes:{root:k.root},"data-testid":"techdocs-search-bar",size:"small",open:ee,getOptionLabel:()=>"",filterOptions:He=>He,onClose:()=>{te(!1)},onFocus:()=>{te(!0)},onChange:rt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:se,renderOption:({document:He,highlight:tt})=>(0,r.jsx)(d.TechDocsSearchResultListItem,{result:He,lineClamp:3,asListItem:!1,asLink:!1,title:He.title,highlight:tt}),loading:P,inputDebounceTime:oe,inputPlaceholder:`Search ${E||I.name} docs`,freeSolo:!1})})},V=Y=>{const I={term:"",types:["techdocs"],pageCursor:"",filters:Y.entityId};return(0,r.jsx)(p.Nd,{initialState:I,children:(0,r.jsx)(ue,{...Y})})}},53260:function(){}},function(Ct){var Be=function(r){return Ct(Ct.s=r)};Ct.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Be(30966)});var n=Ct.O()}]);})();
|
|
507
|
+
|
|
508
|
+
//# sourceMappingURL=main.1628d687.js.map
|