@techdocs/cli 1.2.2-next.0 → 1.2.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.8166f056.chunk.js → 1032.98bf1656.chunk.js} +2 -2
- package/dist/embedded-app/static/1032.98bf1656.chunk.js.map +1 -0
- package/dist/embedded-app/static/{1105.11b79b14.chunk.js → 1105.c44a4e31.chunk.js} +2 -2
- package/dist/embedded-app/static/1105.c44a4e31.chunk.js.map +1 -0
- package/dist/embedded-app/static/{184.80c74c24.chunk.js → 184.9b13e518.chunk.js} +2 -2
- package/dist/embedded-app/static/184.9b13e518.chunk.js.map +1 -0
- package/dist/embedded-app/static/{2440.9db179fb.chunk.js → 2440.d2ba00eb.chunk.js} +2 -2
- package/dist/embedded-app/static/2440.d2ba00eb.chunk.js.map +1 -0
- package/dist/embedded-app/static/{5458.e03cd7d4.chunk.js → 5458.75ad4388.chunk.js} +2 -2
- package/dist/embedded-app/static/5458.75ad4388.chunk.js.map +1 -0
- package/dist/embedded-app/static/5837.b13b9c05.chunk.js +3 -0
- package/dist/embedded-app/static/5837.b13b9c05.chunk.js.map +1 -0
- package/dist/embedded-app/static/{6051.6c7c3d47.chunk.js → 6051.f45bae28.chunk.js} +1 -1
- package/dist/embedded-app/static/6051.f45bae28.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.f4a04097.chunk.js → 732.dc28074b.chunk.js} +2 -2
- package/dist/embedded-app/static/732.dc28074b.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7560.d154b9d8.chunk.js → 7560.7f574fa6.chunk.js} +2 -2
- package/dist/embedded-app/static/7560.7f574fa6.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7750.61ad3a49.chunk.js → 7750.f1fbf797.chunk.js} +2 -2
- package/dist/embedded-app/static/7750.f1fbf797.chunk.js.map +1 -0
- package/dist/embedded-app/static/{8951.30f8a439.chunk.js → 8951.dbc0ba7e.chunk.js} +2 -2
- package/dist/embedded-app/static/8951.dbc0ba7e.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9545.39a064e9.chunk.js → 9545.d96fa9ec.chunk.js} +2 -2
- package/dist/embedded-app/static/{1105.11b79b14.chunk.js.map → 9545.d96fa9ec.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.2d4c00d7.chunk.js → 9770.f5e0b19c.chunk.js} +2 -2
- package/dist/embedded-app/static/9770.f5e0b19c.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.1f9a3ef4.js +492 -0
- package/dist/embedded-app/static/main.1f9a3ef4.js.map +1 -0
- package/dist/embedded-app/static/module-luxon.f67513b2.js +3 -0
- package/dist/embedded-app/static/module-luxon.f67513b2.js.map +1 -0
- package/dist/embedded-app/static/{module-material-ui.3f40a11a.js → module-material-ui.e3edf608.js} +2 -2
- package/dist/embedded-app/static/module-material-ui.e3edf608.js.map +1 -0
- package/dist/embedded-app/static/{module-octokit.47a26b3b.js → module-octokit.67523b24.js} +3 -3
- package/dist/embedded-app/static/module-octokit.67523b24.js.map +1 -0
- package/dist/embedded-app/static/{runtime.e4032bfd.js → runtime.1f9a3ef4.js} +2 -2
- package/dist/embedded-app/static/{runtime.e4032bfd.js.map → runtime.1f9a3ef4.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.e4032bfd.js → vendor.1f9a3ef4.js} +1 -1
- package/dist/embedded-app/static/{vendor.e4032bfd.js.map → vendor.1f9a3ef4.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/1032.8166f056.chunk.js.map +0 -1
- package/dist/embedded-app/static/184.80c74c24.chunk.js.map +0 -1
- package/dist/embedded-app/static/2440.9db179fb.chunk.js.map +0 -1
- package/dist/embedded-app/static/5458.e03cd7d4.chunk.js.map +0 -1
- package/dist/embedded-app/static/5837.a7d76c38.chunk.js +0 -3
- package/dist/embedded-app/static/5837.a7d76c38.chunk.js.map +0 -1
- package/dist/embedded-app/static/6051.6c7c3d47.chunk.js.map +0 -1
- package/dist/embedded-app/static/732.f4a04097.chunk.js.map +0 -1
- package/dist/embedded-app/static/7560.d154b9d8.chunk.js.map +0 -1
- package/dist/embedded-app/static/7750.61ad3a49.chunk.js.map +0 -1
- package/dist/embedded-app/static/8951.30f8a439.chunk.js.map +0 -1
- package/dist/embedded-app/static/9545.39a064e9.chunk.js.map +0 -1
- package/dist/embedded-app/static/9770.2d4c00d7.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.e4032bfd.js +0 -492
- package/dist/embedded-app/static/main.e4032bfd.js.map +0 -1
- package/dist/embedded-app/static/module-luxon.b057ddad.js +0 -3
- package/dist/embedded-app/static/module-luxon.b057ddad.js.map +0 -1
- package/dist/embedded-app/static/module-material-ui.3f40a11a.js.map +0 -1
- package/dist/embedded-app/static/module-octokit.47a26b3b.js.map +0 -1
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{29644:function(bt,Oe,t){"use strict";t.d(Oe,{n3:function(){return W},MS:function(){return S}});var h=t(25271),n=t(23054),v=t(96279),I=t.n(v);const W=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class S{async getEntityAncestors(B,se){const{kind:X,namespace:q,name:F}=(0,h.of)(B.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(X)}/${encodeURIComponent(q)}/${encodeURIComponent(F)}/ancestry`,se)}async getLocationById(B,se){return await this.requestOptional("GET",`/locations/${encodeURIComponent(B)}`,se)}async getEntities(B,se){const{filter:X=[],fields:q=[],offset:F,limit:Q,after:Y}=B!=null?B:{},ue=[];for(const D of[X].flat()){const L=[];for(const[T,re]of Object.entries(D))for(const xe of[re].flat())xe===W?L.push(encodeURIComponent(T)):typeof xe=="string"&&L.push(`${encodeURIComponent(T)}=${encodeURIComponent(xe)}`);L.length&&ue.push(`filter=${L.join(",")}`)}q.length&&ue.push(`fields=${q.map(encodeURIComponent).join(",")}`),F!==void 0&&ue.push(`offset=${F}`),Q!==void 0&&ue.push(`limit=${Q}`),Y!==void 0&&ue.push(`after=${encodeURIComponent(Y)}`);const le=ue.length?`?${ue.join("&")}`:"",P=await this.requestRequired("GET",`/entities${le}`,se),R=(D,L)=>{var T,re;if(((T=D.metadata)===null||T===void 0?void 0:T.name)===void 0||D.kind===void 0||((re=L.metadata)===null||re===void 0?void 0:re.name)===void 0||L.kind===void 0)return 0;const xe=(0,h.eE)(D),Ke=(0,h.eE)(L);return xe<Ke?-1:xe>Ke?1:0};return{items:P.sort(R)}}async getEntityByRef(B,se){const{kind:X,namespace:q,name:F}=(0,h.of)(B);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(X)}/${encodeURIComponent(q)}/${encodeURIComponent(F)}`,se)}async getEntityByName(B,se){const{kind:X,namespace:q="default",name:F}=B;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(X)}/${encodeURIComponent(q)}/${encodeURIComponent(F)}`,se)}async refreshEntity(B,se){const X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(se==null?void 0:se.token)&&{Authorization:`Bearer ${se==null?void 0:se.token}`}},method:"POST",body:JSON.stringify({entityRef:B})});if(X.status!==200)throw new Error(await X.text())}async getEntityFacets(B,se){const{filter:X=[],facets:q}=B,F=[];for(const Y of[X].flat()){const ue=[];for(const[le,P]of Object.entries(Y))for(const R of[P].flat())R===W?ue.push(encodeURIComponent(le)):typeof R=="string"&&ue.push(`${encodeURIComponent(le)}=${encodeURIComponent(R)}`);ue.length&&F.push(`filter=${ue.join(",")}`)}for(const Y of q)F.push(`facet=${encodeURIComponent(Y)}`);const Q=F.length?`?${F.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${Q}`,se)}async addLocation(B,se){const{type:X="url",target:q,dryRun:F}=B,Q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${F?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(se==null?void 0:se.token)&&{Authorization:`Bearer ${se==null?void 0:se.token}`}},method:"POST",body:JSON.stringify({type:X,target:q})});if(Q.status!==201)throw new Error(await Q.text());const{location:Y,entities:ue,exists:le}=await Q.json();if(!Y)throw new Error(`Location wasn't added: ${q}`);return{location:Y,entities:ue,exists:le}}async getLocationByRef(B,se){return(await this.requestRequired("GET","/locations",se)).map(q=>q.data).find(q=>B===(0,h.NZ)(q))}async removeLocationById(B,se){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(B)}`,se)}async removeEntityByUid(B,se){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(B)}`,se)}async validateEntity(B,se,X){const q=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(X==null?void 0:X.token)&&{Authorization:`Bearer ${X==null?void 0:X.token}`}},method:"POST",body:JSON.stringify({entity:B,location:se})});if(q.ok)return{valid:!0};if(q.status!==400)throw await n.VL.fromResponse(q);const{errors:F=[]}=await q.json();return{valid:!1,errors:F}}async requestIgnored(B,se,X){const q=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,F=X!=null&&X.token?{Authorization:`Bearer ${X.token}`}:{},Q=await this.fetchApi.fetch(q,{method:B,headers:F});if(!Q.ok)throw await n.VL.fromResponse(Q)}async requestRequired(B,se,X){const q=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,F=X!=null&&X.token?{Authorization:`Bearer ${X.token}`}:{},Q=await this.fetchApi.fetch(q,{method:B,headers:F});if(!Q.ok)throw await n.VL.fromResponse(Q);return await Q.json()}async requestOptional(B,se,X){const q=`${await this.discoveryApi.getBaseUrl("catalog")}${se}`,F=X!=null&&X.token?{Authorization:`Bearer ${X.token}`}:{},Q=await this.fetchApi.fetch(q,{method:B,headers:F});if(!Q.ok){if(Q.status===404)return;throw await n.VL.fromResponse(Q)}return await Q.json()}constructor(B){this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi||{fetch:I()}}}},25271:function(bt,Oe,t){"use strict";t.d(Oe,{Tf:function(){return v},P1:function(){return he},q1:function(){return te},M6:function(){return Te},l2:function(){return n},zG:function(){return h},w$:function(){return un},nP:function(){return wn},aS:function(){return Cn},S4:function(){return Bt},cz:function(){return Rn},iB:function(){return ct},CV:function(){return J},of:function(){return it},Ou:function(){return ke},eE:function(){return rt},NZ:function(){return Je}});const h="default",n="backstage.io/view-url",v="backstage.io/edit-url",I="kubernetes.io/api-server",W="kubernetes.io/api-server-certificate-authority",S="kubernetes.io/auth-provider";var l=t(76635),B=t.n(l);class se{async enforce(g){return g.metadata.namespace?g:lodash.merge({metadata:{namespace:this.namespace}},g)}constructor(g=DEFAULT_NAMESPACE){this.namespace=g}}class X{static isValidPrefixAndOrSuffix(g,k,G,ce){if(typeof g!="string")return!1;const ge=g.split(k);return ge.length===1?ce(ge[0]):ge.length===2?G(ge[0])&&ce(ge[1]):!1}static isJsonSafe(g){try{return B().isEqual(g,JSON.parse(JSON.stringify(g)))}catch{return!1}}static isValidDnsSubdomain(g){return typeof g=="string"&&g.length>=1&&g.length<=253&&g.split(".").every(X.isValidDnsLabel)}static isValidDnsLabel(g){return typeof g=="string"&&g.length>=1&&g.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(g)}static isValidTag(g){return typeof g=="string"&&g.length>=1&&g.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(g)}static isValidUrl(g){if(typeof g!="string")return!1;try{return new URL(g),!0}catch{return!1}}static isValidString(g){var k;return typeof g=="string"&&((k=g==null?void 0:g.trim())===null||k===void 0?void 0:k.length)>=1}static isNonEmptyString(g){var k;return typeof g=="string"&&((k=g==null?void 0:g.trim())===null||k===void 0?void 0:k.length)>=1}}var q=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),F=t(27991),Q=t.n(F),Y=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"}}}`),ue=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}}}}}}'),le=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 P=new Map,R=[q,Y,ue,le];function D(y){if(!(y!=null&&y.length))throw new TypeError("Unknown error");const g=y[0];throw new TypeError(`${g.instancePath||"<root>"} ${g.message}${g.params?` - ${Object.entries(g.params).map(([k,G])=>`${k}: ${G}`).join(", ")}`:""}`)}function L(y,g={}){var k;const G=(k=g==null?void 0:g.disableCache)!==null&&k!==void 0?k:!1,ce=G?"":JSON.stringify(y);if(!G){const _e=P.get(ce);if(_e)return _e}const ge=T(y),Fe=new(Q())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});ge.length&&Fe.addSchema(ge,void 0,void 0,!0);const st=Fe.compile(y);return G||P.set(ce,st),st}function T(y){if(typeof y!="object")return[];const g=new Set;y.$id&&g.add(y.$id);const k=new Array,G=[y];for(;G.length;){const ce=G.pop();for(const ge of re(ce))if(!g.has(ge)){g.add(ge);const Fe=R.find(st=>st.$id===ge);Fe&&(k.push(Fe),G.push(Fe))}}return k}function*re(y){const g=[y];for(;g.length;){const k=g.pop();if(typeof k=="object"&&k)for(const[G,ce]of Object.entries(k))G==="$ref"&&typeof ce=="string"?yield ce.split("#")[0]:g.push(ce)}}function xe(y){const g=compileAjvSchema(y||entityEnvelopeSchema);return k=>{if(g(k)===!0)return k;throw throwAjvError(g.errors)}}function Ke(y){const g=L(y);return k=>{var G;if(g(k)===!0)return k;const ge=(G=g.errors)===null||G===void 0?void 0:G.filter(Fe=>["/kind","/apiVersion"].includes(Fe.instancePath));if((ge==null?void 0:ge.length)&&ge.every(Fe=>Fe.keyword==="enum"))return!1;throw D(g.errors)}}function Ye(y){const g=compileAjvSchema(y||entitySchema);return k=>{if(g(k)===!0)return k;throw throwAjvError(g.errors)}}class He{static isValidApiVersion(g){return X.isValidPrefixAndOrSuffix(g,"/",X.isValidDnsSubdomain,k=>k.length>=1&&k.length<=63&&/^[a-z0-9A-Z]+$/.test(k))}static isValidKind(g){return typeof g=="string"&&g.length>=1&&g.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(g)}static isValidObjectName(g){return typeof g=="string"&&g.length>=1&&g.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(g)}static isValidNamespace(g){return X.isValidDnsLabel(g)}static isValidLabelKey(g){return X.isValidPrefixAndOrSuffix(g,"/",X.isValidDnsSubdomain,He.isValidObjectName)}static isValidLabelValue(g){return g===""||He.isValidObjectName(g)}static isValidAnnotationKey(g){return X.isValidPrefixAndOrSuffix(g,"/",X.isValidDnsSubdomain,He.isValidObjectName)}static isValidAnnotationValue(g){return typeof g=="string"}}const We={isValidApiVersion:He.isValidApiVersion,isValidKind:He.isValidKind,isValidEntityName:He.isValidObjectName,isValidNamespace:He.isValidNamespace,isValidLabelKey:He.isValidLabelKey,isValidLabelValue:He.isValidLabelValue,isValidAnnotationKey:He.isValidAnnotationKey,isValidAnnotationValue:He.isValidAnnotationValue,isValidTag:y=>typeof y=="string"&&y.length>=1&&y.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(y)};function Ge(y={}){return{...We,...y}}class Ne{async enforce(g){function k(j,U,ne){if(U==null)throw new Error(`${j} must have a value`);let de;try{de=ne(U)}catch(je){throw new Error(`${j} could not be validated, ${je}`)}if(!de){let je;switch(ne.name){case"isValidLabelValue":case"isValidObjectName":je="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":je="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":je="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":je="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":je="a string";break;case"isValidKind":je="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":je="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":je="a non empty string";break;default:je=void 0;break}const Se=je?` expected ${je} but found "${U}".`:"";throw new Error(`"${j}" is not valid;${Se} 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 G(j,U,ne){return U===void 0||k(j,U,ne)}k("apiVersion",g.apiVersion,this.validators.isValidApiVersion),k("kind",g.kind,this.validators.isValidKind),k("metadata.name",g.metadata.name,this.validators.isValidEntityName),G("metadata.namespace",g.metadata.namespace,this.validators.isValidNamespace);var ce;for(const[j,U]of Object.entries((ce=g.metadata.labels)!==null&&ce!==void 0?ce:[]))k(`labels.${j}`,j,this.validators.isValidLabelKey),k(`labels.${j}`,U,this.validators.isValidLabelValue);var ge;for(const[j,U]of Object.entries((ge=g.metadata.annotations)!==null&&ge!==void 0?ge:[]))k(`annotations.${j}`,j,this.validators.isValidAnnotationKey),k(`annotations.${j}`,U,this.validators.isValidAnnotationValue);var Fe;const st=(Fe=g.metadata.tags)!==null&&Fe!==void 0?Fe:[];for(let j=0;j<st.length;++j)k(`tags.${j}`,st[j],this.validators.isValidTag);var _e;const vt=(_e=g.metadata.links)!==null&&_e!==void 0?_e:[];for(let j=0;j<vt.length;++j){var ft,ht,Et;k(`links.${j}.url`,(ft=vt[j])===null||ft===void 0?void 0:ft.url,CommonValidatorFunctions.isValidUrl),G(`links.${j}.title`,(ht=vt[j])===null||ht===void 0?void 0:ht.title,CommonValidatorFunctions.isNonEmptyString),G(`links.${j}.icon`,(Et=vt[j])===null||Et===void 0?void 0:Et.icon,KubernetesValidatorFunctions.isValidObjectName)}return g}constructor(g=makeValidator()){this.validators=g}}class Me{async enforce(g){if(!this.validate){const ce=new Ajv({allowUnionTypes:!0});this.validate=ce.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(g)===!0)return g;const[G]=this.validate.errors||[];throw G?new Error(`Malformed envelope, ${G.instancePath||"<root>"} ${G.message}`):new Error("Malformed envelope, Unknown error")}}function qe(y){let g=y.indexOf(":");const k=y.indexOf("/");k!==-1&&k<g&&(g=-1);const G=g===-1?void 0:y.slice(0,g),ce=k===-1?void 0:y.slice(g+1,k),ge=y.slice(Math.max(g+1,k+1));if(G===""||ce===""||ge==="")throw new TypeError(`Entity reference "${y}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:G,namespace:ce,name:ge}}function ct(y){return{kind:y.kind,namespace:y.metadata.namespace||h,name:y.metadata.name}}function it(y,g){if(!y)throw new Error("Entity reference must not be empty");const k=g==null?void 0:g.defaultKind,G=(g==null?void 0:g.defaultNamespace)||h;let ce,ge,Fe;if(typeof y=="string"){const ht=qe(y);var st;ce=(st=ht.kind)!==null&&st!==void 0?st:k;var _e;ge=(_e=ht.namespace)!==null&&_e!==void 0?_e:G,Fe=ht.name}else{var vt;ce=(vt=y.kind)!==null&&vt!==void 0?vt:k;var ft;ge=(ft=y.namespace)!==null&&ft!==void 0?ft:G,Fe=y.name}if(ce)if(ge){if(!Fe){const ht=JSON.stringify(y);throw new Error(`Entity reference ${ht} had missing or empty name`)}}else{const ht=JSON.stringify(y);throw new Error(`Entity reference ${ht} had missing or empty namespace`)}else{const ht=JSON.stringify(y);throw new Error(`Entity reference ${ht} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:ce,namespace:ge,name:Fe}}function rt(y){let g,k,G;if("metadata"in y){g=y.kind;var ce;k=(ce=y.metadata.namespace)!==null&&ce!==void 0?ce:h,G=y.metadata.name}else{g=y.kind;var ge;k=(ge=y.namespace)!==null&&ge!==void 0?ge:h,G=y.name}return`${g.toLocaleLowerCase("en-US")}:${k.toLocaleLowerCase("en-US")}/${G.toLocaleLowerCase("en-US")}`}class Ae{async enforce(g){let k=g;for(const G of this.policies){const ce=await G.enforce(k);if(!ce)throw new Error(`Policy ${G.constructor.name} did not return a result`);k=ce}return k}constructor(g){this.policies=g}}class tt{async enforce(g){for(const k of this.policies){const G=await k.enforce(g);if(G)return G}throw new Error("The entity did not match any known policy")}constructor(g){this.policies=g}}const mt={allOf(y){return new Ae(y)},oneOf(y){return new tt(y)}};var Le=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function ae(y){let g;return{async check(k){return g||(g=Ke(y)),g(k)===k}}}const Ce=ae(Le);var Ie=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 nt=ae(Ie);var gt=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 Tt=ae(gt);var at=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const St=ae(at);var wt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const Lt=ae(wt),Bt="ownedBy",jt="ownerOf",Ut="consumesApi",Zt="apiConsumedBy",en="providesApi",rn="apiProvidedBy",wn="dependsOn",un="dependencyOf",kn="parentOf",sn="childOf",Vn="memberOf",Mt="hasMember",Rn="partOf",Cn="hasPart";var on=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 an=ae(on);var tn=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 ln=ae(tn);var fn=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 nn=ae(fn),he="backstage.io/managed-by-location",te="backstage.io/managed-by-origin-location",Te="backstage.io/source-location";function ke(y){if(typeof y!="string")throw new TypeError(`Unable to parse location ref '${y}', unexpected argument ${typeof y}`);const g=y.indexOf(":");if(g<0)throw new TypeError(`Unable to parse location ref '${y}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const k=y.substring(0,g).trim(),G=y.substring(g+1).trim();if(!k||!G)throw new TypeError(`Unable to parse location ref '${y}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(k==="http"||k==="https")throw new TypeError(`Invalid location ref '${y}', please prefix it with 'url:', e.g. 'url:${y}'`);return{type:k,target:G}}function Je(y){const{type:g,target:k}=y;if(g){if(!k)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${g}:${k}`}function J(y){var g,k,G,ce,ge;const Fe=(ge=(g=y.metadata)===null||g===void 0||(k=g.annotations)===null||k===void 0?void 0:k[Te])!==null&&ge!==void 0?ge:(G=y.metadata)===null||G===void 0||(ce=G.annotations)===null||ce===void 0?void 0:ce[he];if(!Fe)throw new Error(`Entity '${rt(y)}' is missing location`);return ke(Fe)}},71399:function(bt,Oe,t){"use strict";t.d(Oe,{zx:function(){return Ye},Oi:function(){return Ae},VY:function(){return ji},yW:function(){return Ua},XF:function(){return Le},mn:function(){return Te},NX:function(){return h},ub:function(){return vt},mf:function(){return Wa},yu:function(){return w},h4:function(){return Bi},M6:function(){return ts},i9:function(){return nl},aR:function(){return Ei},rJ:function(){return xr},Oh:function(){return cl},hu:function(){return il},rU:function(){return xe},nU:function(){return os},sk:function(){return Et},Or:function(){return ls},T3:function(){return Di},g9:function(){return hl},Ex:function(){return ds},Gk:function(){return A},tn:function(){return Ai},Ph:function(){return Gt},YE:function(){return Jo},v7:function(){return _i},R6:function(){return wi},tR:function(){return Zo},uw:function(){return ha},qt:function(){return vi},iA:function(){return $i},GB:function(){return $n},po:function(){return rr},mZ:function(){return As},Pf:function(){return kr}});var h={};t.r(h),t.d(h,{Nm:function(){return ae},ht:function(){return nt},LJ:function(){return Ie}});var n=t(52322),v=t(2784),I=t(25248),W=t(19928);function S(e){const[s,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:p={vertical:"top",horizontal:"center"}}=e;if(useEffect(()=>{const Z=d.alert$().subscribe(H=>i(N=>N.concat(H)));return()=>{Z.unsubscribe()}},[d]),s.length===0)return null;const[m]=s,E=()=>{i(Z=>Z.filter(H=>H!==m))};return _jsx(Snackbar,{open:!0,anchorOrigin:p,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:E,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:m.severity,children:_jsxs("span",{children:[m.message.toString(),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var l=t(79692),B=t(12420);const se=(0,l.Z)(e=>(0,B.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function X(e){const{displayName:s,picture:i,customStyles:d}=e,p=se();let m={...d};return i||(m={backgroundColor:stringToColor(s||""),...d}),_jsx(MaterialAvatar,{alt:s,src:i,className:p.avatar,style:m,children:s&&extractInitials(s)})}var q=t(77277),F=t(72779),Q=t.n(F),Y=t(86689),ue=t(62833),le=t(76635);const P=(0,l.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),R=e=>/^([a-z+.-]+):/.test(e),D=()=>{try{return(0,I.h_)(I.Ds).getOptionalString("app.baseUrl")}catch{return}},L=()=>{const e="http://dummy.dev";var s;const i=(s=D())!==null&&s!==void 0?s:"/",{pathname:d}=new URL(i,e);return(0,le.trimEnd)(d,"/")},T=e=>{let s=String(e);const i=L(),d=R(s),p=s.startsWith(i);return!d&&!p&&(s=i.concat(s)),s},re=e=>{if(e instanceof Array)return e.map(re).join(" ").trim();if(typeof e=="object"&&e){var s;return re(e==null||(s=e.props)===null||s===void 0?void 0:s.children)}return["string","number"].includes(typeof e)?String(e):""},xe=v.forwardRef(({onClick:e,noTrack:s,...i},d)=>{const p=P(),m=(0,I.z$)(),E=T(i.to),Z=re(i.children)||E,H=R(E),N=H&&!!/^https?:/.exec(E),ve=ie=>{e==null||e(ie),s||m.captureEvent("click",Z,{attributes:{to:E}})};return H?(0,n.jsxs)(Y.Z,{...N?{target:"_blank",rel:"noopener"}:{},...i,ref:d,href:E,onClick:ve,className:Q()(p.externalLink,i.className),children:[i.children,(0,n.jsx)("span",{className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(Y.Z,{...i,ref:d,component:ue.rU,to:E,onClick:ve})}),Ke=v.forwardRef((e,s)=>(0,n.jsx)(xe,{ref:s,...e,color:"initial"})),Ye=v.forwardRef((e,s)=>(0,n.jsx)(q.Z,{ref:s,component:Ke,...e}));var He=t(60364),We=t(61837),Ge=t(80030),Ne=t(19353),Me=t(95074);function qe(e){const{text:s,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard","aria-label":p="Copy text"}=e,m=(0,I.h_)(I.VE),[E,Z]=(0,v.useState)(!1),[{error:H},N]=(0,Me.Z)();(0,v.useEffect)(()=>{H&&m.post(H)},[H,m]);const ve=ie=>{ie.stopPropagation(),Z(!0),N(s)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ge.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>Z(!1),open:E,children:(0,n.jsx)(We.Z,{onClick:ve,"aria-label":p,children:(0,n.jsx)(Ne.Z,{})})})})}var ct=t(83229),it=t(26639),rt=t(39595);function Ae(e){const{text:s,language:i,showLineNumbers:d=!1,highlightedNumbers:p,customStyle:m,showCopyCodeButton:E=!1}=e,Z=(0,He.Z)(),H=Z.palette.type==="dark"?it.Z:rt.Z,N=Z.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)(ct.Z,{customStyle:m,language:i,style:H,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:Z.palette.textVerySubtle},lineProps:ve=>p!=null&&p.includes(ve)?{style:{backgroundColor:N}}:{},children:s}),E&&(0,n.jsx)("div",{style:{position:"absolute",top:0,right:0},children:(0,n.jsx)(qe,{text:s})})]})}var tt=t(41156),mt=t(88188);function Le(e){const{title:s,to:i}=e,d=(0,tt.Z)(p=>p.breakpoints.down("xs"));return i?d?(0,n.jsx)(We.Z,{component:ue.rU,color:"primary",title:s,size:"small",to:i,children:(0,n.jsx)(mt.Z,{})}):(0,n.jsx)(q.Z,{component:ue.rU,variant:"contained",color:"primary",to:i,children:s}):null}var ae;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(ae||(ae={}));var Ce;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(Ce||(Ce={}));var Ie;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Ie||(Ie={}));var nt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(nt||(nt={}));var gt=t(27397),Tt=t(11105),at=t(97963),St=t(46506),wt=t.n(St),Lt=t(54073),Bt=t.n(Lt),jt=t(10368);const Ut=(0,l.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Zt({node:{id:e}}){const s=Ut(),[i,d]=v.useState(0),[p,m]=v.useState(0),E=v.useRef(null);v.useLayoutEffect(()=>{if(E.current){let{height:ve,width:ie}=E.current.getBBox();ve=Math.round(ve),ie=Math.round(ie),(ve!==p||ie!==i)&&(d(ie),m(ve))}},[i,p]);const Z=10,H=i+Z*2,N=p+Z*2;return(0,n.jsxs)("g",{children:[(0,n.jsx)("rect",{className:s.node,width:H,height:N,rx:10}),(0,n.jsx)("text",{ref:E,className:s.text,y:N/2,x:H/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const en="arrow-marker",rn="node",wn="edge",un="label",kn=(0,jt.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),sn=e=>(0,n.jsx)(Zt,{...e});function Vn({render:e=sn,setNode:s,node:i}){const{width:d,height:p,x:m=0,y:E=0}=i,Z=i,H=kn(),N=v.useRef(null);return v.useLayoutEffect(()=>{if(N.current){let{height:ve,width:ie}=N.current.getBBox();ve=Math.round(ve),ie=Math.round(ie),(ve!==p||ie!==d)&&s(i.id,{...i,height:ve,width:ie})}},[i,d,p,s]),(0,n.jsx)("g",{ref:N,"data-testid":rn,className:H.node,transform:`translate(${m-d/2},${E-p/2})`,children:e({node:Z})})}var Mt=t(55876),Rn=t(66481),Cn=t(19574),on=t.n(Cn);const an=(0,jt.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function tn({edge:{label:e}}){const s=an();return(0,n.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const ln=(0,jt.Z)(e=>({path:{strokeWidth:2,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),fn=e=>(0,n.jsx)(tn,{...e}),nn=Mt.Z().x(e=>e.x).y(e=>e.y).curve(Rn.Z);function he({render:e=fn,setEdge:s,id:i,edge:d}){const{x:p=0,y:m=0,width:E,height:Z,points:H}=d,N=d,ve=ln(),ie=v.useRef(null);v.useLayoutEffect(()=>{if(ie.current){let{height:Ee,width:De}=ie.current.getBBox();Ee=Math.round(Ee),De=Math.round(De),(Ee!==Z||De!==E)&&s(i,{...d,height:Ee,width:De})}},[d,Z,E,s,i]);let fe="";if(H){const Ee=H.filter(De=>on()(De.x)&&on()(De.y));fe=nn(Ee)||""}return(0,n.jsxs)(n.Fragment,{children:[fe&&(0,n.jsx)("path",{"data-testid":wn,className:ve.path,markerEnd:`url(#${en})`,d:fe}),N.label?(0,n.jsx)("g",{ref:ie,"data-testid":un,className:ve.label,transform:`translate(${p},${m})`,children:e({edge:N})}):null]})}const te="workspace";function Te(e){var s,i;const{edges:d,nodes:p,renderNode:m,direction:E=ae.TOP_BOTTOM,align:Z,nodeMargin:H=50,edgeMargin:N=10,rankMargin:ve=50,paddingX:ie=0,paddingY:fe=0,acyclicer:Ee,ranker:De=Ie.NETWORK_SIMPLEX,labelPosition:ut=nt.RIGHT,labelOffset:$t=10,edgeRanks:Vt=1,edgeWeight:Yt=1,renderLabel:Jt,defs:At,zoom:Kt="enabled",...Ht}=e,dr=(0,at.Z)(),[Yn,ur]=v.useState(100),[hr,si]=v.useState(100),Ft=v.useRef(new(wt()).graphlib.Graph),[qr,lo]=v.useState(((s=Ft.current.graph())===null||s===void 0?void 0:s.width)||0),[_r,co]=v.useState(((i=Ft.current.graph())===null||i===void 0?void 0:i.height)||0),[uo,oi]=v.useState([]),[bn,or]=v.useState([]),Jn=Math.max(qr,Yn),Wn=Math.max(_r,hr),pn=v.useMemo(()=>Bt()(_t=>{if(!_t)return;const Sn=Tt.Z(_t),qt=Tt.Z(_t.getElementById(te));function Qn(){Sn.call(gt.sP().scaleExtent([1,10]).on("zoom",pr=>{pr.transform.x=Math.min(0,Math.max(pr.transform.x,Jn-Jn*pr.transform.k)),pr.transform.y=Math.min(0,Math.max(pr.transform.y,Wn-Wn*pr.transform.k)),qt.attr("transform",pr.transform)}))}Kt==="enabled"?Qn():Kt==="enable-on-click"&&Sn.on("click",()=>Qn());const{width:Xn,height:ho}=_t.getBoundingClientRect();Yn!==Xn&&ur(Xn),hr!==ho&&si(ho)},100),[hr,Yn,Jn,Wn,Kt]),In=v.useCallback(()=>{const _t=Ft.current.nodes(),Sn=Ft.current.edges();_t.forEach(qt=>{p.some(Xn=>Xn.id===qt)||Ft.current.removeNode(qt)}),Sn.forEach(qt=>{d.some(Xn=>Xn.from===qt.v&&Xn.to===qt.w)||Ft.current.removeEdge(qt.v,qt.w)}),p.forEach(qt=>{const Qn=Ft.current.nodes().find(Xn=>qt.id===Xn);if(Qn&&Ft.current.node(Qn)){const{width:Xn,height:ho,x:pr,y:Rl}=Ft.current.node(Qn);Ft.current.setNode(Qn,{...qt,width:Xn,height:ho,x:pr,y:Rl})}else Ft.current.setNode(qt.id,{...qt,width:0,height:0})}),d.forEach(qt=>{Ft.current.setEdge(qt.from,qt.to,{...qt,label:qt.label,width:0,height:0,labelpos:ut,labeloffset:$t,weight:Yt,minlen:Vt})})},[d,p,ut,$t,Yt,Vt]),ir=v.useMemo(()=>Bt()(()=>{wt().layout(Ft.current);const{height:_t,width:Sn}=Ft.current.graph(),qt=Math.max(0,_t||0),Qn=Math.max(0,Sn||0);lo(Qn),co(qt),oi(Ft.current.nodes()),or(Ft.current.edges())},250,{leading:!0}),[]);v.useEffect(()=>(Ft.current.setGraph({rankdir:E,align:Z,nodesep:H,edgesep:N,ranksep:ve,marginx:ie,marginy:fe,acyclicer:Ee,ranker:De}),In(),ir(),ir.cancel),[Ee,Z,E,N,ie,fe,H,ve,De,In,ir]);function Or(_t,Sn){return Ft.current.setNode(_t,Sn),ir(),Ft.current}function Is(_t,Sn){return Ft.current.setEdge(_t,Sn),ir(),Ft.current}return(0,n.jsxs)("svg",{ref:pn,...Ht,width:"100%",height:Wn,viewBox:`0 0 ${Jn} ${Wn}`,children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("marker",{id:en,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,n.jsx)("path",{fill:dr.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),At]}),(0,n.jsx)("g",{id:te,children:(0,n.jsxs)("svg",{width:qr,height:_r,y:Wn/2-_r/2,x:Jn/2-qr/2,viewBox:`0 0 ${qr} ${_r}`,children:[bn.map(_t=>{const Sn=Ft.current.edge(_t);return Sn?(0,n.jsx)(he,{id:_t,setEdge:Is,render:Jt,edge:Sn},`${_t.v}-${_t.w}`):null}),uo.map(_t=>{const Sn=Ft.current.node(_t);return Sn?(0,n.jsx)(Vn,{setNode:Or,render:m,node:Sn},_t):null})]})})]})}var ke;const Je=(0,l.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:20},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(ke=e.palette.banner.warning)!==null&&ke!==void 0?ke:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),J=e=>{const{variant:s,message:i,id:d,fixed:p=!1}=e,m=Je(),Z=useApi(storageApiRef).forBucket("notifications");var H;const N=(H=Z.snapshot("dismissedBanners").value)!==null&&H!==void 0?H:[],[ve,ie]=useState(new Set(N)),fe=useObservable(Z.observe$("dismissedBanners"));useEffect(()=>{if(fe!=null&&fe.value){var De;const ut=(De=fe==null?void 0:fe.value)!==null&&De!==void 0?De:[];ie(new Set(ut))}},[fe==null?void 0:fe.value]);const Ee=()=>{Z.set("dismissedBanners",[...ve,d])};return _jsx(Snackbar,{anchorOrigin:p?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ve.has(d),classes:{root:classNames(m.root,!p&&m.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(m.content,m[s]),message:m.message},message:i,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Ee,children:_jsx(Close,{className:m.icon})},"dismiss")]})})};var y=t(60905),g=t(90436),k=t.p+"static/missingAnnotation.67f79e98..svg",G=t.p+"static/noInformation.4b426325..svg",ce=t.p+"static/createComponent.975d1e1e..svg",ge=t.p+"static/noBuild.1715fa71..svg";const Fe=(0,l.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),st=({missing:e})=>{const s=Fe();switch(e){case"field":return(0,n.jsx)("img",{src:k,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,n.jsx)("img",{src:G,alt:"no Information",className:s.generalImg});case"content":return(0,n.jsx)("img",{src:ce,alt:"create Component",className:s.generalImg});case"data":return(0,n.jsx)("img",{src:ge,alt:"no Build",className:s.generalImg});default:return null}},_e=(0,l.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function vt(e){const{title:s,description:i,missing:d,action:p}=e,m=_e();return(0,n.jsxs)(y.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:m.root,spacing:2,children:[(0,n.jsx)(y.Z,{item:!0,xs:12,md:6,children:(0,n.jsxs)(y.Z,{container:!0,direction:"column",children:[(0,n.jsx)(y.Z,{item:!0,xs:!0,children:(0,n.jsx)(g.Z,{variant:"h5",children:s})}),(0,n.jsx)(y.Z,{item:!0,xs:!0,children:(0,n.jsx)(g.Z,{variant:"body1",children:i})}),(0,n.jsx)(y.Z,{item:!0,xs:!0,className:m.action,children:p})]})}),(0,n.jsx)(y.Z,{item:!0,xs:12,md:6,className:m.imageContainer,children:typeof d=="string"?(0,n.jsx)(st,{missing:d}):d.customImage})]})}const ft=`apiVersion: backstage.io/v1alpha1
|
|
2
|
-
kind: Component
|
|
3
|
-
metadata:
|
|
4
|
-
name: example
|
|
5
|
-
description: example.com
|
|
6
|
-
annotations:
|
|
7
|
-
ANNOTATION: value
|
|
8
|
-
spec:
|
|
9
|
-
type: website
|
|
10
|
-
lifecycle: production
|
|
11
|
-
owner: user:guest`,ht=(0,l.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":"#fff"}}),{name:"BackstageMissingAnnotationEmptyState"});function Et(e){const{annotation:s,readMoreUrl:i}=e,d=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",p=ht(),m=(0,n.jsxs)(n.Fragment,{children:["The ",(0,n.jsx)("code",{children:s})," annotation is missing. You need to add the annotation to your component if you want to enable this tool."]});return(0,n.jsx)(vt,{missing:"field",title:"Missing Annotation",description:m,action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:p.code,children:(0,n.jsx)(Ae,{text:ft.replace("ANNOTATION",s),language:"yaml",showLineNumbers:!0,highlightedNumbers:[6,7],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(q.Z,{color:"primary",component:xe,to:d,children:"Read more"})]})})}var j=t(11776),U=t(38402),ne=t(49378),de=t(41128),je=t(27616),Se=t(8284),Qe=t(70660),pt=t(91750),Xe=t(38016);const dt=(e,s)=>(s.palette.type==="light"?de._j:de.$n)(s.palette[e].light,.6),Dt=(e,s)=>(s.palette.type==="light"?de.$n:de._j)(s.palette[e].light,.9),It=(0,l.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>dt(s,e)}})),Wt=({severity:e})=>{const s=It({severity:e});return(0,n.jsx)(pt.Z,{classes:s})},Gn=({severity:e})=>{const s=It({severity:e});return(0,n.jsx)(Xe.Z,{classes:s})},jn=(0,l.Z)(e=>({panel:{backgroundColor:({severity:s})=>Dt(s,e),color:({severity:s})=>dt(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>dt(s,e),fontWeight:"bold"},message:{width:"100%",display:"block",color:({severity:s})=>dt(s,e),backgroundColor:({severity:s})=>Dt(s,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),On=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function $n(e){const{severity:s="warning",title:i,message:d,children:p,defaultExpanded:m}=e,E=jn({severity:s}),Z=On(s)+(i?`: ${i}`:"");return(0,n.jsxs)(je.Z,{defaultExpanded:m!=null?m:!1,className:E.panel,role:"alert",children:[(0,n.jsxs)(Se.Z,{expandIcon:(0,n.jsx)(Gn,{severity:s}),className:E.summary,children:[(0,n.jsx)(Wt,{severity:s}),(0,n.jsx)(g.Z,{className:E.summaryText,variant:"subtitle1",children:Z})]}),(d||p)&&(0,n.jsx)(Qe.Z,{children:(0,n.jsxs)(y.Z,{container:!0,children:[d&&(0,n.jsx)(y.Z,{item:!0,xs:12,children:(0,n.jsx)(g.Z,{className:E.message,variant:"body1",children:d})}),p&&(0,n.jsx)(y.Z,{item:!0,xs:12,className:E.details,children:p})]})})]})}const qn=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),Nt=({error:e,message:s,stack:i,children:d})=>{const p=qn();return(0,n.jsxs)(j.Z,{dense:!0,children:[(0,n.jsxs)(U.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ne.Z,{classes:{secondary:p.text},primary:"Error",secondary:e}),(0,n.jsx)(qe,{text:e})]}),(0,n.jsxs)(U.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ne.Z,{classes:{secondary:p.text},primary:"Message",secondary:s}),(0,n.jsx)(qe,{text:s})]}),i&&(0,n.jsxs)(U.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ne.Z,{classes:{secondary:p.text},primary:"Stack Trace",secondary:i}),(0,n.jsx)(qe,{text:i})]}),d]})};function w(e){const{title:s,error:i,defaultExpanded:d,children:p}=e;return(0,n.jsx)($n,{severity:"error",title:s!=null?s:i.message,defaultExpanded:d,children:(0,n.jsx)(Nt,{error:i.name,message:i.message,stack:i.stack,children:p})})}var u=t(85256);const b=(0,l.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function A(e){var s;const{title:i,error:d,defaultExpanded:p}=e,m=b();if(d.name!=="ResponseError")return(0,n.jsx)(w,{title:i!=null?i:d.message,defaultExpanded:p,error:d});const{body:E,cause:Z}=d,{request:H,response:N}=E,ve=`${N.statusCode}: ${Z.name}`,ie=H&&`${H.method} ${H.url}`,fe=Z.message.replace(/\\n/g,`
|
|
12
|
-
`),Ee=(s=Z.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
13
|
-
`),De=JSON.stringify(E,void 0,2);return(0,n.jsxs)(w,{title:i!=null?i:d.message,defaultExpanded:p,error:{name:ve,message:fe,stack:Ee},children:[ie&&(0,n.jsxs)(U.Z,{alignItems:"flex-start",children:[(0,n.jsx)(ne.Z,{classes:{secondary:m.text},primary:"Request",secondary:H?`${ie}`:void 0}),(0,n.jsx)(qe,{text:ie})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.Z,{component:"li",className:m.divider}),(0,n.jsx)(U.Z,{alignItems:"flex-start",children:(0,n.jsx)(ne.Z,{classes:{secondary:m.text},primary:"Full Error as JSON"})}),(0,n.jsx)(Ae,{language:"json",text:De,showCopyCodeButton:!0})]})]})}var K=t(28316);function me(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function ye(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Re(e){const s=useRef(null);useEffect(function(){const p=document.querySelector(`#${e}`),m=p||me(e);return p||ye(m),m.appendChild(s.current),function(){s.current.remove(),m.childNodes.length===-1&&m.remove()}},[e]);function i(){return s.current||(s.current=document.createElement("div")),s.current}return i()}var et=null;const kt="core.calloutSeen";function Rt(){const[e,s]=useState(()=>{const d=localStorage.getItem(kt);return d?JSON.parse(d):{}}),i=useCallback((d,p)=>{const m=localStorage.getItem(kt),Z={...m?JSON.parse(m):{},[d]:p};s(Z),localStorage.setItem(kt,JSON.stringify(Z))},[]);return{states:e,setState:i}}function _n(e){const{states:s,setState:i}=Rt(),d=useCallback(()=>{i(e,!0)},[i,e]);return{seen:s[e]===!0,markSeen:d}}function fr(e){const{seen:s,markSeen:i}=_n(e);return{show:s===!1,hide:i}}const es=(0,l.Z)({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:"2px solid white",zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:"white",zIndex:2003}},{name:"BackstageFeatureCalloutCircular"});function ar(e){const{featureId:s,title:i,description:d,children:p}=e,{show:m,hide:E}=useShowCallout(s),Z=usePortal("core.callout"),H=useRef(null),[N,ve]=useState(),ie=es(),fe=useCallback(()=>{if(H.current){const Ee=H.current.getBoundingClientRect(),De=Math.max(Ee.width,Ee.height),ut=800,$t=Ee.x-(De-Ee.width)/2-ut,Vt=Ee.y-(De-Ee.height)/2-ut,Yt=De+2*ut,Jt=450,At=Ee.x+Ee.width/2-Jt,Kt=Ee.y-(De-Ee.height)/2+De+20;ve({dotLeft:$t,dotTop:Vt,dotSize:Yt,borderWidth:ut,textTop:Kt,textLeft:At,textWidth:Jt})}},[]);return useEffect(()=>(window.addEventListener("resize",fe),window.addEventListener("scroll",fe),()=>{window.removeEventListener("resize",fe),window.removeEventListener("scroll",fe)}),[fe]),useLayoutEffect(fe,[H.current,fe]),m?_jsxs(_Fragment,{children:[_jsx("div",{className:ie.featureWrapper,ref:H,children:p}),createPortal(_jsx("div",{className:ie.backdrop,children:_jsx(ClickAwayListener,{onClickAway:E,children:_jsxs(_Fragment,{children:[_jsx("div",{className:ie.dot,"data-testid":"dot",style:{left:N==null?void 0:N.dotLeft,top:N==null?void 0:N.dotTop,width:N==null?void 0:N.dotSize,height:N==null?void 0:N.dotSize,borderWidth:N==null?void 0:N.borderWidth},onClick:E,onKeyDown:E,role:"button",tabIndex:0,children:_jsx("div",{className:ie.pulseCircle})}),_jsxs("div",{className:ie.text,"data-testid":"text",style:{left:N==null?void 0:N.textLeft,top:N==null?void 0:N.textTop,width:N==null?void 0:N.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:i}),_jsx(Typography,{children:d})]})]})})}),Z)]}):_jsx(_Fragment,{children:p})}var $r=t(35292);const Br=(0,l.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{fontSize:"0.7rem",textTransform:"uppercase",fontWeight:600,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function jr({color:e="primary",disabled:s=!1,href:i="#",icon:d=(0,n.jsx)($r.Z,{}),label:p,onClick:m,title:E}){const Z=Br();return s?(0,n.jsxs)(Y.Z,{title:E,className:Q()(Z.link,Z.disabled),underline:"none",children:[d,(0,n.jsx)("span",{className:Z.label,children:p})]}):(0,n.jsxs)(Y.Z,{title:E,className:Q()(Z.link,Z[e]),to:i,component:xe,onClick:m,children:[d,(0,n.jsx)("span",{className:Z.label,children:p})]})}const gr=(0,l.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function ts(e){const{links:s}=e,i=gr();return(0,n.jsx)("nav",{className:i.links,children:s.map((d,p)=>(0,n.jsx)(jr,{...d},p+1))})}const Zr=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
14
|
-
hsl(0, 0%, ${s}) 0%,
|
|
15
|
-
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
16
|
-
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
17
|
-
hsla(0, 0%, ${s}, 0.896) 22.5%,
|
|
18
|
-
hsla(0, 0%, ${s}, 0.825) 29%,
|
|
19
|
-
hsla(0, 0%, ${s}, 0.741) 35.3%,
|
|
20
|
-
hsla(0, 0%, ${s}, 0.648) 41.2%,
|
|
21
|
-
hsla(0, 0%, ${s}, 0.55) 47.1%,
|
|
22
|
-
hsla(0, 0%, ${s}, 0.45) 52.9%,
|
|
23
|
-
hsla(0, 0%, ${s}, 0.352) 58.8%,
|
|
24
|
-
hsla(0, 0%, ${s}, 0.259) 64.7%,
|
|
25
|
-
hsla(0, 0%, ${s}, 0.175) 71%,
|
|
26
|
-
hsla(0, 0%, ${s}, 0.104) 77.5%,
|
|
27
|
-
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
28
|
-
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
29
|
-
hsla(0, 0%, ${s}, 0) 100%
|
|
30
|
-
`},ns=100,Bn=10,Zn=(0,l.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:ns,height:`calc(100% + ${Bn}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Bn,background:`linear-gradient(90deg, ${Zr(e.palette.type)})`},fadeRight:{right:-Bn,background:`linear-gradient(270deg, ${Zr(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function lr(e){const[[s,i],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const p=e.current;if(!p){d([0,0]);return}const m=()=>{const E=p.scrollLeft,Z=p.scrollWidth-p.offsetWidth-p.scrollLeft;d([E,Z])};return m(),p.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{p.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[e]),[s,i]}function mr(e,s,i){const[d,p]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const m=performance.now(),E=requestAnimationFrame(Z=>{if(!e.current)return;const H=Z-m,N=Math.abs(d)*H/s,ie=Math.max(i,N)*Math.sign(d);e.current.scrollBy({left:ie});const fe=d-ie;Math.sign(d)!==Math.sign(fe)?p(0):p(fe)});return()=>cancelAnimationFrame(E)},[e,d,s,i]),p}function Dr(e){const{scrollStep:s=100,scrollSpeed:i=50,minScrollDistance:d=5,children:p,...m}=e,E=Zn(e),Z=React.useRef(),[H,N]=lr(Z),ve=mr(Z,i,d),ie=fe=>{!Z.current||ve(fe?s:-s)};return _jsxs("div",{...m,className:E.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:E.container,ref:Z,children:p}),_jsx("div",{className:classNames(E.fade,E.fadeLeft,{[E.fadeHidden]:H===0})}),_jsx("div",{className:classNames(E.fade,E.fadeRight,{[E.fadeHidden]:N===0})}),H>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ie(!1),className:classNames(E.button,E.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),N>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ie(!0),className:classNames(E.button,E.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const rs=(0,l.Z)({alpha:{color:"#ffffff",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}},{name:"BackstageLifecycle"});function Nr(e){const s=rs(e),{shorthand:i,alpha:d}=e;return i?_jsx("span",{className:s[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx("span",{className:s[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const ss=(0,v.lazy)(()=>Promise.all([t.e(5869),t.e(6051)]).then(t.bind(t,76051)).then(e=>({default:e.RealLogViewer})));function os(e){const{Progress:s}=(0,I.qD)().getComponents();return(0,n.jsx)(v.Suspense,{fallback:(0,n.jsx)(s,{}),children:(0,n.jsx)(ss,{...e})})}const vr=(0,l.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),gn=(e,s)=>s?typeof s=="string"?e+s:v.Children.toArray(s.props.children).reduce(gn,e):e,Dn=({level:e,children:s})=>{const p=v.Children.toArray(s).reduce(gn,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return v.createElement(`h${e}`,{id:p},s)},yr={code:({inline:e,className:s,children:i,...d})=>{const p=String(i).replace(/\n+$/,""),m=/language-(\w+)/.exec(s||"");return!e&&m?(0,n.jsx)(Ae,{language:m[1],text:p}):(0,n.jsx)("code",{className:s,...d,children:i})},h1:Dn,h2:Dn,h3:Dn,h4:Dn,h5:Dn,h6:Dn};function Rs(e){const{content:s,dialect:i="gfm",linkTarget:d,transformLinkUri:p,transformImageUri:m,className:E}=e,Z=vr();return _jsx(ReactMarkdown,{remarkPlugins:i==="gfm"?[gfm]:[],className:`${Z.markdown} ${E}`,children:s,components:yr,linkTarget:d,transformLinkUri:p,transformImageUri:m})}var Er=t(23054);const Ar=(0,l.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),is=({request:e,busy:s,setBusy:i})=>{const d=Ar(),[p,m]=useState(),E=async()=>{i(!0);try{await e.trigger()}catch(H){m(isError(H)?H.message:"An unspecified error occurred")}finally{i(!1)}},Z=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(Z,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:p&&_jsx(Typography,{color:"error",children:p})}),_jsx(Button,{color:"primary",variant:"contained",onClick:E,children:"Log in"})]})};var Ls=null;const Hn=(0,l.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function Ps(e){const s=Hn(),[i,d]=useState(!1),p=useApi(oauthRequestApiRef),m=useObservable(useMemo(()=>p.authRequest$(),[p]),[]),E=()=>{m.forEach(Z=>Z.reject())};return _jsxs(Dialog,{open:Boolean(m.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsx(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:_jsx(Typography,{className:s.titleHeading,variant:"h1",children:"Login Required"})}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:m.map(Z=>_jsx(LoginRequestListItem,{request:Z,busy:i,setBusy:d},Z.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:E,children:"Reject All"})})]})}var Fr=t(15277),Tr=t.n(Fr),Ir=t(29862);const as=(0,l.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function ls(e){const[s,i]=(0,v.useState)(!1),d=(0,Ir.t)(),p=as(),m=Z=>{d()&&i(Z)};var E;return(0,n.jsx)(Ge.ZP,{title:(E=e.title)!==null&&E!==void 0?E:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,n.jsx)(Tr(),{text:e.text,line:e.line,onToggled:m,containerClassName:p.container})})}var cs=t(67358);function ds(e){const[s,i]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{const d=setTimeout(()=>i(!0),250);return()=>clearTimeout(d)},[]),s?(0,n.jsx)(cs.Z,{...e,"data-testid":"progress"}):(0,n.jsx)("div",{style:{display:"none"}})}var Ur=t(94339),Mr=t(14503),Rr=t(24579),er=t(32552),Qt=t(15459),Ot=t(95544),zr=t(27597);const us=(0,l.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function Vr(e){const{link:s,title:i,onClick:d}=e,p=us();return(0,n.jsxs)("div",{children:[(0,n.jsx)(u.Z,{}),(0,n.jsx)(xe,{to:s,onClick:d,underline:"none",children:(0,n.jsxs)(Ot.Z,{display:"flex",alignItems:"center",className:p.root,children:[(0,n.jsx)(Ot.Z,{className:p.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(g.Z,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(zr.Z,{className:p.arrow})]})})]})}const hs=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s," for help."]});if(!s.href)return(0,n.jsxs)(n.Fragment,{children:["Please contact ",s.name," for help."]})}else return null;return(0,n.jsx)(Ye,{to:s.href,variant:"contained",children:s.name})},ps=class extends v.Component{componentDidCatch(s,i){console.error(`ErrorBoundary, error: ${s}, info: ${i}`),this.setState({error:s,errorInfo:i})}render(){const{slackChannel:s,children:i}=this.props,{error:d}=this.state;return d?(0,n.jsx)(w,{title:"Something Went Wrong",error:d,children:(0,n.jsx)(hs,{slackChannel:s})}):i}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},fs=(0,l.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:700},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),gs=(0,Qt.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Mr.Z),Hr={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 xr(e){const{title:s,subheader:i,divider:d=!0,deepLink:p,slackChannel:m,errorBoundaryProps:E,variant:Z,children:H,headerStyle:N,headerProps:ve,icon:ie,action:fe,actionsClassName:Ee,actions:De,cardClassName:ut,actionsTopRight:$t,className:Vt,noPadding:Yt,titleTypographyProps:Jt}=e,At=fs();let Kt={},Ht={};Z&&Z.split(/[\s]+/g).forEach(hr=>{Kt={...Kt,...Hr.card[hr]},Ht={...Ht,...Hr.cardContent[hr]}});const dr=()=>(0,n.jsxs)("div",{className:At.headerSubheader,children:[i&&(0,n.jsx)("div",{className:At.subheader,children:i}),ie]}),Yn=E||(m?{slackChannel:m}:{});return(0,n.jsx)(Ur.Z,{style:Kt,className:Vt,children:(0,n.jsxs)(ps,{...Yn,children:[s&&(0,n.jsx)(er.Z,{classes:{root:At.header,title:At.headerTitle,subheader:At.headerSubheader,avatar:At.headerAvatar,action:At.headerAction,content:At.headerContent},title:s,subheader:dr(),action:fe,style:{...N},titleTypographyProps:Jt,...ve}),$t&&(0,n.jsx)(gs,{children:$t}),d&&(0,n.jsx)(u.Z,{}),(0,n.jsx)(Rr.Z,{className:Q()(ut,{[At.noPadding]:Yt}),style:Ht,children:H}),De&&(0,n.jsx)(Mr.Z,{className:Ee,children:De}),p&&(0,n.jsx)(Vr,{...p})]})})}var ks=t(39307);const ms=(0,l.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:45,fontWeight:"bold",color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),Wr={fractional:!0,inverse:!1,unit:"%",max:100},vs=({palette:e,value:s,inverse:i,max:d})=>{if(isNaN(s))return"#ddd";const p=d||Wr.max,m=i?p-s:s;return m<p/3?e.status.error:m<p*(2/3)?e.status.warning:e.status.ok};function Os(e){const[s,i]=useState(null),{getColor:d=vs}=e,p=ms(e),{palette:m}=useTheme(),{value:E,fractional:Z,inverse:H,unit:N,max:ve,description:ie}={...Wr,...e},fe=Z?Math.round(E*ve):E,Ee=ve!==100?Math.round(E):fe,[De,ut]=useState(!1);return useEffect(()=>{const $t=s,Vt=()=>ut(!0),Yt=()=>ut(!1);return $t&&ie?($t.addEventListener("mouseenter",Vt),$t.addEventListener("mouseleave",Yt),()=>{$t.removeEventListener("mouseenter",Vt),$t.removeEventListener("mouseleave",Yt)}):()=>{ut(!1)}},[ie,s]),_jsxs("div",{ref:i,className:p.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:fe,strokeWidth:12,trailWidth:12,strokeColor:d({palette:m,value:Ee,inverse:H,max:ve}),className:p.circle}),ie&&De?_jsx("div",{className:p.description,children:ie}):_jsx("div",{className:p.overlay,children:isNaN(E)?"N/A":`${Ee}${N}`})]})}const ys=(0,l.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function $s(e){const s=ys(e),{title:i,subheader:d,progress:p,inverse:m,deepLink:E,description:Z,icon:H,variant:N,getColor:ve}=e,ie={inverse:m,description:Z,getColor:ve,value:p};return _jsx("div",{className:s.root,children:_jsx(InfoCard,{title:i,subheader:d,deepLink:E,variant:N,icon:H,children:_jsx(Gauge,{...ie})})})}function po(e){const{value:s,getColor:i=getProgressColor}=e,{palette:d}=useTheme();if(isNaN(s))return null;let p=Math.round(s*100*100)/100;p>100&&(p=100);const m=i({palette:d,value:p,inverse:!1,max:100});return _jsx(Tooltip,{title:`${p}%`,children:_jsx("span",{children:_jsx(Line,{percent:p,strokeWidth:4,trailWidth:4,strokeColor:m})})})}var x=t(21324),C=t(7089),O=t(1292),M=t(42494),_=t(74603),ee=t(56939),pe=t(12231),be=t(73698),we=t(72379);const Ze=(0,l.Z)(()=>(0,B.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Pe=()=>{const e=Ze();return(0,n.jsx)(we.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const ze=(0,l.Z)(()=>(0,B.Z)({icon:{position:"absolute",right:"4px",pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var yt=()=>{const e=ze();return(0,n.jsx)(we.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const Ve=(0,Qt.Z)(e=>(0,B.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:4,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:16,padding:"10px 26px 10px 12px",transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:4}}}),{name:"BackstageSelectInputBase"})(_.Z),Pt=(0,l.Z)(e=>(0,B.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:14,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function Gt(e){const{multiple:s,items:i,label:d,placeholder:p,selected:m,onChange:E,triggerReset:Z,native:H=!1,disabled:N=!1,margin:ve}=e,ie=Pt(),[fe,Ee]=(0,v.useState)(m||(s?[]:"")),[De,ut]=(0,v.useState)(!1);(0,v.useEffect)(()=>{Ee(s?[]:"")},[Z,s]),(0,v.useEffect)(()=>{m!==void 0&&Ee(m)},[m]);const $t=At=>{Ee(At.target.value),E(At.target.value)},Vt=At=>{if(N){At.preventDefault();return}ut(Kt=>s&&!(At.target instanceof HTMLElement)?!0:!Kt)},Yt=()=>{ut(!1)},Jt=At=>()=>{const Kt=fe.filter(Ht=>Ht!==At);Ee(Kt),E(Kt)};return(0,n.jsx)("div",{className:ie.root,children:(0,n.jsx)(O.Z,{onClickAway:Yt,children:(0,n.jsxs)(M.Z,{className:ie.formControl,children:[(0,n.jsx)(ee.Z,{className:ie.formLabel,children:d}),(0,n.jsxs)(be.Z,{"aria-label":d,value:fe,native:H,disabled:N,"data-testid":"select",displayEmpty:!0,multiple:s,margin:ve,onChange:$t,onClick:Vt,open:De,input:(0,n.jsx)(Ve,{}),label:d,tabIndex:0,renderValue:At=>{var Kt;return s&&fe.length!==0?(0,n.jsx)("div",{className:ie.chips,children:At.map(Ht=>{var dr,Yn;return(0,n.jsx)(C.Z,{label:(dr=i.find(ur=>ur.value===Ht))===null||dr===void 0?void 0:dr.label,clickable:!0,onDelete:Jt(Ht),className:ie.chip},(Yn=i.find(ur=>ur.value===Ht))===null||Yn===void 0?void 0:Yn.value)})}):(0,n.jsx)(g.Z,{children:fe.length===0?p||"":(Kt=i.find(Ht=>Ht.value===At))===null||Kt===void 0?void 0:Kt.label})},IconComponent:()=>De?(0,n.jsx)(yt,{}):(0,n.jsx)(Pe,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[p&&!s&&(0,n.jsx)(pe.Z,{value:[],children:p}),H?i&&i.map(At=>(0,n.jsx)("option",{value:At.value,children:At.label},At.value)):i&&i.map(At=>(0,n.jsxs)(pe.Z,{value:At.value,children:[s&&(0,n.jsx)(x.Z,{color:"primary",checked:fe.includes(At.value)||!1,className:ie.checkbox}),At.label]},At.value))]})]})})})}const Nn=()=>{},En=v.createContext({stepperLength:0,stepIndex:0,setStepIndex:Nn,stepHistory:[],setStepHistory:Nn,onStepChange:Nn});function tr(e){const{children:s,elevated:i,onStepChange:d,activeStep:p=0}=e,[m,E]=useState(p),[Z,H]=useState([0]);useEffect(()=>{E(p)},[p]);const N=[];let ve;return Children.forEach(s,ie=>{isValidElement(ie)&&(ie.props.end?ve=ie:N.push(ie))}),_jsxs(_Fragment,{children:[_jsx(En.Provider,{value:{stepIndex:m,setStepIndex:E,stepHistory:Z,setStepHistory:H,onStepChange:d,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:m,orientation:"vertical",elevation:i?2:0,children:N})}),m>=Children.count(s)-1&&ve]})}const cn=(0,l.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),mn=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),An=({text:e,handleClick:s,disabled:i,last:d,stepIndex:p})=>_jsx(Button,{variant:"contained",color:"primary",disabled:i,"data-testid":`nextButton-${p}`,onClick:s,children:e||(d?"Finish":"Next")}),br=({text:e,handleClick:s,disabled:i,stepIndex:d})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${d}`,disabled:i,children:e||"Back"}),Sr=({actions:e={},children:s})=>{const i=cn(),{stepperLength:d,stepIndex:p,setStepIndex:m,stepHistory:E,setStepHistory:Z,onStepChange:H}=useContext(VerticalStepperContext),N=(Ee,De)=>{De&&De(),H&&H(p,Ee),m(Ee)},ve=()=>{const Ee=e.nextStep?e.nextStep(p,d-1):p+1;N(Ee,e.onNext),Z([...E,Ee])},ie=()=>{E.pop(),N(E[E.length-1],e.onBack),Z([...E])},fe=()=>{N(0,e.onRestart),Z([0])};return _jsxs("div",{className:i.root,children:[[void 0,!0].includes(e.showBack)&&p!==0&&_jsx(br,{text:e.backText,handleClick:ie,disabled:p===0,stepIndex:p}),[void 0,!0].includes(e.showNext)&&_jsx(An,{text:e.nextText,handleClick:ve,disabled:!!d&&p>=d||!!e.canNext&&!e.canNext(),stepIndex:p}),e.showRestart&&p!==0&&_jsx(mn,{text:e.restartText,handleClick:fe,stepIndex:p}),s]})},wr=(0,l.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function vn(e){const{title:s,children:i,end:d,actions:p,...m}=e,E=wr();return d?_jsxs("div",{className:E.end,children:[_jsx(Typography,{variant:"h6",children:s}),i,_jsx(SimpleStepperFooter,{actions:{...p||{},showNext:!1}})]}):_jsxs(MuiStep,{...m,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[i,_jsx(SimpleStepperFooter,{actions:p})]})]})}const Xt=(0,l.Z)(e=>({status:{fontWeight:500,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:8,borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function nr(e){const s=Xt(e);return _jsx("span",{className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function fo(e){const s=Xt(e);return _jsx("span",{className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ii(e){const s=Xt(e);return _jsx("span",{className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function ai(e){const s=Xt(e);return _jsx("span",{className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Hi(e){const s=Xt(e);return _jsx("span",{className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function Wi(e){const s=Xt(e);return _jsx("span",{className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Lr=t(74600),go=t(15584);const mo=e=>(0,B.Z)({root:{fontWeight:"bolder",whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),li={root:{border:"0",verticalAlign:"top"}},ci=e=>(0,B.Z)({root:{listStyle:"none",margin:e.spacing(0,0,-1,0),padding:"0"}}),hn=e=>(0,B.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),xs=(0,Qt.Z)(mo,{name:"BackstageMetadataTableTitleCell"})(go.Z),vo=(0,Qt.Z)(li,{name:"BackstageMetadataTableCell"})(go.Z),Bs=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Zs=({title:e,children:s,...i})=>_jsxs(TableRow,{children:[e&&_jsx(xs,{children:e}),_jsx(vo,{colSpan:e?1:2,...i,children:s})]}),Gr=(0,Qt.Z)(ci,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)("ul",{className:e.root,children:s})),di=(0,Qt.Z)(hn,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,n.jsx)("li",{className:e.root,children:s})),bs=(0,B.Z)({root:{margin:"0 0",listStyleType:"none"}}),yo=e=>(0,B.Z)({root:{...bs.root,paddingLeft:e.spacing(1)}}),Ds=(0,Qt.Z)(bs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,n.jsx)(Gr,{classes:e,children:s})),Ns=(0,Qt.Z)(yo,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,n.jsx)(Gr,{classes:e,children:s}));function xo(e,s){const i=e.map((d,p)=>_jsx(MetadataListItem,{children:Pr(d)},p));return s?_jsx(Ns,{children:i}):_jsx(Ds,{children:i})}function cr(e,s,i){const d=Object.keys(e).map(p=>{const m=Pr(e[p],!0),E=i&&i.titleFormat?i.titleFormat(p):startCase(p);return _jsxs(MetadataListItem,{children:[`${E}: `,m]},p)});return s?_jsx(Ns,{children:d}):_jsx(Ds,{children:d})}function Pr(e,s,i){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?cr(e,s,i):Array.isArray(e)?xo(e,i):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Fragment,{children:e})}const bo=({value:e,options:s})=>_jsx(Fragment,{children:Pr(e,s)}),So=({title:e,value:s,options:i})=>_jsx(MetadataTableItem,{title:i&&i.titleFormat?i.titleFormat(e):startCase(e),children:_jsx(bo,{value:s,options:i})});function Fs(e,s){return Object.keys(e).map(i=>_jsx(So,{title:i,value:e[i],options:s},i))}function ui(e){const{metadata:s,dense:i=!0,options:d}=e,p=Fs(s,d||{});return _jsx(MetadataTable,{dense:i,children:p})}var wo=t(49429),Co=t(86136),Us=t(79784),hi=t(19126),Ms=t.n(hi);function jo(e){return qs.stringify(e,{strictNullHandling:!0})}function zs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Vs(e,s){return zs(e)[s]}function Hs(e,s,i){const d={...zs(e),[s]:i};return jo(d)}function Ws(e,s=250){const[i,d]=useSearchParams(),p=i.toString(),[m,E]=useState(Vs(p,e));return useEffect(()=>{const Z=Vs(p,e);E(H=>isEqual(Z,H)?H:Z)},[p,E,e]),useDebouncedEffect(()=>{const Z=Hs(p,e,m);p!==Z&&d(Z,{replace:!0})},[d,m,p,e],s),[m,E]}const Eo={url:"https://github.com/backstage/backstage/issues",items:[{title:"Support Not Configured",icon:"warning",links:[{title:"Add `app.support` config key",url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]};function Gs(){const s=(0,I.I_)().get(I.Ds),i=s==null?void 0:s.getOptionalConfig("app.support");if(!i)return Eo;var d;return{url:i.getString("url"),items:i.getConfigArray("items").flatMap(p=>({title:p.getString("title"),icon:p.getOptionalString("icon"),links:((d=p.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(m=>({url:m.getString("url"),title:m.getString("title")}))}))}}var Ao=t(80079);function Fn(e,s){const d=(0,I.qD)().getSystemIcon(e);return d?(0,n.jsx)(d,{...s}):(0,n.jsx)(Ao.Z,{...s})}function Gi(e){return Fn("brokenImage",e)}function Ki(e){return Fn("catalog",e)}function Ss(e){return Fn("chat",e)}function Yi(e){return Fn("dashboard",e)}function Ji(e){return Fn("docs",e)}function pi(e){return Fn("email",e)}function fi(e){return Fn("github",e)}function To(e){return Fn("group",e)}function ws(e){return Fn("help",e)}function Qi(e){return Fn("user",e)}function Io(e){return Fn("warning",e)}const Ks=(0,l.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Ro=({icon:e})=>{const s=(0,I.qD)();var i;const d=e&&(i=s.getSystemIcon(e))!==null&&i!==void 0?i:ws;return(0,n.jsx)(d,{})};var Cs;const gi=({link:e})=>(0,n.jsx)(xe,{to:e.url,children:(Cs=e.title)!==null&&Cs!==void 0?Cs:e.url}),mi=({item:e})=>{var s;return(0,n.jsxs)(U.Z,{children:[(0,n.jsx)(Co.Z,{children:(0,n.jsx)(Ro,{icon:e.icon})}),(0,n.jsx)(ne.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((i,d,p)=>[...i,p>0&&(0,n.jsx)("br",{},p),(0,n.jsx)(gi,{link:d},d.url)],[])})]})};function vi(e){const{title:s,children:i}=e,{items:d}=Gs(),[p,m]=(0,v.useState)(!1),[E,Z]=(0,v.useState)(null),H=Ks(),N=(0,tt.Z)(fe=>fe.breakpoints.down("sm")),ve=fe=>{Z(fe.currentTarget),m(!0)},ie=()=>{m(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ot.Z,{display:"flex",ml:1,children:N?(0,n.jsx)(We.Z,{color:"primary",size:"small",onClick:ve,"data-testid":"support-button",children:(0,n.jsx)(ws,{})}):(0,n.jsx)(q.Z,{"data-testid":"support-button","aria-label":"support",color:"primary",onClick:ve,startIcon:(0,n.jsx)(ws,{}),children:"Support"})}),(0,n.jsxs)(Us.ZP,{"data-testid":"support-button-popover",open:p,anchorEl:E,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:ie,children:[(0,n.jsxs)(j.Z,{className:H.popoverList,children:[s&&(0,n.jsx)(U.Z,{alignItems:"flex-start",children:(0,n.jsx)(g.Z,{variant:"subtitle1",children:s})}),v.Children.map(i,(fe,Ee)=>(0,n.jsx)(U.Z,{alignItems:"flex-start",children:fe},`child-${Ee}`)),d&&d.map((fe,Ee)=>(0,n.jsx)(mi,{item:fe},`item-${Ee}`))]}),(0,n.jsx)(wo.Z,{children:(0,n.jsx)(q.Z,{color:"primary",onClick:ie,children:"Close"})})]})]})}var yn=t(18671),Un=t(10289);const Kr=72,Lo=24,Po=18,rr={drawerWidthClosed:Kr,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:Kr,iconSize:Kr-Lo*2,iconPadding:Lo,selectedIndicatorWidth:3,userBadgePadding:Po,userBadgeDiameter:Kr-Po*2,mobileSidebarHeight:56},yi=e=>({...rr,...e,iconContainerWidth:rr.drawerWidthClosed,iconSize:rr.drawerWidthClosed-rr.iconPadding*2,userBadgeDiameter:rr.drawerWidthClosed-rr.userBadgePadding*2}),ko={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:rr.defaultOpenDelayMs+200},xi=e=>({...ko,...e}),Xi="@backstage/core/sidebar-intro-dismissed",Kn=(0,v.createContext)({sidebarConfig:rr,submenuConfig:ko}),Oo=(0,v.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var js;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(js||(js={}));const Es={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(js.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(js.SIDEBAR_PIN_STATE,JSON.stringify(e))}};var Yr=t(51837);const Ys={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Js=(0,v.createContext)(Ys),Qs=(0,Yr.CT)("sidebar-pin-state-context");function $o(e){const{children:s,value:i}=e;return(0,n.jsx)(Js.Provider,{value:i,children:(0,n.jsx)(Qs.Provider,{value:(0,Yr.EI)({1:i}),children:s})})}const kr=()=>{const e=(0,v.useContext)(Qs),s=(0,v.useContext)(Js);if(e===void 0)return s||Ys;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i},Bo=(0,l.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:s=>s.isPinned?s.sidebarConfig.drawerWidthOpen:s.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:s=>s.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),Xs=(0,v.createContext)({content:{contentRef:void 0}});function Zo(e){const[s,i]=(0,v.useState)(()=>Es.getSidebarPinState()),{sidebarConfig:d}=(0,v.useContext)(Kn),p=(0,v.useRef)(null),m=(0,v.useMemo)(()=>({content:{contentRef:p}}),[p]);(0,v.useEffect)(()=>{Es.setSidebarPinState(s)},[s]);const E=(0,tt.Z)(N=>N.breakpoints.down("xs"),{noSsr:!0}),Z=()=>i(!s),H=Bo({isPinned:s,sidebarConfig:d});return(0,n.jsx)($o,{value:{isPinned:s,toggleSidebarPinState:Z,isMobile:E},children:(0,n.jsx)(Xs.Provider,{value:m,children:(0,n.jsx)("div",{className:H.root,children:e.children})})})}function _s(){const{content:e}=(0,v.useContext)(Xs);return{focusContent:(0,v.useCallback)(()=>{var i,d;e==null||(i=e.contentRef)===null||i===void 0||(d=i.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const Do={isOpen:!1,setOpen:()=>{}},eo=(0,v.createContext)(Do),to=(0,Yr.CT)("sidebar-open-state-context");function No(e){const{children:s,value:i}=e;return(0,n.jsx)(eo.Provider,{value:i,children:(0,n.jsx)(to.Provider,{value:(0,Yr.EI)({1:i}),children:s})})}const As=()=>{const e=(0,v.useContext)(to),s=(0,v.useContext)(eo);if(e===void 0)return s||Do;const i=e.atVersion(1);if(i===void 0)throw new Error("No context found for version 1.");return i};var Fo=t(50023),Uo=t(4190),Mo=t(87685),zo=t(44882),Vo=t(57998);const Ho=(0,l.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:s=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${s.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),Wo=e=>{const{to:s,label:i,icon:d,value:p}=e,{sidebarConfig:m}=(0,v.useContext)(Kn),E=Ho({sidebarConfig:m}),Z=(0,Un.TH)(),{selectedMenuItemIndex:H,setSelectedMenuItemIndex:N}=(0,v.useContext)(so),ve=(fe,Ee)=>{N(Ee===H?-1:Ee)},ie=p===H&&H>=0||p!==H&&!(H>=0)&&s===Z.pathname;return(0,n.jsx)(Vo.Z,{label:i,icon:d,component:xe,to:s||Z.pathname,onChange:ve,value:p,selected:ie,classes:E})},Mn=e=>{const{children:s,to:i,label:d,icon:p,value:m}=e,{isMobile:E}=kr();return E?(0,n.jsx)(Wo,{to:i,label:d,icon:p,value:m}):(0,n.jsx)(n.Fragment,{children:s})},no=(0,l.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:s=>({background:e.palette.navigation.background,width:"100%",bottom:`${s.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${s.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:s=>({marginBottom:`${s.sidebarConfig.mobileSidebarHeight}px`})})),Go=e=>(0,le.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),Ko=v.createElement(Mn).type,ro=({children:e,label:s="Menu",open:i,onClose:d})=>{const{sidebarConfig:p}=(0,v.useContext)(Kn),m=no({sidebarConfig:p});return(0,n.jsxs)(Uo.ZP,{anchor:"bottom",open:i,onClose:d,ModalProps:{BackdropProps:{classes:{root:m.marginMobileSidebar}}},classes:{root:m.marginMobileSidebar,paperAnchorBottom:m.overlay},children:[(0,n.jsxs)(Ot.Z,{className:m.overlayHeader,children:[(0,n.jsx)(g.Z,{variant:"h3",children:s}),(0,n.jsx)(We.Z,{onClick:d,classes:{root:m.overlayHeaderClose},children:(0,n.jsx)(Mo.Z,{})})]}),(0,n.jsx)(Ot.Z,{component:"nav",children:e})]})},so=(0,v.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),Yo=e=>{const{sidebarConfig:s}=(0,v.useContext)(Kn),{children:i}=e,d=no({sidebarConfig:s}),p=(0,Un.TH)(),[m,E]=(0,v.useState)(-1);(0,v.useEffect)(()=>{E(-1)},[p.pathname]);let Z=(0,I.vJ)(i,N=>N.getElements().filter(ve=>ve.type===Ko));if(i)Z.length?Z=Go(Z):Z.push((0,n.jsx)(Mn,{icon:(0,n.jsx)(zo.Z,{}),children:i},"default_menu"));else return null;const H=m>=0&&!Z[m].props.to;return(0,n.jsx)(No,{value:{isOpen:!0,setOpen:()=>{}},children:(0,n.jsxs)(so.Provider,{value:{selectedMenuItemIndex:m,setSelectedMenuItemIndex:E},children:[(0,n.jsx)(ro,{label:Z[m]&&Z[m].props.label,open:H,onClose:()=>E(-1),children:Z[m]&&Z[m].props.children}),(0,n.jsx)(Fo.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:Z})]})})},oo=(0,l.Z)(e=>({drawer:s=>({display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",width:s.sidebarConfig.drawerWidthClosed,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}),drawerOpen:s=>({width:s.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Tn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Tn||(Tn={}));const bi=e=>{const{sidebarConfig:s}=(0,v.useContext)(Kn),{openDelayMs:i=s.defaultOpenDelayMs,closeDelayMs:d=s.defaultCloseDelayMs,disableExpandOnHover:p,children:m}=e,E=oo({sidebarConfig:s}),Z=(0,tt.Z)(Vt=>Vt.breakpoints.down("md"),{noSsr:!0}),[H,N]=(0,v.useState)(Tn.Closed),ve=(0,v.useRef)(),{isPinned:ie,toggleSidebarPinState:fe}=kr(),Ee=()=>{ie||p||(ve.current&&(clearTimeout(ve.current),ve.current=void 0),H!==Tn.Open&&!Z&&(ve.current=window.setTimeout(()=>{ve.current=void 0,N(Tn.Open)},i),N(Tn.Idle)))},De=()=>{ie||p||(ve.current&&(clearTimeout(ve.current),ve.current=void 0),H===Tn.Idle?N(Tn.Closed):H===Tn.Open&&(ve.current=window.setTimeout(()=>{ve.current=void 0,N(Tn.Closed)},d)))},ut=H===Tn.Open&&!Z||ie,$t=Vt=>{Vt?(N(Tn.Open),fe()):(N(Tn.Closed),fe())};return(0,n.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,n.jsx)(a,{}),(0,n.jsx)(No,{value:{isOpen:ut,setOpen:$t},children:(0,n.jsx)("div",{className:E.root,"data-testid":"sidebar-root",onMouseEnter:p?()=>{}:Ee,onFocus:p?()=>{}:Ee,onMouseLeave:p?()=>{}:De,onBlur:p?()=>{}:De,children:(0,n.jsx)("div",{className:Q()(E.drawer,{[E.drawerOpen]:ut}),children:m})})})]})},Jo=e=>{var s;const i=yi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var d;const p=xi((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:m,disableExpandOnHover:E,openDelayMs:Z,closeDelayMs:H}=e,{isMobile:N}=kr();return N?(0,n.jsx)(Yo,{children:m}):(0,n.jsx)(Kn.Provider,{value:{sidebarConfig:i,submenuConfig:p},children:(0,n.jsx)(bi,{openDelayMs:Z,closeDelayMs:H,disableExpandOnHover:E,children:m})})};function a(){const{sidebarConfig:e}=(0,v.useContext)(Kn),{focusContent:s,contentRef:i}=_s(),d=oo({sidebarConfig:e});return i!=null&&i.current?(0,n.jsx)(q.Z,{onClick:s,variant:"contained",className:Q()(d.visuallyHidden),children:"Skip to content"}):null}function r(e,s){const i=new URLSearchParams(s.search).toString(),d=Ms().parse(i),p=new URLSearchParams(e.search).toString(),m=Ms().parse(p);return(0,le.isEqual)(s.pathname,e.pathname)&&(0,le.isMatch)(m,d)}const o=(0,l.Z)(e=>({item:{height:48,width:"100%","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:20,cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:"#FFF"},label:{margin:14,marginLeft:7,fontSize:14,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:"14px",whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),{name:"BackstageSidebarSubmenuItem"}),c=e=>{const{title:s,subtitle:i,to:d,icon:p,dropdownItems:m}=e,E=o(),{setIsHoveredOn:Z}=useContext(SidebarItemWithSubmenuContext),H=()=>{Z(!1)},N=useResolvedPath(d!=null?d:""),ve=useLocation();let ie=isLocationMatch(ve,N);const[fe,Ee]=useState(!1),De=()=>{Ee(!fe)};return m!==void 0?(m.some(ut=>{const $t=resolvePath(ut.to);return ie=isLocationMatch(ve,$t),ie}),_jsxs("div",{className:E.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs("button",{onClick:De,onTouchStart:ut=>ut.stopPropagation(),className:classnames(E.item,ie?E.selected:void 0),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]}),fe?_jsx(ArrowDropUpIcon,{className:E.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:E.dropdownArrow})]})}),m&&fe&&_jsx("div",{className:E.dropdown,children:m.map((ut,$t)=>_jsx(Tooltip,{title:ut.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:ut.to,underline:"none",className:E.dropdownItem,onClick:H,onTouchStart:Vt=>Vt.stopPropagation(),children:_jsx(Typography,{className:E.textContent,children:ut.title})})},$t))})]})):_jsx("div",{className:E.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(E.item,ie?E.selected:void 0),onClick:H,onTouchStart:ut=>ut.stopPropagation(),children:[p&&_jsx(p,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:E.label,children:[s,_jsx("br",{}),i&&_jsx(Typography,{variant:"caption",className:E.subtitle,children:i})]})]})})})};var f;const $=(0,l.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var i;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:s.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(f=(i=e.palette.navigation.submenu)===null||i===void 0?void 0:i.background)!==null&&f!==void 0?f:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:s.submenuConfig.drawerWidthClosed,transitionDelay:`${s.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:s=>({width:s.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:24,fontWeight:500,color:"#FFF",padding:20,[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),z=e=>{const{isOpen:s}=As(),{sidebarConfig:i,submenuConfig:d}=(0,v.useContext)(Kn),p=s?i.drawerWidthOpen:i.drawerWidthClosed,m=$({left:p,submenuConfig:d}),{isHoveredOn:E}=(0,v.useContext)(Oo),[Z,H]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{H(E)},[E]),(0,n.jsxs)("div",{className:Q()(m.drawer,{[m.drawerOpen]:Z}),children:[(0,n.jsx)(g.Z,{variant:"h5",className:m.title,children:e.title}),e.children]})};var V=t(76600),oe=t(26739),Be=t(98989),$e=t(59797),xt=t(83543);const ot=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Ct=()=>{const e=ot();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var zt=null;const dn=(0,l.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),xn=()=>{const e=dn();return _jsxs("div",{className:e.iconContainer,children:[_jsx("div",{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx("div",{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var sr=null,Ln,zn;const Jr=e=>(0,l.Z)(s=>{var i,d;return{root:{color:s.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Ln=(i=s.palette.navigation.navItem)===null||i===void 0?void 0:i.hoverBackground)!==null&&Ln!==void 0?Ln:"#404040"}},highlighted:{background:(zn=(d=s.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&zn!==void 0?zn:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-s.spacing(2),display:"flex",alignItems:"center",justifyContent:"center"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:"bold",fontSize:s.typography.fontSize},searchFieldHTMLInput:{padding:s.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:s.spacing(6),textAlign:"center",marginRight:s.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:s.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${s.palette.navigation.indicator}`,color:s.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function Qr(e){return(0,v.useMemo)(()=>Jr(e),[e])()}const Qo=(e,s)=>(0,I.vJ)(e.props.children,i=>{let d=!1;return i.getElements().forEach(({props:{to:p,dropdownItems:m}})=>{if(!d){if(m!=null&&m.length){m.forEach(({to:E})=>d=d||r(s,(0,Un.i3)(E)));return}p&&(d=r(s,(0,Un.i3)(p)))}}),d},[s.pathname]);function Xr(e){return e.to===void 0}const Xo=v.createElement(z).type,Cr=v.forwardRef(function({to:s,end:i,style:d,className:p,activeStyle:m,caseSensitive:E,activeClassName:Z="active","aria-current":H="page",...N},ve){let{pathname:ie}=(0,Un.TH)(),{pathname:fe}=(0,Un.WU)(s);E||(ie=ie.toLocaleLowerCase("en-US"),fe=fe.toLocaleLowerCase("en-US"));let Ee=ie===fe;!Ee&&!i&&(Ee=ie.startsWith(`${fe}/`));const De=Ee?H:void 0;return(0,n.jsx)(ue.rU,{...N,to:s,ref:ve,"aria-current":De,style:{...d,...Ee?m:void 0},className:Q()([p,Ee?Z:void 0])})}),Si=(0,v.forwardRef)((e,s)=>{const{icon:i,text:d,hasNotifications:p=!1,hasSubmenu:m=!1,disableHighlight:E=!1,onClick:Z,children:H,className:N,...ve}=e,{sidebarConfig:ie}=(0,v.useContext)(Kn),fe=Qr(ie),{isOpen:Ee}=As(),De=!Ee&&m?{display:"flex",marginLeft:"24px"}:{},ut=(0,n.jsxs)("div",{style:De,children:[(0,n.jsx)(i,{fontSize:"small"}),!Ee&&m?(0,n.jsx)(Be.Z,{}):(0,n.jsx)(n.Fragment,{})]}),$t=(0,n.jsx)(oe.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!p,className:Q()({[fe.closedItemIcon]:!Ee}),children:ut}),Vt=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"data-testid":"login-button",className:fe.iconContainer,children:$t}),d&&(0,n.jsx)(g.Z,{variant:"subtitle2",className:fe.label,children:d}),(0,n.jsx)("div",{className:fe.secondaryAction,children:H})]}),Yt=Ee?Vt:$t,Jt={onClick:Z,className:Q()(N,fe.root,Ee?fe.open:fe.closed,Xr(e)&&fe.buttonItem,{[fe.highlightable]:!E})};return Xr(e)?(0,n.jsx)("button",{"aria-label":d,...Jt,ref:s,children:Yt}):(0,n.jsx)(Cr,{...Jt,activeClassName:fe.selected,to:e.to?e.to:"",ref:s,"aria-label":d||e.to,...ve,children:Yt})}),qi=({children:e,...s})=>{const{sidebarConfig:i}=(0,v.useContext)(Kn),d=Qr(i),[p,m]=(0,v.useState)(!1),E=(0,Un.TH)(),Z=Qo(e,E),H=(0,tt.Z)(fe=>fe.breakpoints.down("sm")),N=()=>{m(!0)},ve=()=>{m(!1)},ie=()=>H?p?(0,n.jsx)($e.Z,{fontSize:"small",className:d.submenuArrow}):(0,n.jsx)(xt.Z,{fontSize:"small",className:d.submenuArrow}):!p&&(0,n.jsx)(Be.Z,{fontSize:"small",className:d.submenuArrow});return(0,n.jsx)(Oo.Provider,{value:{isHoveredOn:p,setIsHoveredOn:m},children:(0,n.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:ve,onTouchStart:p?ve:N,onMouseEnter:N,className:Q()(p&&d.highlighted),children:[(0,n.jsx)(Si,{hasSubmenu:!0,className:Z?d.selected:"",...s,children:ie()}),p&&e]})})},wi=(0,v.forwardRef)((e,s)=>{const[i]=(0,I.vJ)(e.children,d=>d.getElements().filter(p=>p.type===Xo));return i?(0,n.jsx)(qi,{...e,children:i}):(0,n.jsx)(Si,{...e,ref:s})});function Ll(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[i,d]=useState(""),p=Qr(s),m=e.icon?e.icon:SearchIcon,E=()=>{e.onSearch(i),d("")},Z=ie=>{ie.key==="Enter"&&(ie.preventDefault(),E())},H=ie=>{d(ie.target.value)},N=ie=>{ie.preventDefault(),ie.stopPropagation()},ve=ie=>{E(),ie.preventDefault()};return _jsx("div",{className:p.searchRoot,children:_jsx(wi,{icon:m,to:e.to,onClick:ve,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:i,onClick:N,onChange:H,onKeyDown:Z,className:p.searchContainer,InputProps:{disableUnderline:!0,className:p.searchField},inputProps:{className:p.searchFieldHTMLInput}})})})}const Pl=(0,V.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),kl=(0,V.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),_i=(0,V.Z)("hr")({height:1,width:"100%",background:"#383838",border:"none",margin:"12px 0px"},{name:"BackstageSidebarDivider"}),ea=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),Ol=(0,V.Z)("div")(({theme:e})=>{const s=ea(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),$l=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=Qr(e),{isOpen:i,setOpen:d}=useSidebarOpenState();if(useMediaQuery(E=>E.breakpoints.down("md"),{noSsr:!0}))return null;const m=()=>{d(!i)};return _jsx("button",{onClick:m,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx("div",{className:s.arrows,children:i?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},ta=(0,l.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:18,marginBottom:12,paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:12},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:4,"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:12}}),{name:"BackstageSidebarIntro"});function na(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),i=ta({sidebarConfig:s}),{text:d,onClose:p}=e,m=()=>p();return _jsxs("div",{className:i.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx("div",{className:i.introDismiss,children:_jsxs(Link,{component:"button",onClick:m,underline:"none",className:i.introDismissLink,children:[_jsx(CloseIcon,{className:i.introDismissIcon}),_jsx(Typography,{component:"span",className:i.introDismissText,children:"Dismiss"})]})})]})}const Ci=e=>{const{text:s,onDismiss:i}=e,[d,p]=useState(!1),m=()=>{p(!0)};return _jsx(Collapse,{in:!d,onExited:i,children:_jsx(na,{text:s,onClose:m})})},ra=null,sa="And your recently viewed plugins will pop up here!";function Bl(e){const{isOpen:s}=useSidebarOpenState(),i={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},[d,p]=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:m,recentlyViewedItemsDismissed:E}=d!=null?d:{},Z=()=>{p(N=>({...i,...N,starredItemsDismissed:!0}))},H=()=>{p(N=>({...i,...N,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!m&&_jsxs(_Fragment,{children:[_jsx(Ci,{text:ra,onDismiss:Z}),_jsx(SidebarDivider,{})]}),!E&&_jsx(Ci,{text:sa,onDismiss:H})]}):null}const oa=(0,l.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function ji(e){const{className:s,stretch:i,noPadding:d,children:p,...m}=e,{contentRef:E}=_s(),Z=oa();return(0,n.jsx)("article",{ref:E,tabIndex:-1,...m,className:Q()(Z.root,s,{[Z.stretch]:i,[Z.noPadding]:d}),children:p})}var ia=t(6487),aa=t(99152);const la=(0,l.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{padding:e.spacing(3,3),...e.typography.caption,textTransform:"uppercase",fontWeight:"bold",color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Ei(e){const{tabs:s,onChange:i,selectedIndex:d}=e,[p,m]=(0,v.useState)(d!=null?d:0),E=la(),Z=(0,v.useCallback)((H,N)=>{d===void 0&&m(N),i&&d!==N&&i(N)},[d,i]);return(0,v.useEffect)(()=>{d!==void 0&&m(d)},[d]),(0,n.jsx)("div",{className:E.tabsWrapper,children:(0,n.jsx)(aa.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"scrollable auto tabs example",onChange:Z,value:p,children:s.map((H,N)=>(0,v.createElement)(ia.Z,{...H.tabProps,"data-testid":`header-tab-${N}`,label:H.label,key:H.id,value:N,className:E.defaultTab,classes:{selected:E.selected,root:E.tabRoot}}))})})}function ca(e){const s=(0,Un.UO)(),d=e.map(({path:fe,children:Ee})=>({caseSensitive:!1,path:`${fe}/*`,element:Ee})).sort((fe,Ee)=>Ee.path.replace(/\/\*$/,"").localeCompare(fe.path.replace(/\/\*$/,"")));var p;const m=(p=(0,Un.V$)(d))!==null&&p!==void 0?p:e[0].children;var E;let Z=(E=s["*"])!==null&&E!==void 0?E:"";Z.startsWith("/")||(Z=`/${Z}`);var H;const[N]=(H=(0,Un.fp)(d,Z))!==null&&H!==void 0?H:[],ve=N?e.findIndex(fe=>`${fe.path}/*`===N.route.path):0;var ie;return{index:ve===-1?0:ve,element:m,route:(ie=e[ve])!==null&&ie!==void 0?ie:e[0]}}function Ai(e){const{routes:s}=e,i=(0,Un.s0)(),{index:d,route:p,element:m}=ca(s),E=(0,v.useMemo)(()=>s.map(H=>({id:H.path,label:H.title,tabProps:H.tabProps})),[s]),Z=H=>{let{path:N}=s[H];N=N.replace(/\/\*$/,""),N=N.replace(/^\//,""),i(N)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ei,{tabs:E,selectedIndex:d,onChange:Z}),(0,n.jsxs)(ji,{children:[(0,n.jsx)(yn.q,{title:p.title}),m]})]})}const qo=()=>null;(0,I.R5)(qo,"core.gatherMountPoints",!0);function Ti(e){const s=(0,n.jsx)(qo,{path:"",title:"",children:(0,n.jsx)("div",{})}).type;return v.Children.toArray(e).flatMap(i=>{if(!(0,v.isValidElement)(i))return[];if(i.type===v.Fragment)return Ti(i.props.children);if(i.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:p,children:m,tabProps:E}=i.props;return[{path:d,title:p,children:m,tabProps:E}]})}function da(e){const s=Ti(e.children);return(0,n.jsx)(Ai,{routes:s})}da.Route=qo;const ua=(0,l.Z)(e=>({value:{marginBottom:"6px"},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function ha(e){const{value:s,subvalue:i}=e,d=ua();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:d.value,children:s}),(0,n.jsx)("div",{className:d.subvalue,children:i})]})}var pa=t(21070),fa=t(90324),ga=t(98281),ma=t(48049),Ii=t(51209),Ri=t(33375),va=t(44233),ya=t(27604),_o=t(36444),xa=t(37971),ba=t(59709),Sa=t(17373),wa=t(3702),Ca=t(93111),io=t(67222);const ja=(0,l.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:"60px",justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ea=e=>{var s;const i=ja(),{onChangeFilters:d}=e,[p,m]=(0,v.useState)({...e.selectedFilters}),[E,Z]=(0,v.useState)(!1),H=()=>{m({}),Z(N=>!N)};return(0,v.useEffect)(()=>{d(p)},[p,d]),(0,n.jsxs)("div",{className:i.root,children:[(0,n.jsxs)("div",{className:i.header,children:[(0,n.jsx)("div",{className:i.value,children:"Filters"}),(0,n.jsx)(q.Z,{color:"primary",onClick:H,children:"Clear all"})]}),(0,n.jsx)("div",{className:i.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(N=>(0,n.jsx)(Gt,{triggerReset:E,...N.element,selected:p[N.element.label],onChange:ve=>m({...p,[N.element.label]:ve})},N.element.label))})]})},Li={Add:(0,v.forwardRef)((e,s)=>(0,n.jsx)(pa.Z,{...e,ref:s})),Check:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ga.Z,{...e,ref:s})),Clear:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),Delete:(0,v.forwardRef)((e,s)=>(0,n.jsx)(va.Z,{...e,ref:s})),DetailPanel:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),Edit:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ya.Z,{...e,ref:s})),Export:(0,v.forwardRef)((e,s)=>(0,n.jsx)(wa.Z,{...e,ref:s})),Filter:(0,v.forwardRef)((e,s)=>(0,n.jsx)(_o.Z,{...e,ref:s})),FirstPage:(0,v.forwardRef)((e,s)=>(0,n.jsx)(xa.Z,{...e,ref:s})),LastPage:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ba.Z,{...e,ref:s})),NextPage:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ii.Z,{...e,ref:s})),PreviousPage:(0,v.forwardRef)((e,s)=>(0,n.jsx)(ma.Z,{...e,ref:s})),ResetSearch:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ri.Z,{...e,ref:s})),Search:(0,v.forwardRef)((e,s)=>(0,n.jsx)(_o.Z,{...e,ref:s})),SortArrow:(0,v.forwardRef)((e,s)=>(0,n.jsx)(fa.Z,{...e,ref:s})),ThirdStateCheck:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Sa.Z,{...e,ref:s})),ViewColumn:(0,v.forwardRef)((e,s)=>(0,n.jsx)(Ca.Z,{...e,ref:s}))};function Pi(e,s){const i=s.split(".");let d=e[i[0]];for(let p=1;p<i.length;++p){if(d===void 0)return d;const m=i[p];d=d[m]}return d}const Aa=(0,Qt.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(io.W$),ki=(0,Qt.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:"bold"}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(io.UW),Ta=(0,l.Z)(()=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:"bold",fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ia=(0,l.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Ra(e,s){return e.map(i=>{const d={};let p=i.cellStyle||{};if(i.highlight)if(d.color=s.palette.textContrast,typeof p=="object")p.fontWeight=s.typography.fontWeightBold;else{const m=p;p=(E,Z,H)=>({...m(E,Z,H),fontWeight:s.typography.fontWeightBold})}return{...i,headerStyle:d,cellStyle:p}})}function La(e,s){return(0,le.transform)(e,(i,d,p)=>{(0,le.isEqual)(d,s[p])||(i[p]=d)})}const Oi={search:"",filtersOpen:!1,filters:{}};function Pa(e){const{toolbarRef:s,setSearch:i,hasFilters:d,selectedFiltersLength:p,toggleFilters:m}=e,E=Ta(),Z=(0,v.useCallback)(H=>{e.onSearchChanged(H),i(H)},[e,i]);return d?(0,n.jsxs)("div",{className:E.root,children:[(0,n.jsxs)("div",{className:E.root,children:[(0,n.jsx)(We.Z,{onClick:m,"aria-label":"filter list",children:(0,n.jsx)(_o.Z,{})}),(0,n.jsxs)(g.Z,{className:E.title,children:["Filters (",p,")"]})]}),(0,n.jsx)(ki,{...e,ref:s,onSearchChanged:Z})]}):(0,n.jsx)(ki,{...e,ref:s,onSearchChanged:Z})}function $i(e){const{data:s,columns:i,options:d,title:p,subtitle:m,filters:E,initialState:Z,emptyContent:H,onStateChange:N,components:ve,...ie}=e,fe=Ia(),Ee=(0,He.Z)(),De={...Oi,...Z},[ut,$t]=(0,v.useState)(De.filtersOpen),Vt=(0,v.useCallback)(()=>$t(bn=>!bn),[$t]),[Yt,Jt]=(0,v.useState)(0),[At,Kt]=(0,v.useState)(s),[Ht,dr]=(0,v.useState)(De.filters),Yn=Ra(i,Ee),[ur,hr]=(0,v.useState)(De.search);(0,v.useEffect)(()=>{if(N){const bn=La({search:ur,filtersOpen:ut,filters:Ht},Oi);N(bn)}},[ur,ut,Ht,N]);const si={headerStyle:{textTransform:"uppercase"}},Ft=(0,v.useCallback)(bn=>{var or;return(or=i.find(Jn=>Jn.title===bn))===null||or===void 0?void 0:or.field},[i]);(0,v.useEffect)(()=>{if(typeof s=="function")return;if(!Ht){Kt(s);return}const bn=Object.values(Ht);if(s&&bn.flat().length){const or=s.filter(Jn=>!!Object.entries(Ht).filter(([,Wn])=>!!Wn.length).every(([Wn,pn])=>{const In=Pi(Jn,Ft(Wn));return Array.isArray(In)&&Array.isArray(pn)?In.some(ir=>pn.includes(ir)):Array.isArray(In)?In.includes(pn):Array.isArray(pn)?pn.includes(In):In===pn}));Kt(or)}else Kt(s);Jt(bn.flat().length)},[s,Ht,Ft]);const qr=(bn,or)=>{const Jn=pn=>{const In=new Set,ir=Or=>{Or!=null&&In.add(Or)};return or&&or.forEach(Or=>{const Is=Pi(Or,Ft(pn));Array.isArray(Is)?Is.forEach(ir):ir(Is)}),In},Wn=pn=>({placeholder:"All results",label:pn.column,multiple:pn.type==="multiple-select",items:[...Jn(pn.column)].sort().map(In=>({label:In,value:In}))});return bn.map(pn=>({type:pn.type,element:Wn(pn)}))},lo=!!(E!=null&&E.length),_r=(0,v.useCallback)(bn=>(0,n.jsx)(Pa,{setSearch:hr,hasFilters:lo,selectedFiltersLength:Yt,toggleFilters:Vt,...bn}),[Vt,lo,Yt,hr]),co=typeof s!="function"&&s.length===0,uo=i.length,oi=(0,v.useCallback)(bn=>H&&co?(0,n.jsx)("tbody",{children:(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:uo,children:H})})}):(0,n.jsx)(io.os,{...bn}),[co,H,uo]);return(0,n.jsxs)("div",{className:fe.root,children:[ut&&s&&typeof s!="function"&&(E==null?void 0:E.length)&&(0,n.jsx)(Ea,{filters:qr(E,s),selectedFilters:Ht,onChangeFilters:dr}),(0,n.jsx)(io.ZP,{components:{Header:Aa,Toolbar:_r,Body:oi,...ve},options:{...si,...d},columns:Yn,icons:Li,title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.Z,{variant:"h5",component:"h2",children:p}),m&&(0,n.jsx)(g.Z,{color:"textSecondary",variant:"body1",children:m})]}),data:typeof s=="function"?s:At,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter"}},...ie})]})}$i.icons=Object.freeze(Li);const Zl=e=>{const{children:s,value:i,index:d,...p}=e;return _jsx("div",{role:"tabpanel",hidden:i!==d,"aria-labelledby":`scrollable-auto-tab-${d}`,...p,children:i===d&&_jsx(Box,{p:3,children:s})})},ka=(0,l.Z)(()=>({root:{color:"#6E6E6E",overflow:"visible",fontSize:"1.5rem",textAlign:"center",borderRadius:"50%",backgroundColor:"#E6E6E6",marginLeft:e=>e.isNext?"auto":"0",marginRight:e=>e.isNext?"0":"10px","&:hover":{backgroundColor:"#E6E6E6",opacity:"1"}}}),{name:"BackstageTabIcon"}),Dl=e=>{const s=ka(e),{ariaLabel:i,onClick:d}=e;return _jsx(IconButton,{onClick:d,className:s.root,size:"small",disableRipple:!0,disableFocusRipple:!0,"aria-label":i,children:e.children})},Oa=(e,s)=>s?e?"20px":"0":"40px",$a=(0,l.Z)(e=>({root:{textTransform:"none",height:"64px",fontWeight:e.typography.fontWeightBold,fontSize:e.typography.pxToRem(13),color:e.palette.textSubtle,marginLeft:s=>Oa(s.isFirstNav,s.isFirstIndex),width:"130px",minWidth:"130px","&:hover":{outline:"none",backgroundColor:"transparent",color:e.palette.textSubtle}}}),{name:"BackstageTab"}),Nl=e=>{const s=$a(e),{isFirstNav:i,isFirstIndex:d,...p}=e;return _jsx(Tab,{classes:s,disableRipple:!0,...p})},Ba=(0,l.Z)(e=>({indicator:{display:"flex",justifyContent:"center",backgroundColor:e.palette.tabbar.indicator,height:"4px"},flexContainer:{alignItems:"center"},root:{"&:last-child":{marginLeft:"auto"}}}),{name:"BackstageTabBar"}),Fl=e=>{const s=Ba(e);return _jsx(Tabs,{classes:s,...e,TabIndicatorProps:{children:_jsx("span",{})}})},Za=(0,l.Z)(e=>({root:{flexGrow:1,width:"100%"},styledTabs:{backgroundColor:e.palette.background.paper},appbar:{boxShadow:"none",backgroundColor:e.palette.background.paper,paddingLeft:"10px",paddingRight:"10px"}}),{name:"BackstageTabs"});function Ul(e){const{tabs:s}=e,i=Za(),[d,p]=useState([0,0]),[m,E]=useState(0),[Z,H]=useState(0),[N,ve]=useState([[]]),ie=useRef(),{width:fe}=useWindowSize(),Ee=(Yt,Jt)=>{p([m,Jt])},De=()=>{E(m-1)},ut=()=>{E(m+1)},$t=()=>m+1<N.length;useEffect(()=>{const Jt=m===0?1:2,At=ie.current.offsetWidth-20-Jt*30,Kt=d[0]*Z+d[1],Ht=Math.floor(At/170);H(Ht),ve(chunkArray(s,Ht)),p([Math.floor(Kt/Ht),Kt%Ht])},[fe,s]);const Vt=m===d[0]?d[1]:!1;return _jsxs("div",{className:i.root,children:[_jsx(AppBar,{ref:ie,className:i.appbar,position:"static",children:_jsx("div",{children:_jsxs(StyledTabs,{value:Vt,onChange:Ee,selectionFollowsFocus:!0,children:[m!==0&&_jsx(StyledIcon,{onClick:De,ariaLabel:"navigate-before",children:_jsx(NavigateBeforeIcon,{})}),N[m].map((Yt,Jt)=>_jsx(StyledTab,{value:Jt,isFirstIndex:Jt===0,isFirstNav:m===0,icon:Yt.icon||void 0,label:Yt.label||void 0},Jt)),$t()&&_jsx(StyledIcon,{isNext:!0,onClick:ut,ariaLabel:"navigate-next",children:_jsx(NavigateNextIcon,{})})]})})}),Vt!==!1?N[m].map((Yt,Jt)=>_jsx(TabPanel,{value:Jt,index:Vt,children:Yt.content},Jt)):_jsx(TabPanel,{value:d[1],index:d[1],children:N[d[0]][d[1]].content},"panel_outside_chunked_array")]})}var Ml=t(44311);function Da(e,s){const i=e[e.length-1];if(!!i)return i>=.9?s.palette.status.ok:i>=.5?s.palette.status.warning:s.palette.status.error}function zl(e){const s=useTheme();if(!e.data)return null;var i;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(i=e.color)!==null&&i!==void 0?i:Da(e.data,s)})]})}const Na=e=>(0,l.Z)(s=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:s.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:s.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Fa=({title:e="Unknown page",className:s})=>(0,n.jsx)(g.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ua(e){const{description:s,title:i,titleComponent:d=void 0,children:p,textAlign:m="left"}=e,E=Na({textAlign:m})(),Z=d||(0,n.jsx)(Fa,{title:i,className:E.title});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(yn.q,{title:i}),(0,n.jsxs)("div",{className:E.container,children:[(0,n.jsxs)("div",{className:E.leftItemsBox,children:[Z,s&&(0,n.jsx)(g.Z,{className:E.description,variant:"body2",children:s})]}),(0,n.jsx)("div",{className:E.rightItemsBox,children:p})]})]})}var Ma=t.p+"static/mic-drop.fe3ef4d0..svg";const za=(0,l.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Va=()=>{const e=za();return(0,n.jsx)("img",{src:Ma,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ha=(0,l.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:32}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Wa(e){const{status:s,statusMessage:i,additionalInfo:d,supportUrl:p}=e,m=Ha(),E=(0,Un.s0)(),Z=Gs();return(0,n.jsxs)(y.Z,{container:!0,spacing:0,className:m.container,children:[(0,n.jsxs)(y.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,n.jsxs)(g.Z,{"data-testid":"error",variant:"body1",className:m.subtitle,children:["ERROR ",s,": ",i]}),(0,n.jsx)(g.Z,{variant:"body1",className:m.subtitle,children:d}),(0,n.jsx)(g.Z,{variant:"h2",className:m.title,children:"Looks like someone dropped the mic!"}),(0,n.jsxs)(g.Z,{variant:"h6",children:[(0,n.jsx)(xe,{to:"#","data-testid":"go-back-link",onClick:()=>E(-1),children:"Go back"}),"... or please"," ",(0,n.jsx)(xe,{to:p||Z.url,children:"contact support"})," if you think this is a bug."]})]}),(0,n.jsx)(Va,{})]})}var Ga=t(16173);const Ka=(0,Qt.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(g.Z),ei=(0,Qt.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Ot.Z);function Ya(e){const{children:s,...i}=e,[d,p]=v.useState(null),m=v.Children.toArray(s),[E,Z,...H]=m,N=H.length?H.pop():m[m.length-1],ve=m.length>3,ie=De=>{p(De.currentTarget)},fe=()=>{p(null)},Ee=Boolean(d);return(0,n.jsxs)(v.Fragment,{children:[(0,n.jsxs)(Ga.Z,{"aria-label":"breadcrumb",...i,children:[m.length>1&&(0,n.jsx)(ei,{clone:!0,children:E}),m.length>2&&(0,n.jsx)(ei,{clone:!0,children:Z}),ve&&(0,n.jsx)(Ka,{onClick:ie,children:"..."}),(0,n.jsx)(Ot.Z,{style:{fontStyle:"italic"},children:N})]}),(0,n.jsx)(Us.ZP,{open:Ee,anchorEl:d,onClose:fe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(j.Z,{children:H.map((De,ut)=>(0,n.jsx)(U.Z,{button:!0,children:(0,n.jsx)(ei,{clone:!0,children:De})},ut))})})]})}const Ja=(0,l.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),Qa=({type:e,typeLink:s,classes:i,pageTitle:d})=>e?s?(0,n.jsxs)(Ya,{className:i.breadcrumb,children:[(0,n.jsx)(xe,{to:s,children:e}),(0,n.jsx)(g.Z,{children:d})]}):(0,n.jsx)(g.Z,{className:i.type,children:e}):null,Xa=({pageTitle:e,classes:s,tooltip:i})=>{const d=(0,n.jsx)(g.Z,{className:s.title,variant:"h1",children:e});return i?(0,n.jsx)(Ge.ZP,{title:i,placement:"top-start",children:d}):d},qa=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,n.jsx)(n.Fragment,{children:s}):(0,n.jsx)(g.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function Bi(e){const{children:s,pageTitleOverride:i,style:d,subtitle:p,title:m,tooltip:E,type:Z,typeLink:H}=e,N=Ja(),ie=(0,I.h_)(I.Ds).getOptionalString("app.title")||"Backstage",fe=i||m,Ee=m||i,De=`${fe} | %s | ${ie}`,ut=`${fe} | ${ie}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(yn.q,{titleTemplate:De,defaultTitle:ut}),(0,n.jsxs)("header",{style:d,className:N.header,children:[(0,n.jsxs)(Ot.Z,{className:N.leftItemsBox,children:[(0,n.jsx)(Qa,{classes:N,type:Z,typeLink:H,pageTitle:Ee}),(0,n.jsx)(Xa,{classes:N,pageTitle:Ee,tooltip:E}),(0,n.jsx)(qa,{classes:N,subtitle:p})]}),(0,n.jsx)(y.Z,{container:!0,className:N.rightItemsBox,spacing:4,children:s})]})]})}const _a=({label:e,secondaryLabel:s,icon:i,disabled:d=!1,onClick:p})=>_jsx(React.Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:m=>{p&&p(m)},children:[i&&_jsx(ListItemIcon,{children:i}),_jsx(ListItemText,{primary:e,secondary:s})]})});function Vl(e){const{actionItems:s}=e,[i,d]=React.useState(!1),p=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>d(!0),"data-testid":"header-action-menu",ref:p,style:{color:"white",height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:i,anchorEl:p.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>d(!1),children:_jsx(List,{children:s.map((m,E)=>_jsx(_a,{...m},`header-action-menu-${E}`))})})]})}const el=(0,l.Z)(e=>({root:{textAlign:"left"},label:{color:e.palette.common.white,fontWeight:"bold",letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:"rgba(255, 255, 255, 0.8)",fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),tl=({value:e,className:s})=>(0,n.jsx)(g.Z,{className:s,children:e});function nl(e){const{label:s,value:i,url:d}=e,p=el(),m=(0,n.jsx)(tl,{className:p.value,value:i||"<Unknown>"});return(0,n.jsx)(y.Z,{item:!0,children:(0,n.jsxs)("span",{className:p.root,children:[(0,n.jsx)(g.Z,{className:p.label,children:s}),d?(0,n.jsx)(xe,{to:d,children:m}):m]})})}const rl={hour:"2-digit",minute:"2-digit"};function Zi(e){const s=new Date,i=window.navigator.language,d=[];if(!e.has("homepage.clocks"))return d;const p=e.getConfigArray("homepage.clocks");for(const m of p)if(m.has("label")&&m.has("timezone")){let E=m.getString("label");const Z={timeZone:m.getString("timezone"),...rl};try{new Date().toLocaleString(i,Z)}catch{console.warn(`The timezone ${Z.timeZone} is invalid. Defaulting to GMT`),Z.timeZone="GMT",E="GMT"}const H=s.toLocaleTimeString(i,Z);d.push({time:H,label:E})}return d}function Hl(e){const s=useApi(configApiRef),i=[],[d,p]=React.useState(i);return React.useEffect(()=>{p(Zi(s));const m=setInterval(()=>{p(Zi(s))},1e3);return()=>{clearInterval(m)}},[s]),d.length!==0?_jsx(_Fragment,{children:d.map(m=>_jsx(HeaderLabel,{label:m.label,value:m.time},m.label))}):null}const sl=e=>(0,B.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),ol=(0,l.Z)(sl,{name:"BackstageItemCardHeader"});function il(e){const{title:s,subtitle:i,children:d}=e,p=ol(e);return(0,n.jsxs)("div",{className:p.root,children:[i&&(0,n.jsx)(g.Z,{variant:"subtitle2",component:"h3",children:i}),s&&(0,n.jsx)(g.Z,{variant:"h6",component:"h4",children:s}),d]})}function Wl(e){const{description:s,tags:i,title:d,type:p,subtitle:m,label:E,onClick:Z,href:H}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:m||p})}),_jsxs(CardContent,{children:[i!=null&&i.length?_jsx(Box,{children:i.map((N,ve)=>_jsx(Chip,{size:"small",label:N},ve))}):null,s]}),_jsxs(CardActions,{children:[!H&&_jsx(Button,{to:"#",onClick:Z,color:"primary",children:E}),H&&_jsx(Button,{to:H,color:"primary",children:E})]})]})}const al=e=>(0,B.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),ll=(0,l.Z)(al,{name:"BackstageItemCardGrid"});function cl(e){const{children:s,...i}=e,d=ll(i);return(0,n.jsx)("div",{className:d.root,...i,children:s})}var dl=t(41547);const ul=(0,l.Z)(()=>({root:({isMobile:e})=>({display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",height:e?"100%":"100vh",overflowY:"auto"})}),{name:"BackstagePage"});function Di(e){const{themeId:s,children:i}=e,{isMobile:d}=kr(),p=ul({isMobile:d});return(0,n.jsx)(dl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:s})}),children:(0,n.jsx)("main",{className:p.root,children:i})})}function hl(e){const{themeId:s,children:i,...d}=e;return(0,n.jsxs)(Di,{themeId:s,children:[(0,n.jsx)(Bi,{...d}),i]})}var Pn=t(30195);const Gl=Pn.z.object({providerInfo:Pn.z.object({}).catchall(Pn.z.unknown()).optional(),profile:Pn.z.object({email:Pn.z.string().optional(),displayName:Pn.z.string().optional(),picture:Pn.z.string().optional()}),backstageIdentity:Pn.z.object({token:Pn.z.string(),identity:Pn.z.object({type:Pn.z.literal("user"),userEntityRef:Pn.z.string(),ownershipEntityRefs:Pn.z.array(Pn.z.string())})})}),Ni={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function pl(e){const s=new Date(Date.now()+Ni.defaultTokenExpiryMillis);if(!e)return s;const[i,d,p]=e.split("."),m=JSON.parse(atob(d));return typeof m.exp!="number"?s:new Date(m.exp*1e3-Ni.tokenExpiryMarginMillis)}class Kl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),i=s.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(i);if(!d)throw new TypeError(`Invalid user entity reference "${i}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,i=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:pl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:i,previous:s},i}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),i=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"});if(!i.ok)throw await ResponseError.fromResponse(i);return proxiedSessionSchema.parse(await i.json())}constructor(s){this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const Yl=e=>{const s=useApi(discoveryApiRef),[{status:i,error:d},{execute:p}]=useAsync(async()=>{const m=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s});await m.start(),e.onSignInSuccess(m)});return useMountEffect(p),i==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},fl=(0,l.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ti=({children:e})=>{const s=fl();return(0,n.jsx)(y.Z,{component:"li",item:!0,classes:s,children:e})};class ni{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const s="user:default/guest";return{type:"user",userEntityRef:s,ownershipEntityRefs:[s]}}async getCredentials(){return{}}async signOut(){}}function gl(e){const[s,i,d]=e.split(".");return JSON.parse(atob(i))}class ri{getUserId(){return this.result.userId}static fromResult(s){return new ri(s)}async getIdToken(){var s,i;return(i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const p=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:p,ownershipEntityRefs:[p]}}const{sub:i,ent:d}=gl(s);return{type:"user",userEntityRef:i,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var s,i;return{token:await((i=(s=this.result).getIdToken)===null||i===void 0?void 0:i.call(s))}}async signOut(){var s,i;return(i=(s=this.result).signOut)===null||i===void 0?void 0:i.call(s)}constructor(s){this.result=s}}class Ts{static createGuest(){return new ni}static fromLegacy(s){return ri.fromResult(s)}static create(s){return new Ts(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!i)throw new TypeError(`Invalid user entity reference "${s}"`);return i[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(s){throw this.profilePromise=void 0,s}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(s,i,d){this.identity=s,this.authApi=i,this.profile=d}}const ml={Component:({config:e,onSignInSuccess:s})=>{const{apiRef:i,title:d,message:p}=e,m=(0,I.h_)(i),E=(0,I.h_)(I.VE),Z=async()=>{try{const H=await m.getBackstageIdentity({instantPopup:!0});if(!H)throw new Error(`The ${d} provider is not configured to support sign-in`);const N=await m.getProfile();s(Ts.create({identity:H.identity,profile:N,authApi:m}))}catch(H){E.post(new Er.SP("Login failed",H))}};return(0,n.jsx)(ti,{children:(0,n.jsx)(xr,{variant:"fullHeight",title:d,actions:(0,n.jsx)(q.Z,{color:"primary",variant:"outlined",onClick:Z,children:"Sign In"}),children:(0,n.jsx)(g.Z,{variant:"body1",children:p})})})},loader:async(e,s)=>{const i=e.get(s),d=await i.getBackstageIdentity({optional:!0});if(!d)return;const p=await i.getProfile();return Ts.create({identity:d.identity,profile:p,authApi:i})}},vl={Component:({onSignInSuccess:e})=>(0,n.jsx)(ti,{children:(0,n.jsx)(xr,{title:"Guest",variant:"fullHeight",actions:(0,n.jsx)(q.Z,{color:"primary",variant:"outlined",onClick:()=>e(new ni),children:"Enter"}),children:(0,n.jsxs)(g.Z,{variant:"body1",children:["Enter as a Guest User.",(0,n.jsx)("br",{}),"You will not have a verified identity,",(0,n.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ni};var yl=t(63955),Fi=t(86619),Ui=t(74828),xl=t(45455),bl=t.n(xl);const Sl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,wl=(0,l.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Mi=e=>{const{ref:s,...i}=e;return{inputRef:s,...i}},Cl={Component:({onSignInSuccess:e})=>{const s=wl(),{register:i,handleSubmit:d,formState:p}=(0,yl.cI)({mode:"onChange"}),{errors:m}=p,E=({userId:Z})=>{e(Ts.fromLegacy({userId:Z,profile:{email:`${Z}@example.com`}}))};return(0,n.jsx)(ti,{children:(0,n.jsxs)(xr,{title:"Custom User",variant:"fullHeight",children:[(0,n.jsxs)(g.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,n.jsx)("br",{}),"This selection will not be stored."]}),(0,n.jsxs)("form",{className:s.form,onSubmit:d(E),children:[(0,n.jsxs)(M.Z,{children:[(0,n.jsx)(Fi.Z,{...Mi(i("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(m.userId)}),m.userId&&(0,n.jsx)(Ui.Z,{error:!0,children:m.userId.message})]}),(0,n.jsxs)(M.Z,{children:[(0,n.jsx)(Fi.Z,{...Mi(i("idToken",{required:!1,validate:Z=>!Z||Sl.test(Z)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(m.idToken)}),m.idToken&&(0,n.jsx)(Ui.Z,{error:!0,children:m.idToken.message})]}),(0,n.jsx)(q.Z,{type:"submit",color:"primary",variant:"outlined",className:s.button,disabled:!(p!=null&&p.isDirty)||!bl()(m),children:"Continue"})]})]})})},loader:async()=>{}},ao="@backstage/core:SignInPage:provider",zi={guest:vl,custom:Cl,common:ml};function Vi(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function tc(e){return e.reduce((i,d)=>{if(typeof d=="string")return Vi(d,i),i[d]={components:zi[d],id:d},i;const{id:p}=d;return Vi(p,i),i[p]={components:zi.common,id:p,config:d},i},{})}const nc=(e,s)=>{const i=useApi(errorApiRef),d=useApiHolder(),[p,m]=useState(!0),E=useCallback(H=>{s(IdentityApiSignOutProxy.from({identityApi:H,signOut:async()=>{var N;localStorage.removeItem(ao),await((N=H.signOut)===null||N===void 0?void 0:N.call(H))}}))},[s]);useLayoutEffect(()=>{var H;if(!p)return;const N=localStorage.getItem(ao);if(N===null){m(!1);return}const ve=e[N];if(!ve){m(!1);return}let ie=!1;return ve.components.loader(d,(H=ve.config)===null||H===void 0?void 0:H.apiRef).then(fe=>{ie||(fe?E(fe):m(!1))}).catch(fe=>{ie||(localStorage.removeItem(ao),i.post(fe),m(!1))}),()=>{ie=!0}},[p,i,s,d,e,E]);const Z=useMemo(()=>Object.keys(e).map(H=>{const N=e[H],{Component:ve}=N.components,ie=fe=>{localStorage.setItem(ao,N.id),E(fe)};return _jsx(ve,{config:N.config,onSignInSuccess:ie},N.id)}),[e,E]);return[p,Z]},jl=({onSignInSuccess:e,providers:s=[],title:i,align:d="left"})=>{const p=useApi(configApiRef),m=useStyles(),E=getSignInProviders(s),[Z,H]=useSignInProviders(E,e);return Z?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:p.getString("app.title")}),_jsxs(Content,{children:[i&&_jsx(ContentHeader,{title:i,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:m,children:H})]})]})},El=({provider:e,auto:s,onSignInSuccess:i})=>{const d=useStyles(),p=useApi(e.apiRef),m=useApi(configApiRef),[E,Z]=useState(),[H,N]=useState(!1),ve=async({checkExisting:ie,showPopup:fe})=>{try{let Ee;if(ie&&(Ee=await p.getBackstageIdentity({optional:!0})),!Ee&&(fe||s)&&(N(!0),Ee=await p.getBackstageIdentity({instantPopup:!0}),!Ee))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ee){N(!0);return}const De=await p.getProfile();i(UserIdentity.create({identity:Ee.identity,authApi:p,profile:De}))}catch(Ee){Z(Ee),N(!0)}};return useMountEffect(()=>ve({checkExisting:!0})),H?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{ve({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),E&&E.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:E.message})]})})})})]}):_jsx(Progress,{})};function rc(e){return"provider"in e?_jsx(El,{...e}):_jsx(jl,{...e})}const Al=(0,l.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Tl=(0,Qt.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(er.Z);function sc(e){const{slackChannel:s,errorBoundaryProps:i,children:d,title:p,deepLink:m,value:E,onChange:Z}=e,H=Al(),[N,ve]=useState(0),ie=Z||((De,ut)=>ve(ut));let fe;E?React.Children.map(d,De=>{React.isValidElement(De)&&(De==null?void 0:De.props.value)===E&&(fe=De==null?void 0:De.props.children)}):React.Children.map(d,(De,ut)=>{React.isValidElement(De)&&ut===N&&(fe=De==null?void 0:De.props.children)});const Ee=i||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ee,children:[p&&_jsx(Tl,{title:p}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:H,value:E||N,onChange:ie,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:fe}),m&&_jsx(BottomLink,{...m})]})})}const Il=(0,l.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:"bold"}}),{name:"BackstageCardTab"});function oc(e){const{children:s,...i}=e,d=Il();return _jsx(Tab,{disableRipple:!0,classes:d,...i})}},25248:function(bt,Oe,t){"use strict";t.d(Oe,{fC:function(){return S},CL:function(){return Ne},sM:function(){return Y},$v:function(){return xe},v_:function(){return Ke},hg:function(){return Ye},uB:function(){return re},R5:function(){return Tt},bq:function(){return T},Ds:function(){return He},ni:function(){return Q},T0:function(){return F},CO:function(){return Cn},x8:function(){return un},rx:function(){return nn},YO:function(){return on},P4:function(){return Rn},NT:function(){return Bt},NW:function(){return We},VE:function(){return Ge},W0:function(){return Me},gP:function(){return qe},IY:function(){return at},F4:function(){return le},ux:function(){return R},Kp:function(){return ue},$4:function(){return ct},p_:function(){return D},ZM:function(){return it},D:function(){return P},gW:function(){return L},E6:function(){return rt},z$:function(){return mt},h_:function(){return se},I_:function(){return B},qD:function(){return Ie},vJ:function(){return ln},yx:function(){return Ce},tg:function(){return sn},Oi:function(){return Vn}});var h=t(52322),n=t(51837),v=t(2784);const I=(0,n.CT)("analytics-context"),W=()=>{const he=(0,v.useContext)(I);if(he===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const te=he.atVersion(1);if(te===void 0)throw new Error("No context found for version 1.");return te},S=he=>{const{attributes:te,children:Te}=he,Je={...W(),...te},J=(0,n.EI)({1:Je});return(0,h.jsx)(I.Provider,{value:J,children:Te})};function l(he,te){const Te=ke=>_jsx(S,{attributes:te,children:_jsx(he,{...ke})});return Te.displayName=`WithAnalyticsContext(${he.displayName||he.name||"Component"})`,Te}function B(){const he=(0,n.Vt)("api-context");if(!he)throw new Error("API context is not available");const te=he.atVersion(1);if(!te)throw new Error("ApiContext v1 not available");return te}function se(he){const Te=B().get(he);if(!Te)throw new Error(`No implementation available for ${he}`);return Te}function X(he){return function(Te){const ke=J=>{const y=B(),g={};for(const k in he)if(he.hasOwnProperty(k)){const G=he[k],ce=y.get(G);if(!ce)throw new Error(`No implementation available for ${G}`);g[k]=ce}return _jsx(Te,{...J,...g})},Je=Te.displayName||Te.name||"Component";return ke.displayName=`withApis(${Je})`,ke}}class q{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(te){if(this.config=te,!te.id.split(".").flatMap(ke=>ke.split("-")).every(ke=>ke.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${te.id}'`)}}function F(he){return new q(he)}function Q(he,te){return"id"in he?{api:he,deps:{},factory:()=>te}:he}var Y;(function(he){he.SignedIn="SignedIn",he.SignedOut="SignedOut"})(Y||(Y={}));const ue=F({id:"core.auth.google"}),le=F({id:"core.auth.github"}),P=F({id:"core.auth.okta"}),R=F({id:"core.auth.gitlab"}),D=F({id:"core.auth.microsoft"}),L=F({id:"core.auth.onelogin"}),T=F({id:"core.auth.bitbucket"}),re=F({id:"core.auth.atlassian"}),xe=F({id:"core.alert"}),Ke=F({id:"core.analytics"}),Ye=F({id:"core.apptheme"}),He=F({id:"core.config"}),We=F({id:"core.discovery"}),Ge=F({id:"core.error"});var Ne;(function(he){he[he.None=0]="None",he[he.Active=1]="Active"})(Ne||(Ne={}));const Me=F({id:"core.featureflags"}),qe=F({id:"core.fetch"}),ct=F({id:"core.identity"}),it=F({id:"core.oauthrequest"}),rt=F({id:"core.storage"});class Ae{setContext(te){this.context=te}captureEvent(te,Te,{value:ke,attributes:Je}={}){try{this.analyticsApi.captureEvent({action:te,subject:Te,value:ke,attributes:Je,context:this.context})}catch(J){console.warn("Error during analytics event capture. %o",J)}}constructor(te,Te={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=te,this.context=Te}}function tt(){try{return se(Ke)}catch{return{captureEvent:()=>{}}}}function mt(){const he=(0,v.useRef)(null),te=W(),Te=tt();function ke(){return he.current===null&&(he.current=new Ae(Te)),he.current}const Je=ke();return Je.setContext(te),Je}const Le="plugin-context",ae=he=>{const{children:te,plugin:Te}=he,{Provider:ke}=(0,n.CT)(Le);return(0,h.jsx)(ke,{value:(0,n.EI)({1:{plugin:Te}}),children:te})};function Ce(){const he=(0,n.Vt)(Le);if(!he)throw new Error("Plugin Options context is not available");const te=he.atVersion(1);if(!te)throw new Error("Plugin Options v1 is not available");return te.plugin.getPluginOptions()}const Ie=()=>{const he=(0,n.Vt)("app-context");if(!he)throw new Error("App context is not available");const te=he.atVersion(1);if(!te)throw new Error("AppContext v1 not available");return te},nt=(0,n.uW)("component-data-store",()=>new WeakMap),gt="__backstage_data";function Tt(he,te,Te){const ke=he;var Je;let J=(Je=ke[gt])!==null&&Je!==void 0?Je:nt.get(he);if(J||(J={map:new Map},Object.defineProperty(ke,gt,{enumerable:!1,configurable:!0,writable:!1,value:J}),nt.set(he,J)),J.map.has(te)){const y=he.displayName||he.name;throw new Error(`Attempted to attach duplicate data "${te}" to component "${y}"`)}J.map.set(te,Te)}function at(he,te){if(!he)return;const Te=he.type;if(!Te)return;var ke;const Je=(ke=Te[gt])!==null&&ke!==void 0?ke:nt.get(Te);if(!!Je)return Je.map.get(te)}const St=(0,n.uW)("route-ref-type",()=>Symbol("route-ref-type"));let wt=St;class Lt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(te,Te){this.id=te,this.params=Te,this[wt]="absolute"}}function Bt(he){var te;return new Lt(he.id,(te=he.params)!==null&&te!==void 0?te:[])}const jt=/^\w+$/;let Ut=null;class Zt{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(te,Te,ke,Je){this.id=te,this.path=Te,this.parent=ke,this.params=Je,this[Ut]="sub"}}function en(he){const{id:te,path:Te,parent:ke}=he,Je=Te.split("/").filter(g=>g.startsWith(":")).map(g=>g.substring(1)),J=[...ke.params,...Je];if(ke.params.some(g=>Je.includes(g)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Te.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Te}'`);if(Te.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Te}'`);for(const g of Je)if(!jt.test(g))throw new Error(`SubRouteRef path has invalid param, got '${g}'`);return new Zt(te,Te,ke,J)}let rn=St;class wn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(te,Te,ke){this.id=te,this.params=Te,this.optional=ke,this[rn]="external"}}function un(he){var te;return new wn(he.id,(te=he.params)!==null&&te!==void 0?te:[],Boolean(he.optional))}var kn=t(10289);function sn(he){const te=(0,kn.TH)(),Te=(0,n.Vt)("routing-context");if(!Te)throw new Error("Routing context is not available");const ke=Te.atVersion(1),Je=(0,v.useMemo)(()=>ke&&ke.resolve(he,te),[ke,he,te]);if(!Te)throw new Error("useRouteRef used outside of routing context");if(!ke)throw new Error("RoutingContext v1 not available");const J="optional"in he&&he.optional;if(!Je&&!J)throw new Error(`No path for ${he}`);return Je}function Vn(he){return(0,kn.UO)()}class Mt extends v.Component{static getDerivedStateFromError(te){return{error:te}}render(){const{error:te}=this.state,{app:Te,plugin:ke}=this.props,{ErrorBoundaryFallback:Je}=Te.getComponents();return te?(0,h.jsx)(Je,{error:te,resetError:this.handleErrorReset,plugin:ke}):this.props.children}constructor(...te){super(...te),this.state={error:void 0},this.handleErrorReset=()=>{this.setState({error:void 0})}}}function Rn(he){const{component:te,mountPoint:Te,name:ke}=he;return on({component:{lazy:()=>te().then(Je=>{const J=g=>{try{sn(Te)}catch(k){if(typeof k=="object"&&k!==null){const{message:G}=k;if(typeof G=="string"&&G.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Te} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw k}return(0,h.jsx)(Je,{...g})},y=ke||Je.displayName||Je.name||"LazyComponent";return J.displayName=`RoutableExtension(${y})`,J},Je=>y=>{const g=Ie(),{BootErrorPage:k}=g.getComponents();return(0,h.jsx)(k,{step:"load-chunk",error:Je})})},data:{"core.mountPoint":Te},name:ke})}function Cn(he){const{component:te,name:Te}=he;return on({component:te,name:Te})}function on(he){const{data:te={},name:Te}=he;Te||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let ke;if("lazy"in he.component){const J=he.component.lazy;ke=(0,v.lazy)(()=>J().then(y=>({default:y})))}else ke=he.component.sync;const Je=Te||ke.displayName||ke.name||"Component";return{expose(J){const y=g=>{const k=Ie(),{Progress:G}=k.getComponents(),ce=te==null?void 0:te["core.mountPoint"];return(0,h.jsx)(v.Suspense,{fallback:(0,h.jsx)(G,{}),children:(0,h.jsx)(Mt,{app:k,plugin:J,children:(0,h.jsx)(S,{attributes:{pluginId:J.getId(),...Te&&{extension:Te},...ce&&{routeRef:ce.id}},children:(0,h.jsx)(ae,{plugin:J,children:(0,h.jsx)(ke,{...g})})})})})};Tt(y,"core.plugin",J);for(const[g,k]of Object.entries(te))Tt(y,g,k);return y.displayName=`Extension(${Je})`,y}}}function an(he,te,Te,ke){return v.Children.toArray(he).flatMap(Je=>{if(!(0,v.isValidElement)(Je))return[];if(Je.type===v.Fragment)return an(Je.props.children,te,Te,ke);if(at(Je,"core.featureFlagged")){const J=Je.props;return("with"in J?te.isActive(J.with):!te.isActive(J.without))?an(Je.props.children,te,Te,ke):[]}if(Te===void 0||Te(Je))return[Je];if(ke)throw new Error(ke);return an(Je.props.children,te,Te,ke)})}class tn{selectByComponentData(te){const Te=an(this.node,this.featureFlagsApi,ke=>at(ke,te.key)!==void 0,te.withStrictError);return new tn(Te,this.featureFlagsApi)}findComponentData(te){return an(this.node,this.featureFlagsApi,ke=>at(ke,te.key)!==void 0).map(ke=>at(ke,te.key)).filter(ke=>ke!==void 0)}getElements(){return an(this.node,this.featureFlagsApi)}constructor(te,Te){this.node=te,this.featureFlagsApi=Te}}function ln(he,te,Te=[]){const ke=se(Me),Je=new tn(he,ke);return(0,v.useMemo)(()=>te(Je),[he,...Te])}class fn{getId(){return this.config.id}getApis(){var te;return(te=this.config.apis)!==null&&te!==void 0?te:[]}getFeatureFlags(){var te,Te;return(Te=(te=this.config.featureFlags)===null||te===void 0?void 0:te.slice())!==null&&Te!==void 0?Te:[]}get routes(){var te;return(te=this.config.routes)!==null&&te!==void 0?te:{}}get externalRoutes(){var te;return(te=this.config.externalRoutes)!==null&&te!==void 0?te:{}}provide(te){return te.expose(this)}__experimentalReconfigure(te){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(te))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var te;return(te=this.options)!==null&&te!==void 0?te:{}}toString(){return`plugin{${this.config.id}}`}constructor(te){this.config=te,this.options=void 0}}function nn(he){return new fn(he)}},23054:function(bt,Oe,t){"use strict";t.d(Oe,{SP:function(){return Y},dR:function(){return q},VL:function(){return le},BD:function(){return n}});function h(P){if(typeof P!="object"||P===null||Array.isArray(P))return!1;const R=P;return!(typeof R.name!="string"||R.name===""||typeof R.message!="string")}function n(P){if(typeof P!="object"||P===null||Array.isArray(P))throw new Error(`Encountered invalid error, not an object, got '${P}'`);const R=P;if(typeof R.name!="string"||R.name==="")throw new Error(`Encountered error object without a name, got '${P}'`);if(typeof R.message!="string")throw new Error(`Encountered error object without a message, got '${P}'`)}var v=t(24852);function I(P,R){const D=serializeErrorInternal(P),L={name:"Unknown",message:"<no reason given>",...D};return R!=null&&R.includeStack||delete L.stack,L}function W(P){const R=(0,v.deserializeError)(P);return P.stack||(R.stack=void 0),R}function S(P){if(h(P)){const R=String(P);return R!=="[object Object]"?R:`${P.name}: ${P.message}`}return`unknown error '${P}'`}class l extends Error{constructor(R,D){var L;let T=R;if(D!==void 0){const re=S(D);T?T+=`; caused by ${re}`:T=`caused by ${re}`}super(T),(L=Error.captureStackTrace)===null||L===void 0||L.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=h(D)?D:void 0}}class B extends null{}class se extends null{}class X extends null{}class q extends l{}class F extends null{}class Q extends null{}class Y extends l{constructor(R,D){super(R,D),this.name=h(D)?D.name:"Error"}}async function ue(P){try{const D=await P.text();if(D){var R;if(!((R=P.headers.get("content-type"))===null||R===void 0)&&R.startsWith("application/json"))try{const L=JSON.parse(D);if(L.error&&L.response)return L}catch{}return{error:{name:"Error",message:`Request failed with status ${P.status} ${P.statusText}, ${D}`},response:{statusCode:P.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${P.status} ${P.statusText}`},response:{statusCode:P.status}}}class le extends Error{static async fromResponse(R){const D=await ue(R),L=D.response.statusCode||R.status,T=D.error.name||R.statusText,re=`Request failed with ${L} ${T}`,xe=W(D.error);return new le({message:re,response:R,data:D,cause:xe})}constructor(R){super(R.message),this.name="ResponseError",this.response=R.response,this.body=R.data,this.cause=R.cause}}},32838:function(bt,Oe,t){"use strict";t.d(Oe,{nW:function(){return le},ae:function(){return q},q3:function(){return F}});var h=t(25248);const n=(0,h.T0)({id:"core.scmauth"});var v=new WeakMap;class I{async getCredentials(R){const D=new URL(R.url),L=_class_private_field_get(this,v).find(T=>T.isUrlSupported(D));if(!L)throw new Error(`No auth provider available for '${R.url}', see https://backstage.io/link?scm-auth`);return L.getCredentials(R)}constructor(R){_class_private_field_init(this,v,{writable:!0,value:void 0}),_class_private_field_set(this,v,R)}}var W=new WeakMap,S=new WeakMap,l=new WeakMap,B=new WeakMap;class se{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:R,gitlab:D,azure:L,bitbucket:T})=>se.merge(se.forGithub(R),se.forGitlab(D),se.forAzure(L),se.forBitbucket(T))})}static forAuthApi(R,D){return new se("generic",R,D.host,D.scopeMapping)}static forGithub(R,D){var L;const T=(L=D==null?void 0:D.host)!==null&&L!==void 0?L:"github.com";return new se("github",R,T,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(R,D){var L;const T=(L=D==null?void 0:D.host)!==null&&L!==void 0?L:"gitlab.com";return new se("gitlab",R,T,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(R,D){var L;const T=(L=D==null?void 0:D.host)!==null&&L!==void 0?L:"dev.azure.com";return new se("azure",R,T,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(R,D){var L;const T=(L=D==null?void 0:D.host)!==null&&L!==void 0?L:"bitbucket.org";return new se("bitbucket",R,T,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...R){return new I(R)}isUrlSupported(R){return R.host===_class_private_field_get(this,S)}getAdditionalScopesForProvider(R){var D;if(!(R!=null&&R.customScopes)||_class_private_field_get(this,B)==="generic")return[];var L;return(L=(D=R.customScopes)===null||D===void 0?void 0:D[_class_private_field_get(this,B)])!==null&&L!==void 0?L:[]}async getCredentials(R){const{url:D,additionalScope:L,...T}=R,re=_class_private_field_get(this,l).default.slice();L!=null&&L.repoWrite&&re.push(..._class_private_field_get(this,l).repoWrite);const xe=this.getAdditionalScopesForProvider(L);xe.length&&re.push(...xe);const Ke=[...new Set(re)],Ye=await _class_private_field_get(this,W).getAccessToken(Ke,T);return{token:Ye,headers:{Authorization:`Bearer ${Ye}`}}}constructor(R,D,L,T){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_init(this,S,{writable:!0,value:void 0}),_class_private_field_init(this,l,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,W,D),_class_private_field_set(this,S,L),_class_private_field_set(this,l,T),_class_private_field_set(this,B,R)}}var X=t(39619);class q{static fromConfig(R){return X.Lx.fromConfig(R)}}const F=(0,h.T0)({id:"integration.scmintegrations"});var Q=t(52322),Y=t(73250),ue=t(2784);const le=P=>{const{type:R}=P,D=(0,h.qD)(),L=Y.Z;var T;const re=R&&(T=D.getSystemIcon(R))!==null&&T!==void 0?T:L;return(0,Q.jsx)(re,{})}},39619:function(bt,Oe,t){"use strict";t.d(Oe,{Lx:function(){return Nt},Pb:function(){return Qe}});var h=t(82717),n=t.n(h),v=t(76635);function I(w){const u=new URL("http://example.com");return u.host=w,u.host===w}function W(w){try{return new URL(w),!0}catch{return!1}}function S(w,u){return{list(){return w},byUrl(b){try{const A=typeof b=="string"?new URL(b):b;return w.find(K=>u(K)===A.host)}catch{return}},byHost(b){return w.find(A=>u(A)===b)}}}function l(w){const{url:u,base:b,lineNumber:A}=w;try{return new URL(u),u}catch{}let K;if(u.startsWith("/")){const{filepath:me}=n()(b);K=new URL(b);const ye=(0,v.trimEnd)(K.pathname.substring(0,K.pathname.length-me.length),"/");K.pathname=`${ye}${u}`}else K=new URL(u,b);return K.search=new URL(b).search,A&&(K.hash=`L${A}`),K.toString()}const B="amazonaws.com";function se(w){const u=w.getOptionalString("endpoint");var b;const A=(b=w.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let K,me;if(u){try{const Rt=new URL(u);K=Rt.host,me=Rt.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else K=B;const ye=w.getOptionalString("accessKeyId"),Re=w.getOptionalString("secretAccessKey"),et=w.getOptionalString("roleArn"),kt=w.getOptionalString("externalId");return{host:K,endpoint:u,s3ForcePathStyle:A,accessKeyId:ye,secretAccessKey:Re,roleArn:et,externalId:kt}}function X(w){const u=w.map(se);return u.some(b=>b.host===B)||u.push({host:B}),u}class q{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}q.factory=({config:w})=>{var u;const b=X((u=w.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new q(A)),A=>A.config.host)};var F=t(90383),Q=t(22504),Y=t(69866);const ue="GB";var le=new WeakMap,P=new WeakMap,R=new WeakMap,D=new WeakMap,L=new WeakMap,T=new WeakMap,re=new WeakMap;class xe{static fromRepoUrl(u){const b=new URL(u);let A,K,me;const ye=b.pathname.split("/").map(_n=>decodeURIComponent(_n));if(ye[2]==="_git"?(A=ye[1],K=me=ye[3]):ye[3]==="_git"?(A=ye[1],K=ye[2],me=ye[4]):ye[4]==="_git"&&(A=`${ye[1]}/${ye[2]}`,K=ye[3],me=ye[5]),!A||!K||!me)throw new Error("Azure URL must point to a git repository");var Re;const et=(Re=b.searchParams.get("path"))!==null&&Re!==void 0?Re:void 0;let kt;const Rt=b.searchParams.get("version");if(Rt){if(Rt.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");kt=Rt.slice(2)}return new xe(b.origin,A,K,me,et,kt)}toRepoUrl(){let u;return(0,F.Z)(this,R)===(0,F.Z)(this,D)?u=(0,F.Z)(this,re).call(this,(0,F.Z)(this,P),"_git",(0,F.Z)(this,D)):u=(0,F.Z)(this,re).call(this,(0,F.Z)(this,P),(0,F.Z)(this,R),"_git",(0,F.Z)(this,D)),(0,F.Z)(this,L)&&u.searchParams.set("path",(0,F.Z)(this,L)),(0,F.Z)(this,T)&&u.searchParams.set("version",ue+(0,F.Z)(this,T)),u.toString()}toFileUrl(){if(!(0,F.Z)(this,L))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,F.Z)(this,re).call(this,(0,F.Z)(this,P),(0,F.Z)(this,R),"_apis","git","repositories",(0,F.Z)(this,D),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,F.Z)(this,L)),(0,F.Z)(this,T)&&u.searchParams.set("version",(0,F.Z)(this,T)),u.toString()}toArchiveUrl(){const u=(0,F.Z)(this,re).call(this,(0,F.Z)(this,P),(0,F.Z)(this,R),"_apis","git","repositories",(0,F.Z)(this,D),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,F.Z)(this,L)&&u.searchParams.set("scopePath",(0,F.Z)(this,L)),(0,F.Z)(this,T)&&u.searchParams.set("version",(0,F.Z)(this,T)),u.toString()}toCommitsUrl(){const u=(0,F.Z)(this,re).call(this,(0,F.Z)(this,P),(0,F.Z)(this,R),"_apis","git","repositories",(0,F.Z)(this,D),"commits");return u.searchParams.set("api-version","6.0"),(0,F.Z)(this,T)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,F.Z)(this,T)),u.toString()}getOwner(){return(0,F.Z)(this,P)}getProject(){return(0,F.Z)(this,R)}getRepo(){return(0,F.Z)(this,D)}getPath(){return(0,F.Z)(this,L)}getRef(){return(0,F.Z)(this,T)}constructor(u,b,A,K,me,ye){(0,Q.Z)(this,le,{writable:!0,value:void 0}),(0,Q.Z)(this,P,{writable:!0,value:void 0}),(0,Q.Z)(this,R,{writable:!0,value:void 0}),(0,Q.Z)(this,D,{writable:!0,value:void 0}),(0,Q.Z)(this,L,{writable:!0,value:void 0}),(0,Q.Z)(this,T,{writable:!0,value:void 0}),(0,Q.Z)(this,re,{writable:!0,value:(...Re)=>{const et=new URL((0,F.Z)(this,le));return et.pathname=Re.map(kt=>encodeURIComponent(kt)).join("/"),et}}),(0,Y.Z)(this,le,u),(0,Y.Z)(this,P,b),(0,Y.Z)(this,R,A),(0,Y.Z)(this,D,K),(0,Y.Z)(this,L,me),(0,Y.Z)(this,T,ye)}}const Ke="dev.azure.com";function Ye(w){var u;const b=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:Ke,A=w.getOptionalString("token");if(!I(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);return{host:b,token:A}}function He(w){const u=w.map(Ye);return u.some(b=>b.host===Ke)||u.push({host:Ke}),u}class We{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:b,base:A}=u;if(W(b))return b;try{const me=xe.fromRepoUrl(A),ye=new URL(A);var K;const Re=new URL(`https://a.com${(K=me.getPath())!==null&&K!==void 0?K:""}`),et=new URL(b,Re).pathname;return ye.searchParams.set("path",et),u.lineNumber&&(ye.searchParams.set("line",String(u.lineNumber)),ye.searchParams.set("lineEnd",String(u.lineNumber+1)),ye.searchParams.set("lineStartColumn","1"),ye.searchParams.set("lineEndColumn","1")),ye.toString()}catch{return new URL(b,A).toString()}}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}We.factory=({config:w})=>{var u;const b=He((u=w.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new We(A)),A=>A.config.host)};var Ge=t(48834).lW;function Ne(w){return AzureUrl.fromRepoUrl(w).toFileUrl()}function Me(w){return AzureUrl.fromRepoUrl(w).toArchiveUrl()}function qe(w){return AzureUrl.fromRepoUrl(w).toCommitsUrl()}function ct(w,u){const b=u?{...u}:{};if(w.token){const A=Ge.from(`:${w.token}`,"utf8");b.Authorization=`Basic ${A.toString("base64")}`}return{headers:b}}const it="bitbucket.org",rt="https://api.bitbucket.org/2.0";function Ae(w){var u;const b=(u=w.getOptionalString("host"))!==null&&u!==void 0?u:it;let A=w.getOptionalString("apiBaseUrl");const K=w.getOptionalString("token"),me=w.getOptionalString("username"),ye=w.getOptionalString("appPassword");if(!I(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return A?A=(0,v.trimEnd)(A,"/"):b===it?A=rt:A=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:A,token:K,username:me,appPassword:ye}}function tt(w){const u=w.map(Ae);return u.some(b=>b.host===it)||u.push({host:it,apiBaseUrl:rt}),u}class mt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(!u.lineNumber)return b;const A=new URL(b);return this.integrationConfig.host==="bitbucket.org"?A.hash=`lines-${u.lineNumber}`:A.hash=`${u.lineNumber}`,A.toString()}resolveEditUrl(u){const b=n()(u),A=new URL(u);return A.searchParams.set("mode","edit"),A.searchParams.set("spa","0"),A.searchParams.set("at",b.ref),A.toString()}constructor(u){this.integrationConfig=u}}mt.factory=({config:w})=>{var u,b,A;const K=tt((A=w.getOptionalConfigArray("integrations.bitbucket"))!==null&&A!==void 0?A:[...(u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(b=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return S(K.map(me=>new mt(me)),me=>me.config.host)};var Le=t(96279),ae=t(48834).lW;async function Ce(w,u){const{name:b,owner:A,resource:K}=parseGitUrl(w),me=K==="bitbucket.org";let ye=me?`${u.apiBaseUrl}/repositories/${A}/${b}`:`${u.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,Re=await fetch(ye,gt(u));if(Re.status===404&&!me&&(ye=`${u.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,Re=await fetch(ye,gt(u))),!Re.ok){const kt=`Failed to retrieve default branch from ${ye}, ${Re.status} ${Re.statusText}`;throw new Error(kt)}let et;if(me)et=(await Re.json()).mainbranch.name;else{const{displayId:kt}=await Re.json();et=kt}if(!et)throw new Error(`Failed to read default branch from ${ye}. Response ${Re.status} ${Re.json()}`);return et}async function Ie(w,u){const{name:b,owner:A,ref:K,protocol:me,resource:ye,filepath:Re}=parseGitUrl(w),et=ye==="bitbucket.org";let kt=K;kt||(kt=await Ce(w,u));const Rt=Re?`&path=${encodeURIComponent(decodeURIComponent(Re))}`:"";return et?`${me}://${ye}/${A}/${b}/get/${kt}.tar.gz`:`${u.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${kt}&prefix=${A}-${b}${Rt}`}function nt(w,u){try{const{owner:b,name:A,ref:K,filepathtype:me,filepath:ye}=parseGitUrl(w);if(!b||!A||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const Re=ye.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!K)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${b}/${A}/src/${K}/${Re}`}return`${u.apiBaseUrl}/projects/${b}/repos/${A}/raw/${Re}?at=${K}`}catch(b){throw new Error(`Incorrect URL: ${w}, ${b}`)}}function gt(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.appPassword){const b=ae.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}const Tt="bitbucket.org",at="https://api.bitbucket.org/2.0";function St(w){const u=Tt,b=at,A=w.getString("username"),K=w.getString("appPassword");return{host:u,apiBaseUrl:b,username:A,appPassword:K}}function wt(w){const u=w.map(St);return u.length===0&&u.push({host:Tt,apiBaseUrl:at}),u}class Lt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(u.lineNumber){const A=new URL(b);return A.hash=`lines-${u.lineNumber}`,A.toString()}return b}resolveEditUrl(u){const b=n()(u),A=new URL(u);return A.searchParams.set("mode","edit"),A.searchParams.set("at",b.ref),A.toString()}constructor(u){this.integrationConfig=u}}Lt.factory=({config:w})=>{var u;const b=wt((u=w.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new Lt(A)),A=>A.config.host)};var Bt=t(48834).lW;async function jt(w,u){const{name:b,owner:A}=parseGitUrl(w),K=`${u.apiBaseUrl}/repositories/${A}/${b}`,me=await fetch(K,en(u));if(!me.ok){const et=`Failed to retrieve default branch from ${K}, ${me.status} ${me.statusText}`;throw new Error(et)}const Re=(await me.json()).mainbranch.name;if(!Re)throw new Error(`Failed to read default branch from ${K}. Response ${me.status} ${me.json()}`);return Re}async function Ut(w,u){const{name:b,owner:A,ref:K,protocol:me,resource:ye}=parseGitUrl(w);let Re=K;return Re||(Re=await jt(w,u)),`${me}://${ye}/${A}/${b}/get/${Re}.tar.gz`}function Zt(w,u){try{const{owner:b,name:A,ref:K,filepathtype:me,filepath:ye}=parseGitUrl(w);if(!b||!A||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Re=ye.replace(/^\//,"");if(!K)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${b}/${A}/src/${K}/${Re}`}catch(b){throw new Error(`Incorrect URL: ${w}, ${b}`)}}function en(w){const u={};if(w.username&&w.appPassword){const b=Bt.from(`${w.username}:${w.appPassword}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}function rn(w){const u=w.getString("host");let b=w.getOptionalString("apiBaseUrl");const A=w.getOptionalString("token"),K=w.getOptionalString("username"),me=w.getOptionalString("password");if(!I(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return b?b=(0,v.trimEnd)(b,"/"):b=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:b,token:A,username:K,password:me}}function wn(w){return w.map(rn)}class un{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const b=l(u);if(u.lineNumber){const A=new URL(b);return A.hash=u.lineNumber.toString(),A.toString()}return b}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){this.integrationConfig=u}}un.factory=({config:w})=>{var u;const b=wn((u=w.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new un(A)),A=>A.config.host)};var kn=t(48834).lW;async function sn(w,u){const{name:b,owner:A}=parseGitUrl(w);let K=`${u.apiBaseUrl}/projects/${A}/repos/${b}/default-branch`,me=await fetch(K,Rn(u));if(me.status===404&&(K=`${u.apiBaseUrl}/projects/${A}/repos/${b}/branches/default`,me=await fetch(K,Rn(u))),!me.ok){const et=`Failed to retrieve default branch from ${K}, ${me.status} ${me.statusText}`;throw new Error(et)}const{displayId:ye}=await me.json(),Re=ye;if(!Re)throw new Error(`Failed to read default branch from ${K}. Response ${me.status} ${me.json()}`);return Re}async function Vn(w,u){const{name:b,owner:A,ref:K,filepath:me}=parseGitUrl(w);let ye=K;ye||(ye=await sn(w,u));const Re=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${u.apiBaseUrl}/projects/${A}/repos/${b}/archive?format=tgz&at=${ye}&prefix=${A}-${b}${Re}`}function Mt(w,u){try{const{owner:b,name:A,ref:K,filepathtype:me,filepath:ye}=parseGitUrl(w);if(!b||!A||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Re=ye.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${b}/repos/${A}/raw/${Re}?at=${K}`}catch(b){throw new Error(`Incorrect URL: ${w}, ${b}`)}}function Rn(w){const u={};if(w.token)u.Authorization=`Bearer ${w.token}`;else if(w.username&&w.password){const b=kn.from(`${w.username}:${w.password}`,"utf8");u.Authorization=`Basic ${b.toString("base64")}`}return{headers:u}}function Cn(w){const u=w.getString("host");let b=w.getOptionalString("baseUrl"),A=w.getOptionalString("cloneUrl"),K=w.getOptionalString("gitilesBaseUrl");const me=w.getOptionalString("username"),ye=w.getOptionalString("password");if(I(u)){if(b&&!W(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(A&&!W(A))throw new Error(`Invalid Gerrit integration config, '${A}' is not a valid cloneUrl`);if(K&&!W(K))throw new Error(`Invalid Gerrit integration config, '${K}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return b?b=(0,v.trimEnd)(b,"/"):b=`https://${u}`,K?K=(0,v.trimEnd)(K,"/"):K=`https://${u}`,A?A=(0,v.trimEnd)(A,"/"):A=b,{host:u,baseUrl:b,cloneUrl:A,gitilesBaseUrl:K,username:me,password:ye}}function on(w){return w.map(Cn)}var an=t(48834).lW;const tn=")]}'";function ln(w,u){const A=u.replace(w.gitilesBaseUrl,"").split("/").filter(kt=>!!kt),K=A.indexOf("+");if(K<=0)throw new Error(`Unable to parse project from url: ${u}`);const me=(0,v.trimStart)(A.slice(0,K).join("/"),"/"),ye=A.indexOf("heads");if(ye<=0)throw new Error(`Unable to parse branch from url: ${u}`);const Re=A[ye+1],et=A.slice(ye+2).join("/");return{branch:Re,filePath:et===""?"/":et,project:me}}function fn(w,u,b,A){return`${w.gitilesBaseUrl}/${u}/+/refs/heads/${b}/${(0,v.trimStart)(A,"/")}`}function nn(w){return w.password?"/a/":"/"}function he(w,u){const{branch:b,project:A}=ln(w,u);return`${w.baseUrl}${nn(w)}projects/${encodeURIComponent(A)}/branches/${b}`}function te(w,u){const{project:b}=ln(w,u);return`${w.cloneUrl}${nn(w)}${b}`}function Te(w,u){const{branch:b,filePath:A,project:K}=ln(w,u);return`${w.baseUrl}${nn(w)}projects/${encodeURIComponent(K)}/branches/${b}/files/${encodeURIComponent(A)}/content`}function ke(w){return`${w.baseUrl}${nn(w)}projects/`}function Je(w){const u={};if(!w.password)return u;const b=an.from(`${w.username}:${w.password}`,"utf8");return u.Authorization=`Basic ${b.toString("base64")}`,{headers:u}}async function J(w){const u=await w.text();if(u.startsWith(tn))try{return JSON.parse(u.slice(tn.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class y{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:b,base:A,lineNumber:K}=u;let me;if(b.startsWith("/")){const{branch:ye,project:Re}=ln(this.config,A);return fn(this.config,Re,ye,b)}return b?me=new URL(b,A):me=new URL(A),K&&(me.hash=K.toString()),me.toString()}resolveEditUrl(u){return u}constructor(u){this.integrationConfig=u}}y.factory=({config:w})=>{var u;const b=on((u=w.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new y(A)),A=>A.config.host)};const g="github.com",k="https://api.github.com",G="https://raw.githubusercontent.com";function ce(w){var u,b;const A=(b=w.getOptionalString("host"))!==null&&b!==void 0?b:g;let K=w.getOptionalString("apiBaseUrl"),me=w.getOptionalString("rawBaseUrl");const ye=w.getOptionalString("token"),Re=(u=w.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(et=>({appId:et.getNumber("appId"),clientId:et.getString("clientId"),clientSecret:et.getString("clientSecret"),webhookSecret:et.getString("webhookSecret"),privateKey:et.getString("privateKey"),allowedInstallationOwners:et.getOptionalStringArray("allowedInstallationOwners")}));if(!I(A))throw new Error(`Invalid GitHub integration config, '${A}' is not a valid host`);return K?K=(0,v.trimEnd)(K,"/"):A===g&&(K=k),me?me=(0,v.trimEnd)(me,"/"):A===g&&(me=G),{host:A,apiBaseUrl:K,rawBaseUrl:me,token:ye,apps:Re}}function ge(w){const u=w.map(ce);return u.some(b=>b.host===g)||u.push({host:g,apiBaseUrl:k,rawBaseUrl:G}),u}function Fe(w,u,b){try{const{owner:A,name:K,ref:me,filepathtype:ye,filepath:Re}=parseGitUrl(w);if(!A||!K||!me||ye!=="blob"&&ye!=="raw"&&ye!=="tree")throw new Error("Invalid GitHub URL or file path");const et=Re.replace(/^\//,"");return _e(u,b)==="api"?`${u.apiBaseUrl}/repos/${A}/${K}/contents/${et}?ref=${me}`:`${u.rawBaseUrl}/${A}/${K}/${me}/${et}`}catch(A){throw new Error(`Incorrect URL: ${w}, ${A}`)}}function st(w,u){const b={};return _e(w,u)==="api"&&(b.Accept="application/vnd.github.v3.raw"),u.token&&(b.Authorization=`token ${u.token}`),{headers:b}}function _e(w,u){return w.apiBaseUrl&&(u.token||!w.rawBaseUrl)?"api":"raw"}var vt=t(42822),ft=t(89393),ht=t(26228);class Et{async getOrCreateToken(u,b,A){let K=this.tokenCache.get(u);if((!K||this.isExpired(K.expiresAt))&&(K=await A(),K.expiresAt=K.expiresAt.minus({minutes:10}),this.tokenCache.set(u,K)),!this.appliesToRepo(K,b))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${b}`);return{accessToken:K.token}}appliesToRepo(u,b){return b===void 0?!0:u.repositories!==void 0?u.repositories.includes(b):!0}constructor(){this.tokenCache=new Map,this.isExpired=u=>ht.ou.local()>u}}const j={Accept:"application/vnd.github.machine-man-preview+json"};class U{async getInstallationCredentials(u,b){if(this.allowedInstallationOwners){var A;if(!(!((A=this.allowedInstallationOwners)===null||A===void 0)&&A.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,b,async()=>{const{installationId:K,suspended:me}=await this.getInstallationData(u);if(me)throw new Error(`The GitHub application for ${u} is suspended`);const ye=await this.appClient.apps.createInstallationAccessToken({installation_id:K,headers:j});let Re;if(ye.data.repository_selection==="selected"){const kt=new ft.v({baseUrl:this.baseUrl,auth:ye.data.token}),Rt=await kt.paginate(kt.apps.listReposAccessibleToInstallation);var et;Re=((et=Rt.repositories)!==null&&et!==void 0?et:Rt).map(fr=>fr.name)}return{token:ye.data.token,expiresAt:ht.ou.fromISO(ye.data.expires_at),repositories:Re}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const A=(await this.getInstallations()).find(me=>{var ye,Re;return((ye=me.account)===null||ye===void 0||(Re=ye.login)===null||Re===void 0?void 0:Re.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(A)return{installationId:A.id,suspended:Boolean(A.suspended_by)};const K=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw K.name="NotFoundError",K}constructor(u,b){this.cache=new Et,this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
31
|
-
`)},this.appClient=new ft.v({baseUrl:b,headers:j,authStrategy:vt.i,auth:this.baseAuthConfig})}}class ne{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(u,b){if(this.apps.length===0)return;const A=await Promise.all(this.apps.map(Re=>Re.getInstallationCredentials(u,b).then(et=>({credentials:et,error:void 0}),et=>({credentials:void 0,error:et})))),K=A.find(Re=>Re.credentials);if(K)return K.credentials.accessToken;const ye=A.map(Re=>Re.error).find(Re=>Re.name!=="NotFoundError");if(ye)throw ye}constructor(u){var b,A;this.apps=(A=(b=u.apps)===null||b===void 0?void 0:b.map(K=>new U(K,u.apiBaseUrl)))!==null&&A!==void 0?A:[]}}class de{async getCredentials(u){const b=n()(u.url),A=b.owner||b.name,K=b.owner?b.name:void 0;let me="app",ye=await this.githubAppCredentialsMux.getAppToken(A,K);return ye||(me="token",ye=this.token),{headers:ye?{Authorization:`Bearer ${ye}`}:void 0,token:ye,type:me}}constructor(u,b){this.githubAppCredentialsMux=u,this.token=b}}de.create=w=>new de(new ne(w),w.token);class je{static fromIntegrations(u){const b=new Map;return u.github.list().forEach(A=>{const K=SingleInstanceGithubCredentialsProvider.create(A.config);b.set(A.config.host,K)}),new je(b)}async getCredentials(u){const b=new URL(u.url),A=this.providers.get(b.host);if(!A)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return A.getCredentials(u)}constructor(u){this.providers=u}}class Se{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return Qe(l(u),"tree")}resolveEditUrl(u){return Qe(u,"edit")}constructor(u){this.integrationConfig=u}}Se.factory=({config:w})=>{var u;const b=ge((u=w.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new Se(A)),A=>A.config.host)};function Qe(w,u){return w.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,A,K,me)=>`//${A}/${K}/${me}/${u}/`)}const pt="gitlab.com",Xe="https://gitlab.com/api/v4";function dt(w){const u=w.getString("host");let b=w.getOptionalString("apiBaseUrl");const A=w.getOptionalString("token");let K=w.getOptionalString("baseUrl");if(b?b=(0,v.trimEnd)(b,"/"):u===pt&&(b=Xe),K?K=(0,v.trimEnd)(K,"/"):K=`https://${u}`,I(u)){if(!b||!W(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!W(K))throw new Error(`Invalid GitLab integration config, '${K}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:A,apiBaseUrl:b,baseUrl:K}}function Dt(w){const u=w.map(dt);return u.some(b=>b.host===pt)||u.push({host:pt,apiBaseUrl:Xe,baseUrl:`https://${pt}`}),u}function It(w){let u="";return w.host!==pt&&(u=new URL(w.baseUrl).pathname),trimEnd(u,"/")}async function Wt(w,u){const b=await On(w,u);return jn(w,b,u).toString()}function Gn(w){const{token:u=""}=w;return{headers:{"PRIVATE-TOKEN":u}}}function jn(w,u,b){try{const A=new URL(w),K=A.pathname.split("/blob/").slice(1).join("/blob/"),[me,...ye]=K.split("/"),Re=getGitLabIntegrationRelativePath(b);return A.pathname=[...Re?[Re]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(ye.join("/"))),"raw"].join("/"),A.search=`?ref=${me}`,A}catch(A){throw new Error(`Incorrect url: ${w}, ${A}`)}}async function On(w,u){const b=new URL(w);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let A=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const K=getGitLabIntegrationRelativePath(u);K&&(A=A.replace(K,""));const me=new URL(`${b.origin}${K}/api/v4/projects/${encodeURIComponent(A.replace(/^\//,""))}`),ye=await fetch(me.toString(),Gn(u)),Re=await ye.json();if(!ye.ok)throw new Error(`GitLab Error '${Re.error}', ${Re.error_description}`);return Number(Re.id)}catch(A){throw new Error(`Could not get GitLab project ID for: ${w}, ${A}`)}}class $n{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return l(u)}resolveEditUrl(u){return qn(u,"edit")}constructor(u){this.integrationConfig=u}}$n.factory=({config:w})=>{var u;const b=Dt((u=w.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return S(b.map(A=>new $n(A)),A=>A.config.host)};function qn(w,u){return w.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class Nt{static fromConfig(u){return new Nt({awsS3:q.factory({config:u}),azure:We.factory({config:u}),bitbucket:mt.factory({config:u}),bitbucketCloud:Lt.factory({config:u}),bitbucketServer:un.factory({config:u}),gerrit:y.factory({config:u}),github:Se.factory({config:u}),gitlab:$n.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let b=Object.values(this.byType).map(A=>A.byUrl(u)).filter(Boolean);if(b.length>1){const A=b.filter(K=>!(K instanceof mt));A.length!==0&&(b=A)}return b[0]}byHost(u){return Object.values(this.byType).map(b=>b.byHost(u)).find(Boolean)}resolveUrl(u){const b=this.byUrl(u.base);return b?b.resolveUrl(u):l(u)}resolveEditUrl(u){const b=this.byUrl(u);return b?b.resolveEditUrl(u):u}constructor(u){this.byType=u}}},96215:function(bt,Oe,t){"use strict";var h={};t.r(h),t.d(h,{TechDocsPlugin:function(){return T.s4}});var n=t(52322),v=t(2784),I=t(28316),W=t(10289),S=t(25248);const l=(0,S.T0)({id:"plugin.techdocs.storageservice"}),B=(0,S.T0)({id:"plugin.techdocs.service"});var se=t(92077),X=t(95481),q=t(7476),F=t(93225),Q=t(67896),Y=t(65124),ue=t(17339),le=t(85478),P=t(68435),R=t(3482),D=t(42081),L=t(48431),T=t(89258),re=t(52943),xe=t(61886),Ke=t(13980),Ye=t.n(Ke);class He{get(r){for(const o of this.holders){const c=o.get(r);if(c)return c}}constructor(...r){this.holders=r}}var We=t(51837);const Ge=(0,We.CT)("api-context"),Ne=a=>{var r;const{apis:o,children:c}=a,f=(r=(0,v.useContext)(Ge))===null||r===void 0?void 0:r.atVersion(1),$=f?new He(o,f):o;return(0,n.jsx)(Ge.Provider,{value:(0,We.EI)({1:$}),children:c})};Ne.propTypes={apis:Ye().shape({get:Ye().func.isRequired}).isRequired,children:Ye().node};class Me{static validateFactories(r,o){for(const c of o){const f=[c],$=new Set;for(;f.length;){const z=f.shift(),V=r.get(z);if(!!V)for(const oe of Object.values(V.deps)){if(oe.id===c.id)throw new Error(`Circular dependency of api factory for ${c}`);$.has(oe)||($.add(oe),f.push(oe))}}}}get(r){return this.load(r)}load(r,o=[]){const c=this.apis.get(r.id);if(c)return c;const f=this.factories.get(r);if(!f)return;if(o.includes(f.api))throw new Error(`Circular dependency of api factory for ${f.api}`);const $=this.loadDeps(r,f.deps,[...o,f.api]),z=f.factory($);return this.apis.set(r.id,z),z}loadDeps(r,o,c){const f={};for(const $ in o)if(o.hasOwnProperty($)){const z=o[$],V=this.load(z,c);if(!V)throw new Error(`No API factory available for dependency ${z} of dependent ${r}`);f[$]=V}return f}constructor(r){this.factories=r,this.apis=new Map}}var qe;(function(a){a[a.default=10]="default",a[a.app=50]="app",a[a.static=100]="static"})(qe||(qe={}));class ct{register(r,o){const c=qe[r],f=this.factories.get(o.api.id);return f&&f.priority>=c?!1:(this.factories.set(o.api.id,{priority:c,factory:o}),!0)}get(r){const o=this.factories.get(r.id);if(!!o)return o.factory}getAllApis(){const r=new Set;for(const{factory:o}of this.factories.values())r.add(o.api);return r}constructor(){this.factories=new Map}}function it(a){return new Promise((r,o)=>{const c=a.width||500,f=a.height||700,$=window.screen.width/2-c/2,z=window.screen.height/2-f/2,V=window.open(a.url,a.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${c},height=${f},top=${z},left=${$}`);let oe="";if(!V||typeof V.closed=="undefined"||V.closed){const ot=new Error("Failed to open auth popup.");ot.name="PopupRejectedError",o(ot);return}const Be=ot=>{if(ot.source!==V||ot.origin!==a.origin)return;const{data:Ct}=ot;if(Ct.type==="config_info"){oe=Ct.targetOrigin;return}if(Ct.type!=="authorization_response")return;const zt=Ct;if("error"in zt){const dn=new Error(zt.error.message);dn.name=zt.error.name,o(dn)}else r(zt.response);xt()},$e=setInterval(()=>{if(V.closed){const ot=`Login failed, ${oe&&oe!==window.location.origin?`Incorrect app origin, expected ${oe}`:"popup was closed"}`,Ct=new Error(ot);Ct.name="PopupClosedError",o(Ct),xt()}},100);function xt(){window.removeEventListener("message",Be),clearInterval($e)}window.addEventListener("message",Be)})}function rt(a){return[...a].join(" ")}class Ae{async createSession(r){return r.instantPopup?this.showPopup(r.scopes):this.authRequester(r.scopes)}async refreshSession(){const r=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(c=>{throw new Error(`Auth refresh request failed, ${c}`)});if(!r.ok){const c=new Error(`Auth refresh request failed, ${r.statusText}`);throw c.status=r.status,c}const o=await r.json();if(o.error){const c=new Error(o.error.message);throw o.error.name&&(c.name=o.error.name),c}return await this.sessionTransform(o)}async removeSession(){const r=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!r.ok){const o=new Error(`Logout request failed, ${r.statusText}`);throw o.status=r.status,o}}async showPopup(r){const o=this.joinScopesFunc(r),c=await this.buildUrl("/start",{scope:o,origin:location.origin}),f=await it({url:c,name:`${this.provider.title} Login`,origin:new URL(c).origin,width:450,height:730});return await this.sessionTransform(f)}async buildUrl(r,o){const c=await this.discoveryApi.getBaseUrl("auth"),f=this.buildQueryString({...o,env:this.environment});return`${c}/${this.provider.id}${r}${f}`}buildQueryString(r){if(!r)return"";const o=Object.entries(r).map(([c,f])=>{if(typeof f=="string")return`${encodeURIComponent(c)}=${encodeURIComponent(f)}`;if(f)return encodeURIComponent(c)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(r){const{discoveryApi:o,environment:c,provider:f,joinScopes:$=rt,oauthRequestApi:z,sessionTransform:V=oe=>oe}=r;this.authRequester=z.createAuthRequester({provider:f,onAuthRequest:oe=>this.showPopup(oe)}),this.discoveryApi=o,this.environment=c,this.provider=f,this.joinScopesFunc=$,this.sessionTransform=V}}function tt(a,r){for(const o of r)if(!a.has(o))return!1;return!0}class mt{sessionExistsAndHasScope(r,o){if(!r)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const c=this.options.sessionScopes(r);return tt(c,o)}getExtendedScope(r,o){const c=new Set(this.options.defaultScopes);if(r&&this.options.sessionScopes!==void 0){const f=this.options.sessionScopes(r);for(const $ of f)c.add($)}if(o)for(const f of o)c.add(f);return c}constructor(r){this.options=r}}var Le=t(82394),ae=t.n(Le);let Ce=Symbol.observable;class Ie{[Ce](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(){this.isClosed=!1,this.observable=new(ae())(r=>this.isClosed?(this.terminatingError?r.error(this.terminatingError):r.complete(),()=>{}):(this.subscribers.add(r),()=>{this.subscribers.delete(r)})),this.subscribers=new Set}}let nt=Symbol.observable;class gt{[nt](){return this}get closed(){return this.isClosed}next(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=r,this.subscribers.forEach(o=>o.next(r))}error(r){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=r,this.subscribers.forEach(o=>o.error(r))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(r=>r.complete())}subscribe(r,o,c){const f=typeof r=="function"?{next:r,error:o,complete:c}:r;return this.observable.subscribe(f)}constructor(r){this.subscribers=new Set,this.isClosed=!1,this.currentValue=r,this.terminatingError=void 0,this.observable=new(ae())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class Tt{setIsSignedIn(r){this.signedIn!==r&&(this.signedIn=r,this.subject.next(this.signedIn?S.sM.SignedIn:S.sM.SignedOut))}sessionState$(){return this.subject}constructor(){this.subject=new gt(S.sM.SignedOut),this.signedIn=!1}}class at{async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const c=await this.collapsedSessionRefresh(),f=this.sessionScopesFunc(this.currentSession),$=this.sessionScopesFunc(c);return tt($,f)&&(this.currentSession=c),c}catch(c){if(r.optional)return;throw c}}if(!this.currentSession&&!r.instantPopup)try{const o=await this.collapsedSessionRefresh();return this.currentSession=o,this.getSession(r)}catch{}if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const r=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),r}finally{delete this.refreshPromise}}constructor(r){this.stateTracker=new Tt;const{connector:o,defaultScopes:c=new Set,sessionScopes:f,sessionShouldRefresh:$}=r;this.connector=o,this.sessionScopesFunc=f,this.sessionShouldRefreshFunc=$,this.helper=new mt({sessionScopes:f,defaultScopes:c})}}class St{setSession(r){this.currentSession=r,this.stateTracker.setIsSignedIn(Boolean(r))}async getSession(r){if(this.helper.sessionExistsAndHasScope(this.currentSession,r.scopes))return this.currentSession;if(!r.optional)return this.currentSession=await this.connector.createSession({...r,scopes:this.helper.getExtendedScope(this.currentSession,r.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(r){this.stateTracker=new SessionStateTracker;const{connector:o,defaultScopes:c=new Set,sessionScopes:f}=r;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:f,defaultScopes:c})}}const wt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Lt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=wt,oauthRequestApi:$,defaultScopes:z=[],scopeTransform:V=$e=>$e}=r,oe=new Ae({discoveryApi:o,environment:c,provider:f,oauthRequestApi:$,sessionTransform($e){return{...$e,providerInfo:{idToken:$e.providerInfo.idToken,accessToken:$e.providerInfo.accessToken,scopes:Lt.normalizeScopes(V,$e.providerInfo.scope),expiresAt:new Date(Date.now()+$e.providerInfo.expiresInSeconds*1e3)}}}}),Be=new at({connector:oe,defaultScopes:new Set(z),sessionScopes:$e=>$e.providerInfo.scopes,sessionShouldRefresh:$e=>($e.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Lt({sessionManager:Be,scopeTransform:V})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(r,o){const c=Lt.normalizeScopes(this.scopeTransform,r),f=await this.sessionManager.getSession({...o,scopes:c});var $;return($=f==null?void 0:f.providerInfo.accessToken)!==null&&$!==void 0?$:""}async getIdToken(r={}){const o=await this.sessionManager.getSession(r);var c;return(c=o==null?void 0:o.providerInfo.idToken)!==null&&c!==void 0?c:""}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}static normalizeScopes(r,o){if(!o)return new Set;const c=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(r(c))}constructor(r){this.sessionManager=r.sessionManager,this.scopeTransform=r.scopeTransform}}const Bt={id:"github",title:"GitHub",icon:()=>null};class jt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Bt,oauthRequestApi:$,defaultScopes:z=["read:user"]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:$,provider:f,environment:c,defaultScopes:z})}}const Ut={id:"gitlab",title:"GitLab",icon:()=>null};class Zt{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Ut,oauthRequestApi:$,defaultScopes:z=["read_user"]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:$,provider:f,environment:c,defaultScopes:z})}}const en={id:"google",title:"Google",icon:()=>null},rn="https://www.googleapis.com/auth/";class wn{static create(r){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:$=en,defaultScopes:z=["openid",`${rn}userinfo.email`,`${rn}userinfo.profile`]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:c,provider:$,environment:f,defaultScopes:z,scopeTransform(V){return V.map(oe=>oe==="openid"?oe:oe==="profile"||oe==="email"?`${rn}userinfo.${oe}`:oe.startsWith(rn)?oe:`${rn}${oe}`)}})}}const un={id:"okta",title:"Okta",icon:()=>null},kn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),sn="okta.";class Vn{static create(r){const{discoveryApi:o,environment:c="development",provider:f=un,oauthRequestApi:$,defaultScopes:z=["openid","email","profile","offline_access"]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:$,provider:f,environment:c,defaultScopes:z,scopeTransform(V){return V.map(oe=>kn.has(oe)||oe.startsWith(sn)?oe:`${sn}${oe}`)}})}}var Mt=t(30195);const Rn=Mt.z.object({profile:Mt.z.object({email:Mt.z.string().optional(),displayName:Mt.z.string().optional(),picture:Mt.z.string().optional()}),backstageIdentity:Mt.z.object({token:Mt.z.string(),identity:Mt.z.object({type:Mt.z.literal("user"),userEntityRef:Mt.z.string(),ownershipEntityRefs:Mt.z.array(Mt.z.string())})})}),Cn={id:"saml",title:"SAML",icon:()=>null};class on{static create(r){const{discoveryApi:o,environment:c="development",provider:f=Cn}=r,$=new DirectAuthConnector({discoveryApi:o,environment:c,provider:f}),z=new StaticAuthSessionManager({connector:$}),V=new AuthSessionStore({manager:z,storageKey:`${f.id}Session`,schema:samlSessionSchema});return new on(V)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.backstageIdentity}async getProfile(r={}){const o=await this.sessionManager.getSession(r);return o==null?void 0:o.profile}constructor(r){this.sessionManager=r}}const an={id:"microsoft",title:"Microsoft",icon:()=>null};class tn{static create(r){const{environment:o="development",provider:c=an,oauthRequestApi:f,discoveryApi:$,defaultScopes:z=["openid","offline_access","profile","email","User.Read"]}=r;return Lt.create({discoveryApi:$,oauthRequestApi:f,provider:c,environment:o,defaultScopes:z})}}const ln={id:"onelogin",title:"onelogin",icon:()=>null},fn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),nn="onelogin.";class he{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ln,oauthRequestApi:$}=r;return Lt.create({discoveryApi:o,oauthRequestApi:$,provider:f,environment:c,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(z){return z.map(V=>fn.has(V)||V.startsWith(nn)?V:`${nn}${V}`)}})}}const te={id:"bitbucket",title:"Bitbucket",icon:()=>null};class Te{static create(r){const{discoveryApi:o,environment:c="development",provider:f=te,oauthRequestApi:$,defaultScopes:z=["team"]}=r;return Lt.create({discoveryApi:o,oauthRequestApi:$,provider:f,environment:c,defaultScopes:z})}}const ke={id:"atlassian",title:"Atlassian",icon:()=>null};class Je{static create(r){const{discoveryApi:o,environment:c="development",provider:f=ke,oauthRequestApi:$}=r;return Lt.create({discoveryApi:o,oauthRequestApi:$,provider:f,environment:c})}}class J{post(r){this.subject.next(r)}alert$(){return this.subject}constructor(){this.subject=new Ie}}class y{captureEvent(r){}}const g="theme";class k{static createWithStorage(r){const o=new k(r);if(!window.localStorage)return o;var c;const f=(c=window.localStorage.getItem(g))!==null&&c!==void 0?c:void 0;return o.setActiveThemeId(f),o.activeThemeId$().subscribe($=>{$?window.localStorage.setItem(g,$):window.localStorage.removeItem(g)}),window.addEventListener("storage",$=>{if($.key===g){var z;const V=(z=localStorage.getItem(g))!==null&&z!==void 0?z:void 0;o.setActiveThemeId(V)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(r){this.activeThemeId=r,this.subject.next(r)}constructor(r){this.themes=r,this.subject=new gt(void 0)}}var G=t(9850),ce=t.n(G),ge=t(12782),Fe=t.n(ge);const st=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function _e(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function vt(a){if(a===null)return"null";if(Array.isArray(a))return"array";const r=typeof a;return r==="number"&&isNaN(a)?"nan":r==="string"&&a===""?"empty-string":r}const ft={type(a,r,o,c){return`Invalid type in config for key '${a}' in '${r}', got ${o}, wanted ${c}`},missing(a){return`Missing required config value at '${a}'`},convert(a,r,o){return`Unable to convert config value for key '${a}' in '${r}' to a ${o}`}};class ht{static fromConfigs(r){return r.length===0?new ht(void 0):r.reduce((o,{data:c,context:f,filteredKeys:$,deprecatedKeys:z})=>{const V=new ht(c,f,o);if(V.filteredKeys=$,z)for(const{key:oe,description:Be}of z)console.warn(`The configuration key '${oe}' of ${f} is deprecated and may be removed soon. ${Be||""}`);return V},void 0)}has(r){var o;if(this.readValue(r)!==void 0)return!0;var f;return(f=(o=this.fallback)===null||o===void 0?void 0:o.has(r))!==null&&f!==void 0?f:!1}keys(){var r;const o=this.data?Object.keys(this.data):[];var c;const f=(c=(r=this.fallback)===null||r===void 0?void 0:r.keys())!==null&&c!==void 0?c:[];return[...new Set([...o,...f])]}get(r){const o=this.getOptional(r);if(o===void 0)throw new Error(ft.missing(this.fullKey(r!=null?r:"")));return o}getOptional(r){var o;const c=ce()(this.readValue(r)),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(r);if(c===void 0){if(!1)var $;return f}else if(f===void 0)return c;return Fe()({},{value:f},{value:c},(z,V)=>!_e(V)||!_e(z)?V:void 0).value}getConfig(r){const o=this.getOptionalConfig(r);if(o===void 0)throw new Error(ft.missing(this.fullKey(r)));return o}getOptionalConfig(r){var o;const c=this.readValue(r),f=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(r);if(_e(c))return this.copy(c,r,f);if(c!==void 0)throw new TypeError(ft.type(this.fullKey(r),this.context,vt(c),"object"));return f}getConfigArray(r){const o=this.getOptionalConfigArray(r);if(o===void 0)throw new Error(ft.missing(this.fullKey(r)));return o}getOptionalConfigArray(r){const o=this.readConfigValue(r,f=>{if(!Array.isArray(f))return{expected:"object-array"};for(const[$,z]of f.entries())if(!_e(z))return{expected:"object-array",value:z,key:`${r}[${$}]`};return!0});if(!o){if(!1)var c;return}return o.map((f,$)=>this.copy(f,`${r}[${$}]`))}getNumber(r){const o=this.getOptionalNumber(r);if(o===void 0)throw new Error(ft.missing(this.fullKey(r)));return o}getOptionalNumber(r){const o=this.readConfigValue(r,f=>typeof f=="number"||typeof f=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const c=Number(o);if(!Number.isFinite(c))throw new Error(ft.convert(this.fullKey(r),this.context,"number"));return c}getBoolean(r){const o=this.getOptionalBoolean(r);if(o===void 0)throw new Error(ft.missing(this.fullKey(r)));return o}getOptionalBoolean(r){return this.readConfigValue(r,o=>typeof o=="boolean"||{expected:"boolean"})}getString(r){const o=this.getOptionalString(r);if(o===void 0)throw new Error(ft.missing(this.fullKey(r)));return o}getOptionalString(r){return this.readConfigValue(r,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(r){const o=this.getOptionalStringArray(r);if(o===void 0)throw new Error(ft.missing(this.fullKey(r)));return o}getOptionalStringArray(r){return this.readConfigValue(r,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[c,f]of o.entries())if(typeof f!="string"||f==="")return{expected:"string-array",value:f,key:`${r}[${c}]`};return!0})}fullKey(r){return`${this.prefix}${this.prefix?".":""}${r}`}copy(r,o,c){const f=new ht(r,this.context,c,this.fullKey(o));return f.filteredKeys=this.filteredKeys,f}readConfigValue(r,o){const c=this.readValue(r);if(c===void 0){var f;if(!1)var $;return(f=this.fallback)===null||f===void 0?void 0:f.readConfigValue(r,o)}const z=o(c);if(z!==!0){const{key:V=r,value:oe=c,expected:Be}=z;throw new TypeError(ft.type(this.fullKey(V),this.context,vt(oe),Be))}return c}readValue(r){const o=r?r.split("."):[];for(const f of o)if(!st.test(f))throw new TypeError(`Invalid config key '${r}'`);if(this.data===void 0)return;let c=this.data;for(const[f,$]of o.entries())if(_e(c))c=c[$];else if(c!==void 0){const z=this.fullKey(o.slice(0,f).join("."));throw new TypeError(ft.type(z,this.context,vt(c),"object"))}return c}constructor(r,o="mock-config",c,f=""){this.data=r,this.context=o,this.fallback=c,this.prefix=f,this.notifiedFilteredKeys=new Set}}const Et="Invalid discovery URL pattern,";class j{static compile(r){const o=r.split(/\{\{\s*pluginId\s*\}\}/),c=o.join("pluginId");let f;try{f=new URL(c)}catch{throw new Error(`${Et} URL '${c}' is invalid`)}if(f.hash)throw new Error(`${Et} URL must not have a hash`);if(f.search)throw new Error(`${Et} URL must not have a query`);if(c.endsWith("/"))throw new Error(`${Et} URL must not end with a slash`);return new j(o)}async getBaseUrl(r){return this.parts.join(r)}constructor(r){this.parts=r}}class U{post(r,o){return o!=null&&o.hidden||this.alertApi.post({message:r.message,severity:"error"}),this.errorApi.post(r,o)}error$(){return this.errorApi.error$()}constructor(r,o){this.alertApi=r,this.errorApi=o}}class ne{post(r,o){this.subject.next({error:r,context:o})}error$(){return this.subject}constructor(){this.subject=new Ie}}class de{static forward(r,o){window.addEventListener("unhandledrejection",c=>{r.post(c.reason,o)})}}function je(a){if(a.length<3)throw new Error(`The '${a}' feature flag must have a minimum length of three characters.`);if(a.length>150)throw new Error(`The '${a}' feature flag must not exceed 150 characters.`);if(!a.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${a}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Se{registerFlag(r){je(r.name),this.registeredFeatureFlags.push(r)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(r){return this.flags||(this.flags=this.load()),this.flags.get(r)===S.CL.Active}save(r){this.flags||(this.flags=this.load()),r.merge||this.flags.clear();for(const[c,f]of Object.entries(r.states))this.flags.set(c,f);const o=Array.from(this.flags.entries()).filter(([,c])=>c===S.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const r=window.localStorage.getItem("featureFlags");if(!r)return new Map;const o=JSON.parse(r);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const c=Object.entries(o).filter(([f,$])=>(je(f),$===S.CL.Active));return new Map(c)}catch{return new Map}}constructor(){this.registeredFeatureFlags=[]}}function Qe(a){let r=a.baseImplementation||t.g.fetch;var o;const c=[(o=a.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const f of c)r=f.apply(r);return{fetch:r}}class pt{static create(r){var o,c;const f=Xe(r),$=((o=r.header)===null||o===void 0?void 0:o.name)||"authorization",z=((c=r.header)===null||c===void 0?void 0:c.value)||(V=>`Bearer ${V}`);return new pt(r.identityApi,f,$,z)}apply(r){return async(o,c)=>{const f=new Request(o,c),{token:$}=await this.identityApi.getCredentials();return f.headers.get(this.headerName)||typeof $!="string"||!$||!this.allowUrl(f.url)?r(o,c):(f.headers.set(this.headerName,this.headerValue($)),r(f))}}constructor(r,o,c,f){this.identityApi=r,this.allowUrl=o,this.headerName=c,this.headerValue=f}}function Xe(a){return a.allowUrl?a.allowUrl:a.urlPrefixAllowlist?dt(a.urlPrefixAllowlist):a.config?dt([a.config.getString("backend.baseUrl")]):()=>!1}function dt(a){const r=a.map(o=>o.replace(/\/$/,""));return o=>r.some(c=>o===c||o.startsWith(`${c}/`))}function Dt(a,r){return!r||r==="/"?a:`${a.replace(/\/$/,"")}/${r.replace(/^\//,"")}`}class It{apply(r){return async(o,c)=>{const f=new Request(o,c),$="plugin://";if(!f.url.startsWith($))return r(o,c);const{hostname:z,pathname:V,search:oe,hash:Be,username:$e,password:xt}=new URL(`http://${f.url.substring($.length)}`);let ot=await this.discoveryApi.getBaseUrl(z);if($e||xt){const zt=new URL(ot),dn=`${$e}${xt?`:${xt}`:""}@`;ot=`${zt.protocol}//${dn}${zt.host}${zt.pathname}`}const Ct=`${Dt(ot,V)}${oe}${Be}`;return r(Ct,typeof o=="string"||Wt(o)?c:o)}}constructor(r){this.discoveryApi=r}}function Wt(a){return typeof a=="object"&&(a==null?void 0:a.constructor)===URL}class Gn{static resolvePluginProtocol(r){return new It(r.discoveryApi)}static injectIdentityAuth(r){return pt.create(r)}constructor(){}}function jn(a,r){for(const o of r)if(!a.has(o))return!1;return!0}function On(a,...r){const o=new Set(a);for(const c of r)for(const f of c)o.add(f);return o}class $n{request(r){return new Promise((o,c)=>{this.requests.push({scopes:r,resolve:o,reject:c}),this.subject.next(this.getCurrentPending())})}resolve(r,o){this.requests=this.requests.filter(c=>jn(r,c.scopes)?(c.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(r){this.requests.forEach(o=>o.reject(r)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const r=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,c)=>On(o,c.scopes),this.requests[0].scopes);return{scopes:r,resolve:o=>{r&&this.resolve(r,o)},reject:o=>{r&&this.reject(o)}}}constructor(){this.requests=[],this.subject=new gt(this.getCurrentPending())}}class qn{createAuthRequester(r){const o=new $n,c=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:f=>{const $=this.currentRequests.slice(),z=this.makeAuthRequest(f,r);z?$[c]=z:delete $[c],this.currentRequests=$,this.subject.next($.filter(Boolean))}}),f=>o.request(f)}makeAuthRequest(r,o){const{scopes:c}=r;if(!!c)return{provider:o.provider,trigger:async()=>{const f=await o.onAuthRequest(c);r.resolve(f)},reject:()=>{const f=new Error("Login failed, rejected by user");f.name="RejectedError",r.reject(f)}}}authRequest$(){return this.subject}constructor(){this.subject=new gt([]),this.currentRequests=[],this.handlerCount=0}}const Nt=new Map;class w{static create(r){var o;return new w((o=r.namespace)!==null&&o!==void 0?o:"",r.errorApi)}get(r){return this.snapshot(r).value}snapshot(r){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(r));f&&(o=JSON.parse(f,($,z)=>(typeof z=="object"&&z!==null&&Object.freeze(z),z)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${r}`))}return{key:r,value:o,presence:c}}forBucket(r){const o=`${this.namespace}/${r}`;return Nt.has(o)||Nt.set(o,new w(o,this.errorApi)),Nt.get(o)}async set(r,o){localStorage.setItem(this.getKeyName(r),JSON.stringify(o)),this.notifyChanges(r)}async remove(r){localStorage.removeItem(this.getKeyName(r)),this.notifyChanges(r)}observe$(r){return this.observable.filter(({key:o})=>o===r)}getKeyName(r){return`${this.namespace}/${encodeURIComponent(r)}`}notifyChanges(r){const o=this.snapshot(r);for(const c of this.subscribers)c.next(o)}constructor(r,o){this.namespace=r,this.errorApi=o,this.subscribers=new Set,this.observable=new(ae())(c=>(this.subscribers.add(c),()=>{this.subscribers.delete(c)}))}}var u=t(64279);function b(a){const r={};for(const c in a.collectors)a.collectors.hasOwnProperty(c)&&(r[c]=a.collectors[c]());const o=[{node:v.Children.toArray(a.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:c,parent:f,contexts:$}=o.shift();v.Children.forEach(c,z=>{if(!(0,v.isValidElement)(z))return;const V={};for(const oe in r)if(r.hasOwnProperty(oe)){const Be=r[oe];V[oe]=Be.visit(Be.accumulator,z,f,$[oe])}for(const oe of a.discoverers){const Be=oe(z);Be&&o.push({node:Be,parent:z,contexts:V})}})}return Object.fromEntries(Object.entries(r).map(([c,f])=>[c,f.accumulator]))}function A(a,r){return()=>({accumulator:a(),visit:r})}function K(a){var r;return(r=a.props)===null||r===void 0?void 0:r.children}function me(a){var r,o;if(((r=a.props)===null||r===void 0?void 0:r.path)&&((o=a.props)===null||o===void 0?void 0:o.element)){var c;return(c=a.props)===null||c===void 0?void 0:c.element}}const ye=A(()=>new Set,(a,r)=>{const o=(0,S.IY)(r,"core.plugin");o&&a.add(o)}),Re=a=>{const{children:r}=a,o=(0,S.h_)(S.W0),c="with"in a?o.isActive(a.with):!o.isActive(a.without);return(0,n.jsx)(n.Fragment,{children:c?r:null})};(0,S.R5)(Re,"core.featureFlagged",!0);const et={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function kt(a){const r=a;if(r!=null&&r.type){var o,c;return(c=(o=r.type.displayName)!==null&&o!==void 0?o:r.type.name)!==null&&c!==void 0?c:String(r.type)}return String(r)}function Rt(a,r=new Array){return v.Children.forEach(a,o=>{if(!(0,v.isValidElement)(o))return;const c=(0,S.IY)(o,"core.mountPoint");if(c){const f=(0,S.IY)(o,"core.plugin");r.push({routeRef:c,plugin:f})}Rt(o.props.children,r)}),r}const _n=A(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,$;if(c!=null&&c.isElementAncestor)return c;if((o==null?void 0:o.props.element)===r)return{...c,isElementAncestor:!0};const z=(f=r.props)===null||f===void 0?void 0:f.path,V=(0,S.IY)(r,"core.mountPoint");if(V&&z)throw new Error(`Path property may not be set directly on a routable extension "${kt(r)}"`);var oe;const Be=(oe=c==null||($=c.obj)===null||$===void 0?void 0:$.children)!==null&&oe!==void 0?oe:a.objects;if(z!==void 0){if(typeof z!="string")throw new Error(`Element path must be a string at "${kt(r)}"`);const Ct=z.startsWith("/")?z.slice(1):z,zt=r.props.element;if((0,S.IY)(r,"core.gatherMountPoints")){var $e;if(zt)throw new Error(`Mount point gatherers may not have an element prop "${kt(r)}"`);const dn={path:Ct,element:"gathered",routeRefs:new Set,caseSensitive:Boolean(($e=r.props)===null||$e===void 0?void 0:$e.caseSensitive),children:[et],plugin:void 0};return Be.push(dn),{obj:dn,gatherPath:Ct,routeRef:c==null?void 0:c.routeRef,gatherRouteRef:c==null?void 0:c.routeRef}}if(zt){var xt;const[dn,...xn]=Rt(zt);if(xn.length>0)throw new Error(`Route element with path "${z}" may not contain multiple routable extensions`);if(!dn)return c;const{routeRef:sr,plugin:Ln}=dn,zn={path:Ct,element:"mounted",routeRefs:new Set([sr]),caseSensitive:Boolean((xt=r.props)===null||xt===void 0?void 0:xt.caseSensitive),children:[et],plugin:Ln};return Be.push(zn),a.paths.set(sr,Ct),a.parents.set(sr,c==null?void 0:c.routeRef),{obj:zn,routeRef:sr!=null?sr:c==null?void 0:c.routeRef,gatherPath:Ct,gatherRouteRef:c==null?void 0:c.gatherRouteRef}}}if(V){var ot;if(!(c!=null&&c.gatherPath))throw new Error(`Routable extension "${kt(r)}" with mount point "${V}" must be assigned a path`);return c==null||(ot=c.obj)===null||ot===void 0||ot.routeRefs.add(V),a.paths.set(V,c.gatherPath),a.parents.set(V,c==null?void 0:c.gatherRouteRef),{...c,routeRef:V}}return c}),fr=A(()=>({paths:new Map,parents:new Map,objects:new Array}),(a,r,o,c)=>{var f,$,z;if((o==null?void 0:o.props.element)===r)return c;let V=c==null?void 0:c.obj,oe=c==null?void 0:c.routeRef,Be=c==null?void 0:c.sticky;const $e=(f=r.props)===null||f===void 0?void 0:f.path;var xt;const ot=(xt=V==null?void 0:V.children)!==null&&xt!==void 0?xt:a.objects,Ct=Boolean(($=r.props)===null||$===void 0?void 0:$.caseSensitive);let zt=c==null?void 0:c.path;if((0,S.IY)(r,"core.gatherMountPoints")){if(!$e)throw new Error("Mount point gatherer must have a path");zt=$e}const dn=(z=r.props)===null||z===void 0?void 0:z.element;let xn=(0,S.IY)(r,"core.mountPoint");if(!xn&&(0,v.isValidElement)(dn)&&(xn=(0,S.IY)(dn,"core.mountPoint")),xn){let zn=$e;if(zt&&(zn?zt=void 0:zn=zt),!zn)throw new Error("Mounted routable extension must have a path");a.paths.set(xn,zn),oe&&Be?(a.parents.set(xn,oe),$e&&(oe=xn,Be=!1)):(a.parents.set(xn,oe),oe=xn),$e?(V={caseSensitive:Ct,path:$e,element:"mounted",routeRefs:new Set([xn]),children:[et],plugin:(0,S.IY)(r.props.element,"core.plugin")},ot.push(V)):V==null||V.routeRefs.add(xn)}if((0,S.IY)(r,"core.gatherMountPoints")&&(Be=!0),(0,S.IY)(r,"core.gatherMountPoints")){if(!$e)throw new Error("Mount point gatherer must have a path");if(!xn){var Ln;V={caseSensitive:Ct,path:$e,element:"gathered",routeRefs:new Set,children:[et],plugin:c==null||(Ln=c.obj)===null||Ln===void 0?void 0:Ln.plugin},ot.push(V)}}return{obj:V,path:zt,routeRef:oe,sticky:Be}}),es=A(()=>new Set,(a,r)=>{if(r.type===Re){const o=r.props;a.add("with"in o?o.with:o.without)}}),ar=(0,We.uW)("route-ref-type",()=>Symbol("route-ref-type"));function $r(a){return a[ar]==="absolute"}function Br(a){return a[ar]==="sub"}function jr(a){return a[ar]==="external"}function gr(...a){const r=a.join("/").replace(/\/\/+/g,"/");return r!=="/"&&r.endsWith("/")?r.slice(0,-1):r}function ts(a,r,o){let c,f="";if($r(a))c=a;else if(Br(a))c=a.parent,f=a.path;else if(jr(a)){const V=o.get(a);if(!V)return[void 0,""];if($r(V))c=V;else if(Br(V))c=V.parent,f=V.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${V}`)}else throw a[ar]?new Error(`Unknown or invalid route ref type, ${a[ar]}`):new Error(`Unknown object passed to useRouteRef, got ${a}`);if(!c)return[void 0,""];const $=r.get(c);if($===void 0)return[void 0,""];const z=gr($,f);return[c,z]}function Zr(a,r,o,c,f){var $;const z=($=(0,W.fp)(f,r))!==null&&$!==void 0?$:[],V=Array();let oe=-1;for(let xt=a;xt&&(oe=z.findIndex(ot=>ot.route.routeRefs.has(xt)),oe===-1);xt=c.get(xt))V.unshift(xt);V.length===0&&(oe-=1);const Be=oe===-1?"":z[oe].pathname,$e=V.slice(0,-1).map(xt=>{const ot=o.get(xt);if(ot===void 0)throw new Error(`No path for ${xt}`);if(ot.includes(":"))throw new Error(`Cannot route to ${a} with parent ${xt} as it has parameters`);return ot});return`${gr(Be,...$e)}/`}class ns{resolve(r,o){const[c,f]=ts(r,this.routePaths,this.routeBindings);if(!c)return;let $;typeof o=="string"?$=this.trimPath(o):o.pathname?$={...o,pathname:this.trimPath(o.pathname)}:$=o;const z=this.appBasePath+Zr(c,$,this.routePaths,this.routeParents,this.routeObjects);return(...[oe])=>gr(z,(0,W.Gn)(f,oe))}trimPath(r){return r&&(r.startsWith(this.appBasePath)?r.slice(this.appBasePath.length):r)}constructor(r,o,c,f,$){this.routePaths=r,this.routeParents=o,this.routeObjects=c,this.routeBindings=f,this.appBasePath=$}}const Bn=(0,We.CT)("routing-context"),Zn=({routePaths:a,routeParents:r,routeObjects:o,routeBindings:c,basePath:f="",children:$})=>{const z=new ns(a,r,o,c,f),V=(0,We.EI)({1:z});return(0,n.jsx)(Bn.Provider,{value:V,children:$})},lr=(a,r)=>{try{var o,c;const f=(0,W.fp)(r,{pathname:a}),$=(o=f==null?void 0:f.filter(V=>{var oe;return((oe=V==null?void 0:V.route.routeRefs)===null||oe===void 0?void 0:oe.size)>0}).pop())===null||o===void 0?void 0:o.route;if(!$)return{};let z;return $.routeRefs.size===1&&(z=$.routeRefs.values().next().value),{extension:"App",pluginId:((c=$.plugin)===null||c===void 0?void 0:c.getId())||"root",...z?{routeRef:z.id}:{}}}catch{return{}}},mr=({pathname:a,search:r,hash:o})=>{const c=(0,S.z$)();return(0,v.useEffect)(()=>{c.captureEvent("navigate",`${a}${r}${o}`)},[c,a,r,o]),null},Dr=({routeObjects:a})=>{const{pathname:r,search:o,hash:c}=(0,W.TH)();return(0,n.jsx)(S.fC,{attributes:lr(r,a),children:(0,n.jsx)(mr,{pathname:r,search:o,hash:c})})};function rs(a,r){const o=new Set(r.values());o.delete(void 0);for(const c of r.keys()){if(o.has(c))continue;let f=c,$="";for(;f;){const V=a.get(f);if(V===void 0)throw new Error(`No path for ${f}`);$=gr(V,$),f=r.get(f)}const z=$.match(/:(\w+)/g);if(z){for(let V=0;V<z.length;V++)for(let oe=V+1;oe<z.length;oe++)if(z[oe]===z[V])throw new Error(`Parameter ${z[oe]} is duplicated in path ${$}`)}}}function Nr(a,r){for(const o of r)if(!!o.externalRoutes){for(const[c,f]of Object.entries(o.externalRoutes))if(!f.optional&&!a.has(f))throw new Error(`External route '${c}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const ss=(0,We.CT)("app-context"),os=({appContext:a,children:r})=>{const o=(0,We.EI)({1:a});return(0,n.jsx)(ss.Provider,{value:o,children:r})};function vr(a){return new Error(`Tried to access IdentityApi ${a} before app was loaded`)}function gn(a){console.warn(`WARNING: Call to ${a} is deprecated and will break in the future`)}class Dn{setTarget(r,o){this.target=r,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(r)}getUserId(){if(!this.target)throw vr("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return gn("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw vr("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return gn("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(r=>r.getProfileInfo())}async getBackstageIdentity(){const r=await this.waitForTarget.then(o=>o.getBackstageIdentity());return r.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${r.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),r}async getCredentials(){return this.waitForTarget.then(r=>r.getCredentials())}async getIdToken(){return this.waitForTarget.then(r=>{if(!r.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return gn("getIdToken"),r.getIdToken()})}async signOut(){await this.waitForTarget.then(r=>r.signOut()),location.href=this.signOutTargetUrl}constructor(){this.resolveTarget=()=>{},this.signOutTargetUrl="/",this.waitForTarget=new Promise(r=>{this.resolveTarget=r})}}var yr=t(72164);function Rs(a,r,o){if(a!==void 0){const f=o.find($=>$.id===a);if(f)return f}if(r){const f=o.find($=>$.variant==="dark");if(f)return f}const c=o.find(f=>f.variant==="light");return c||o[0]}const Er=()=>{const a=(0,v.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[r,o]=(0,v.useState)(a.matches);return(0,v.useEffect)(()=>{const c=f=>{o(f.matches)};return a.addListener(c),()=>{a.removeListener(c)}},[a]),r};function Ar({children:a}){const r=(0,S.h_)(S.hg),o=(0,yr.Z)(r.activeThemeId$(),r.getActiveThemeId()),c=Boolean(window.matchMedia)?Er():!1,f=Rs(o,c,r.getInstalledThemes());if(!f)throw new Error("App has no themes");return(0,n.jsx)(f.Provider,{children:a})}const is=async(a="__APP_INJECTED_RUNTIME_CONFIG__")=>{const r=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!r)throw new Error("No static configuration provided");if(!Array.isArray(r))throw new Error("Static configuration has invalid format");const o=r.slice();if(a!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const f=JSON.parse(a);Array.isArray(f)?o.push(...f):o.push({data:f,context:"env"})}catch(f){throw new Error(`Failed to load runtime configuration, ${f}`)}const c=window.__APP_CONFIG__;return c&&o.push({context:"window",data:c}),o};class Ls{add(r,o){return this.apis.push([r.id,o]),o}build(){return new Hn(new Map(this.apis))}constructor(){this.apis=[]}}class Hn{static builder(){return new Ls}static from(r){return new Hn(new Map(r.map(([o,c])=>[o.id,c])))}static with(r,o){return new Hn(new Map([[r.id,o]]))}with(r,o){return new Hn(new Map([...this.apis,[r.id,o]]))}get(r){return this.apis.get(r.id)}constructor(r){this.apis=r}}function Ps(a){const r=new Map;return a&&a({bind:(c,f)=>{for(const[$,z]of Object.entries(f)){const V=c[$];if(!V)throw new Error(`Key ${$} is not an existing external route`);if(!z&&!V.optional)throw new Error(`External route ${$} is required but was undefined`);z&&r.set(V,z)}}}),r}function Fr(){const[a]=(0,W.is)((0,n.jsx)(W.AW,{index:!0,element:(0,n.jsx)("div",{})}));return!a.index}const Tr=(0,v.createContext)({routeObjects:[]});function Ir(a){var r;let{pathname:o}=new URL((r=a.getOptionalString("app.baseUrl"))!==null&&r!==void 0?r:"/","http://dummy.dev");return o=o.replace(/\/*$/,""),o}function as(a,r,o){const c=Boolean(a),f=(0,u.default)(a||(()=>Promise.resolve([])));let $;if(c&&f.loading){const{Progress:Be}=r;$=(0,n.jsx)(Be,{})}else if(f.error){const{BootErrorPage:Be}=r;$=(0,n.jsx)(Be,{step:"load-config",error:f.error})}const{ThemeProvider:z=Ar}=r;if($)return{node:(0,n.jsx)(Ne,{apis:Hn.with(S.hg,o),children:(0,n.jsx)(z,{children:$})})};var V;return{api:ht.fromConfigs((V=f.value)!==null&&V!==void 0?V:[])}}class ls{getPlugins(){return this.app.getPlugins()}getSystemIcon(r){return this.app.getSystemIcon(r)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(r){this.app=r}}class cs{getPlugins(){return Array.from(this.plugins)}getSystemIcon(r){return this.icons[r]}getSystemIcons(){return this.icons}getComponents(){return this.components}getProvider(){const r=new ls(this);let o=!1;return({children:f})=>{const $=(0,v.useMemo)(()=>k.createWithStorage(this.themes),[]),{routing:z,featureFlags:V,routeBindings:oe}=(0,v.useMemo)(()=>{const ot=b({root:f,discoverers:[K,me],collectors:{routing:Fr()?fr:_n,collectedPlugins:ye,featureFlags:es}});return ot.collectedPlugins.forEach(Ct=>this.plugins.add(Ct)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...ot,routeBindings:Ps(this.bindRoutes)}},[f]);o||(o=!0,rs(z.paths,z.parents),Nr(oe,this.plugins));const Be=as(this.configLoader,this.components,$),$e="api"in Be;if($e){const{api:ot}=Be;this.configApi=ot}if((0,v.useEffect)(()=>{if($e){const ot=this.getApiHolder().get(S.W0);for(const Ct of this.plugins.values())if("getFeatureFlags"in Ct)for(const zt of Ct.getFeatureFlags())ot.registerFlag({name:zt.name,pluginId:Ct.getId()});else for(const zt of Ct.output())zt.type==="feature-flag"&&ot.registerFlag({name:zt.name,pluginId:Ct.getId()});for(const Ct of V)ot.registerFlag({name:Ct,pluginId:""})}},[$e,Be,V]),"node"in Be)return Be.node;const{ThemeProvider:xt=Ar}=this.components;return(0,n.jsx)(Ne,{apis:this.getApiHolder(),children:(0,n.jsx)(os,{appContext:r,children:(0,n.jsx)(xt,{children:(0,n.jsx)(Zn,{routePaths:z.paths,routeParents:z.parents,routeObjects:z.objects,routeBindings:oe,basePath:Ir(Be.api),children:(0,n.jsx)(Tr.Provider,{value:{routeObjects:z.objects},children:f})})})})})}}getRouter(){const{Router:r,SignInPage:o}=this.components,c=({component:$,children:z})=>{const[V,oe]=(0,v.useState)(),Be=(0,S.h_)(S.Ds),$e=Ir(Be);return V?(this.appIdentityProxy.setTarget(V,{signOutTargetUrl:$e||"/"}),z):(0,n.jsx)($,{onSignInSuccess:oe})};return({children:$})=>{const z=(0,S.h_)(S.Ds),V=Ir(z),oe=`${V}/*`,{routeObjects:Be}=(0,v.useContext)(Tr);return o?(0,n.jsxs)(r,{children:[(0,n.jsx)(Dr,{routeObjects:Be}),(0,n.jsx)(c,{component:o,children:(0,n.jsx)(W.Z5,{children:(0,n.jsx)(W.AW,{path:oe,element:(0,n.jsx)(n.Fragment,{children:$})})})})]}):(this.appIdentityProxy.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:V||"/"}),(0,n.jsxs)(r,{children:[(0,n.jsx)(Dr,{routeObjects:Be}),(0,n.jsx)(W.Z5,{children:(0,n.jsx)(W.AW,{path:oe,element:(0,n.jsx)(n.Fragment,{children:$})})})]}))}}getApiHolder(){if(this.apiHolder){for(const r of this.plugins)for(const o of r.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return Me.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:S.hg,deps:{},factory:()=>k.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:S.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:S.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:S.W0,deps:{},factory:()=>new Se});for(const r of this.defaultApis)this.apiFactoryRegistry.register("default",r);for(const r of this.plugins)for(const o of r.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${r.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const r of this.apis)if(!this.apiFactoryRegistry.register("app",r))throw new Error(`Duplicate or forbidden API factory for ${r.api} in app`);return Me.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Me(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(r){const o=new Set;for(const c of r){const f=c.getId();if(o.has(f))throw new Error(`Duplicate plugin found '${f}'`);o.add(f)}}constructor(r){this.appIdentityProxy=new Dn;var o;this.apis=(o=r.apis)!==null&&o!==void 0?o:[],this.icons=r.icons;var c;this.plugins=new Set((c=r.plugins)!==null&&c!==void 0?c:[]),this.components=r.components,this.themes=r.themes;var f;this.configLoader=(f=r.configLoader)!==null&&f!==void 0?f:is;var $;this.defaultApis=($=r.defaultApis)!==null&&$!==void 0?$:[],this.bindRoutes=r.bindRoutes,this.apiFactoryRegistry=new ct}}function ds(a){return new cs(a)}let Ur=!1;const Mr=a=>{const r=(0,S.qD)(),{NotFoundErrorPage:o}=r.getComponents(),c=(0,v.useMemo)(()=>Fr(),[]),$=[...(0,S.vJ)(a.children,z=>z.getElements().flatMap(V=>{let oe=V.props.path;if(oe==="")return[];var Be;oe=(Be=oe==null?void 0:oe.replace(/\/\*$/,""))!==null&&Be!==void 0?Be:"/";let $e=c?V:V.props.element;return!c&&!$e&&($e=V,Ur||(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] />} />."),Ur=!0)),[{path:oe,element:$e,children:V.props.children?[{path:oe==="/"?"/":"*",element:V.props.children}]:void 0}]}).sort((V,oe)=>oe.path.localeCompare(V.path)).map(V=>({...V,path:V.path==="/"?"/":`${V.path}/*`}))),{path:"*",element:(0,n.jsx)(o,{})}];return(0,W.V$)($)};var Rr=t(25488);const er=[(0,S.ni)({api:S.NW,deps:{configApi:S.Ds},factory:({configApi:a})=>j.compile(`${a.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,S.ni)({api:S.$v,deps:{},factory:()=>new J}),(0,S.ni)({api:S.v_,deps:{},factory:()=>new y}),(0,S.ni)({api:S.VE,deps:{alertApi:S.$v},factory:({alertApi:a})=>{const r=new U(a,new ne);return de.forward(r,{hidden:!1}),r}}),(0,S.ni)({api:S.E6,deps:{errorApi:S.VE},factory:({errorApi:a})=>w.create({errorApi:a})}),(0,S.ni)({api:S.gP,deps:{configApi:S.Ds,identityApi:S.$4,discoveryApi:S.NW},factory:({configApi:a,identityApi:r,discoveryApi:o})=>Qe({middleware:[Gn.resolvePluginProtocol({discoveryApi:o}),Gn.injectIdentityAuth({identityApi:r,config:a})]})}),(0,S.ni)({api:S.ZM,deps:{},factory:()=>new qn}),(0,S.ni)({api:S.Kp,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>wn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.p_,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>tn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.F4,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>jt.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.D,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Vn.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.ux,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Zt.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.gW,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>he.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.bq,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Te.create({discoveryApi:a,oauthRequestApi:r,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,S.ni)({api:S.uB,deps:{discoveryApi:S.NW,oauthRequestApi:S.ZM,configApi:S.Ds},factory:({discoveryApi:a,oauthRequestApi:r,configApi:o})=>Je.create({discoveryApi:a,oauthRequestApi:r,environment:o.getOptionalString("auth.environment")})}),(0,S.ni)({api:Rr.RV,deps:{discovery:S.NW,identity:S.$4,config:S.Ds},factory:({config:a,discovery:r,identity:o})=>Rr.iM.create({config:a,discovery:r,identity:o})})];var Qt=t(77277),Ot=t(71399),zr=t(62833);function us({children:a}){return(0,W.GV)()?(0,n.jsx)(n.Fragment,{children:a}):(0,n.jsx)(W.VA,{children:a})}const Vr=()=>(0,n.jsx)(Ot.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),hs=({step:a,error:r})=>{let o="";return a==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${r.message}`:a==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${r.message}`),(0,n.jsx)(us,{children:(0,n.jsx)(Ot.mf,{status:"501",statusMessage:o})})},ps=({error:a,resetError:r,plugin:o})=>(0,n.jsx)(Ot.yu,{title:`Error in ${o==null?void 0:o.getId()}`,defaultExpanded:!0,error:a,children:(0,n.jsx)(Qt.Z,{variant:"outlined",onClick:r,children:"Retry"})}),fs={Progress:Ot.Ex,Router:zr.VK,NotFoundErrorPage:Vr,BootErrorPage:hs,ErrorBoundaryFallback:ps};var gs=t(43642),Hr=t(80079),xr=t(90941),ks=t(32915),ms=t(40562),Wr=t(21853),vs=t(60744),Os=t(66569),ys=t(30254),$s=t(13384),po=t(15933),x=t(58838),C=t(86737),O=t(4989),M=t(44407),_=t(18628),ee=t(84219),pe=t(98685),be=t(39781);const we={brokenImage:Hr.Z,catalog:_.Z,scaffolder:ks.Z,techdocs:ms.Z,search:Wr.Z,chat:vs.Z,dashboard:Os.Z,docs:ys.Z,email:$s.Z,github:x.Z,group:ee.Z,help:C.Z,"kind:api":po.Z,"kind:component":M.Z,"kind:domain":gs.Z,"kind:group":ee.Z,"kind:location":O.Z,"kind:system":xr.Z,"kind:user":pe.Z,user:pe.Z,warning:be.Z};var Ze=t(73689),Ue=t(48032);const Pe={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")`},ze={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 lt(a){const{colors:r,shape:o,options:c}=a,$=`linear-gradient(90deg, ${(r.length===1?[r[0],r[0]]:r).join(", ")})`,z=`${o}, ${$}`;var V;const oe=(V=c==null?void 0:c.fontColor)!==null&&V!==void 0?V:"#FFFFFF";return{colors:r,shape:o,backgroundImage:z,fontColor:oe}}const yt={home:lt({colors:ze.teal,shape:Pe.wave}),documentation:lt({colors:ze.pinkSea,shape:Pe.wave2}),tool:lt({colors:ze.purpleSky,shape:Pe.round}),service:lt({colors:ze.marineBlue,shape:Pe.wave}),website:lt({colors:ze.veryBlue,shape:Pe.wave}),library:lt({colors:ze.rubyRed,shape:Pe.wave}),other:lt({colors:ze.darkGrey,shape:Pe.wave}),app:lt({colors:ze.toastyOrange,shape:Pe.wave}),apis:lt({colors:ze.teal,shape:Pe.wave2}),card:lt({colors:ze.greens,shape:Pe.wave})},Ve=16,Pt='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Gt(a){const{palette:r,htmlFontSize:o=Ve,fontFamily:c=Pt,defaultPageTheme:f,pageTheme:$=yt}=a;if(!$[f])throw new Error(`${f} is not defined in pageTheme.`);var z;return{palette:r,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:o,fontFamily:c,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:$[f],getPageTheme:({themeId:V})=>(z=$[V])!==null&&z!==void 0?z:$[f]}}function Nn(a){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:a.typography.fontFamily},body:{height:"100%",fontFamily:a.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:a.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:a.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:a.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:"rgb(179, 179, 179)",fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:a.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Ue.darken)(a.palette.link,.3),background:(0,Ue.lighten)(a.palette.link,.95)},[a.breakpoints.up("md")]:{minWidth:120,fontSize:a.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:a.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:a.spacing(1),marginBottom:a.spacing(1),color:a.palette.grey[900]},outlined:{color:a.palette.text.primary},label:{lineHeight:`${a.spacing(2.5)}px`,fontWeight:a.typography.fontWeightMedium,fontSize:`${a.spacing(1.75)}px`},labelSmall:{fontSize:`${a.spacing(1.5)}px`},deleteIcon:{color:a.palette.grey[500],width:`${a.spacing(3)}px`,height:`${a.spacing(3)}px`,margin:`0 ${a.spacing(.75)}px 0 -${a.spacing(.75)}px`},deleteIconSmall:{width:`${a.spacing(2)}px`,height:`${a.spacing(2)}px`,margin:`0 ${a.spacing(.5)}px 0 -${a.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function En(a){const r=Gt(a),o=(0,Ze.Z)(r),c=Nn(o);return{...o,overrides:c}}var tr=t(34505);const cn=En({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:tr.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:yt}),mn=En({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:tr.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:yt});var An=t(98192),br=t(15222),Sr=t(41547),wr=t(87561);const vn=[{id:"light",title:"Light Theme",variant:"light",icon:(0,n.jsx)(br.Z,{}),Provider:({children:a})=>(0,n.jsx)(Sr.Z,{theme:cn,children:(0,n.jsx)(wr.ZP,{children:a})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,n.jsx)(An.Z,{}),Provider:({children:a})=>(0,n.jsx)(Sr.Z,{theme:mn,children:(0,n.jsx)(wr.ZP,{children:a})})}];function Xt(a){var r,o,c;return ds({...a,apis:(r=a==null?void 0:a.apis)!==null&&r!==void 0?r:[],bindRoutes:a==null?void 0:a.bindRoutes,components:{...fs,...a==null?void 0:a.components},configLoader:a==null?void 0:a.configLoader,defaultApis:er,icons:{...we,...a==null?void 0:a.icons},plugins:(o=a==null?void 0:a.plugins)!==null&&o!==void 0?o:[],themes:(c=a==null?void 0:a.themes)!==null&&c!==void 0?c:vn})}var nr=t(25271),fo=t(76635);async function ii({storageApi:a}){const r=a.forBucket("settings"),o=a.forBucket("starredEntities"),c=r.snapshot("starredEntities").value;if(!(0,fo.isArray)(c))return;var f;const $=new Set((f=o.snapshot("entityRefs").value)!==null&&f!==void 0?f:[]);c.filter(fo.isString).map(z=>z.split(":")).filter(z=>z.length===4&&z[0]==="entity").map(([z,V,oe,Be])=>(0,nr.eE)({kind:V,namespace:oe,name:Be})).forEach(z=>$.add(z)),await o.set("entityRefs",Array.from($)),await r.remove("starredEntities")}class ai{async toggleStarred(r){this.starredEntities.has(r)?this.starredEntities.delete(r):this.starredEntities.add(r),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const r of this.subscribers)r.next(new Set(this.starredEntities))}constructor(r){this.subscribers=new Set,this.observable=new(ae())(c=>(c.next(new Set(this.starredEntities)),this.subscribers.add(c),()=>{this.subscribers.delete(c)})),ii(r).then(),this.settingsStore=r.storageApi.forBucket("starredEntities");var o;this.starredEntities=new Set((o=this.settingsStore.snapshot("entityRefs").value)!==null&&o!==void 0?o:[]),this.settingsStore.observe$("entityRefs").subscribe({next:c=>{var f;this.starredEntities=new Set((f=c.value)!==null&&f!==void 0?f:[]),this.notifyChanges()}})}}var Hi=t(33414),Wi=t(79324),Lr=t(79692),go=t(60712);const mo=(0,Lr.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}});function li(a){var r,o;const c=a.result,f=mo(),$=useAnalytics(),z=()=>{$.captureEvent("discover",c.title,{attributes:{to:c.location},value:a.rank})};return _jsxs(Link,{noTrack:!0,to:c.location,onClick:z,children:[_jsxs(ListItem,{alignItems:"flex-start",children:[a.icon&&_jsx(ListItemIcon,{children:a.icon}),_jsxs("div",{className:f.flexContainer,children:[_jsx(ListItemText,{className:f.itemText,primaryTypographyProps:{variant:"h6"},primary:!((r=a.highlight)===null||r===void 0)&&r.fields.title?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.title,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.title,secondary:!((o=a.highlight)===null||o===void 0)&&o.fields.text?_jsx(HighlightedSearchResultText,{text:a.highlight.fields.text,preTag:a.highlight.preTag,postTag:a.highlight.postTag}):c.text}),_jsxs(Box,{children:[c.kind&&_jsx(Chip,{label:`Kind: ${c.kind}`,size:"small"}),c.lifecycle&&_jsx(Chip,{label:`Lifecycle: ${c.lifecycle}`,size:"small"})]})]})]}),_jsx(Divider,{component:"li"})]})}var ci=t(86359),hn=t(46285),xs=t(95544),vo=t(99688),Bs=t(12231),Zs=t(86136),Gr=t(49378),di=t(85256),bs=t(61837),yo=t(79784),Ds=t(50758),Ns=t(31654),xo=t(43054),cr=t(51666);const Pr="catalog-entity",bo=(0,cr.J$)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:Pr}),So=(0,cr.J$)({name:"catalog.entity.create",attributes:{action:"create"}}),Fs=(0,cr.J$)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:Pr}),ui=(0,cr.J$)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:Pr}),wo=(0,cr.J$)({name:"catalog.location.read",attributes:{action:"read"}}),Co=(0,cr.J$)({name:"catalog.location.create",attributes:{action:"create"}}),Us=(0,cr.J$)({name:"catalog.location.delete",attributes:{action:"delete"}}),hi=[bo,So,Fs,ui,wo,Co,Us];var Ms=t(49166);function jo(a){const{unregisterEntityOptions:r,isUnregisterAllowed:o,onUnregisterEntity:c,onClose:f}=a,$=typeof(r==null?void 0:r.disableUnregister)=="boolean";var z;const V=(z=!o||($?!!(r!=null&&r.disableUnregister):(r==null?void 0:r.disableUnregister)==="disable"))!==null&&z!==void 0?z:!1;let oe=(0,n.jsx)(n.Fragment,{});return(r==null?void 0:r.disableUnregister)!=="hidden"&&(oe=(0,n.jsxs)(Bs.Z,{onClick:()=>{f(),c()},disabled:V,children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Ms.Z,{fontSize:"small"})}),(0,n.jsx)(Gr.Z,{primary:"Unregister entity"})]})),(0,n.jsx)(n.Fragment,{children:oe})}const zs=(0,Lr.Z)(a=>({button:{color:a.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Vs(a){const{UNSTABLE_extraContextMenuItems:r,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:c,onInspectEntity:f}=a,[$,z]=(0,v.useState)(),V=zs(),Be=(0,hn.N$)(Fs).allowed,$e=Ct=>{z(Ct.currentTarget)},xt=()=>{z(void 0)},ot=r&&[...r.map(Ct=>(0,n.jsxs)(Bs.Z,{onClick:()=>{xt(),Ct.onClick()},children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Ct.Icon,{fontSize:"small"})}),(0,n.jsx)(Gr.Z,{primary:Ct.title})]},Ct.title)),(0,n.jsx)(di.Z,{},"the divider is here!")];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!$,role:"button",onClick:$e,"data-testid":"menu-button",className:V.button,id:"long-menu",children:(0,n.jsx)(xo.Z,{})}),(0,n.jsx)(yo.ZP,{open:Boolean($),onClose:xt,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,n.jsxs)(Ds.Z,{children:[ot,(0,n.jsx)(jo,{unregisterEntityOptions:o,isUnregisterAllowed:Be,onUnregisterEntity:c,onClose:xt}),(0,n.jsxs)(Bs.Z,{onClick:()=>{xt(),f()},children:[(0,n.jsx)(Zs.Z,{children:(0,n.jsx)(Ns.Z,{fontSize:"small"})}),(0,n.jsx)(Gr.Z,{primary:"Inspect entity"})]})]})})]})}const Hs="plugin.catalog.entityLayoutRoute",Ws=()=>null;(0,S.R5)(Ws,Hs,!0),(0,S.R5)(Ws,"core.gatherMountPoints",!0);function Eo(a){const{entity:r,title:o}=a;return(0,n.jsxs)(xs.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,n.jsx)(xs.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),r&&(0,n.jsx)(hn.LH,{entity:r})]})}function Gs(a,r,o,c){var f;const $=(f=a!=null?a:c==null?void 0:c.kind)!==null&&f!==void 0?f:"";var z;const V=(z=r!=null?r:c==null?void 0:c.metadata.namespace)!==null&&z!==void 0?z:"";var oe,Be,$e;return{headerTitle:`${($e=(Be=(oe=c==null?void 0:c.metadata.title)!==null&&oe!==void 0?oe:o)!==null&&Be!==void 0?Be:c==null?void 0:c.metadata.name)!==null&&$e!==void 0?$e:""}${V&&V!==nr.zG?` in ${V}`:""}`,headerType:(()=>{let ot=$.toLocaleLowerCase("en-US");return c&&c.spec&&"type"in c.spec&&(ot+=" \u2014 ",ot+=c.spec.type.toLocaleLowerCase("en-US")),ot})()}}function Ao(a){var r;const{entity:o}=a,c=(0,hn.hF)(o,nr.S4);return(0,n.jsxs)(n.Fragment,{children:[c.length>0&&(0,n.jsx)(Ot.i9,{label:"Owner",value:(0,n.jsx)(hn.rI,{entityRefs:c,defaultKind:"Group",color:"inherit"})}),((r=o.spec)===null||r===void 0?void 0:r.lifecycle)&&(0,n.jsx)(Ot.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Fn=a=>{var r,o;const{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,children:$,NotFoundComponent:z}=a,{kind:V,namespace:oe,name:Be}=(0,S.Oi)(hn.wi),{entity:$e,loading:xt,error:ot}=(0,hn.ce)(),Ct=(0,W.TH)(),zt=(0,S.vJ)($,Xo=>Xo.selectByComponentData({key:Hs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Cr})=>{if($e){if(Cr.if&&!Cr.if($e))return[]}else return[];return[{path:Cr.path,title:Cr.title,children:Cr.children,tabProps:Cr.tabProps}]}),[$e]),{headerTitle:dn,headerType:xn}=Gs(V,oe,Be,$e),[sr,Ln]=(0,v.useState)(!1),[zn,Jr]=(0,v.useState)(!1),Qr=(0,W.s0)(),Qo=async()=>{Ln(!1),Jr(!1),Qr("/")};(0,v.useEffect)(()=>{Ln(!1),Jr(!1)},[Ct.pathname]);var Xr;return(0,n.jsxs)(Ot.T3,{themeId:(Xr=$e==null||(r=$e.spec)===null||r===void 0||(o=r.type)===null||o===void 0?void 0:o.toString())!==null&&Xr!==void 0?Xr:"home",children:[(0,n.jsx)(Ot.h4,{title:(0,n.jsx)(Eo,{title:dn,entity:$e}),pageTitleOverride:dn,type:xn,children:$e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ao,{entity:$e}),(0,n.jsx)(Vs,{UNSTABLE_extraContextMenuItems:c,UNSTABLE_contextMenuOptions:f,onUnregisterEntity:()=>Ln(!0),onInspectEntity:()=>Jr(!0)})]})}),xt&&(0,n.jsx)(Ot.Ex,{}),$e&&(0,n.jsx)(Ot.tn,{routes:zt}),ot&&(0,n.jsx)(Ot.VY,{children:(0,n.jsx)(vo.Z,{severity:"error",children:ot.toString()})}),!xt&&!ot&&!$e&&(0,n.jsx)(Ot.VY,{children:z||(0,n.jsxs)(Ot.GB,{title:"Entity not found",children:["There is no ",V," with the requested"," ",(0,n.jsx)(Ot.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,n.jsx)(hn.pp,{open:sr,entity:$e,onConfirm:Qo,onClose:()=>Ln(!1)}),(0,n.jsx)(hn.U_,{open:zn,entity:$e,onClose:()=>Jr(!1)})]})};Fn.Route=Ws;var Gi=t(23054);function Ki(a){const{open:r,onClose:o,onConfirm:c,entity:f}=a,[$,z]=useState(!1),V=useApi(catalogApiRef),oe=useApi(alertApiRef),Be=async()=>{z(!0);try{const $e=f.metadata.uid;await V.removeEntityByUid($e),c()}catch($e){assertError($e),oe.post({message:$e.message})}finally{z(!1)}};return _jsxs(Dialog,{open:r,onClose:o,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:$,onClick:Be,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var Ss=t(19625);function Yi(a){var r,o;return(a==null||(r=a.metadata)===null||r===void 0||(o=r.annotations)===null||o===void 0?void 0:o["backstage.io/orphan"])==="true"}function Ji(){const a=useNavigate(),r=useRouteRef(rootRouteRef),[o,c]=useState(!1),{entity:f}=useEntity(),$=async()=>{c(!1),a(r())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>c(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:f,onConfirm:$,onClose:()=>c(!1)})]})}var pi=t(29644);const fi=a=>a.error&&a.level==="error"&&a.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function To(a,r){return{items:(await r.getEntityAncestors({entityRef:a})).items.map(f=>{var $,z;return{errors:((z=($=f.entity.status)===null||$===void 0?void 0:$.items)!==null&&z!==void 0?z:[]).filter(fi).map(Be=>Be.error).filter(Be=>Boolean(Be)),entity:f.entity}}).filter(f=>f.errors.length>0)}}async function ws(a,r){const o=r.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await To(stringifyEntityRef(a),o)).items.length>0}function Qi(){const{entity:a}=useEntity(),r=stringifyEntityRef(a),o=useApi(catalogApiRef),{loading:c,error:f,value:$}=useAsync(async()=>To(r,o),[r,o]);return f?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:f})}):c||!$?null:_jsx(_Fragment,{children:$.items.map((z,V)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(a)!==stringifyEntityRef(z.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:z.entity})]}),z.errors.map((oe,Be)=>_jsx(ResponseErrorPanel,{error:oe},Be))]},V))})}const Io="core.backstage.entitySwitch",Ks=a=>null;(0,S.R5)(Ks,Io,!0);const Ro=a=>{var r;const{entity:o,loading:c}=(0,hn.ce)(),f=(0,S.I_)(),$=(0,S.vJ)(a.children,oe=>oe.selectByComponentData({key:Io,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Be=>{if(c)return[];const{if:$e,children:xt}=Be.props;if(!o)return[{if:$e===void 0,children:xt}];var ot;return[{if:(ot=$e==null?void 0:$e(o,{apis:f}))!==null&&ot!==void 0?ot:!0,children:xt}]}),[f,o,c]);if($.some(oe=>typeof oe.if=="object"&&"then"in oe.if))return(0,n.jsx)(Cs,{results:$});var V;return(V=(r=$.find(oe=>oe.if))===null||r===void 0?void 0:r.children)!==null&&V!==void 0?V:null};function Cs({results:a}){const{loading:r,value:o}=(0,u.default)(async()=>{const c=a.map(async({if:$,children:z})=>{try{if(await $)return z}catch{}return null});var f;return(f=(await Promise.all(c)).find(Boolean))!==null&&f!==void 0?f:null},[a]);return r||!o?null:o}Ro.Case=Ks;const gi=null,mi=hn._i.Filters,vi=hn._i.Content,yn=(0,S.rx)({id:"catalog",apis:[(0,S.ni)({api:hn.Ah,deps:{discoveryApi:S.NW,fetchApi:S.gP},factory:({discoveryApi:a,fetchApi:r})=>new pi.MS({discoveryApi:a,fetchApi:r})}),(0,S.ni)({api:hn.p3,deps:{storageApi:S.E6},factory:({storageApi:a})=>new ai({storageApi:a})})],routes:{catalogIndex:Ss._Z,catalogEntity:hn.wi},externalRoutes:{createComponent:Ss.yw,viewTechDoc:Ss.jU},__experimentalConfigure(a){return{...{createButtonTitle:"Create"},...a}}}),Un=yn.provide((0,S.P4)({name:"CatalogIndexPage",component:()=>t.e(5837).then(t.bind(t,95837)).then(a=>a.CatalogPage),mountPoint:Ss._Z})),Kr=yn.provide((0,S.P4)({name:"CatalogEntityPage",component:()=>t.e(8951).then(t.bind(t,78951)).then(a=>a.CatalogEntityPage),mountPoint:hn.wi})),Lo=yn.provide((0,S.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(t.bind(t,33414)).then(a=>a.AboutCard)}})),Po=yn.provide((0,S.CO)({name:"EntityLinksCard",component:{lazy:()=>t.e(7750).then(t.bind(t,17750)).then(a=>a.EntityLinksCard)}})),rr=yn.provide((0,S.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>t.e(5458).then(t.bind(t,5458)).then(a=>a.HasSystemsCard)}})),yi=yn.provide((0,S.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>t.e(1105).then(t.bind(t,1105)).then(a=>a.HasComponentsCard)}})),ko=yn.provide((0,S.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>t.e(2440).then(t.bind(t,82440)).then(a=>a.HasSubcomponentsCard)}})),xi=yn.provide((0,S.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>t.e(9770).then(t.bind(t,79770)).then(a=>a.HasResourcesCard)}})),Xi=yn.provide((0,S.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>t.e(9545).then(t.bind(t,19545)).then(a=>a.DependsOnComponentsCard)}})),Kn=yn.provide((0,S.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>t.e(184).then(t.bind(t,40184)).then(a=>a.DependencyOfComponentsCard)}})),Oo=yn.provide((0,S.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>t.e(1032).then(t.bind(t,81032)).then(a=>a.DependsOnResourcesCard)}})),js=yn.provide((0,S.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>t.e(732).then(t.bind(t,732)).then(a=>a.RelatedEntitiesCard)}}));var Es=t(32838);class Yr{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(r,o){const f=`${await this.getApiOrigin()}/${o}`,$=await fetch(`${f.endsWith("/")?f:`${f}/`}index.html`);if($.status===404)throw new Error("Page not found");return $.text()}async syncEntityDocs(r){return"cached"}async getBaseUrl(r,o,c){const f=await this.getApiOrigin();return new URL(r,`${f}/${c}`).toString()}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}class Ys{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(r){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(r){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:r,discoveryApi:o,identityApi:c}){this.configApi=r,this.discoveryApi=o,this.identityApi=c}}const Js=[(0,S.ni)({api:xe.Dl,deps:{configApi:S.Ds,discoveryApi:S.NW,identityApi:S.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Yr({configApi:a,discoveryApi:r,identityApi:o})}),(0,S.ni)({api:xe.gT,deps:{configApi:S.Ds,discoveryApi:S.NW,identityApi:S.$4},factory:({configApi:a,discoveryApi:r,identityApi:o})=>new Ys({configApi:a,discoveryApi:r,identityApi:o})}),(0,S.ni)({api:Es.q3,deps:{configApi:S.Ds},factory:({configApi:a})=>Es.ae.fromConfig(a)})],Qs={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},$o={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function kr(){const a=await fetch("/.detect");return a.ok?(await a.text()).trim()==="techdocs-cli-server":!1}async function Bo(){const a=await is(),r=await kr();return[...a,{context:"detected",data:r?Qs:$o}]}var Xs=t(86689),Zo=t(58845);const _s=(0,Lr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var eo=()=>{const a=_s();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,n.jsx)("path",{className:a.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const to=(0,Lr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var As=()=>{const a=to();return(0,n.jsx)("svg",{className:a.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,n.jsx)("path",{className:a.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const Fo=(0,Lr.Z)({root:{width:Ot.po.drawerWidthClosed,height:3*Ot.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:Ot.po.drawerWidthClosed,marginLeft:24}}),Uo=()=>{const a=Fo(),{isOpen:r}=(0,Ot.mZ)();return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)(Xs.Z,{component:zr.OL,to:"/docs/default/component/local/",underline:"none",className:a.link,children:r?(0,n.jsx)(eo,{}):(0,n.jsx)(As,{})})})},Mo=({children:a})=>(0,n.jsxs)(Ot.tR,{children:[(0,n.jsxs)(Ot.YE,{children:[(0,n.jsx)(Uo,{}),(0,n.jsx)(Ot.v7,{}),(0,n.jsx)(Ot.R6,{icon:Zo.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),a]});var zo=t(80030),Vo=t(32388),Ho=t(4142);const Wo=(0,Lr.Z)(a=>({headerIcon:{color:a.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:a.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var Mn;(function(a){a.LIGHT="light",a.DARK="dark"})(Mn||(Mn={}));const no=()=>{const a=(0,S.h_)(S.hg),r=Wo(),[o,c]=(0,v.useState)(a.getActiveThemeId()===Mn.DARK?Mn.DARK:Mn.LIGHT),f={[Mn.LIGHT]:{icon:Ho.Z,title:"Dark theme"},[Mn.DARK]:{icon:Vo.Z,title:"Light theme"}},{title:$,icon:z}=f[o],V=()=>{c(oe=>{const Be=oe===Mn.LIGHT?Mn.DARK:Mn.LIGHT;return a.setActiveThemeId(Be),Be})};return(0,n.jsx)(xs.Z,{display:"flex",alignItems:"center",mr:2,children:(0,n.jsx)(zo.ZP,{title:$,arrow:!0,children:(0,n.jsx)(bs.Z,{size:"small",onClick:V,children:(0,n.jsx)(z,{className:r.headerIcon})})})})},Go=()=>(0,n.jsxs)(T.I6,{children:[(0,n.jsx)(F.S,{}),(0,n.jsx)(Q.F,{withSearch:!1})]}),Ko=(0,n.jsx)(Go,{}),ro=Xt({apis:Js,configLoader:Bo,plugins:Object.values(h)}),so=ro.getProvider(),Yo=ro.getRouter(),oo=T.s4.provide((0,xe.KY)({name:"ThemeToggleAddon",component:no,location:xe.oZ.Header})),Tn=(0,n.jsxs)(Mr,{children:[(0,n.jsx)(W.Fg,{to:"/docs/default/component/local/"},"/"),(0,n.jsx)(W.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,n.jsx)(Kr,{})}),(0,n.jsx)(W.AW,{path:"/docs",element:(0,n.jsx)(T.Jl,{}),children:(0,n.jsx)(R.u,{})}),(0,n.jsxs)(W.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,n.jsx)(T.I6,{}),children:[Ko,(0,n.jsx)(xe.DR,{children:(0,n.jsx)(oo,{})})]})]});var Jo=()=>(0,n.jsx)(so,{children:(0,n.jsx)(Yo,{children:(0,n.jsx)(Mo,{children:Tn})})});I.render((0,n.jsx)(Jo,{}),document.getElementById("root"))},51837:function(bt,Oe,t){"use strict";t.d(Oe,{CT:function(){return S},EI:function(){return se},uW:function(){return I},Vt:function(){return l}});function h(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const n=h(),v=X=>`__@backstage/${X}__`;function I(X,q){const F=v(X);let Q=n[F];return Q||(Q=q(),n[F]=Q,Q)}var W=t(2784);function S(X){return I(X,()=>(0,W.createContext)(void 0))}function l(X){return(0,W.useContext)(S(X))}function B(X){return{set(q){globalThis[`__@backstage/${X}__`]=createContext(createVersionedValueMap(q))},reset(){delete globalThis[`__@backstage/${X}__`]}}}function se(X){return Object.freeze(X),{atVersion(q){return X[q]}}}},46285:function(bt,Oe,t){"use strict";t.d(Oe,{h$:function(){return re},n3:function(){return h.n3},_i:function(){return D},zo:function(){return rn},df:function(){return ht},UO:function(){return Ce},dq:function(){return ne},nl:function(){return $s},dx:function(){return Zt},rI:function(){return en},u3:function(){return dt},xE:function(){return Gn},sL:function(){return $n},LH:function(){return A},U_:function(){return Ot},pp:function(){return fs},EW:function(){return Wr},Ah:function(){return v},wi:function(){return wt},hF:function(){return tt},CV:function(){return mt},$3:function(){return Bt},p3:function(){return I},ce:function(){return Ye},X2:function(){return Ke},wp:function(){return Ie},ZW:function(){return Te},N$:function(){return Je},eK:function(){return tn},CR:function(){return nn}});var h=t(29644),n=t(25248);const v=(0,n.T0)({id:"plugin.catalog.service"}),I=(0,n.T0)({id:"catalog-react.starred-entities"});var W=t(82394);class S{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const O of this.subscribers)O.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){this.starredEntities=new Set,this.subscribers=new Set,this.observable=new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)}))}}var l=t(52322),B=t(2784),se=t(41156),X=t(60364),q=t(77277),F=t(4190),Q=t(95544),Y=t(90436),ue=t(60905),le=t(36444);const P=x=>{const C=(0,se.Z)(ee=>ee.breakpoints.down("md")),O=(0,X.Z)(),[M,_]=(0,B.useState)(!1);return C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(q.Z,{style:{marginTop:O.spacing(1),marginLeft:O.spacing(1)},onClick:()=>_(!0),startIcon:(0,l.jsx)(le.Z,{}),children:"Filters"}),(0,l.jsx)(F.ZP,{open:M,onClose:()=>_(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,l.jsxs)(Q.Z,{m:2,children:[(0,l.jsx)(Y.Z,{variant:"h6",component:"h2",style:{marginBottom:O.spacing(1)},children:"Filters"}),x.children]})})]}):(0,l.jsx)(ue.Z,{item:!0,lg:2,children:x.children})},R=x=>(0,l.jsx)(ue.Z,{item:!0,xs:12,lg:10,children:x.children}),D=x=>(0,l.jsx)(ue.Z,{container:!0,style:{position:"relative"},children:x.children});D.Filters=P,D.Content=R;var L=t(51837);const T=(0,L.CT)("entity-context"),re=({children:x,entity:C,loading:O,error:M,refresh:_})=>{const ee={entity:C,loading:O,error:M,refresh:_};return(0,l.jsx)(T.Provider,{value:(0,L.EI)({1:ee}),children:x})},xe=x=>_jsx(re,{entity:x.entity,loading:!Boolean(x.entity),error:void 0,refresh:void 0,children:x.children});function Ke(){const x=(0,L.Vt)("entity-context");if(!x)throw new Error("Entity context is not available");const C=x.atVersion(1);if(!C)throw new Error("EntityContext v1 not available");if(!C.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:C.entity}}function Ye(){const x=(0,L.Vt)("entity-context");if(!x)throw new Error("Entity context is not available");const C=x.atVersion(1);if(!C)throw new Error("EntityContext v1 not available");const{entity:O,loading:M,error:_,refresh:ee}=C;return{entity:O,loading:M,error:_,refresh:ee}}var He=t(76635),We=t(19126),Ge=t.n(We),Ne=t(10289),Me=t(69294),qe=t(48760),ct=t(90736);function it(x){return x.reduce((C,O)=>({...C,...O.getCatalogFilters?O.getCatalogFilters():{}}),{})}function rt(x){return C=>x.every(O=>!O.filterEntity||O.filterEntity(C))}var Ae=t(25271);function tt(x,C,O){var M;let _=(x==null||(M=x.relations)===null||M===void 0?void 0:M.filter(ee=>ee.type===C).map(ee=>(0,Ae.of)(ee.targetRef)))||[];return O!=null&&O.kind&&(_=_.filter(ee=>ee.kind.toLocaleLowerCase("en-US")===O.kind.toLocaleLowerCase("en-US"))),_}function mt(x,C){var O;const M=(O=x.metadata.annotations)===null||O===void 0?void 0:O[Ae.M6];if(!!M)try{const _=(0,Ae.Ou)(M),ee=C.byUrl(_.target);return{locationTargetUrl:_.target,integrationType:ee==null?void 0:ee.type}}catch{return}}function Le(x,C){const O=new Set([...getEntityRelations(x,RELATION_MEMBER_OF,{kind:"group"}),...x?[getCompoundEntityRef(x)]:[]].map(stringifyEntityRef)),M=getEntityRelations(C,RELATION_OWNED_BY).map(stringifyEntityRef);for(const _ of M)if(O.has(_))return!0;return!1}const ae=(0,B.createContext)(void 0),Ce=({children:x})=>{const C=(0,ct.default)(),O=(0,n.h_)(v),[M,_]=(0,B.useState)({}),ee=(0,Ne.TH)();var pe;const be=(0,B.useMemo)(()=>(pe=Ge().parse(ee.search,{ignoreQueryPrefix:!0}).filters)!==null&&pe!==void 0?pe:{},[ee]),[we,Ze]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Ue,error:Pe},ze]=(0,Me.default)(async()=>{const Ve=(0,He.compact)(Object.values(M)),Pt=rt(Ve),Gt=it(Ve),Nn=it((0,He.compact)(Object.values(we.appliedFilters))),En=Object.keys(M).reduce((cn,mn)=>{const An=M[mn];return An!=null&&An.toQueryValue&&(cn[mn]=An.toQueryValue()),cn},{});if((0,He.isEqual)(Nn,Gt))Ze({appliedFilters:M,backendEntities:we.backendEntities,entities:we.backendEntities.filter(Pt)});else{const cn=await O.getEntities({filter:Gt});Ze({appliedFilters:M,backendEntities:cn.items,entities:cn.items.filter(Pt)})}if(C()){var tr;const cn=Ge().parse(ee.search,{ignoreQueryPrefix:!0}),mn=Ge().stringify({...cn,filters:En},{addQueryPrefix:!0,arrayFormat:"repeat"}),An=`${window.location.pathname}${mn}`;(tr=window.history)===null||tr===void 0||tr.replaceState(null,document.title,An)}},[O,be,M,we],{loading:!0});(0,qe.Z)(ze,10,[M]);const lt=(0,B.useCallback)(Ve=>{_(Pt=>{const Gt=typeof Ve=="function"?Ve(Pt):Ve;return{...Pt,...Gt}})},[]),yt=(0,B.useMemo)(()=>({filters:we.appliedFilters,entities:we.entities,backendEntities:we.backendEntities,updateFilters:lt,queryParameters:be,loading:Ue,error:Pe}),[we,lt,be,Ue,Pe]);return(0,l.jsx)(ae.Provider,{value:yt,children:x})};function Ie(){const x=(0,B.useContext)(ae);if(!x)throw new Error("useEntityList must be used within EntityListProvider");return x}var nt=t(64279),gt=t(18149),Tt=t.n(gt),at=t(829),St=t.n(at);const wt=(0,L.uW)("catalog:entity-route-ref",()=>(0,n.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Lt(x){var C,O;return{kind:x.kind.toLocaleLowerCase("en-US"),namespace:(O=(C=x.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&O!==void 0?O:DEFAULT_NAMESPACE,name:x.metadata.name}}function Bt(x,C){const O=C==null?void 0:C.defaultKind;let M,_,ee;return"metadata"in x?(M=x.kind,_=x.metadata.namespace,ee=x.metadata.name):(M=x.kind,_=x.namespace,ee=x.name),(_===void 0||_==="")&&(_=Ae.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===_&&(_=void 0):_===Ae.zG&&(_=void 0),M=M.toLocaleLowerCase("en-US"),M=O&&O.toLocaleLowerCase("en-US")===M?void 0:M,`${M?`${M}:`:""}${_?`${_}/`:""}${ee}`}var jt=t(71399),Ut=t(80030);const Zt=(0,B.forwardRef)((x,C)=>{const{entityRef:O,defaultKind:M,title:_,children:ee,...pe}=x,be=(0,n.tg)(wt);let we,Ze,Ue;if(typeof O=="string"){const Ve=(0,Ae.of)(O);we=Ve.kind,Ze=Ve.namespace,Ue=Ve.name}else"metadata"in O?(we=O.kind,Ze=O.metadata.namespace,Ue=O.metadata.name):(we=O.kind,Ze=O.namespace,Ue=O.name);we=we.toLocaleLowerCase("en-US");var Pe;Ze=(Pe=Ze==null?void 0:Ze.toLocaleLowerCase("en-US"))!==null&&Pe!==void 0?Pe:Ae.zG;const ze={kind:we,namespace:Ze,name:Ue},lt=Bt({kind:we,namespace:Ze,name:Ue},{defaultKind:M}),yt=(0,l.jsxs)(jt.rU,{...pe,ref:C,to:be(ze),children:[ee,!ee&&(_!=null?_:lt)]});return _?(0,l.jsx)(Ut.ZP,{title:lt,children:yt}):yt});function en(x){const{entityRefs:C,defaultKind:O,...M}=x;return(0,l.jsx)(l.Fragment,{children:C.map((_,ee)=>(0,l.jsxs)(B.Fragment,{children:[ee>0&&", ",(0,l.jsx)(Zt,{...M,entityRef:_,defaultKind:O})]},ee))})}class rn{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){this.value=C}}class wn{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){this.value=C}}class un{filterEntity(C){var O;return this.values.every(M=>((O=C.metadata.tags)!==null&&O!==void 0?O:[]).includes(M))}toQueryValue(){return this.values}constructor(C){this.values=C}}class kn{filterEntity(C){const O=this.toUpperArray(this.value.split(/\s/)),M=this.toUpperArray([C.metadata.tags]),_=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const ee of O)if(M.every(pe=>pe!==ee)&&_.every(pe=>!pe.includes(ee)))return!1;return!0}toUpperArray(C){return C.flat().filter(O=>Boolean(O)).map(O=>O.toLocaleUpperCase("en-US"))}constructor(C){this.value=C}}class sn{filterEntity(C){return this.values.some(O=>tt(C,Ae.S4).some(M=>Bt(M,{defaultKind:"group"})===O))}toQueryValue(){return this.values}constructor(C){this.values=C}}class Vn{filterEntity(C){return this.values.some(O=>{var M;return((M=C.spec)===null||M===void 0?void 0:M.lifecycle)===O})}toQueryValue(){return this.values}constructor(C){this.values=C}}class Mt{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,O,M){this.value=C,this.isOwnedEntity=O,this.isStarredEntity=M}}class Rn{filterEntity(C){var O;const M=(O=C.metadata.annotations)===null||O===void 0?void 0:O["backstage.io/orphan"];return M!==void 0&&this.value.toString()===M}constructor(C){this.value=C}}class Cn{filterEntity(C){var O,M;const _=(C==null||(O=C.status)===null||O===void 0||(M=O.items)===null||M===void 0?void 0:M.length)>0;return _!==void 0&&this.value===_}constructor(C){this.value=C}}function on(){const x=(0,n.h_)(v),{filters:{kind:C,type:O},queryParameters:{type:M},updateFilters:_}=Ie(),ee=(0,B.useMemo)(()=>[M].flat().filter(Boolean),[M]);var pe;const[be,we]=(0,B.useState)(ee.length?ee:(pe=O==null?void 0:O.getTypes())!==null&&pe!==void 0?pe:[]);(0,B.useEffect)(()=>{ee.length&&we(ee)},[ee]);const[Ze,Ue]=(0,B.useState)([]),Pe=(0,B.useMemo)(()=>C==null?void 0:C.value,[C]),{error:ze,loading:lt,value:yt}=(0,nt.default)(async()=>Pe?await x.getEntityFacets({filter:{kind:Pe},facets:["spec.type"]}).then(Gt=>Gt.facets["spec.type"]||[]):[],[Pe,x]),Ve=(0,B.useRef)(yt);return(0,B.useEffect)(()=>{const Pt=Ve.current;if(Ve.current=yt,lt||!Pe||Pt===yt||!yt)return;const Gt=[...new Set(St()(yt,En=>-En.count).map(En=>En.value.toLocaleLowerCase("en-US")))];Ue(Gt);const Nn=be.filter(En=>Gt.includes(En));Tt()(be,Nn)||we(Nn)},[lt,Pe,be,we,yt]),(0,B.useEffect)(()=>{_({type:be.length?new wn(be):void 0})},[be,_]),{loading:lt,error:ze,availableTypes:Ze,selectedTypes:be,setSelectedTypes:we}}const an=20;function tn(x,C){var O,M;const _=C==null||(O=C.type)===null||O===void 0?void 0:O.toLocaleLowerCase("en-US"),ee=C==null||(M=C.kind)===null||M===void 0?void 0:M.toLocaleLowerCase("en-US"),pe=(0,n.h_)(v),{loading:be,value:we,error:Ze}=(0,nt.default)(async()=>{var Ue;const Pe=(Ue=x.relations)===null||Ue===void 0?void 0:Ue.map(Ve=>({type:Ve.type,target:(0,Ae.of)(Ve.targetRef)})).filter(Ve=>(!_||Ve.type.toLocaleLowerCase("en-US")===_)&&(!ee||Ve.target.kind===ee));if(!Pe)return[];const ze=Object.values((0,He.groupBy)(Pe,({target:Ve})=>`${Ve.kind}:${Ve.namespace}`.toLocaleLowerCase("en-US"))),lt=[];for(const Ve of ze)lt.push({kind:Ve[0].target.kind,namespace:Ve[0].target.namespace,nameBatches:(0,He.chunk)(Ve.map(Pt=>Pt.target.name),an)});return(await Promise.all(lt.flatMap(Ve=>Ve.nameBatches.map(Pt=>pe.getEntities({filter:{kind:Ve.kind,"metadata.namespace":Ve.namespace,"metadata.name":Pt}}))))).flatMap(Ve=>Ve.items)},[x,_,ee]);return{entities:we,loading:be,error:Ze}}var ln=t(72164);function fn(x){return typeof x=="string"?x:(0,Ae.eE)(x)}function nn(){const x=(0,n.h_)(I),C=(0,ln.Z)(x.starredEntitie$(),new Set),O=(0,B.useCallback)(_=>C.has(fn(_)),[C]),M=(0,B.useCallback)(_=>x.toggleStarred(fn(_)).then(),[x]);return{starredEntities:C,toggleStarredEntity:M,isStarredEntity:O}}function he(x){return typeof x=="string"?x:(0,Ae.eE)(x)}function te(x){const C=(0,n.h_)(I),[O,M]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const ee=C.starredEntitie$().subscribe({next(pe){M(pe.has(he(x)))}});return()=>{ee.unsubscribe()}},[x,C]),{toggleStarredEntity:(0,B.useCallback)(()=>C.toggleStarred(he(x)).then(),[x,C]),isStarredEntity:O}}function Te(){const x=(0,n.h_)(n.$4),{loading:C,value:O}=(0,nt.default)(async()=>{const{ownershipEntityRefs:_}=await x.getBackstageIdentity();return _},[]),M=(0,B.useMemo)(()=>{const _=new Set(O!=null?O:[]);return ee=>{const pe=tt(ee,Ae.S4).map(Ae.eE);for(const be of pe)if(_.has(be))return!0;return!1}},[O]);return(0,B.useMemo)(()=>({loading:C,isOwnedEntity:M}),[C,M])}var ke=t(25488);function Je(x){const{entity:C,loading:O,error:M}=Ye(),{allowed:_,loading:ee,error:pe}=(0,ke.gI)({permission:x,resourceRef:C?(0,Ae.eE)(C):void 0});return O||ee?{loading:!0,allowed:!1}:M?{loading:!1,allowed:!1,error:M}:{loading:!1,allowed:_,error:pe}}const J=x=>{const{initialFilter:C,hidden:O}=x,{updateFilters:M,queryParameters:{kind:_}}=useEntityList();var ee;const[pe]=useState((ee=[_].flat()[0])!==null&&ee!==void 0?ee:C);return useEffect(()=>{M({kind:pe?new EntityKindFilter(pe):void 0})},[pe,M]),O?null:_jsx(Alert,{severity:"warning",children:"Kind filter not yet available"})};var y=t(79692),g=t(5806),k=t(21324),G=t(86619),ce=t(19996),ge=t(25505),Fe=t(38016),st=t(88013);const _e=(0,y.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),vt=(0,l.jsx)(ge.Z,{fontSize:"small"}),ft=(0,l.jsx)(ce.Z,{fontSize:"small"}),ht=()=>{var x;const C=_e(),{updateFilters:O,backendEntities:M,filters:_,queryParameters:{lifecycles:ee}}=Ie(),pe=(0,B.useMemo)(()=>[ee].flat().filter(Boolean),[ee]);var be;const[we,Ze]=(0,B.useState)(pe.length?pe:(be=(x=_.lifecycles)===null||x===void 0?void 0:x.values)!==null&&be!==void 0?be:[]);(0,B.useEffect)(()=>{pe.length&&Ze(pe)},[pe]),(0,B.useEffect)(()=>{O({lifecycles:we.length?new Vn(we):void 0})},[we,O]);const Ue=(0,B.useMemo)(()=>[...new Set(M.map(Pe=>{var ze;return(ze=Pe.spec)===null||ze===void 0?void 0:ze.lifecycle}).filter(Boolean))].sort(),[M]);return Ue.length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Lifecycle",(0,l.jsx)(st.ZP,{multiple:!0,options:Ue,value:we,onChange:(Pe,ze)=>Ze(ze),renderOption:(Pe,{selected:ze})=>(0,l.jsx)(g.Z,{control:(0,l.jsx)(k.Z,{icon:vt,checkedIcon:ft,checked:ze}),label:Pe}),size:"small",popupIcon:(0,l.jsx)(Fe.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:Pe=>(0,l.jsx)(G.Z,{...Pe,className:C.input,variant:"outlined"})})]})}):null},Et=(0,y.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),j=(0,l.jsx)(ge.Z,{fontSize:"small"}),U=(0,l.jsx)(ce.Z,{fontSize:"small"}),ne=()=>{var x;const C=Et(),{updateFilters:O,backendEntities:M,filters:_,queryParameters:{owners:ee}}=Ie(),pe=(0,B.useMemo)(()=>[ee].flat().filter(Boolean),[ee]);var be;const[we,Ze]=(0,B.useState)(pe.length?pe:(be=(x=_.owners)===null||x===void 0?void 0:x.values)!==null&&be!==void 0?be:[]);(0,B.useEffect)(()=>{pe.length&&Ze(pe)},[pe]),(0,B.useEffect)(()=>{O({owners:we.length?new sn(we):void 0})},[we,O]);const Ue=(0,B.useMemo)(()=>[...new Set(M.flatMap(Pe=>tt(Pe,Ae.S4).map(ze=>Bt(ze,{defaultKind:"group"}))).filter(Boolean))].sort(),[M]);return Ue.length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Owner",(0,l.jsx)(st.ZP,{multiple:!0,options:Ue,value:we,onChange:(Pe,ze)=>Ze(ze),renderOption:(Pe,{selected:ze})=>(0,l.jsx)(g.Z,{control:(0,l.jsx)(k.Z,{icon:j,checkedIcon:U,checked:ze}),label:Pe}),size:"small",popupIcon:(0,l.jsx)(Fe.Z,{"data-testid":"owner-picker-expand"}),renderInput:Pe=>(0,l.jsx)(G.Z,{...Pe,className:C.input,variant:"outlined"})})]})}):null},de=(0,y.Z)(x=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),je=()=>{var x;const C=de(),{filters:O,updateFilters:M}=useEntityList();var _;const[ee,pe]=useState((_=(x=O.text)===null||x===void 0?void 0:x.value)!==null&&_!==void 0?_:"");return useDebounce(()=>{M({text:ee.length?new EntityTextFilter(ee):void 0})},250,[ee,M]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:be=>pe(be.target.value),value:ee,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>pe(""),edge:"end",disabled:ee.length===0,children:_jsx(Clear,{})})})})})})},Se=Object.freeze({createEntityRefColumn(x){const{defaultKind:C}=x;function O(M){var _;return((_=M.metadata)===null||_===void 0?void 0:_.title)||Bt(M,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch(M,_){return O(_).includes(M)},customSort(M,_){return O(M).localeCompare(O(_))},render:M=>{var _;return(0,l.jsx)(Zt,{entityRef:M,defaultKind:C,title:(_=M.metadata)===null||_===void 0?void 0:_.title})}}},createEntityRelationColumn(x){const{title:C,relation:O,defaultKind:M,filter:_}=x;function ee(be){return tt(be,O,_)}function pe(be){return ee(be).map(we=>Bt(we,{defaultKind:M})).join(", ")}return{title:C,customFilterAndSearch(be,we){return pe(we).includes(be)},customSort(be,we){return pe(be).localeCompare(pe(we))},render:be=>(0,l.jsx)(en,{entityRefs:ee(be),defaultKind:M})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:Ae.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:Ae.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:Ae.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:x=>(0,l.jsx)(jt.Or,{text:x.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),Qe=[Se.createEntityRefColumn({defaultKind:"system"}),Se.createDomainColumn(),Se.createOwnerColumn(),Se.createMetadataDescriptionColumn()],pt=[Se.createEntityRefColumn({defaultKind:"component"}),Se.createSystemColumn(),Se.createOwnerColumn(),Se.createSpecTypeColumn(),Se.createSpecLifecycleColumn(),Se.createMetadataDescriptionColumn()],Xe=(0,y.Z)(x=>({empty:{padding:x.spacing(2),display:"flex",justifyContent:"center"}})),dt=x=>{const{entities:C,title:O,emptyContent:M,variant:_="gridItem",columns:ee}=x,pe=Xe(),be={minWidth:"0",width:"100%"};return _==="gridItem"&&(be.height="calc(100% - 10px)"),(0,l.jsx)(jt.iA,{columns:ee,title:O,style:be,emptyContent:M&&(0,l.jsx)("div",{className:pe.empty,children:M}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};dt.columns=Se,dt.systemEntityColumns=Qe,dt.componentEntityColumns=pt;const Dt=(0,y.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),It=(0,l.jsx)(ge.Z,{fontSize:"small"}),Wt=(0,l.jsx)(ce.Z,{fontSize:"small"}),Gn=x=>{var C;const O=Dt(),{updateFilters:M,filters:_,queryParameters:{tags:ee}}=Ie(),pe=(0,n.h_)(v),{value:be}=(0,nt.default)(async()=>{var ze;const lt="metadata.tags",{facets:yt}=await pe.getEntityFacets({facets:[lt],filter:(ze=_.kind)===null||ze===void 0?void 0:ze.getCatalogFilters()});return Object.fromEntries(yt[lt].map(({value:Ve,count:Pt})=>[Ve,Pt]))},[_.kind]),we=(0,B.useMemo)(()=>[ee].flat().filter(Boolean),[ee]);var Ze;const[Ue,Pe]=(0,B.useState)(we.length?we:(Ze=(C=_.tags)===null||C===void 0?void 0:C.values)!==null&&Ze!==void 0?Ze:[]);return(0,B.useEffect)(()=>{we.length&&Pe(we)},[we]),(0,B.useEffect)(()=>{M({tags:Ue.length?new un(Ue):void 0})},[Ue,M]),Object.keys(be!=null?be:{}).length?(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Tags",(0,l.jsx)(st.ZP,{multiple:!0,options:Object.keys(be!=null?be:{}),value:Ue,onChange:(ze,lt)=>Pe(lt),renderOption:(ze,{selected:lt})=>(0,l.jsx)(g.Z,{control:(0,l.jsx)(k.Z,{icon:It,checkedIcon:Wt,checked:lt}),label:x.showCounts?`${ze} (${be==null?void 0:be[ze]})`:ze}),size:"small",popupIcon:(0,l.jsx)(Fe.Z,{"data-testid":"tag-picker-expand"}),renderInput:ze=>(0,l.jsx)(G.Z,{...ze,className:O.input,variant:"outlined"})})]})}):null};var jn=t(82108),On=t.n(jn);const $n=x=>{const{hidden:C,initialFilter:O}=x,M=(0,n.h_)(n.$v),{error:_,availableTypes:ee,selectedTypes:pe,setSelectedTypes:be}=on();if((0,B.useEffect)(()=>{_&&M.post({message:"Failed to load entity types",severity:"error"}),O&&be([O])},[_,M,O,be]),ee.length===0||_)return null;const we=[{value:"all",label:"All"},...ee.map(Ue=>({value:Ue,label:On()(Ue)}))];var Ze;return C?null:(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsx)(jt.Ph,{label:"Type",items:we,selected:(Ze=we.length>1?pe[0]:void 0)!==null&&Ze!==void 0?Ze:"all",onChange:Ue=>be(Ue==="all"?[]:[String(Ue)])})})};var qn=t(15459),Nt=t(61837),w=t(11640),u=t(28347);const b=(0,qn.Z)({root:{color:"#f3ba37"}})(w.Z),A=x=>{const{toggleStarredEntity:C,isStarredEntity:O}=te(x.entity);return(0,l.jsx)(Nt.Z,{"aria-label":"favorite",color:"inherit",...x,onClick:()=>C(),children:(0,l.jsx)(Ut.ZP,{title:O?"Remove from favorites":"Add to favorites",children:O?(0,l.jsx)(b,{}):(0,l.jsx)(u.Z,{})})})};var K=t(8629),me=t(79249),ye=t(38724),Re=t(99152),et=t(6487),kt=t(49429),Rt=t(55999),_n=t(72779),fr=t.n(_n),es=t(39412);const ar=es.Z;function $r(x,C){if(x)return x.toLocaleLowerCase("en-US");if(C)try{return(0,Ae.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function Br(x,C){const O=(0,n.qD)(),M=$r(x,C);return M&&O.getSystemIcon(`kind:${M}`)||ar}function jr(x){const{kind:C,entityRef:O,...M}=x,_=Br(C,O);return(0,l.jsx)(_,{...M})}const gr=(0,y.Z)(x=>({node:{fill:x.palette.grey[300],stroke:x.palette.grey[300],"&.primary":{fill:x.palette.primary.light,stroke:x.palette.primary.light},"&.secondary":{fill:x.palette.secondary.light,stroke:x.palette.secondary.light}},text:{fill:x.palette.getContrastText(x.palette.grey[300]),"&.primary":{fill:x.palette.primary.contrastText},"&.secondary":{fill:x.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function ts(x){const C=(0,n.h_)(v),O=(0,Ae.eE)(x),{loading:M,error:_,value:ee}=(0,nt.default)(async()=>{const pe=await C.getEntityAncestors({entityRef:O}),be=new Array,we=new Array;for(const Ze of pe.items){const Ue=(0,Ae.eE)(Ze.entity),Pe=Ue===pe.rootEntityRef;be.push({id:Ue,root:Pe,...Ze.entity});for(const ze of Ze.parentEntityRefs)we.push({from:Ue,to:ze})}return{nodes:be,edges:we}},[O]);return{loading:M,error:_,nodes:(ee==null?void 0:ee.nodes)||[],edges:(ee==null?void 0:ee.edges)||[]}}function Zr({node:x}){const C=gr(),O=(0,Ne.s0)(),M=(0,n.tg)(wt),[_,ee]=(0,B.useState)(0),[pe,be]=(0,B.useState)(0),we=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(we.current){let{height:Pt,width:Gt}=we.current.getBBox();Pt=Math.round(Pt),Gt=Math.round(Gt),(Pt!==pe||Gt!==_)&&(ee(Gt),be(Pt))}},[_,pe]);const Ze=10,Ue=pe,Pe=Ue+Ze,ze=Pe+_+Ze*2,lt=pe+Ze*2,yt=x.metadata.title||(x.kind&&x.metadata.name&&x.metadata.namespace?Bt({kind:x.kind,name:x.metadata.name,namespace:x.metadata.namespace||""}):x.id),Ve=()=>{O(M({kind:x.kind,namespace:x.metadata.namespace||Ae.zG,name:x.metadata.name}))};return(0,l.jsxs)("g",{onClick:Ve,className:C.clickable,children:[(0,l.jsx)("rect",{className:fr()(C.node,x.root?"secondary":"primary"),width:ze,height:lt,rx:10}),(0,l.jsx)(jr,{kind:x.kind,y:Ze,x:Ze,width:Ue,height:Ue,className:fr()(C.text,x.root?"secondary":"primary")}),(0,l.jsx)("text",{ref:we,className:fr()(C.text,x.root?"secondary":"primary"),y:lt/2,x:Pe+(_+Ze*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:yt})]})}function ns(x){const{loading:C,error:O,nodes:M,edges:_}=ts(x.entity);return C?(0,l.jsx)(jt.Ex,{}):O?(0,l.jsx)(jt.Gk,{error:O}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Ancestry"}),(0,l.jsxs)(Rt.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,l.jsx)(jt.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,l.jsx)(Q.Z,{mt:4,children:(0,l.jsx)(jt.mn,{nodes:M,edges:_,renderNode:Zr,direction:jt.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Bn=t(11776),Zn=t(38402),lr=t(86136),mr=t(99688),Dr=t(49378),rs=t(54506),Nr=t(94339),ss=t(24579),os=t(27685);const vr=(0,y.Z)(x=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:x.spacing(2)},helpIcon:{marginLeft:x.spacing(1),color:x.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function gn(x){const C=vr();return(0,l.jsx)(Dr.Z,{...x,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function Dn(x){const C=vr();return(0,l.jsx)(rs.Z,{className:C.monospace,children:x.children})}function yr(x){return(0,l.jsx)(Q.Z,{mt:2,children:(0,l.jsx)(Nr.Z,{variant:"outlined",children:(0,l.jsxs)(ss.Z,{children:[(0,l.jsxs)(Y.Z,{variant:"h6",gutterBottom:!0,children:[x.title,x.helpLink&&(0,l.jsx)(Ar,{to:x.helpLink})]}),x.children]})})})}function Rs(x){if(x.match(/^url:https?:\/\//))return x.slice(4);if(x.match(/^https?:\/\//))return x}function Er(x){const[C,O]=x.entry,M=Rs(O);return(0,l.jsxs)(Zn.Z,{children:[x.indent&&(0,l.jsx)(lr.Z,{}),(0,l.jsx)(gn,{primary:C,secondary:M?(0,l.jsx)(jt.rU,{to:M,children:O}):O})]})}function Ar(x){const C=vr();return(0,l.jsx)(jt.rU,{to:x.to,className:C.helpIcon,children:(0,l.jsx)(os.Z,{fontSize:"inherit"})})}const is=(0,y.Z)({root:{display:"flex",flexDirection:"column"}});function Ls(x){var C,O;const M=(0,n.h_)(v),_=(0,Ae.eE)(x),ee=(C=x.metadata.annotations)===null||C===void 0?void 0:C[Ae.P1],pe=(O=x.metadata.annotations)===null||O===void 0?void 0:O[Ae.q1],{loading:be,error:we,value:Ze}=(0,nt.default)(async()=>!ee&&!pe?[]:(await M.getEntities({filter:[...ee?[{[`metadata.annotations.${Ae.P1}`]:ee}]:[],...pe?[{[`metadata.annotations.${Ae.q1}`]:pe}]:[]]})).items,[ee,pe]);return{loading:be,error:we,location:ee,originLocation:pe,colocatedEntities:Ze==null?void 0:Ze.filter(Ue=>(0,Ae.eE)(Ue)!==_)}}function Hn(x){return(0,l.jsxs)(Bn.Z,{dense:!0,children:[x.header&&(0,l.jsx)(Er,{entry:x.header},"header"),x.entities.map(C=>(0,l.jsxs)(Zn.Z,{children:[(0,l.jsx)(lr.Z,{children:(0,l.jsx)(jr,{kind:C.kind})}),(0,l.jsx)(gn,{primary:(0,l.jsx)(Zt,{entityRef:C})})]},(0,Ae.eE)(C)))]})}function Ps(x){const{entity:C}=x,{loading:O,error:M,location:_,originLocation:ee,colocatedEntities:pe}=Ls(C);if(O)return(0,l.jsx)(jt.Ex,{});if(M)return(0,l.jsx)(jt.Gk,{error:M});if(!_&&!ee)return(0,l.jsx)(mr.Z,{severity:"warning",children:"Entity had no location information."});if(!(pe!=null&&pe.length))return(0,l.jsx)(mr.Z,{severity:"info",children:"There were no other entities on this location."});if(_===ee)return(0,l.jsx)(Hn,{entities:pe});const be=pe.filter(Ze=>{var Ue;return((Ue=Ze.metadata.annotations)===null||Ue===void 0?void 0:Ue[Ae.P1])===_}),we=pe.filter(Ze=>{var Ue;return((Ue=Ze.metadata.annotations)===null||Ue===void 0?void 0:Ue[Ae.q1])===ee});return(0,l.jsxs)(l.Fragment,{children:[be.length>0&&(0,l.jsx)(Hn,{entities:be,header:["At the same location",_]}),we.length>0&&(0,l.jsx)(Hn,{entities:we,header:["At the same origin",ee]})]})}function Fr(x){const C=is();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Colocated"}),(0,l.jsx)(Rt.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,l.jsx)("div",{className:C.root,children:(0,l.jsx)(Ps,{entity:x.entity})})]})}function Tr(x){return Object.fromEntries([...Object.entries(x)].sort((C,O)=>C[0]<O[0]?-1:1))}function Ir(x){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Entity as JSON"}),(0,l.jsx)(Rt.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,l.jsx)(Rt.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(jt.Oi,{text:JSON.stringify(Tr(x.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var as=t(3440),ls=t.n(as);const cs=(0,y.Z)({root:{display:"flex",flexDirection:"column"}});function ds(x){var C,O;const M=cs(),{apiVersion:_,kind:ee,metadata:pe,spec:be,relations:we=[],status:Ze={}}=x.entity,Ue=ls()(St()(we,Pe=>Pe.targetRef),"type");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Overview"}),(0,l.jsxs)("div",{className:M.root,children:[(0,l.jsx)(yr,{title:"Identity",children:(0,l.jsxs)(Bn.Z,{dense:!0,children:[(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(gn,{primary:"apiVersion",secondary:_})}),(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(gn,{primary:"kind",secondary:ee})}),(be==null?void 0:be.type)&&(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(gn,{primary:"spec.type",secondary:be.type})}),pe.uid&&(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(gn,{primary:"uid",secondary:pe.uid})}),pe.etag&&(0,l.jsx)(Zn.Z,{children:(0,l.jsx)(gn,{primary:"etag",secondary:pe.etag})})]})}),(0,l.jsxs)(yr,{title:"Metadata",children:[!!Object.keys(pe.annotations||{}).length&&(0,l.jsx)(Bn.Z,{dense:!0,subheader:(0,l.jsxs)(Dn,{children:["Annotations",(0,l.jsx)(Ar,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(pe.annotations).map(Pe=>(0,l.jsx)(Er,{indent:!0,entry:Pe},Pe[0]))}),!!Object.keys(pe.labels||{}).length&&(0,l.jsx)(Bn.Z,{dense:!0,subheader:(0,l.jsx)(Dn,{children:"Labels"}),children:Object.entries(pe.labels).map(Pe=>(0,l.jsx)(Er,{indent:!0,entry:Pe},Pe[0]))}),!!(!((C=pe.tags)===null||C===void 0)&&C.length)&&(0,l.jsx)(Bn.Z,{dense:!0,subheader:(0,l.jsx)(Dn,{children:"Tags"}),children:pe.tags.map((Pe,ze)=>(0,l.jsxs)(Zn.Z,{children:[(0,l.jsx)(lr.Z,{}),(0,l.jsx)(gn,{primary:Pe})]},`${Pe}-${ze}`))})]}),!!we.length&&(0,l.jsx)(yr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ue).map(([Pe,ze],lt)=>(0,l.jsx)("div",{children:(0,l.jsx)(Bn.Z,{dense:!0,subheader:(0,l.jsx)(Dn,{children:Pe}),children:ze.map(yt=>(0,l.jsxs)(Zn.Z,{children:[(0,l.jsx)(lr.Z,{children:(0,l.jsx)(jr,{entityRef:yt.targetRef})}),(0,l.jsx)(gn,{primary:(0,l.jsx)(Zt,{entityRef:yt.targetRef})})]},yt.targetRef))})},lt))}),!!(!((O=Ze.items)===null||O===void 0)&&O.length)&&(0,l.jsx)(yr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Ze.items.map((Pe,ze)=>(0,l.jsxs)("div",{children:[(0,l.jsxs)(Y.Z,{children:[Pe.level,": ",Pe.type]}),(0,l.jsx)(Q.Z,{ml:2,children:Pe.message})]},ze))})]})]})}var Ur=t(72847);function Mr(x){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{variant:"h2",children:"Entity as YAML"}),(0,l.jsx)(Rt.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,l.jsx)(Rt.Z,{children:(0,l.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,l.jsx)(jt.Oi,{text:Ur.ZP.stringify(Tr(x.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const Rr=(0,y.Z)(x=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:x.palette.background.paper},tabs:{borderRight:`1px solid ${x.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function er(x){const{children:C,value:O,index:M,..._}=x,ee=Rr();return(0,l.jsx)("div",{role:"tabpanel",hidden:O!==M,id:`vertical-tabpanel-${M}`,"aria-labelledby":`vertical-tab-${M}`,className:ee.tabContents,..._,children:O===M&&(0,l.jsx)(Q.Z,{pl:3,pr:3,children:C})})}function Qt(x){return{id:`vertical-tab-${x}`,"aria-controls":`vertical-tabpanel-${x}`}}function Ot(x){const C=Rr(),[O,M]=B.useState(0);return(0,B.useEffect)(()=>{M(0)},[x.open]),x.entity?(0,l.jsxs)(K.Z,{fullWidth:!0,maxWidth:"xl",open:x.open,onClose:x.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,l.jsx)(me.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,l.jsx)(ye.Z,{dividers:!0,children:(0,l.jsxs)("div",{className:C.root,children:[(0,l.jsxs)(Re.Z,{orientation:"vertical",variant:"scrollable",value:O,onChange:(_,ee)=>M(ee),"aria-label":"Inspector options",className:C.tabs,children:[(0,l.jsx)(et.Z,{label:"Overview",...Qt(0)}),(0,l.jsx)(et.Z,{label:"Ancestry",...Qt(1)}),(0,l.jsx)(et.Z,{label:"Colocated",...Qt(2)}),(0,l.jsx)(et.Z,{label:"Raw JSON",...Qt(3)}),(0,l.jsx)(et.Z,{label:"Raw YAML",...Qt(4)})]}),(0,l.jsx)(er,{value:O,index:0,children:(0,l.jsx)(ds,{entity:x.entity})}),(0,l.jsx)(er,{value:O,index:1,children:(0,l.jsx)(ns,{entity:x.entity})}),(0,l.jsx)(er,{value:O,index:2,children:(0,l.jsx)(Fr,{entity:x.entity})}),(0,l.jsx)(er,{value:O,index:3,children:(0,l.jsx)(Ir,{entity:x.entity})}),(0,l.jsx)(er,{value:O,index:4,children:(0,l.jsx)(Mr,{entity:x.entity})})]})}),(0,l.jsx)(kt.Z,{children:(0,l.jsx)(q.Z,{onClick:x.onClose,color:"primary",children:"Close"})})]}):null}var zr=t(85256);function us(x){var C;const O=(0,n.h_)(v),M=(C=x.metadata.annotations)===null||C===void 0?void 0:C[Ae.q1],_=x.metadata.uid,ee=M==="bootstrap:bootstrap",pe=(0,nt.default)(async()=>{const yt=O.getLocationByRef(M);let Ve;if(!M)Ve=Promise.resolve([]);else{const Pt=`metadata.annotations.${Ae.q1}`;Ve=O.getEntities({filter:{[Pt]:M},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Gt=>Gt.items)}return Promise.all([yt,Ve]).then(([Pt,Gt])=>({location:Pt,colocatedEntities:Gt}))},[O,x]),be=(0,B.useCallback)(async function(){const{location:Ve}=pe.value;await O.removeLocationById(Ve.id)},[O,pe]),we=(0,B.useCallback)(async function(){await O.removeEntityByUid(_)},[O,_]);if(ee)return{type:"bootstrap",location:M,deleteEntity:we};const{loading:Ze,error:Ue,value:Pe}=pe;if(Ze)return{type:"loading"};if(Ue)return{type:"error",error:Ue};const{location:ze,colocatedEntities:lt}=Pe;return ze?{type:"unregister",location:M,colocatedEntities:lt.map(Ae.iB),unregisterLocation:be,deleteEntity:we}:{type:"only-delete",deleteEntity:we}}var Vr=t(23054);const hs=(0,y.Z)({advancedButton:{fontSize:"0.7em"}}),ps=({entity:x,onConfirm:C})=>{const O=(0,n.h_)(n.$v),M=(0,n.h_)(n.Ds),_=hs(),ee=us(x),[pe,be]=(0,B.useState)(!1),[we,Ze]=(0,B.useState)(!1);var Ue;const Pe=(Ue=M.getOptionalString("app.title"))!==null&&Ue!==void 0?Ue:"Backstage",ze=(0,B.useCallback)(async function(){if("unregisterLocation"in ee){Ze(!0);try{await ee.unregisterLocation(),C()}catch(Ve){(0,Vr.BD)(Ve),O.post({message:Ve.message})}finally{Ze(!1)}}},[O,C,ee]),lt=(0,B.useCallback)(async function(){if("deleteEntity"in ee){Ze(!0);try{await ee.deleteEntity(),C()}catch(Ve){(0,Vr.BD)(Ve),O.post({message:Ve.message})}finally{Ze(!1)}}},[O,C,ee]);return ee.type==="loading"?(0,l.jsx)(jt.Ex,{}):ee.type==="error"?(0,l.jsx)(jt.Gk,{error:ee.error}):ee.type==="bootstrap"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(mr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',ee.location,'"). If you believe this is in error, please contact the ',Pe," ","integrator."]}),(0,l.jsxs)(Q.Z,{marginTop:2,children:[!pe&&(0,l.jsx)(q.Z,{variant:"text",size:"small",color:"primary",className:_.advancedButton,onClick:()=>be(!0),children:"Advanced Options"}),pe&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(q.Z,{variant:"contained",color:"secondary",disabled:we,onClick:lt,children:"Delete Entity"})]})]})]}):ee.type==="only-delete"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,l.jsx)(q.Z,{variant:"contained",color:"secondary",disabled:we,onClick:lt,children:"Delete Entity"})]}):ee.type==="unregister"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Rt.Z,{children:"This action will unregister the following entities:"}),(0,l.jsx)(Rt.Z,{component:"ul",children:ee.colocatedEntities.map(yt=>(0,l.jsx)("li",{children:(0,l.jsx)(Zt,{entityRef:yt})},`${yt.kind}:${yt.namespace}/${yt.name}`))}),(0,l.jsx)(Rt.Z,{children:"Located at the following location:"}),(0,l.jsx)(Rt.Z,{component:"ul",children:(0,l.jsx)("li",{children:ee.location})}),(0,l.jsxs)(Rt.Z,{children:["To undo, just re-register the entity in ",Pe,"."]}),(0,l.jsxs)(Q.Z,{marginTop:2,children:[(0,l.jsx)(q.Z,{variant:"contained",color:"secondary",disabled:we,onClick:ze,children:"Unregister Location"}),!pe&&(0,l.jsx)(Q.Z,{component:"span",marginLeft:2,children:(0,l.jsx)(q.Z,{variant:"text",size:"small",color:"primary",className:_.advancedButton,onClick:()=>be(!0),children:"Advanced Options"})})]}),pe&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.Z,{paddingTop:4,paddingBottom:4,children:(0,l.jsx)(zr.Z,{})}),(0,l.jsx)(Rt.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,l.jsx)(q.Z,{variant:"contained",color:"secondary",disabled:we,onClick:lt,children:"Delete Entity"})]})]}):(0,l.jsx)(mr.Z,{severity:"error",children:"Internal error: Unknown state"})},fs=x=>{const{open:C,onConfirm:O,onClose:M,entity:_}=x;return(0,l.jsxs)(K.Z,{open:C,onClose:M,children:[(0,l.jsx)(me.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,l.jsx)(ye.Z,{children:(0,l.jsx)(ps,{entity:_,onConfirm:O})}),(0,l.jsx)(kt.Z,{children:(0,l.jsx)(q.Z,{onClick:M,color:"primary",children:"Cancel"})})]})};var gs=t(12231),Hr=t(9520),xr=t(47603);const ks=(0,y.Z)(x=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:x.spacing(1,0,1,0)},title:{margin:x.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:x.palette.text.primary},menuItem:{minHeight:x.spacing(6)},groupWrapper:{margin:x.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function ms(x){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:xr.Z},{id:"starred",label:"Starred",icon:w.Z}]},{name:x!=null?x:"Company",items:[{id:"all",label:"All"}]}]}const Wr=x=>{const{initialFilter:C,availableFilters:O}=x,M=ks(),_=(0,n.h_)(n.Ds);var ee;const pe=(ee=_.getOptionalString("organization.name"))!==null&&ee!==void 0?ee:"Company",{filters:be,updateFilters:we,backendEntities:Ze,queryParameters:{kind:Ue,user:Pe},loading:ze}=Ie(),lt=["starred","all"],yt=ms(pe).map(vn=>({...vn,items:vn.items.filter(({id:Xt})=>["group","user"].some(nr=>nr===Ue)?lt.includes(Xt):!O||O.includes(Xt))})).filter(({items:vn})=>!!vn.length),{isStarredEntity:Ve}=nn(),{isOwnedEntity:Pt,loading:Gt}=Te(),Nn=ze||Gt,En=(0,B.useMemo)(()=>new Mt("owned",Pt,Ve),[Pt,Ve]),tr=(0,B.useMemo)(()=>new Mt("starred",Pt,Ve),[Pt,Ve]),cn=(0,B.useMemo)(()=>[Pe].flat()[0],[Pe]),[mn,An]=(0,B.useState)(cn!=null?cn:C),br=(0,B.useMemo)(()=>Ze.filter(rt((0,He.compact)(Object.values({...be,user:void 0})))),[be,Ze]),Sr=(0,B.useMemo)(()=>({all:br.length,starred:br.filter(vn=>tr.filterEntity(vn)).length,owned:br.filter(vn=>En.filterEntity(vn)).length}),[br,tr,En]);(0,B.useEffect)(()=>{cn&&An(cn)},[cn]),(0,B.useEffect)(()=>{!Nn&&!!mn&&mn!=="all"&&Sr[mn]===0&&An("all")},[Nn,Sr,mn,An]),(0,B.useEffect)(()=>{we({user:mn?new Mt(mn,Pt,Ve):void 0})},[mn,Pt,Ve,we]);var wr;return(0,l.jsx)(Nr.Z,{className:M.root,children:yt.map(vn=>(0,l.jsxs)(B.Fragment,{children:[(0,l.jsx)(Y.Z,{variant:"subtitle2",component:"span",className:M.title,children:vn.name}),(0,l.jsx)(Nr.Z,{className:M.groupWrapper,children:(0,l.jsx)(Bn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":vn.name,children:vn.items.map(Xt=>{var nr;return(0,l.jsxs)(gs.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>An(Xt.id),selected:Xt.id===((nr=be.user)===null||nr===void 0?void 0:nr.value),className:M.menuItem,disabled:Sr[Xt.id]===0,"data-testid":`user-picker-${Xt.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Xt.icon&&(0,l.jsx)(lr.Z,{className:M.listIcon,children:(0,l.jsx)(Xt.icon,{fontSize:"small"})}),(0,l.jsx)(Dr.Z,{children:(0,l.jsxs)(Y.Z,{variant:"body1",children:[Xt.label," "]})}),(0,l.jsx)(Hr.Z,{children:(wr=Sr[Xt.id])!==null&&wr!==void 0?wr:"-"})]},Xt.id)})})})]},vn.name))})},vs=(0,y.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Os=(0,l.jsx)(ge.Z,{fontSize:"small"}),ys=(0,l.jsx)(ce.Z,{fontSize:"small"}),$s=()=>{const x=vs(),{updateFilters:C}=Ie(),[O,M]=(0,B.useState)([]);function _(be){C({orphan:be?new Rn(be):void 0})}function ee(be){C({error:be?new Cn(be):void 0})}const pe=["Is Orphan","Has Error"];return(0,l.jsx)(Q.Z,{pb:1,pt:1,children:(0,l.jsxs)(Y.Z,{variant:"button",component:"label",children:["Processing Status",(0,l.jsx)(st.ZP,{multiple:!0,options:pe,value:O,onChange:(be,we)=>{M(we),_(we.includes("Is Orphan")),ee(we.includes("Has Error"))},renderOption:(be,{selected:we})=>(0,l.jsx)(g.Z,{control:(0,l.jsx)(k.Z,{icon:Os,checkedIcon:ys,checked:we}),label:be}),size:"small",popupIcon:(0,l.jsx)(Fe.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:be=>(0,l.jsx)(G.Z,{...be,className:x.input,variant:"outlined"})})]})})},po=({children:x,value:C})=>{var O;const[M,_]=useState((O=C==null?void 0:C.filters)!==null&&O!==void 0?O:{}),ee=useCallback(lt=>{_(yt=>{const Ve=typeof lt=="function"?lt(yt):lt;return{...yt,...Ve}})},[]),pe=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var be,we,Ze,Ue,Pe;const ze=useMemo(()=>({entities:(be=C==null?void 0:C.entities)!==null&&be!==void 0?be:pe.entities,backendEntities:(we=C==null?void 0:C.backendEntities)!==null&&we!==void 0?we:pe.backendEntities,updateFilters:(Ze=C==null?void 0:C.updateFilters)!==null&&Ze!==void 0?Ze:ee,filters:M,loading:(Ue=C==null?void 0:C.loading)!==null&&Ue!==void 0?Ue:!1,queryParameters:(Pe=C==null?void 0:C.queryParameters)!==null&&Pe!==void 0?Pe:pe.queryParameters,error:C==null?void 0:C.error}),[C,pe,M,ee]);return _jsx(EntityListContext.Provider,{value:ze,children:x})}},33414:function(bt,Oe,t){"use strict";t.r(Oe),t.d(Oe,{AboutCard:function(){return Ge},AboutContent:function(){return He},AboutField:function(){return re}});var h=t(52322),n=t(25271),v=t(71399),I=t(25248),W=t(32838),S=t(46285),l=t(79692),B=t(94339),se=t(32552),X=t(61837),q=t(85256),F=t(24579),Q=t(52866),Y=t(30254),ue=t(27604),le=t(2784),P=t(19625),R=t(60905),D=t(90436),L=t(7089);const T=(0,l.Z)(Ne=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Ne.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function re(Ne){const{label:Me,value:qe,gridSizes:ct,children:it}=Ne,rt=T(),Ae=(0,I.vJ)(it,mt=>mt.getElements()),tt=Ae.length>0?Ae:(0,h.jsx)(D.Z,{variant:"body2",className:rt.value,children:qe||"unknown"});return(0,h.jsxs)(R.Z,{item:!0,...ct,children:[(0,h.jsx)(D.Z,{variant:"h2",className:rt.label,children:Me}),tt]})}var xe=t(24851);const Ke=(0,l.Z)({description:{wordBreak:"break-word"}});function Ye(Ne,Me,qe){if(Me==="url"||Ne.includes("://"))return Ne;const ct=qe.type==="file"?`file://${qe.target}`:qe.target;return Me==="file"||qe.type==="file"?new URL(Ne,ct).href:ct}function He(Ne){var Me,qe,ct,it,rt,Ae,tt,mt;const{entity:Le}=Ne,ae=Ke(),Ce=Le.kind.toLocaleLowerCase("en-US")==="system",Ie=Le.kind.toLocaleLowerCase("en-US")==="resource",nt=Le.kind.toLocaleLowerCase("en-US")==="component",gt=Le.kind.toLocaleLowerCase("en-US")==="api",Tt=Le.kind.toLocaleLowerCase("en-US")==="template",at=Le.kind.toLocaleLowerCase("en-US")==="location",St=Le.kind.toLocaleLowerCase("en-US")==="group",wt=(0,S.hF)(Le,n.cz,{kind:"system"}),Lt=(0,S.hF)(Le,n.cz,{kind:"component"}),Bt=(0,S.hF)(Le,n.cz,{kind:"domain"}),jt=(0,S.hF)(Le,n.S4);let Ut;try{Ut=(0,n.CV)(Le)}catch{Ut=void 0}return(0,h.jsxs)(R.Z,{container:!0,children:[(0,h.jsx)(re,{label:"Description",gridSizes:{xs:12},children:(0,h.jsx)(D.Z,{variant:"body2",paragraph:!0,className:ae.description,children:(Le==null||(Me=Le.metadata)===null||Me===void 0?void 0:Me.description)||"No description"})}),(0,h.jsx)(re,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:jt.length>0&&(0,h.jsx)(S.rI,{entityRefs:jt,defaultKind:"group"})}),(Ce||Bt.length>0)&&(0,h.jsx)(re,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Bt.length>0&&(0,h.jsx)(S.rI,{entityRefs:Bt,defaultKind:"domain"})}),(gt||nt||Ie||wt.length>0)&&(0,h.jsx)(re,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:wt.length>0&&(0,h.jsx)(S.rI,{entityRefs:wt,defaultKind:"system"})}),nt&&Lt.length>0&&(0,h.jsx)(re,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,h.jsx)(S.rI,{entityRefs:Lt,defaultKind:"component"})}),(gt||nt||Ie||Tt||St||at||typeof(Le==null||(qe=Le.spec)===null||qe===void 0?void 0:qe.type)=="string")&&(0,h.jsx)(re,{label:"Type",value:Le==null||(ct=Le.spec)===null||ct===void 0?void 0:ct.type,gridSizes:{xs:12,sm:6,lg:4}}),(gt||nt||typeof(Le==null||(it=Le.spec)===null||it===void 0?void 0:it.lifecycle)=="string")&&(0,h.jsx)(re,{label:"Lifecycle",value:Le==null||(rt=Le.spec)===null||rt===void 0?void 0:rt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,h.jsx)(re,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Le==null||(Ae=Le.metadata)===null||Ae===void 0?void 0:Ae.tags)||[]).map(Zt=>(0,h.jsx)(L.Z,{size:"small",label:Zt},Zt))}),at&&((Le==null||(tt=Le.spec)===null||tt===void 0?void 0:tt.targets)||(Le==null||(mt=Le.spec)===null||mt===void 0?void 0:mt.target))&&(0,h.jsx)(re,{label:"Targets",gridSizes:{xs:12},children:(0,h.jsx)(xe.s,{cols:1,items:(Le.spec.targets||[Le.spec.target]).map(Zt=>Zt).map(Zt=>{var en;return{text:Zt,href:Ye(Zt,(Le==null||(en=Le.spec)===null||en===void 0?void 0:en.type)||"unknown",Ut)}})})})]})}const We=(0,l.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function Ge(Ne){var Me,qe,ct;const{variant:it}=Ne,rt=We(),{entity:Ae}=(0,S.X2)(),tt=(0,I.h_)(W.q3),mt=(0,I.h_)(S.Ah),Le=(0,I.h_)(I.$v),ae=(0,I.tg)(P.jU),Ce=(0,S.CV)(Ae,tt),Ie=(Me=Ae.metadata.annotations)===null||Me===void 0?void 0:Me[n.Tf],nt={label:"View Source",disabled:!Ce,icon:(0,h.jsx)(W.nW,{type:Ce==null?void 0:Ce.integrationType}),href:Ce==null?void 0:Ce.locationTargetUrl},gt={label:"View TechDocs",disabled:!(!((qe=Ae.metadata.annotations)===null||qe===void 0)&&qe["backstage.io/techdocs-ref"])||!ae,icon:(0,h.jsx)(Y.Z,{}),href:ae&&ae({namespace:Ae.metadata.namespace||n.zG,kind:Ae.kind,name:Ae.metadata.name})};let Tt="";it==="gridItem"?Tt=rt.gridItemCard:it==="fullHeight"&&(Tt=rt.fullHeightCard);let at="";it==="gridItem"?at=rt.gridItemCardContent:it==="fullHeight"&&(at=rt.fullHeightCardContent);const St=(ct=Ae.metadata.annotations)===null||ct===void 0?void 0:ct[n.P1],wt=(St==null?void 0:St.startsWith("url:"))||(St==null?void 0:St.startsWith("file:")),Lt=(0,le.useCallback)(async()=>{await mt.refreshEntity((0,n.eE)(Ae)),Le.post({message:"Refresh scheduled",severity:"info"})},[mt,Le,Ae]);return(0,h.jsxs)(B.Z,{className:Tt,children:[(0,h.jsx)(se.Z,{title:"About",action:(0,h.jsxs)(h.Fragment,{children:[wt&&(0,h.jsx)(X.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Lt,children:(0,h.jsx)(Q.Z,{})}),(0,h.jsx)(X.Z,{component:v.rU,"aria-label":"Edit",disabled:!Ie,title:"Edit Metadata",to:Ie!=null?Ie:"#",children:(0,h.jsx)(ue.Z,{})})]}),subheader:(0,h.jsx)(v.M6,{links:[nt,gt]})}),(0,h.jsx)(q.Z,{}),(0,h.jsx)(F.Z,{className:at,children:(0,h.jsx)(He,{entity:Ae})})]})}},79324:function(bt,Oe,t){"use strict";t.d(Oe,{K:function(){return Q}});var h=t(52322),n=t(2784),v=t(79692),I=t(12420),W=t(97580),S=t(73698),l=t(74603),B=t(12231),se=t(46285),X=t(64279),q=t(25248);const F=(0,v.Z)(Y=>(0,I.Z)({root:{...Y.typography.h4}}));function Q(Y){const{initialFilter:ue="component",allowedKinds:le}=Y,P=F(),R=(0,q.h_)(se.Ah),{value:D}=(0,X.default)(async()=>await R.getEntityFacets({facets:["kind"]}).then(Ge=>{var Ne;return((Ne=Ge.facets.kind)===null||Ne===void 0?void 0:Ne.map(Me=>Me.value).sort())||[]})),{updateFilters:L,queryParameters:{kind:T}}=(0,se.wp)(),re=(0,n.useMemo)(()=>{var Ge;return(Ge=[T].flat()[0])===null||Ge===void 0?void 0:Ge.toLocaleLowerCase("en-US")},[T]),[xe,Ke]=(0,n.useState)(re!=null?re:ue);(0,n.useEffect)(()=>{L({kind:xe?new se.zo(xe):void 0})},[xe,L]),(0,n.useEffect)(()=>{re&&Ke(re)},[re]);var Ye;const We=[(0,W.Z)(xe)].concat((Ye=D==null?void 0:D.filter(Ge=>le?le.some(Ne=>Ne.toLocaleLowerCase("en-US")===Ge.toLocaleLowerCase("en-US")):!0))!==null&&Ye!==void 0?Ye:[]).sort().reduce((Ge,Ne)=>(Ge[Ne.toLocaleLowerCase("en-US")]=Ne,Ge),{});return(0,h.jsx)(S.Z,{input:(0,h.jsx)(l.Z,{value:xe}),value:xe,onChange:Ge=>Ke(Ge.target.value),classes:P,children:Object.keys(We).map(Ge=>(0,h.jsx)(B.Z,{value:Ge,children:`${We[Ge]}s`},Ge))})}},86359:function(bt,Oe,t){"use strict";t.d(Oe,{E:function(){return le}});var h=t(52322),n=t(25271),v=t(71399),I=t(46285),W=t(90436),S=t(15459),l=t(27604),B=t(2997),se=t(11640),X=t(28347),q=t(76635),F=t(2784),Q=t(7089);const Y=Object.freeze({createNameColumn(P){function R(D){var L;return((L=D.metadata)===null||L===void 0?void 0:L.title)||(0,I.$3)(D,{defaultKind:P==null?void 0:P.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:D},{entity:L}){return R(D).localeCompare(R(L))},render:({entity:D})=>{var L;return(0,h.jsx)(I.dx,{entityRef:D,defaultKind:(P==null?void 0:P.defaultKind)||"Component",title:(L=D.metadata)===null||L===void 0?void 0:L.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:P})=>(0,h.jsx)(I.rI,{entityRefs:P.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:P})=>(0,h.jsx)(I.rI,{entityRefs:P.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:P})=>{var R,D;return(0,h.jsx)(h.Fragment,{children:((P==null||(R=P.spec)===null||R===void 0?void 0:R.targets)||(P==null||(D=P.spec)===null||D===void 0?void 0:D.target))&&(0,h.jsx)(v.Or,{text:(P.spec.targets||[P.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:P})=>(0,h.jsx)(v.Or,{text:P.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>(0,h.jsx)(h.Fragment,{children:P.metadata.tags&&P.metadata.tags.map(R=>(0,h.jsx)(Q.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(P){return{title:"Title",field:"entity.metadata.title",hidden:P==null?void 0:P.hidden,searchable:!0}}}),ue=(0,S.Z)({root:{color:"#f3ba37"}})(se.Z),le=P=>{var R,D;const{columns:L,actions:T,tableOptions:re,subtitle:xe}=P,{isStarredEntity:Ke,toggleStarredEntity:Ye}=(0,I.CR)(),{loading:He,error:We,entities:Ge,filters:Ne}=(0,I.wp)(),Me=(0,F.useMemo)(()=>{var Le;return[Y.createTitleColumn({hidden:!0}),Y.createNameColumn({defaultKind:(Le=Ne.kind)===null||Le===void 0?void 0:Le.value}),...ae(),Y.createMetadataDescriptionColumn(),Y.createTagsColumn()];function ae(){var Ce;switch((Ce=Ne.kind)===null||Ce===void 0?void 0:Ce.value){case"user":return[];case"domain":case"system":return[Y.createOwnerColumn()];case"group":case"template":return[Y.createSpecTypeColumn()];case"location":return[Y.createSpecTypeColumn(),Y.createSpecTargetsColumn()];default:return[Y.createSystemColumn(),Y.createOwnerColumn(),Y.createSpecTypeColumn(),Y.createSpecLifecycleColumn()]}}},[(R=Ne.kind)===null||R===void 0?void 0:R.value]),qe=Ne.type===void 0;var ct;const it=(0,q.capitalize)((ct=(D=Ne.user)===null||D===void 0?void 0:D.value)!==null&&ct!==void 0?ct:"all");if(We)return(0,h.jsx)("div",{children:(0,h.jsx)(v.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,h.jsx)(v.Oi,{language:"text",text:We.toString()})})});const rt=[({entity:Le})=>{var ae;const Ce=(ae=Le.metadata.annotations)===null||ae===void 0?void 0:ae[n.l2],Ie="View";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:Ie}),(0,h.jsx)(B.Z,{fontSize:"small"})]}),tooltip:Ie,disabled:!Ce,onClick:()=>{!Ce||window.open(Ce,"_blank")}}},({entity:Le})=>{var ae;const Ce=(ae=Le.metadata.annotations)===null||ae===void 0?void 0:ae[n.Tf],Ie="Edit";return{icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:Ie}),(0,h.jsx)(l.Z,{fontSize:"small"})]}),tooltip:Ie,disabled:!Ce,onClick:()=>{!Ce||window.open(Ce,"_blank")}}},({entity:Le})=>{const ae=Ke(Le),Ce=ae?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(W.Z,{variant:"srOnly",children:Ce}),ae?(0,h.jsx)(ue,{}):(0,h.jsx)(X.Z,{})]}),tooltip:Ce,onClick:()=>Ye(Le)}}],Ae=Ge.map(Le=>{const ae=(0,I.hF)(Le,n.cz,{kind:"system"}),Ce=(0,I.hF)(Le,n.S4);return{entity:Le,resolved:{name:(0,I.$3)(Le,{defaultKind:"Component"}),ownedByRelationsTitle:Ce.map(Ie=>(0,I.$3)(Ie,{defaultKind:"group"})).join(", "),ownedByRelations:Ce,partOfSystemRelationTitle:ae.map(Ie=>(0,I.$3)(Ie,{defaultKind:"system"})).join(", "),partOfSystemRelations:ae}}}),tt=(L||Me).find(Le=>Le.title==="Type");tt&&(tt.hidden=!qe);const mt=Ae.length>20;return(0,h.jsx)(v.iA,{isLoading:He,columns:L||Me,options:{paging:mt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!He,padding:"dense",pageSizeOptions:[20,50,100],...re},title:`${it} (${Ge.length})`,data:Ae,actions:T||rt,subtitle:xe})};le.columns=Y},24851:function(bt,Oe,t){"use strict";t.d(Oe,{s:function(){return ue}});var h=t(52322),n=t(90348),v=t(11861),I=t(2784),W=t(79692),S=t(95544),l=t(90436),B=t(52160),se=t(71399);const X=(0,W.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function q(le){const{href:P,text:R,Icon:D}=le,L=X();return(0,h.jsxs)(S.Z,{display:"flex",children:[(0,h.jsx)(S.Z,{mr:1,className:L.svgIcon,children:(0,h.jsx)(l.Z,{component:"div",children:D?(0,h.jsx)(D,{}):(0,h.jsx)(B.Z,{})})}),(0,h.jsx)(S.Z,{flexGrow:"1",children:(0,h.jsx)(se.rU,{to:P,target:"_blank",rel:"noopener",children:R||P})})]})}var F=t(41156);const Q={xs:1,sm:1,md:1,lg:2,xl:3};function Y(le){const P=[(0,F.Z)(T=>T.breakpoints.up("xl"))?"xl":null,(0,F.Z)(T=>T.breakpoints.up("lg"))?"lg":null,(0,F.Z)(T=>T.breakpoints.up("md"))?"md":null,(0,F.Z)(T=>T.breakpoints.up("sm"))?"sm":null,(0,F.Z)(T=>T.breakpoints.up("xs"))?"xs":null];let R=1;if(typeof le=="number")R=le;else{var D;const T=(D=P.find(re=>re!==null))!==null&&D!==void 0?D:"xs";var L;R=(L=le==null?void 0:le[T])!==null&&L!==void 0?L:Q[T]}return R}function ue(le){const{items:P,cols:R=void 0}=le,D=Y(R);return(0,h.jsx)(n.Z,{rowHeight:"auto",cols:D,children:P.map(({text:L,href:T,Icon:re},xe)=>(0,h.jsx)(v.Z,{children:(0,h.jsx)(q,{href:T,text:L!=null?L:T,Icon:re})},xe))})}},19625:function(bt,Oe,t){"use strict";t.d(Oe,{_Z:function(){return I},jU:function(){return v},yw:function(){return n}});var h=t(25248);const n=(0,h.x8)({id:"create-component",optional:!0}),v=(0,h.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),I=(0,h.NT)({id:"catalog"})},51666:function(bt,Oe,t){"use strict";t.d(Oe,{rG:function(){return h},Y2:function(){return D},J$:function(){return se},g2:function(){return v}});var h;(function(L){L.DENY="DENY",L.ALLOW="ALLOW",L.CONDITIONAL="CONDITIONAL"})(h||(h={}));function n(L,T){return L.name===T.name}function v(L,T){return"resourceType"in L?!T||L.resourceType===T:!1}function I(L){return L.attributes.action==="create"}function W(L){return L.attributes.action==="read"}function S(L){return L.attributes.action==="update"}function l(L){return L.attributes.action==="delete"}function B(L){return{authorize:async(T,re)=>await L.authorize(T,re),authorizeConditional(T,re){const xe=T;return L.authorize(xe,re)}}}function se({name:L,attributes:T,resourceType:re}){return re?{type:"resource",name:L,attributes:T,resourceType:re}:{type:"basic",name:L,attributes:T}}var X=t(23054),q=t(96279),F=t.n(q),Q=t(9571),Y=t(30195);const ue=Y.z.lazy(()=>Y.z.object({rule:Y.z.string(),resourceType:Y.z.string(),params:Y.z.array(Y.z.unknown())}).or(Y.z.object({anyOf:Y.z.array(ue).nonempty()})).or(Y.z.object({allOf:Y.z.array(ue).nonempty()})).or(Y.z.object({not:ue}))),le=Y.z.object({result:Y.z.literal(h.ALLOW).or(Y.z.literal(h.DENY))}),P=Y.z.union([Y.z.object({result:Y.z.literal(h.ALLOW).or(Y.z.literal(h.DENY))}),Y.z.object({result:Y.z.literal(h.CONDITIONAL),pluginId:Y.z.string(),resourceType:Y.z.string(),conditions:ue})]),R=(L,T)=>Y.z.object({items:Y.z.array(Y.z.intersection(Y.z.object({id:Y.z.string()}),L)).refine(re=>re.length===T.size&&re.every(({id:xe})=>T.has(xe)),{message:"Items in response do not match request"})});class D{async authorize(T,re){return this.makeRequest(T,le,re)}async authorizeConditional(T,re){return this.makeRequest(T,P,re)}async makeRequest(T,re,xe){if(!this.enabled)return T.map(Me=>({result:h.ALLOW}));const Ke={items:T.map(Me=>({id:Q.Z(),...Me}))},Ye=await this.discovery.getBaseUrl("permission"),He=await F()(`${Ye}/authorize`,{method:"POST",body:JSON.stringify(Ke),headers:{...this.getAuthorizationHeader(xe==null?void 0:xe.token),"content-type":"application/json"}});if(!He.ok)throw await X.VL.fromResponse(He);const We=await He.json(),Ne=R(re,new Set(Ke.items.map(({id:Me})=>Me))).parse(We).items.reduce((Me,qe)=>(Me[qe.id]=qe,Me),{});return Ke.items.map(Me=>Ne[Me.id])}getAuthorizationHeader(T){return T?{Authorization:`Bearer ${T}`}:{}}constructor(T){this.discovery=T.discovery;var re;this.enabled=(re=T.config.getOptionalBoolean("permission.enabled"))!==null&&re!==void 0?re:!1}}},25488:function(bt,Oe,t){"use strict";t.d(Oe,{iM:function(){return S},RV:function(){return I},gI:function(){return B}});var h=t(52322),n=t(2784),v=t(25248);const I=(0,v.T0)({id:"plugin.permission.api"});var W=t(51666);class S{static create(F){const{config:Q,discovery:Y,identity:ue}=F,le=new W.Y2({discovery:Y,config:Q});return new S(le,ue)}async authorize(F){return(await this.permissionClient.authorize([F],await this.identityApi.getCredentials()))[0]}constructor(F,Q){this.permissionClient=F,this.identityApi=Q}}var l=t(49857);function B(q){const F=(0,v.h_)(I),{data:Q,error:Y}=(0,l.ZP)(q,async ue=>{if((0,W.g2)(ue.permission)&&!ue.resourceRef)return W.rG.DENY;const{result:le}=await F.authorize(ue);return le});return Y?{error:Y,loading:!1,allowed:!1}:Q===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:Q===W.rG.ALLOW}}const se=q=>{const{permission:F,resourceRef:Q,errorComponent:Y,...ue}=q,le=usePermission(isResourcePermission(F)?{permission:F,resourceRef:Q}:{permission:F}),P=useApp(),{NotFoundErrorPage:R}=P.getComponents();let D=Y===void 0?_jsx(R,{}):Y;return le.loading?D=null:le.allowed&&(D=q.element),_jsx(Route,{...ue,element:D})};function X(q){const{permission:F,resourceRef:Q}=q,Y=usePermission(isResourcePermission(F)?{permission:F,resourceRef:Q}:{permission:F}),ue=useApp();if(Y.loading)return null;if(Y.allowed)return _jsx(_Fragment,{children:q.children});if(q.errorPage)return _jsx(_Fragment,{children:q.errorPage});const{NotFoundErrorPage:le}=ue.getComponents();return _jsx(le,{})}},60712:function(bt,Oe,t){"use strict";t.d(Oe,{FA:function(){return B},qO:function(){return it},Nd:function(){return Ye},Rx:function(){return L}});var h=t(25248);const n=(0,h.T0)({id:"plugin.search.queryservice"});class v{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(y){this.mockedResults=y}}var I=t(52322),W=t(2784),S=t(79692);const l=(0,S.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),B=({text:J,preTag:y,postTag:g})=>{const k=l(),G=(0,W.useMemo)(()=>J.split(new RegExp(`(${y}.+?${g})`)),[g,y,J]);return(0,I.jsx)(I.Fragment,{children:G.map((ce,ge)=>ce.includes(y)?(0,I.jsx)("mark",{className:k.highlight,children:ce.replace(new RegExp(`${y}|${g}`,"g"),"")},ge):ce)})};var se=t(48760),X=t(50581),q=t(61837),F=t(74603),Q=t(21853),Y=t(33375),ue=t(76635),le=t(64279),P=t(1849),R=t(51837);const D=(0,R.CT)("search-context"),L=()=>{const J=(0,W.useContext)(D);if(!J)throw new Error("useSearch must be used within a SearchContextProvider");const y=J.atVersion(1);if(!y)throw new Error("No SearchContext v1 found");return y},T=()=>(0,W.useContext)(D)!==void 0,re={term:"",pageCursor:void 0,filters:{},types:[]},xe=(J=re)=>{var y,g,k,G;const ce=(0,h.h_)(n),[ge,Fe]=(0,W.useState)(J.term),[st,_e]=(0,W.useState)(J.types),[vt,ft]=(0,W.useState)(J.filters),[ht,Et]=(0,W.useState)(J.pageCursor),j=(0,P.Z)(ge),U=(0,P.Z)(vt),ne=(0,le.default)(()=>ce.query({term:ge,filters:vt,pageCursor:ht,types:st}),[ge,st,vt,ht]),de=!ne.loading&&!ne.error&&((y=ne.value)===null||y===void 0?void 0:y.nextPageCursor),je=!ne.loading&&!ne.error&&((g=ne.value)===null||g===void 0?void 0:g.previousPageCursor),Se=(0,W.useCallback)(()=>{var Xe;Et((Xe=ne.value)===null||Xe===void 0?void 0:Xe.nextPageCursor)},[(k=ne.value)===null||k===void 0?void 0:k.nextPageCursor]),Qe=(0,W.useCallback)(()=>{var Xe;Et((Xe=ne.value)===null||Xe===void 0?void 0:Xe.previousPageCursor)},[(G=ne.value)===null||G===void 0?void 0:G.previousPageCursor]);return(0,W.useEffect)(()=>{j!==void 0&&ge!==j&&Et(void 0)},[ge,j,Et]),(0,W.useEffect)(()=>{U!==void 0&&!(0,ue.isEqual)(vt,U)&&Et(void 0)},[vt,U,Et]),{result:ne,filters:vt,setFilters:ft,term:ge,setTerm:Fe,types:st,setTypes:_e,pageCursor:ht,setPageCursor:Et,fetchNextPage:de?Se:void 0,fetchPreviousPage:je?Qe:void 0}},Ke=J=>{const{initialState:y,children:g}=J,k=xe(y);return(0,I.jsx)(h.fC,{attributes:{searchTypes:k.types.sort().join(",")},children:(0,I.jsx)(D.Provider,{value:(0,R.EI)({1:k}),children:g})})},Ye=J=>{const{initialState:y,inheritParentContextIfAvailable:g,children:k}=J;return T()&&g?(0,I.jsx)(I.Fragment,{children:k}):(0,I.jsx)(Ke,{initialState:y,children:k})},He=({children:J})=>{const y=(0,h.z$)(),{term:g}=L();return(0,W.useEffect)(()=>{g&&y.captureEvent("search",g)},[y,g]),(0,I.jsx)(I.Fragment,{children:J})};function We(J){return(0,W.forwardRef)((y,g)=>(0,I.jsx)(Ye,{inheritParentContextIfAvailable:!0,children:(0,I.jsx)(J,{...y,ref:g})}))}const Ge=We((0,W.forwardRef)((J,y)=>{const{onChange:g,onKeyDown:k=()=>{},onClear:G=()=>{},onSubmit:ce=()=>{},debounceTime:ge=200,clearButton:Fe=!0,fullWidth:st=!0,value:_e,placeholder:vt,inputProps:ft={},endAdornment:ht,...Et}=J,j=(0,h.h_)(h.Ds),[U,ne]=(0,W.useState)("");(0,W.useEffect)(()=>{ne(dt=>dt!==_e?String(_e):dt)},[_e]),(0,se.Z)(()=>g(U),ge,[U]);const de=(0,W.useCallback)(dt=>{ne(dt.target.value)},[ne]),je=(0,W.useCallback)(dt=>{k&&k(dt),ce&&dt.key==="Enter"&&ce()},[k,ce]),Se=(0,W.useCallback)(()=>{g(""),G&&G()},[g,G]),Qe=vt!=null?vt:`Search in ${j.getOptionalString("app.title")||"Backstage"}`,pt=(0,I.jsx)(X.Z,{position:"start",children:(0,I.jsx)(q.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,I.jsx)(Q.Z,{})})}),Xe=(0,I.jsx)(X.Z,{position:"end",children:(0,I.jsx)(q.Z,{"aria-label":"Clear",size:"small",onClick:Se,children:(0,I.jsx)(Y.Z,{})})});return(0,I.jsx)(He,{children:(0,I.jsx)(F.Z,{"data-testid":"search-bar-next",ref:y,value:U,placeholder:Qe,startAdornment:pt,endAdornment:Fe?Xe:ht,inputProps:{"aria-label":"Search",...ft},fullWidth:st,onChange:de,onKeyDown:je,...Et})})})),Ne=We((0,W.forwardRef)((J,y)=>{const{value:g="",onChange:k,...G}=J,{term:ce,setTerm:ge}=L();(0,W.useEffect)(()=>{g&&ge(String(g))},[g,ge]);const Fe=(0,W.useCallback)(st=>{k?k(st):ge(st)},[k,ge]);return(0,I.jsx)(h.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,I.jsx)(Ge,{...G,ref:y,value:ce,onChange:Fe})})}));var Me=t(4614),qe=t(88013);const it=(J=>y=>(0,I.jsx)(Ye,{inheritParentContextIfAvailable:!0,children:(0,I.jsx)(J,{...y})}))(function(y){const{loading:g,value:k,onChange:G=()=>{},options:ce=[],getOptionLabel:ge=Se=>String(Se),inputPlaceholder:Fe,inputDebounceTime:st,freeSolo:_e=!0,fullWidth:vt=!0,clearOnBlur:ft=!1,"data-testid":ht="search-autocomplete",...Et}=y,{setTerm:j}=L(),U=(0,W.useCallback)(Se=>Se?typeof Se=="string"?Se:ge(Se):"",[ge]),ne=(0,W.useMemo)(()=>U(k),[k,U]),de=(0,W.useCallback)((Se,Qe,pt,Xe)=>{j(U(Qe)),G(Se,Qe,pt,Xe)},[U,j,G]),je=(0,W.useCallback)(({InputProps:{ref:Se,endAdornment:Qe},InputLabelProps:pt,...Xe})=>(0,I.jsx)(Ne,{...Xe,ref:Se,clearButton:!1,value:ne,placeholder:Fe,debounceTime:st,endAdornment:g?(0,I.jsx)(Me.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Qe}),[g,ne,Fe,st]);return(0,I.jsx)(qe.ZP,{...Et,"data-testid":ht,value:k,onChange:de,options:ce,getOptionLabel:ge,renderInput:je,freeSolo:_e,fullWidth:vt,clearOnBlur:ft})}),rt=({icon:J,primaryText:y,primaryTextTypographyProps:g,secondaryText:k,secondaryTextTypographyProps:G,disableTextTypography:ce})=>_jsxs(_Fragment,{children:[J?_jsx(ListItemIcon,{children:J}):null,_jsx(ListItemText,{primary:y,primaryTypographyProps:g,secondary:k,secondaryTypographyProps:G,disableTypography:ce})]});var Ae=t(42494),tt=t(84899),mt=t(5806),Le=t(21324),ae=t(56939),Ce=t(73698),Ie=t(12231),nt=t(86619),gt=t(7089),Tt=t(69294);const at=(J,y,g=[],k=250)=>{const G=(0,W.useRef)({}),ce=J||(()=>Promise.resolve([])),[ge,Fe]=(0,Tt.default)(ce,[y],{loading:!0});if((0,se.Z)(()=>{G.current[y]===void 0&&(G.current[y]=Fe(y).then(_e=>(G.current[y]=_e,_e)))},k,[Fe,y]),g.length)return{loading:!1,value:g};const st=G.current[y];return Array.isArray(st)?{loading:!1,value:st}:ge},St=(J,y)=>{const{setFilters:g}=L();(0,W.useEffect)(()=>{y&&[y].flat().length>0&&g(k=>({...k,[J]:y}))},[])},wt=J=>{const{className:y,defaultValue:g,name:k,values:G,valuesDebounceMs:ce,label:ge,filterSelectedOptions:Fe,limitTags:st,multiple:_e}=J,[vt,ft]=(0,W.useState)("");St(k,g);const ht=typeof G=="function"?G:void 0,Et=typeof G=="function"?void 0:G,{value:j,loading:U}=at(ht,vt,Et,ce),{filters:ne,setFilters:de}=L(),je=ne[k]||(_e?[]:null),Se=(Xe,dt)=>{de(Dt=>{const{[k]:It,...Wt}=Dt;return dt?{...Wt,[k]:dt}:{...Wt}})},Qe=Xe=>(0,I.jsx)(nt.Z,{...Xe,name:"search",variant:"outlined",label:ge,fullWidth:!0}),pt=(Xe,dt)=>Xe.map((Dt,It)=>(0,I.jsx)(gt.Z,{label:Dt,color:"primary",...dt({index:It})}));return(0,I.jsx)(qe.ZP,{filterSelectedOptions:Fe,limitTags:st,multiple:_e,className:y,id:`${_e?"multi-":""}select-filter-${k}--select`,options:j||[],loading:U,value:je,onChange:Se,onInputChange:(Xe,dt)=>ft(dt),renderInput:Qe,renderTags:pt})},Lt=(0,S.Z)({label:{textTransform:"capitalize"}}),Bt=J=>{const{className:y,defaultValue:g,label:k,name:G,values:ce=[],valuesDebounceMs:ge}=J,Fe=Lt(),{filters:st,setFilters:_e}=L();St(G,g);const vt=typeof ce=="function"?ce:void 0,ft=typeof ce=="function"?void 0:ce,{value:ht=[],loading:Et}=at(vt,"",ft,ge),j=ne=>{const{target:{value:de,checked:je}}=ne;_e(Se=>{const{[G]:Qe,...pt}=Se,Xe=(Qe||[]).filter(Dt=>Dt!==de),dt=je?[...Xe,de]:Xe;return dt.length?{...pt,[G]:dt}:pt})};var U;return(0,I.jsxs)(Ae.Z,{className:y,disabled:Et,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[k?(0,I.jsx)(tt.Z,{className:Fe.label,children:k}):null,ht.map(ne=>(0,I.jsx)(mt.Z,{control:(0,I.jsx)(Le.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":ne},value:ne,name:ne,onChange:j,checked:((U=st[G])!==null&&U!==void 0?U:[]).includes(ne)}),label:ne},ne))]})},jt=J=>{const{className:y,defaultValue:g,label:k,name:G,values:ce,valuesDebounceMs:ge}=J,Fe=Lt();St(G,g);const st=typeof ce=="function"?ce:void 0,_e=typeof ce=="function"?void 0:ce,{value:vt=[],loading:ft}=at(st,"",_e,ge),{filters:ht,setFilters:Et}=L(),j=U=>{const{target:{value:ne}}=U;Et(de=>{const{[G]:je,...Se}=de;return ne?{...Se,[G]:ne}:Se})};return(0,I.jsxs)(Ae.Z,{disabled:ft,className:y,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[k?(0,I.jsx)(ae.Z,{className:Fe.label,margin:"dense",children:k}):null,(0,I.jsxs)(Ce.Z,{variant:"outlined",value:ht[G]||"",onChange:j,children:[(0,I.jsx)(Ie.Z,{value:"",children:(0,I.jsx)("em",{children:"All"})}),vt.map(U=>(0,I.jsx)(Ie.Z,{value:U,children:U},U))]})]})},Ut=({component:J,...y})=>(0,I.jsx)(J,{...y});Ut.Checkbox=J=>(0,I.jsx)(Ut,{...J,component:Bt}),Ut.Select=J=>(0,I.jsx)(Ut,{...J,component:jt}),Ut.Autocomplete=J=>(0,I.jsx)(Ut,{...J,component:wt});var Zt=t(71399);const en=J=>{const{children:y}=J,k=useSearch().result;return y(k)},rn=J=>{const{query:y,children:g}=J,k=useApi(searchApiRef);var G,ce,ge;const Fe=useAsync(()=>k.query({term:(G=y.term)!==null&&G!==void 0?G:"",types:(ce=y.types)!==null&&ce!==void 0?ce:[],filters:(ge=y.filters)!==null&&ge!==void 0?ge:{},pageCursor:y.pageCursor}),[y]);return g(Fe)},wn=J=>{const{query:y,children:g}=J;return y?_jsx(rn,{query:y,children:g}):_jsx(en,{children:g})},un=J=>{const{query:y,children:g}=J;return _jsx(wn,{query:y,children:({loading:k,error:G,value:ce})=>k?_jsx(Progress,{}):G?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:G}):ce!=null&&ce.results.length?g(ce):_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})})},kn=J=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(un,{...J})}),sn=(0,S.Z)(J=>({root:{display:"flex",justifyContent:"space-between",gap:J.spacing(2),margin:J.spacing(2,0)}})),Vn=()=>{const{fetchNextPage:J,fetchPreviousPage:y}=useSearch(),g=sn();return!J&&!y?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:g.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!y,onClick:y,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!J,onClick:J,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Mt=({result:J,highlight:y,rank:g,icon:k,secondaryAction:G,lineClamp:ce=5})=>{const ge=useAnalytics(),Fe=()=>{ge.captureEvent("discover",J.title,{attributes:{to:J.location},value:g})};return _jsxs(Link,{noTrack:!0,to:J.location,onClick:Fe,children:[_jsxs(ListItem,{alignItems:"center",children:[k&&_jsx(ListItemIcon,{children:k}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:y!=null&&y.fields.title?_jsx(HighlightedSearchResultText,{text:y.fields.title,preTag:y.preTag,postTag:y.postTag}):J.title,secondary:_jsx("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ce,overflow:"hidden"},children:y!=null&&y.fields.text?_jsx(HighlightedSearchResultText,{text:y.fields.text,preTag:y.preTag,postTag:y.postTag}):J.text})}),G&&_jsx(Box,{alignItems:"flex-end",children:G})]}),_jsx(Divider,{})]})},Rn=J=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Mt,{...J})}),Cn=J=>{const{loading:y,error:g,resultItems:k,renderResultItem:G,...ce}=J;var ge;return _jsxs(List,{...ce,children:[y?_jsx(Progress,{}):null,!y&&g?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:g}):null,!y&&!g&&(k==null?void 0:k.length)?k.map(Fe=>(ge=G==null?void 0:G(Fe))!==null&&ge!==void 0?ge:null):null,!y&&!g&&!(k!=null&&k.length)?_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}):null]})},on=J=>{const{query:y,renderResultItem:g=({document:G})=>_jsx(DefaultResultListItem,{result:G},G.location),...k}=J;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:y,children:({loading:G,error:ce,value:ge})=>_jsx(Cn,{...k,loading:G,error:ce,resultItems:ge==null?void 0:ge.results,renderResultItem:g})})})};var an=t(19126);const tn=(0,S.Z)(J=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:J.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:J.palette.text.secondary,margin:J.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:J.palette.text.secondary,margin:J.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:J.spacing(.5)}})),ln=J=>{const y=tn(),{label:g,children:k,...G}=J;return _jsx(Chip,{...G,className:y.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[g,": ",k]})})},fn=()=>null,nn=(0,S.Z)(J=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:J.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:J.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),he=J=>{const y=nn(),{label:g,value:k="None",onChange:G,onDelete:ce}=J,ge=useCallback(Fe=>{G(Fe.target.value)},[G]);return _jsx(ln,{label:g,onDelete:ce,children:_jsx(Typography,{role:"textbox",component:"span",className:y.root,onChange:ge,contentEditable:!0,suppressContentEditableWarning:!0,children:k})})},te=(0,S.Z)(J=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:J.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Te=J=>{const y=te(),{label:g,value:k="none",onChange:G,onDelete:ce,children:ge}=J,Fe=useCallback(st=>{G(st.target.value)},[G]);return _jsx(ln,{label:g,onDelete:ce,children:_jsxs(Select,{className:y.root,value:k,onChange:Fe,input:_jsx(InputBase,{}),IconComponent:fn,children:[_jsx(MenuItem,{value:"none",children:"None"}),ge]})})};function ke(J){const y=tn(),[g,k]=useState(null),{loading:G,error:ce,icon:ge,title:Fe,titleProps:st={},link:_e,linkProps:vt={},filterOptions:ft,renderFilterOption:ht,filterFields:Et,renderFilterField:j,resultItems:U,renderResultItem:ne,...de}=J,je=useCallback(Xe=>{k(Xe.currentTarget)},[]),Se=useCallback(()=>{k(null)},[]);var Qe,pt;return _jsxs(List,{...de,children:[_jsxs(ListSubheader,{className:y.listSubheader,children:[ge,_jsx(Typography,{className:y.listSubheaderName,component:"strong",...st,children:Fe}),ft?_jsx(Chip,{className:y.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:je}):null,ft?_jsx(Menu,{id:"filters-menu",anchorEl:g,open:Boolean(g),onClose:Se,onClick:Se,keepMounted:!0,children:ft.map(Xe=>ht?ht(Xe):_jsx(MenuItem,{value:String(Xe),children:Xe},String(Xe)))}):null,Et==null?void 0:Et.map(Xe=>(Qe=j==null?void 0:j(Xe))!==null&&Qe!==void 0?Qe:null),_jsx(Link,{className:y.listSubheaderLink,to:"/search",...vt,children:_e!=null?_e:_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:y.listSubheaderLinkIcon})]})})]}),G?_jsx(Progress,{}):null,!G&&ce?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ce}):null,!G&&!ce&&(U==null?void 0:U.length)?U.map(Xe=>(pt=ne==null?void 0:ne(Xe))!==null&&pt!==void 0?pt:null):null,!G&&!ce&&!(U!=null&&U.length)?_jsx(ListItem,{children:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"})}):null]})}function Je(J){const{query:y,linkProps:g={},renderResultItem:k=({document:Fe})=>_jsx(DefaultResultListItem,{result:Fe},Fe.location),...G}=J,ce=`/search?${qs.stringify({query:y.term,types:y.types,filters:y.filters,pageCursor:y.pageCursor},{arrayFormat:"brackets"})}`;var ge;return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:y,children:({loading:Fe,error:st,value:_e})=>_jsx(ke,{...G,loading:Fe,error:st,linkProps:{to:ce,...g},resultItems:_e==null?void 0:_e.results,renderResultItem:k,filterFields:Object.keys((ge=y.filters)!==null&&ge!==void 0?ge:{})})})})}},61886:function(bt,Oe,t){"use strict";t.d(Oe,{Ox:function(){return Me},Zz:function(){return S},oZ:function(){return Ye},DR:function(){return l},ZS:function(){return xe},VA:function(){return it},KY:function(){return se},gT:function(){return Y},Dl:function(){return ue},ux:function(){return ct},$L:function(){return Q},x1:function(){return Ke}});var h=t(52322),n=t(2784),v=t(10289),I=t(25248);const W="techdocs.addons.addon.v1",S="techdocs.addons.wrapper.v1",l=()=>null;(0,I.R5)(l,S,!0);const B=ae=>`${W}.${ae.toLocaleLowerCase("en-US")}`;function se(ae){const{name:Ce,component:Ie}=ae;return(0,I.YO)({name:Ce,component:{sync:nt=>(0,h.jsx)(Ie,{...nt})},data:{[W]:ae,[B(Ce)]:!0}})}const X=(ae,Ce)=>ae.selectByComponentData({key:Ce}).getElements()[0],q=ae=>ae.selectByComponentData({key:S}).selectByComponentData({key:W}),F=ae=>ae.selectByComponentData({key:S}).findComponentData({key:W}),Q=()=>{const ae=(0,v.pC)(),Ce=(0,I.vJ)(ae,q),Ie=(0,I.vJ)(ae,F),nt=(0,n.useCallback)(at=>{if(!Ce||!at)return null;const St=B(at.name);var wt;return(wt=X(Ce,St))!==null&&wt!==void 0?wt:null},[Ce]),gt=(0,n.useCallback)(at=>{const St=Ie.find(wt=>wt.name===at);return St?nt(St):null},[Ie,nt]),Tt=(0,n.useCallback)(at=>{const St=Ie.filter(wt=>wt.location===at);return St.length?St.map(nt):null},[Ie,nt]);return{renderComponentByName:gt,renderComponentsByLocation:Tt}},Y=(0,I.T0)({id:"plugin.techdocs.service"}),ue=(0,I.T0)({id:"plugin.techdocs.storageservice"});var le=t(64279),P=t(25271),R=t(51837);function D(ae,Ce){return Ce.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ae.kind=ae.kind.toLocaleLowerCase(),ae.name=ae.name.toLocaleLowerCase(),ae.namespace=ae.namespace.toLocaleLowerCase()),ae}const L=(ae,Ce)=>(0,P.eE)(ae)===(0,P.eE)(Ce),T={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},re=(0,R.CT)("techdocs-reader-page-context"),xe=(0,n.memo)(({entityRef:ae,children:Ce})=>{const Ie=(0,I.h_)(Y),nt=(0,I.h_)(I.Ds),gt=(0,le.default)(async()=>Ie.getTechDocsMetadata(ae),[ae]),Tt=(0,le.default)(async()=>Ie.getEntityMetadata(ae),[ae]),[at,St]=(0,n.useState)(T.title),[wt,Lt]=(0,n.useState)(T.subtitle),[Bt,jt]=(0,n.useState)(T.shadowRoot),Ut={metadata:gt,entityRef:D(ae,nt),entityMetadata:Tt,shadowRoot:Bt,setShadowRoot:jt,title:at,setTitle:St,subtitle:wt,setSubtitle:Lt},Zt=(0,R.EI)({1:Ut});return(0,h.jsx)(re.Provider,{value:Zt,children:Ce instanceof Function?Ce(Ut):Ce})},(ae,Ce)=>L(ae.entityRef,Ce.entityRef)),Ke=()=>{const ae=(0,n.useContext)(re);if(ae===void 0)return T;const Ce=ae.atVersion(1);if(Ce===void 0)throw new Error("No context found for version 1.");return Ce},Ye=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var He=t(70882),We=t(50236),Ge=t(19219),Ne=t(71399);const Me="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",qe=ae=>{(0,n.useEffect)(()=>{if(!ae)return()=>{};const Ce=ae.querySelectorAll('head > link[rel="stylesheet"]');var Ie;let nt=(Ie=Ce==null?void 0:Ce.length)!==null&&Ie!==void 0?Ie:0;const gt=new CustomEvent(Me);if(!nt)return ae.dispatchEvent(gt),()=>{};const Tt=()=>{--nt===0&&ae.dispatchEvent(gt)};return Ce==null||Ce.forEach(at=>{at.addEventListener("load",Tt)}),()=>{Ce==null||Ce.forEach(at=>{at.removeEventListener("load",Tt)})}},[ae])},ct=ae=>{const[Ce,Ie]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!ae)return()=>{};Ie(!0);const nt=ae.style;nt.setProperty("opacity","0");const gt=()=>{Ie(!1),nt.setProperty("opacity","1")};return ae.addEventListener(Me,gt),()=>{ae.removeEventListener(Me,gt)}},[ae]),Ce},it=({element:ae,onAppend:Ce,children:Ie})=>{const[nt,gt]=(0,n.useState)((0,He.Ue)({...(0,We.Z)(),insertionPoint:void 0}));qe(ae);const Tt=ct(ae),at=(0,n.useCallback)(St=>{if(!ae||!St)return;gt((0,He.Ue)({...(0,We.Z)(),insertionPoint:ae.querySelector("head")||void 0}));let wt=St.shadowRoot;wt||(wt=St.attachShadow({mode:"open"})),wt.replaceChildren(ae),typeof Ce=="function"&&Ce(wt)},[ae,Ce]);return(0,h.jsxs)(h.Fragment,{children:[Tt&&(0,h.jsx)(Ne.Ex,{}),(0,h.jsxs)(Ge.ZP,{jss:nt,sheetsManager:new Map,children:[(0,h.jsx)("div",{ref:at,"data-testid":"techdocs-native-shadowroot"}),Ie]})]})};var rt=t(54073);const Ae=()=>{const{shadowRoot:ae}=useTechDocsReaderPage();return ae},tt=ae=>{const Ce=Ae();return Ce?ae.map(Ie=>Ce==null?void 0:Ce.querySelectorAll(Ie)).filter(Ie=>Ie.length).map(Ie=>Array.from(Ie)).flat():[]},mt=ae=>ae.toString()&&ae.rangeCount&&ae.getRangeAt(0).getBoundingClientRect().top,Le=(ae=0)=>{const Ce=Ae(),[Ie,nt]=useState(null),gt=useMemo(()=>debounce(()=>{const Tt=Ce,at=Tt.getSelection?Tt.getSelection():document.getSelection();at&&mt(at)?nt(at):nt(null)},ae),[Ce,nt,ae]);return useEffect(()=>(window.document.addEventListener("selectionchange",gt),()=>window.document.removeEventListener("selectionchange",gt)),[gt]),Ie}},52943:function(bt,Oe,t){"use strict";t.r(Oe),t.d(Oe,{EmbeddedDocsRouter:function(){return le},Router:function(){return ue},isTechDocsAvailable:function(){return Y}});var h=t(52322),n=t(2784),v=t(10289),I=t(46285),W=t(71399),S=t(25271),l=t(89258),B=t(65124),se=t(67896);const X=({entity:P})=>{const R=(0,S.iB)(P);return(0,h.jsxs)(l.I6,{entityRef:R,children:[(0,h.jsx)(B.b,{}),(0,h.jsx)(se.F,{withSearch:!1})]})};var q=t(18662),F=t(7476);const Q="backstage.io/techdocs-ref",Y=P=>{var R,D;return Boolean(P==null||(R=P.metadata)===null||R===void 0||(D=R.annotations)===null||D===void 0?void 0:D[Q])},ue=()=>(0,h.jsxs)(v.Z5,{children:[(0,h.jsx)(v.AW,{path:"/",element:(0,h.jsx)(q.TechDocsIndexPage,{})}),(0,h.jsx)(v.AW,{path:"/:namespace/:kind/:name/*",element:(0,h.jsx)(F.TechDocsReaderPage,{})})]}),le=P=>{var R;const{children:D}=P,{entity:L}=(0,I.X2)(),T=(0,v.V$)([{path:"/*",element:(0,h.jsx)(X,{entity:L}),children:[{path:"*",element:D}]}]);return((R=L.metadata.annotations)===null||R===void 0?void 0:R[Q])?T:(0,h.jsx)(W.sk,{annotation:Q})}},92077:function(bt,Oe,t){"use strict";t.d(Oe,{k:function(){return W},p:function(){return I}});var h=t(23054),n=t(76372),v=t.n(n);class I{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(l){const{kind:B,namespace:se,name:X}=l,F=`${await this.getApiOrigin()}/metadata/techdocs/${se}/${B}/${X}`,Q=await this.fetchApi.fetch(`${F}`);if(!Q.ok)throw await h.VL.fromResponse(Q);return await Q.json()}async getEntityMetadata(l){const{kind:B,namespace:se,name:X}=l,F=`${await this.getApiOrigin()}/metadata/entity/${se}/${B}/${X}`,Q=await this.fetchApi.fetch(`${F}`);if(!Q.ok)throw await h.VL.fromResponse(Q);return await Q.json()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.fetchApi=l.fetchApi}}class W{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var l;return(l=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&l!==void 0?l:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(l,B){const{kind:se,namespace:X,name:q}=l,Q=`${await this.getStorageUrl()}/${X}/${se}/${q}/${B}`,Y=await this.fetchApi.fetch(`${Q.endsWith("/")?Q:`${Q}/`}index.html`);let ue="";switch(Y.status){case 404:throw ue="Page not found. ",B||(ue+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ue);case 500:throw ue="Could not generate documentation or an error in the TechDocs backend. ",new Error(ue);default:break}return Y.text()}async syncEntityDocs(l,B=()=>{}){const{kind:se,namespace:X,name:q}=l,Q=`${await this.getApiOrigin()}/sync/${X}/${se}/${q}`,{token:Y}=await this.identityApi.getCredentials();return new Promise((ue,le)=>{const P=new n.EventSourcePolyfill(Q,{withCredentials:!0,headers:Y?{Authorization:`Bearer ${Y}`}:{}});P.addEventListener("log",R=>{R.data&&B(JSON.parse(R.data))}),P.addEventListener("finish",R=>{let D=!1;R.data&&({updated:D}=JSON.parse(R.data)),ue(D?"updated":"cached")}),P.onerror=R=>{switch(P.close(),R.status){case 404:le(new h.dR(R.message));return;default:le(new Error(R.data));return}}})}async getBaseUrl(l,B,se){const{kind:X,namespace:q,name:F}=B,Y=`${await this.getApiOrigin()}/static/docs/${q}/${X}/${F}/${se}`;return new URL(l,Y.endsWith("/")?Y:`${Y}/`).toString()}constructor(l){this.configApi=l.configApi,this.discoveryApi=l.discoveryApi,this.identityApi=l.identityApi,this.fetchApi=l.fetchApi}}},51953:function(bt,Oe,t){"use strict";t.d(Oe,{D:function(){return h}});function h(n,v){return v.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?n:n.toLocaleLowerCase("en-US")}},3482:function(bt,Oe,t){"use strict";t.d(Oe,{u:function(){return B}});var h=t(52322),n=t(2784),v=t(71399),I=t(46285),W=t(42081),S=t(48431),l=t(68435);const B=se=>{const{initialFilter:X="owned",columns:q,actions:F}=se;return(0,h.jsx)(W.j,{children:(0,h.jsxs)(v.VY,{children:[(0,h.jsx)(v.yW,{title:"",children:(0,h.jsx)(v.qt,{children:"Discover documentation in your ecosystem."})}),(0,h.jsx)(I.UO,{children:(0,h.jsxs)(I._i,{children:[(0,h.jsxs)(I._i.Filters,{children:[(0,h.jsx)(S.f,{}),(0,h.jsx)(I.EW,{initialFilter:X}),(0,h.jsx)(I.dq,{}),(0,h.jsx)(I.xE,{})]}),(0,h.jsx)(I._i.Content,{children:(0,h.jsx)(l.n,{actions:F,columns:q})})]})})]})})}},85478:function(bt,Oe,t){"use strict";t.d(Oe,{f:function(){return q}});var h=t(52322),n=t(95573),v=t(51953),I=t(25248),W=t(71399),S=t(94339),l=t(16111),B=t(24579),se=t(14503),X=t(2784);const q=Y=>{const{entities:ue}=Y,le=(0,I.tg)(n.Fw),P=(0,I.h_)(I.Ds);if(!ue)return null;var R,D;return(0,h.jsx)(W.Oh,{"data-testid":"docs-explore",children:ue!=null&&ue.length?ue.map((L,T)=>(0,h.jsxs)(S.Z,{children:[(0,h.jsx)(l.Z,{children:(0,h.jsx)(W.hu,{title:(R=L.metadata.title)!==null&&R!==void 0?R:L.metadata.name})}),(0,h.jsx)(B.Z,{children:L.metadata.description}),(0,h.jsx)(se.Z,{children:(0,h.jsx)(W.zx,{to:le({namespace:(0,v.D)((D=L.metadata.namespace)!==null&&D!==void 0?D:"default",P),kind:(0,v.D)(L.kind,P),name:(0,v.D)(L.metadata.name,P)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},T)):null})};var F=t(46285);const Q=()=>{const{loading:Y,error:ue,entities:le}=useEntityList();if(ue)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:ue.toString()})});if(Y||!le)return _jsx(Progress,{});var P,R;return le.sort((D,L)=>((P=D.metadata.title)!==null&&P!==void 0?P:D.metadata.name).localeCompare((R=L.metadata.title)!==null&&R!==void 0?R:L.metadata.name)),_jsx(DocsCardGrid,{entities:le})}},68435:function(bt,Oe,t){"use strict";t.d(Oe,{H:function(){return D},n:function(){return L}});var h=t(52322),n=t(2784),v=t(95074),I=t(76635),W=t(71399),S=t(46285),l=t(25248),B=t(25271),se=t(95573),X=t(39981),q=t(2337),F=t(11640),Q=t(28347);const Y=(0,q.Z)({root:{color:"#f3ba37"}})(F.Z),ue={createCopyDocsUrlAction(T){return re=>({icon:()=>(0,h.jsx)(X.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>T(`${window.location.origin}${re.resolved.docsUrl}`)})},createStarEntityAction(T,re){return({entity:xe})=>{const Ke=T(xe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ke?(0,h.jsx)(Y,{}):(0,h.jsx)(Q.Z,{}),tooltip:Ke?"Remove from favorites":"Add to favorites",onClick:()=>re(xe)}}}};function le(T){return T.metadata.title||T.metadata.name}const P={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:T=>(0,h.jsx)(W.uw,{value:(0,h.jsx)(W.rU,{to:T.resolved.docsUrl,children:le(T.entity)}),subvalue:T.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,h.jsx)(S.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var R=t(51953);const D=T=>{const{entities:re,title:xe,loading:Ke,columns:Ye,actions:He}=T,[,We]=(0,v.Z)(),Ge=(0,l.tg)(se.Fw),Ne=(0,l.h_)(l.Ds);if(!re)return null;const Me=re.map(it=>{const rt=(0,S.hF)(it,B.S4);var Ae;return{entity:it,resolved:{docsUrl:Ge({namespace:(0,R.D)((Ae=it.metadata.namespace)!==null&&Ae!==void 0?Ae:"default",Ne),kind:(0,R.D)(it.kind,Ne),name:(0,R.D)(it.metadata.name,Ne)}),ownedByRelations:rt,ownedByRelationsTitle:rt.map(tt=>(0,S.$3)(tt,{defaultKind:"group"})).join(", ")}}}),qe=[P.createNameColumn(),P.createOwnerColumn(),P.createTypeColumn()],ct=[ue.createCopyDocsUrlAction(We)];return(0,h.jsx)(h.Fragment,{children:Ke||Me&&Me.length>0?(0,h.jsx)(W.iA,{isLoading:Ke,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1},data:Me,columns:Ye||qe,actions:He||ct,title:xe?`${xe} (${Me.length})`:`All (${Me.length})`}):(0,h.jsx)(W.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,h.jsx)(W.zx,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};D.columns=P,D.actions=ue;const L=T=>{var re;const{columns:xe,actions:Ke}=T,{loading:Ye,error:He,entities:We,filters:Ge}=(0,S.wp)(),{isStarredEntity:Ne,toggleStarredEntity:Me}=(0,S.CR)(),[,qe]=(0,v.Z)();var ct;const it=(0,I.capitalize)((ct=(re=Ge.user)===null||re===void 0?void 0:re.value)!==null&&ct!==void 0?ct:"all"),rt=[ue.createCopyDocsUrlAction(qe),ue.createStarEntityAction(Ne,Me)];return He?(0,h.jsx)(W.GB,{severity:"error",title:"Could not load available documentation.",children:(0,h.jsx)(W.Oi,{language:"text",text:He.toString()})}):(0,h.jsx)(D,{title:it,entities:We,loading:Ye,actions:Ke||rt,columns:xe})};L.columns=P,L.actions=ue},18662:function(bt,Oe,t){"use strict";t.r(Oe),t.d(Oe,{TechDocsIndexPage:function(){return W}});var h=t(52322),n=t(2784),v=t(10289),I=t(3482);const W=S=>(0,v.pC)()||(0,h.jsx)(I.u,{...S})},42081:function(bt,Oe,t){"use strict";t.d(Oe,{j:function(){return W}});var h=t(52322),n=t(2784),v=t(71399),I=t(25248);const W=S=>{const{children:l}=S,B=(0,I.h_)(I.Ds);var se;const X=`Documentation available in ${(se=B.getOptionalString("organization.name"))!==null&&se!==void 0?se:"Backstage"}`;return(0,h.jsx)(v.g9,{title:"Documentation",subtitle:X,themeId:"documentation",children:l})}},48431:function(bt,Oe,t){"use strict";t.d(Oe,{f:function(){return I}});var h=t(2784),n=t(46285);class v{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":n.n3}}}const I=()=>{const{updateFilters:W}=(0,n.wp)();return(0,h.useEffect)(()=>{W({techdocs:new v})},[W]),null}},89258:function(bt,Oe,t){"use strict";t.d(Oe,{I6:function(){return X},Jl:function(){return se},s4:function(){return W}});var h=t(61886),n=t(92077),v=t(95573),I=t(25248);const W=(0,I.rx)({id:"techdocs",apis:[(0,I.ni)({api:h.Dl,deps:{configApi:I.Ds,discoveryApi:I.NW,identityApi:I.$4,fetchApi:I.gP},factory:({configApi:q,discoveryApi:F,identityApi:Q,fetchApi:Y})=>new n.k({configApi:q,discoveryApi:F,identityApi:Q,fetchApi:Y})}),(0,I.ni)({api:h.gT,deps:{configApi:I.Ds,discoveryApi:I.NW,fetchApi:I.gP},factory:({configApi:q,discoveryApi:F,fetchApi:Q})=>new n.p({configApi:q,discoveryApi:F,fetchApi:Q})})],routes:{root:v._Z,docRoot:v.Fw,entityContent:v.pd}}),S=W.provide((0,I.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(t.bind(t,52943)).then(q=>q.Router),mountPoint:v._Z})),l=W.provide((0,I.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(t.bind(t,52943)).then(q=>q.EmbeddedDocsRouter),mountPoint:v.pd})),B=W.provide((0,I.P4)({name:"TechDocsCustomHome",component:()=>t.e(7560).then(t.bind(t,27560)).then(q=>q.TechDocsCustomHome),mountPoint:v._Z})),se=W.provide((0,I.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(t.bind(t,18662)).then(q=>q.TechDocsIndexPage),mountPoint:v._Z})),X=W.provide((0,I.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(t.bind(t,7476)).then(q=>q.TechDocsReaderPage),mountPoint:v.Fw}))},7476:function(bt,Oe,t){"use strict";t.r(Oe),t.d(Oe,{TechDocsReaderLayout:function(){return q},TechDocsReaderPage:function(){return F}});var h=t(52322),n=t(2784),v=t(10289),I=t(71399),W=t(61886),S=t(67896),l=t(93225),B=t(65124),se=t(95573),X=t(25248);const q=({withSearch:Q,withHeader:Y=!0})=>(0,h.jsxs)(I.T3,{themeId:"documentation",children:[Y&&(0,h.jsx)(l.S,{}),(0,h.jsx)(B.b,{}),(0,h.jsx)(S.F,{withSearch:Q})]}),F=Q=>{const{kind:Y,name:ue,namespace:le}=(0,X.Oi)(se.Fw),{children:P,entityRef:R={kind:Y,name:ue,namespace:le}}=Q,D=(0,v.pC)();if(!P){const T=(D?n.Children.toArray(D.props.children):[]).find(re=>{var xe;if((0,X.IY)(re,W.Zz))return!1;const Ke=re==null||(xe=re.props)===null||xe===void 0?void 0:xe.children;return Ke?!n.Children.toArray(Ke).some(Ye=>(0,X.IY)(Ye,W.Zz)):!0});return(0,h.jsx)(W.ZS,{entityRef:R,children:T||(0,h.jsx)(q,{})})}return(0,h.jsx)(W.ZS,{entityRef:R,children:({metadata:L,entityMetadata:T,onReady:re})=>(0,h.jsx)("div",{className:"techdocs-reader-page",children:(0,h.jsx)(I.T3,{themeId:"documentation",children:P instanceof Function?P({entityRef:R,techdocsMetadataValue:L.value,entityMetadataValue:T.value,onReady:re}):P})})})}},67896:function(bt,Oe,t){"use strict";t.d(Oe,{F:function(){return ht}});var h=t(52322),n=t(2784),v=t(79692),I=t(60905),W=t(61886),S=t(71399),l=t(17339),B=t(4614),se=t(77277),X=t(99688),q=t(12420),F=t(90436),Q=t(61837),Y=t(4190),ue=t(87685);const le=(0,v.Z)(j=>(0,q.Z)({paper:{width:"100%",[j.breakpoints.up("sm")]:{width:"75%"},[j.breakpoints.up("md")]:{width:"50%"},padding:j.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:j.palette.background.default}})),P=({buildLog:j,onClose:U})=>{const ne=le(),de=j.length===0?"Waiting for logs...":j.join(`
|
|
32
|
-
`);return(0,h.jsxs)(I.Z,{container:!0,direction:"column",className:ne.root,spacing:0,wrap:"nowrap",children:[(0,h.jsxs)(I.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,h.jsx)(F.Z,{variant:"h5",children:"Build Details"}),(0,h.jsx)(Q.Z,{title:"Close the drawer",onClick:U,color:"inherit",children:(0,h.jsx)(ue.Z,{})},"dismiss")]}),(0,h.jsx)(S.nU,{text:de,classes:{root:ne.logs}})]})},R=({buildLog:j})=>{const U=le(),[ne,de]=(0,n.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(se.Z,{color:"inherit",onClick:()=>de(!0),children:"Show Build Logs"}),(0,h.jsx)(Y.ZP,{classes:{paper:U.paper},anchor:"right",open:ne,onClose:()=>de(!1),children:(0,h.jsx)(P,{buildLog:j,onClose:()=>de(!1)})})]})};var D=t(25248);const L=({errorMessage:j})=>{const U=(0,D.h_)(D.Ds).getOptionalString("techdocs.builder");let ne="";return U!=="local"&&(ne="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,h.jsx)(S.mf,{status:"404",statusMessage:j||"Documentation not found",additionalInfo:ne})};var T=t(95481);const re=(0,v.Z)(j=>({root:{marginBottom:j.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),xe=()=>{let j=null;const U=re(),{state:ne,contentReload:de,contentErrorMessage:je,syncErrorMessage:Se,buildLog:Qe}=(0,T.DK)();return ne==="INITIAL_BUILD"&&(j=(0,h.jsx)(X.Z,{classes:{root:U.root},variant:"outlined",severity:"info",icon:(0,h.jsx)(B.Z,{size:"24px"}),action:(0,h.jsx)(R,{buildLog:Qe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),ne==="CONTENT_STALE_REFRESHING"&&(j=(0,h.jsx)(X.Z,{variant:"outlined",severity:"info",icon:(0,h.jsx)(B.Z,{size:"24px"}),action:(0,h.jsx)(R,{buildLog:Qe}),classes:{root:U.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),ne==="CONTENT_STALE_READY"&&(j=(0,h.jsx)(X.Z,{variant:"outlined",severity:"success",action:(0,h.jsx)(se.Z,{color:"inherit",onClick:()=>de(),children:"Refresh"}),classes:{root:U.root},children:"A newer version of this documentation is now available, please refresh to view."})),ne==="CONTENT_STALE_ERROR"&&(j=(0,h.jsxs)(X.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(R,{buildLog:Qe}),classes:{root:U.root,message:U.message},children:["Building a newer version of this documentation failed."," ",Se]})),ne==="CONTENT_NOT_FOUND"&&(j=(0,h.jsxs)(h.Fragment,{children:[Se&&(0,h.jsxs)(X.Z,{variant:"outlined",severity:"error",action:(0,h.jsx)(R,{buildLog:Qe}),classes:{root:U.root,message:U.message},children:["Building a newer version of this documentation failed."," ",Se]}),(0,h.jsx)(L,{errorMessage:je})]})),j};var Ke=t(10289),Ye=t(60364),He=t(41156),We=t(32838),Ge=t(35368),Ne=t.n(Ge);const Me=/main\.[A-Fa-f0-9]{8}\.min\.css$/,qe=/^https:\/\/fonts\.googleapis\.com/,ct=/^https:\/\/fonts\.gstatic\.com/,it=j=>j.nodeName==="LINK",rt=j=>{const U=(j==null?void 0:j.getAttribute("href"))||"",ne=U.match(Me),de=U.match(qe),je=U.match(ct);return ne||de||je},Ae=j=>(it(j)&&!rt(j)&&j.remove(),j),tt=j=>j.nodeName==="IFRAME",mt=(j,U)=>{const ne=j.getAttribute("src")||"";try{const{host:de}=new URL(ne);return U.includes(de)}catch{return!1}},Le=j=>U=>(tt(U)&&!mt(U,j)&&U.remove(),U),ae=()=>{const j=(0,D.h_)(D.Ds);return(0,n.useMemo)(()=>j.getOptionalConfig("techdocs.sanitizer"),[j])},Ce=()=>{const j=ae();return(0,n.useCallback)(async U=>{const ne=j==null?void 0:j.getOptionalStringArray("allowedIframeHosts");Ne().addHook("beforeSanitizeElements",Ae);const de=["link"];return ne&&(de.push("iframe"),Ne().addHook("beforeSanitizeElements",Le(ne))),Ne().sanitize(U.innerHTML,{ADD_TAGS:de,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[j])};var Ie=t(41128),nt=({theme:j})=>`
|
|
33
|
-
/*================== Variables ==================*/
|
|
34
|
-
/*
|
|
35
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
36
|
-
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
:host {
|
|
40
|
-
/* FONT */
|
|
41
|
-
--md-default-fg-color: ${j.palette.text.primary};
|
|
42
|
-
--md-default-fg-color--light: ${j.palette.text.secondary};
|
|
43
|
-
--md-default-fg-color--lighter: ${(0,Ie.$n)(j.palette.text.secondary,.7)};
|
|
44
|
-
--md-default-fg-color--lightest: ${(0,Ie.$n)(j.palette.text.secondary,.3)};
|
|
45
|
-
|
|
46
|
-
/* BACKGROUND */
|
|
47
|
-
--md-default-bg-color:${j.palette.background.default};
|
|
48
|
-
--md-default-bg-color--light: ${j.palette.background.paper};
|
|
49
|
-
--md-default-bg-color--lighter: ${(0,Ie.$n)(j.palette.background.paper,.7)};
|
|
50
|
-
--md-default-bg-color--lightest: ${(0,Ie.$n)(j.palette.background.paper,.3)};
|
|
51
|
-
|
|
52
|
-
/* PRIMARY */
|
|
53
|
-
--md-primary-fg-color: ${j.palette.primary.main};
|
|
54
|
-
--md-primary-fg-color--light: ${j.palette.primary.light};
|
|
55
|
-
--md-primary-fg-color--dark: ${j.palette.primary.dark};
|
|
56
|
-
--md-primary-bg-color: ${j.palette.primary.contrastText};
|
|
57
|
-
--md-primary-bg-color--light: ${(0,Ie.$n)(j.palette.primary.contrastText,.7)};
|
|
58
|
-
|
|
59
|
-
/* ACCENT */
|
|
60
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
61
|
-
|
|
62
|
-
/* SHADOW */
|
|
63
|
-
--md-shadow-z1: ${j.shadows[1]};
|
|
64
|
-
--md-shadow-z2: ${j.shadows[2]};
|
|
65
|
-
--md-shadow-z3: ${j.shadows[3]};
|
|
66
|
-
|
|
67
|
-
/* EXTENSIONS */
|
|
68
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
69
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
70
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
71
|
-
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
72
|
-
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
73
|
-
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
74
|
-
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
75
|
-
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
76
|
-
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
77
|
-
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
78
|
-
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
79
|
-
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
80
|
-
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
81
|
-
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
82
|
-
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
83
|
-
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
84
|
-
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
85
|
-
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
86
|
-
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
87
|
-
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
88
|
-
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
89
|
-
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
90
|
-
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
91
|
-
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
92
|
-
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
93
|
-
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
94
|
-
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
95
|
-
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
96
|
-
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host > * {
|
|
100
|
-
/* CODE */
|
|
101
|
-
--md-code-fg-color: ${j.palette.text.primary};
|
|
102
|
-
--md-code-bg-color: ${j.palette.background.paper};
|
|
103
|
-
--md-code-hl-color: ${(0,Ie.Fq)(j.palette.warning.main,.5)};
|
|
104
|
-
--md-code-hl-keyword-color: ${j.palette.type==="dark"?j.palette.primary.light:j.palette.primary.dark};
|
|
105
|
-
--md-code-hl-function-color: ${j.palette.type==="dark"?j.palette.secondary.light:j.palette.secondary.dark};
|
|
106
|
-
--md-code-hl-string-color: ${j.palette.type==="dark"?j.palette.success.light:j.palette.success.dark};
|
|
107
|
-
--md-code-hl-number-color: ${j.palette.type==="dark"?j.palette.error.light:j.palette.error.dark};
|
|
108
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
109
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
110
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
111
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
112
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
113
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
114
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
115
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
116
|
-
|
|
117
|
-
/* TYPESET */
|
|
118
|
-
--md-typeset-font-size: 1rem;
|
|
119
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
120
|
-
--md-typeset-a-color: var(--md-accent-fg-color);
|
|
121
|
-
--md-typeset-table-color: ${j.palette.text.primary};
|
|
122
|
-
--md-typeset-del-color: ${j.palette.type==="dark"?(0,Ie.Fq)(j.palette.error.dark,.5):(0,Ie.Fq)(j.palette.error.light,.5)};
|
|
123
|
-
--md-typeset-ins-color: ${j.palette.type==="dark"?(0,Ie.Fq)(j.palette.success.dark,.5):(0,Ie.Fq)(j.palette.success.light,.5)};
|
|
124
|
-
--md-typeset-mark-color: ${j.palette.type==="dark"?(0,Ie.Fq)(j.palette.warning.dark,.5):(0,Ie.Fq)(j.palette.warning.light,.5)};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@media screen and (max-width: 76.1875em) {
|
|
128
|
-
:host > * {
|
|
129
|
-
/* TYPESET */
|
|
130
|
-
--md-typeset-font-size: .9rem;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@media screen and (max-width: 600px) {
|
|
135
|
-
:host > * {
|
|
136
|
-
/* TYPESET */
|
|
137
|
-
--md-typeset-font-size: .7rem;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
`,gt=({theme:j})=>`
|
|
141
|
-
/*================== Reset ==================*/
|
|
142
|
-
|
|
143
|
-
body {
|
|
144
|
-
--md-text-color: var(--md-default-fg-color);
|
|
145
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
146
|
-
--md-text-font-family: ${j.typography.fontFamily};
|
|
147
|
-
font-family: var(--md-text-font-family);
|
|
148
|
-
background-color: unset;
|
|
149
|
-
}
|
|
150
|
-
`;const Tt="224px";var at=({theme:j,sidebar:U})=>`
|
|
151
|
-
/*================== Layout ==================*/
|
|
152
|
-
|
|
153
|
-
.md-grid {
|
|
154
|
-
max-width: 100%;
|
|
155
|
-
margin: 0;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.md-nav {
|
|
159
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
160
|
-
}
|
|
161
|
-
.md-nav__link {
|
|
162
|
-
display: flex;
|
|
163
|
-
align-items: center;
|
|
164
|
-
justify-content: space-between;
|
|
165
|
-
}
|
|
166
|
-
.md-nav__icon {
|
|
167
|
-
height: 20px !important;
|
|
168
|
-
width: 20px !important;
|
|
169
|
-
margin-left:${j.spacing(1)}px;
|
|
170
|
-
}
|
|
171
|
-
.md-nav__icon svg {
|
|
172
|
-
margin: 0;
|
|
173
|
-
width: 20px !important;
|
|
174
|
-
height: 20px !important;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon:after {
|
|
177
|
-
width: 20px !important;
|
|
178
|
-
height: 20px !important;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
182
|
-
text-decoration: underline;
|
|
183
|
-
color: var(--md-typeset-a-color);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.md-main__inner {
|
|
187
|
-
margin-top: 0;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.md-sidebar {
|
|
191
|
-
bottom: 75px;
|
|
192
|
-
position: fixed;
|
|
193
|
-
width: 16rem;
|
|
194
|
-
overflow-y: auto;
|
|
195
|
-
overflow-x: hidden;
|
|
196
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
197
|
-
scrollbar-width: thin;
|
|
198
|
-
}
|
|
199
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
200
|
-
width: calc(12.1rem);
|
|
201
|
-
}
|
|
202
|
-
.md-sidebar--secondary {
|
|
203
|
-
right: ${j.spacing(3)}px;
|
|
204
|
-
}
|
|
205
|
-
.md-sidebar::-webkit-scrollbar {
|
|
206
|
-
width: 5px;
|
|
207
|
-
}
|
|
208
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
209
|
-
width: 5px;
|
|
210
|
-
height: 5px;
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
213
|
-
background: #eee;
|
|
214
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
215
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
216
|
-
border-radius: 3px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
219
|
-
width: 5px;
|
|
220
|
-
background: rgb(193, 193, 193);
|
|
221
|
-
border: transparent;
|
|
222
|
-
border-radius: 3px;
|
|
223
|
-
}
|
|
224
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
225
|
-
background: rgb(125, 125, 125);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.md-content {
|
|
229
|
-
max-width: calc(100% - 16rem * 2);
|
|
230
|
-
margin-left: 16rem;
|
|
231
|
-
margin-bottom: 50px;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.md-footer {
|
|
235
|
-
position: fixed;
|
|
236
|
-
bottom: 0px;
|
|
237
|
-
}
|
|
238
|
-
.md-footer__title {
|
|
239
|
-
background-color: unset;
|
|
240
|
-
}
|
|
241
|
-
.md-footer-nav__link {
|
|
242
|
-
width: 16rem;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.md-dialog {
|
|
246
|
-
background-color: unset;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
@media screen and (min-width: 76.25em) {
|
|
250
|
-
.md-sidebar {
|
|
251
|
-
height: auto;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
@media screen and (max-width: 76.1875em) {
|
|
256
|
-
.md-nav {
|
|
257
|
-
transition: none !important;
|
|
258
|
-
background-color: var(--md-default-bg-color)
|
|
259
|
-
}
|
|
260
|
-
.md-nav--primary .md-nav__title {
|
|
261
|
-
cursor: auto;
|
|
262
|
-
color: var(--md-default-fg-color);
|
|
263
|
-
font-weight: 700;
|
|
264
|
-
white-space: normal;
|
|
265
|
-
line-height: 1rem;
|
|
266
|
-
height: auto;
|
|
267
|
-
display: flex;
|
|
268
|
-
flex-flow: column;
|
|
269
|
-
row-gap: 1.6rem;
|
|
270
|
-
padding: 1.2rem .8rem .8rem;
|
|
271
|
-
background-color: var(--md-default-bg-color);
|
|
272
|
-
}
|
|
273
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
274
|
-
box-shadow: none;
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
277
|
-
border-top: none;
|
|
278
|
-
}
|
|
279
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
280
|
-
display: none;
|
|
281
|
-
}
|
|
282
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
283
|
-
color: var(--md-default-fg-color);
|
|
284
|
-
position: static;
|
|
285
|
-
height: auto;
|
|
286
|
-
margin: 0 0 0 -0.2rem;
|
|
287
|
-
}
|
|
288
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
289
|
-
padding-top: 0;
|
|
290
|
-
}
|
|
291
|
-
.md-nav--primary .md-nav__item {
|
|
292
|
-
border-top: none;
|
|
293
|
-
}
|
|
294
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
295
|
-
font-size : var(--md-typeset-font-size);
|
|
296
|
-
}
|
|
297
|
-
.md-nav .md-source {
|
|
298
|
-
display: none;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.md-sidebar {
|
|
302
|
-
height: 100%;
|
|
303
|
-
}
|
|
304
|
-
.md-sidebar--primary {
|
|
305
|
-
width: 12.1rem !important;
|
|
306
|
-
z-index: 200;
|
|
307
|
-
left: ${U.isPinned?`calc(-12.1rem + ${Tt})`:"calc(-12.1rem + 72px)"} !important;
|
|
308
|
-
}
|
|
309
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
310
|
-
display: none;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.md-content {
|
|
314
|
-
max-width: 100%;
|
|
315
|
-
margin-left: 0;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.md-header__button {
|
|
319
|
-
margin: 0.4rem 0;
|
|
320
|
-
margin-left: 0.4rem;
|
|
321
|
-
padding: 0;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.md-overlay {
|
|
325
|
-
left: 0;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.md-footer {
|
|
329
|
-
position: static;
|
|
330
|
-
padding-left: 0;
|
|
331
|
-
}
|
|
332
|
-
.md-footer-nav__link {
|
|
333
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
334
|
-
width: 50%;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
@media screen and (max-width: 600px) {
|
|
339
|
-
.md-sidebar--primary {
|
|
340
|
-
left: -12.1rem !important;
|
|
341
|
-
width: 12.1rem;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
`;const St=["h1","h2","h3","h4","h5","h6"];var wt=({theme:j})=>`
|
|
345
|
-
/*================== Typeset ==================*/
|
|
346
|
-
|
|
347
|
-
.md-typeset {
|
|
348
|
-
font-size: var(--md-typeset-font-size);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
${St.reduce((U,ne)=>{var de;const je=(de=j.typography.htmlFontSize)!==null&&de!==void 0?de:16,Se=j.typography[ne],{lineHeight:Qe,fontFamily:pt,fontWeight:Xe,fontSize:dt}=Se,Dt=It=>{let Wt=1;return typeof It=="number"&&(Wt=It/je*.6),typeof It=="string"&&(Wt=It.replace("rem","")),`calc(${Wt} * var(--md-typeset-font-size))`};return U.concat(`
|
|
352
|
-
.md-typeset ${ne} {
|
|
353
|
-
color: var(--md-default-fg-color);
|
|
354
|
-
line-height: ${Qe};
|
|
355
|
-
font-family: ${pt};
|
|
356
|
-
font-weight: ${Xe};
|
|
357
|
-
font-size: ${Dt(dt)};
|
|
358
|
-
}
|
|
359
|
-
`)},"")}
|
|
360
|
-
|
|
361
|
-
.md-typeset .md-content__button {
|
|
362
|
-
color: var(--md-default-fg-color);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.md-typeset hr {
|
|
366
|
-
border-bottom: 0.05rem dotted ${j.palette.divider};
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.md-typeset details {
|
|
370
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
371
|
-
}
|
|
372
|
-
.md-typeset details summary {
|
|
373
|
-
padding-left: 2.5rem !important;
|
|
374
|
-
}
|
|
375
|
-
.md-typeset details summary:before,
|
|
376
|
-
.md-typeset details summary:after {
|
|
377
|
-
top: 50% !important;
|
|
378
|
-
width: 20px !important;
|
|
379
|
-
height: 20px !important;
|
|
380
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
381
|
-
}
|
|
382
|
-
.md-typeset details[open] > summary:after {
|
|
383
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.md-typeset blockquote {
|
|
387
|
-
color: var(--md-default-fg-color--light);
|
|
388
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.md-typeset table:not([class]) {
|
|
392
|
-
font-size: var(--md-typeset-font-size);
|
|
393
|
-
border: 1px solid var(--md-default-fg-color);
|
|
394
|
-
border-bottom: none;
|
|
395
|
-
border-collapse: collapse;
|
|
396
|
-
}
|
|
397
|
-
.md-typeset table:not([class]) th {
|
|
398
|
-
font-weight: bold;
|
|
399
|
-
}
|
|
400
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
401
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
405
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
406
|
-
}
|
|
407
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
408
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
409
|
-
}
|
|
410
|
-
`,Lt=()=>`
|
|
411
|
-
/*================== Animations ==================*/
|
|
412
|
-
/*
|
|
413
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
414
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
415
|
-
*/
|
|
416
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
417
|
-
transition: none;
|
|
418
|
-
}
|
|
419
|
-
`,Bt=({theme:j})=>`
|
|
420
|
-
/*================== Extensions ==================*/
|
|
421
|
-
|
|
422
|
-
/* HIGHLIGHT */
|
|
423
|
-
.highlight .md-clipboard:after {
|
|
424
|
-
content: unset;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.highlight .nx {
|
|
428
|
-
color: ${j.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/* CODE HILITE */
|
|
432
|
-
.codehilite .gd {
|
|
433
|
-
background-color: ${j.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.codehilite .gi {
|
|
437
|
-
background-color: ${j.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/* TABBED */
|
|
441
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
442
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
443
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
444
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
445
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
446
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
447
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
448
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
449
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
450
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
451
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
452
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
453
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
454
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
455
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
456
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
457
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
458
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
459
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
460
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
461
|
-
color: var(--md-accent-fg-color);
|
|
462
|
-
border-color: var(--md-accent-fg-color);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/* TASK-LIST */
|
|
466
|
-
.task-list-control .task-list-indicator::before {
|
|
467
|
-
background-color: ${j.palette.action.disabledBackground};
|
|
468
|
-
}
|
|
469
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
470
|
-
background-color: ${j.palette.success.main};
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/* ADMONITION */
|
|
474
|
-
.admonition {
|
|
475
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
476
|
-
}
|
|
477
|
-
.admonition .admonition-title {
|
|
478
|
-
padding-left: 2.5rem !important;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.admonition .admonition-title:before {
|
|
482
|
-
top: 50% !important;
|
|
483
|
-
width: 20px !important;
|
|
484
|
-
height: 20px !important;
|
|
485
|
-
transform: translateY(-50%) !important;
|
|
486
|
-
}
|
|
487
|
-
`;const jt=[nt,gt,at,wt,Lt,Bt],Ut=()=>(0,S.Pf)(),Zt=()=>{const j=Ut(),U=(0,Ye.Z)();return(0,n.useMemo)(()=>{const ne={theme:U,sidebar:j};return jt.reduce((de,je)=>de+je(ne),"")},[U,j])},en=()=>{const j=Zt();return(0,n.useCallback)(U=>(U.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${j}</style>`),U),[j])},rn=(j,U,ne)=>{const de=j==="src"&&U.endsWith(".svg"),je=!U.match(/^([a-z]*:)?\/\//i),Se=U.startsWith(ne);return de&&(je||Se)},wn=({techdocsStorageApi:j,entityId:U,path:ne})=>async de=>{const je=await j.getApiOrigin(),Se=async(Qe,pt)=>{for(const Xe of Qe)if(Xe.hasAttribute(pt)){const dt=Xe.getAttribute(pt);if(!dt)return;const Dt=await j.getBaseUrl(dt,U,ne);if(rn(pt,dt,je))try{const Wt=await(await fetch(Dt,{credentials:"include"})).text();Xe.setAttribute(pt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Wt)))}`)}catch{Xe.setAttribute("alt",`Error: ${dt}`)}else Xe.setAttribute(pt,Dt)}};return await Promise.all([Se(de.querySelectorAll("img"),"src"),Se(de.querySelectorAll("script"),"src"),Se(de.querySelectorAll("source"),"src"),Se(de.querySelectorAll("link"),"href"),Se(de.querySelectorAll("a[download]"),"href")]),de};var un=t(39619),kn=t(67097),sn=t(28316),Vn=t(82717),Mt=t.n(Vn);const Rn=j=>U=>{var ne;const de=U.querySelector('[title="Edit this page"]');if(!de||!de.href)return U;const je=new URL(de.href),Se=j.byUrl(je);if((Se==null?void 0:Se.type)!=="github"&&(Se==null?void 0:Se.type)!=="gitlab")return U;const Qe=((ne=U.querySelector("article>h1"))===null||ne===void 0?void 0:ne.childNodes[0].textContent)||"",pt=encodeURIComponent(`Documentation Feedback: ${Qe}`),Xe=encodeURIComponent(`Page source:
|
|
488
|
-
${de.href}
|
|
489
|
-
|
|
490
|
-
Feedback:`),dt=(Se==null?void 0:Se.type)==="github"?(0,un.Pb)(je.href,"blob"):je.href,Dt=Mt()(dt),It=`/${Dt.organization}/${Dt.name}`,Wt=de.cloneNode();switch(Se==null?void 0:Se.type){case"gitlab":Wt.href=`${je.origin}${It}/issues/new?issue[title]=${pt}&issue[description]=${Xe}`;break;case"github":Wt.href=`${je.origin}${It}/issues/new?title=${pt}&body=${Xe}`;break;default:return U}return sn.render(n.createElement(kn.Z),Wt),Wt.style.paddingLeft="5px",Wt.title="Leave feedback for this page",Wt.id="git-feedback-link",de==null||de.insertAdjacentElement("beforebegin",Wt),U};var Cn=t(44882);const on=()=>j=>{const U=j.querySelector('.md-header label[for="__drawer"]'),ne=j.querySelector("article");if(!U||!ne)return j;const de=U.cloneNode();return sn.render(n.createElement(Cn.Z),de),de.id="toggle-sidebar",de.title="Toggle Sidebar",de.classList.add("md-content__button"),de.style.setProperty("padding","0 0 0 5px"),de.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ne==null||ne.prepend(de),j},an=()=>j=>(((ne,de)=>{Array.from(ne).filter(je=>je.hasAttribute(de)).forEach(je=>{const Se=je.getAttribute(de);if(Se){Se.match(/^https?:\/\//i)&&je.setAttribute("target","_blank");try{const Qe=tn(window.location.href);je.setAttribute(de,new URL(Se,Qe).toString())}catch{je.replaceWith(je.textContent||Se)}}})})(Array.from(j.getElementsByTagName("a")),"href"),j);function tn(j){const U=new URL(j);return!U.pathname.endsWith("/")&&!U.pathname.endsWith(".html")&&(U.pathname+="/"),U.toString()}const ln=({baseUrl:j,onClick:U})=>ne=>(Array.from(ne.getElementsByTagName("a")).forEach(de=>{de.addEventListener("click",je=>{const Qe=de.getAttribute("href");!Qe||Qe.startsWith(j)&&!de.hasAttribute("download")&&(je.preventDefault(),U(je,Qe))})}),ne);var fn=t(15459),nn=t(80030),he=t(72379),te=t(41547);const Te=(0,fn.Z)(j=>({tooltip:{fontSize:"inherit",color:j.palette.text.primary,margin:0,padding:j.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(nn.ZP),ke=()=>(0,h.jsx)(he.Z,{children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),Je=({text:j})=>{const[U,ne]=(0,n.useState)(!1),de=(0,n.useCallback)(()=>{navigator.clipboard.writeText(j),ne(!0)},[j]),je=(0,n.useCallback)(()=>{ne(!1)},[ne]);return(0,h.jsx)(Te,{title:"Copied to clipboard",placement:"left",open:U,onClose:je,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:de,children:(0,h.jsx)(ke,{})})})},J=j=>U=>{const ne=U.querySelectorAll("pre > code");for(const je of ne){var de;const Se=je.textContent||"",Qe=document.createElement("div");je==null||(de=je.parentElement)===null||de===void 0||de.prepend(Qe),sn.render((0,h.jsx)(te.Z,{theme:j,children:(0,h.jsx)(Je,{text:Se})}),Qe)}return U},y=()=>j=>{var U;return(U=j.querySelector(".md-header"))===null||U===void 0||U.remove(),j},g=()=>j=>{var U,ne;return(U=j.querySelector(".md-footer .md-copyright"))===null||U===void 0||U.remove(),(ne=j.querySelector(".md-footer-copyright"))===null||ne===void 0||ne.remove(),j},k=({onLoading:j,onLoaded:U})=>ne=>(j(),ne.addEventListener(W.Ox,function de(){U(),ne.removeEventListener(W.Ox,de)}),ne),G=()=>j=>(setTimeout(()=>{if(window.location.hash){var U;const ne=window.location.hash.slice(1);(U=j==null?void 0:j.querySelector(`[id="${ne}"]`))===null||U===void 0||U.scrollIntoView()}},200),j),ce=()=>j=>(setTimeout(()=>{const U=j==null?void 0:j.querySelectorAll("li.md-nav__item--active");U.length!==0&&(U.forEach(de=>{const je=de==null?void 0:de.querySelector("input");je!=null&&je.checked||je==null||je.click()}),U[U.length-1].scrollIntoView())},200),j),ge=async(j,U)=>{let ne;if(typeof j=="string")ne=new DOMParser().parseFromString(j,"text/html").documentElement;else if(j instanceof Element)ne=j;else throw new Error("dom is not a recognized type");for(const de of U)ne=await de(ne);return ne},Fe="screen and (max-width: 76.1875em)",st=j=>{const U=(0,Ke.s0)(),ne=(0,Ye.Z)(),de=(0,He.Z)(Fe),je=Ce(),Se=en(),Qe=(0,D.h_)(W.Dl),pt=(0,D.h_)(We.q3),{state:Xe,path:dt,content:Dt}=(0,T.DK)(),[It,Wt]=(0,n.useState)(null),Gn=(0,W.ux)(It),jn=(0,n.useCallback)(()=>{if(!It)return;It.querySelectorAll(".md-sidebar").forEach(w=>{if(de)w.style.top="0px";else{const K=document==null?void 0:document.querySelector(".techdocs-reader-page");var u;const me=(u=K==null?void 0:K.getBoundingClientRect().top)!==null&&u!==void 0?u:0;var b;let ye=(b=It.getBoundingClientRect().top)!==null&&b!==void 0?b:0;const Re=It.querySelector(".md-container > .md-tabs");var A;const et=(A=Re==null?void 0:Re.getBoundingClientRect().height)!==null&&A!==void 0?A:0;ye<me&&(ye=me),w.style.top=`${Math.max(ye,0)+et}px`}w.style.setProperty("opacity","1")})},[It,de]);(0,n.useEffect)(()=>(window.addEventListener("resize",jn),window.addEventListener("scroll",jn,!0),()=>{window.removeEventListener("resize",jn),window.removeEventListener("scroll",jn,!0)}),[It,jn]);const On=(0,n.useCallback)(()=>{if(!It)return;const Nt=It.querySelector(".md-footer");Nt&&(Nt.style.width=`${It.getBoundingClientRect().width}px`)},[It]);(0,n.useEffect)(()=>(window.addEventListener("resize",On),()=>{window.removeEventListener("resize",On)}),[It,On]),(0,n.useEffect)(()=>{Gn||(On(),jn())},[Xe,Gn,On,jn]);const $n=(0,n.useCallback)((Nt,w)=>ge(Nt,[je,wn({techdocsStorageApi:Qe,entityId:j,path:w}),an(),on(),y(),g(),Rn(pt),Se]),[j,pt,Qe,je,Se]),qn=(0,n.useCallback)(async Nt=>ge(Nt,[G(),ce(),J(ne),ln({baseUrl:window.location.origin,onClick:(w,u)=>{const b=w.ctrlKey||w.metaKey,A=new URL(u);if(A.hash)if(b)window.open(`${A.pathname}${A.hash}`,"_blank");else{var K;U(`${A.pathname}${A.hash}`),(K=Nt==null?void 0:Nt.querySelector(`[id="${A.hash.slice(1)}"]`))===null||K===void 0||K.scrollIntoView()}else b?window.open(A.pathname,"_blank"):U(A.pathname)}}),k({onLoading:()=>{},onLoaded:()=>{var w;(w=Nt.querySelector(".md-nav__title"))===null||w===void 0||w.removeAttribute("for")}}),k({onLoading:()=>{Array.from(Nt.querySelectorAll(".md-sidebar")).forEach(u=>{u.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ne,U]);return(0,n.useEffect)(()=>{if(!Dt)return()=>{};let Nt=!0;return $n(Dt,dt).then(async w=>{if(!(w!=null&&w.innerHTML)||!Nt)return;window.scroll({top:0});const u=await qn(w);Wt(u)}),()=>{Nt=!1}},[Dt,dt,$n,qn]),It};var _e=t(8560);const vt=()=>{const j=(0,W.$L)(),{shadowRoot:U}=(0,W.x1)(),ne=U==null?void 0:U.querySelector('[data-md-component="content"]'),de=U==null?void 0:U.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let je=de==null?void 0:de.querySelector('[data-techdocs-addons-location="primary sidebar"]');je||(je=document.createElement("div"),je.setAttribute("data-techdocs-addons-location","primary sidebar"),de==null||de.prepend(je));const Se=U==null?void 0:U.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Qe=Se==null?void 0:Se.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Qe||(Qe=document.createElement("div"),Qe.setAttribute("data-techdocs-addons-location","secondary sidebar"),Se==null||Se.prepend(Qe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_e.Z,{container:je,children:j.renderComponentsByLocation(W.oZ.PrimarySidebar)}),(0,h.jsx)(_e.Z,{container:ne,children:j.renderComponentsByLocation(W.oZ.Content)}),(0,h.jsx)(_e.Z,{container:Qe,children:j.renderComponentsByLocation(W.oZ.SecondarySidebar)})]})},ft=(0,v.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),ht=(0,T.m1)(j=>{var U;const{withSearch:ne=!0,onReady:de}=j,je=ft(),{entityMetadata:{value:Se,loading:Qe},entityRef:pt,setShadowRoot:Xe}=(0,W.x1)(),dt=st(pt),Dt=(0,n.useCallback)(It=>{Xe(It),de instanceof Function&&de()},[Xe,de]);return Qe===!1&&!Se?(0,h.jsx)(S.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):dt?(0,h.jsx)(S.VY,{children:(0,h.jsxs)(I.Z,{container:!0,children:[(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(xe,{})}),ne&&(0,h.jsx)(I.Z,{className:je.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:pt,entityTitle:Se==null||(U=Se.metadata)===null||U===void 0?void 0:U.title})}),(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(W.VA,{element:dt,onAppend:Dt,children:(0,h.jsx)(vt,{})})})]})}):(0,h.jsx)(S.VY,{children:(0,h.jsx)(I.Z,{container:!0,children:(0,h.jsx)(I.Z,{xs:12,item:!0,children:(0,h.jsx)(xe,{})})})})}),Et=null},93225:function(bt,Oe,t){"use strict";t.d(Oe,{S:function(){return Q}});var h=t(52322),n=t(2784),v=t(18671),I=t(98069),W=t(73250),S=t(61886),l=t(46285),B=t(25271),se=t(71399),X=t(25248),q=t(95573);const F=(0,h.jsx)(I.Z,{animation:"wave",variant:"text",height:40}),Q=Y=>{const{children:ue}=Y,le=(0,S.$L)(),P=(0,X.h_)(X.Ds),{title:R,setTitle:D,subtitle:L,setSubtitle:T,entityRef:re,metadata:{value:xe,loading:Ke},entityMetadata:{value:Ye,loading:He}}=(0,S.x1)();(0,n.useEffect)(()=>{!xe||(D(xe.site_name),T(()=>{let{site_description:mt}=xe;return(!mt||mt==="None")&&(mt="Home"),mt}))},[xe,D,T]);const We=P.getOptional("app.title")||"Backstage",Ge=[R,L,We].filter(Boolean).join(" | "),{locationMetadata:Ne,spec:Me}=Ye||{},qe=Me==null?void 0:Me.lifecycle,ct=Ye?(0,l.hF)(Ye,B.S4):[],it=(0,X.tg)(q._Z)(),rt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(se.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:re,title:Ye==null?void 0:Ye.metadata.title,defaultKind:"Component"})}),ct.length>0&&(0,h.jsx)(se.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:ct,defaultKind:"group"})}),qe?(0,h.jsx)(se.i9,{label:"Lifecycle",value:qe}):null,Ne&&Ne.type!=="dir"&&Ne.type!=="file"?(0,h.jsx)(se.i9,{label:"",value:(0,h.jsx)("a",{href:Ne.target,target:"_blank",rel:"noopener noreferrer",children:(0,h.jsx)(W.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!He&&Ye===void 0||!Ke&&xe===void 0?null:(0,h.jsxs)(se.h4,{type:"Documentation",typeLink:it,title:R||F,subtitle:L||F,children:[(0,h.jsx)(v.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ge})}),rt,ue,le.renderComponentsByLocation(S.oZ.Header)]})}},65124:function(bt,Oe,t){"use strict";t.d(Oe,{b:function(){return F}});var h=t(52322),n=t(2784),v=t(79692),I=t(15223),W=t(95544),S=t(80030),l=t(61837),B=t(48348),se=t(47603),X=t(61886);const q=(0,v.Z)(Q=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:Q.spacing(3,3,0)}})),F=Q=>{const Y=q(),[ue,le]=(0,n.useState)(null),P=(0,n.useCallback)(Ke=>{le(Ke.currentTarget)},[]),R=(0,n.useCallback)(()=>{le(null)},[]),{entityMetadata:{value:D,loading:L}}=(0,X.x1)(),T=(0,X.$L)(),re=T.renderComponentsByLocation(X.oZ.Subheader),xe=T.renderComponentsByLocation(X.oZ.Settings);return!re&&!xe||L===!1&&!D?null:(0,h.jsx)(I.Z,{classes:Y,...Q.toolbarProps,children:(0,h.jsxs)(W.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[re,xe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(S.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:P,children:(0,h.jsx)(se.Z,{})})}),(0,h.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ue,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ue),onClose:R,keepMounted:!0,children:xe})]}):null]})})}},95481:function(bt,Oe,t){"use strict";t.d(Oe,{DK:function(){return F},m1:function(){return Y}});var h=t(52322),n=t(2784),v=t(10289),I=t(61886),W=t(25248),S=t(64279),l=t(77446);function B({contentLoading:ue,content:le,activeSyncState:P}){return ue||P==="BUILD_READY_RELOAD"||!le&&P==="CHECKING"?"CHECKING":!le&&P==="BUILDING"?"INITIAL_BUILD":le?P==="BUILDING"?"CONTENT_STALE_REFRESHING":P==="BUILD_READY"?"CONTENT_STALE_READY":P==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function se(ue,le){const P={...ue};switch(le.type){case"sync":le.state==="CHECKING"&&(P.buildLog=[]),P.activeSyncState=le.state,P.syncError=le.syncError;break;case"contentLoading":P.contentLoading=!0,P.contentError=void 0;break;case"content":typeof le.path=="string"&&(P.path=le.path),P.contentLoading=!1,P.content=le.content,P.contentError=le.contentError;break;case"buildLog":P.buildLog=P.buildLog.concat(le.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(P.activeSyncState)&&["contentLoading","content"].includes(le.type)&&(P.activeSyncState="UP_TO_DATE",P.buildLog=[]),P}function X(ue,le,P,R){var D,L;const[T,re]=(0,n.useReducer)(se,{activeSyncState:"CHECKING",path:R,contentLoading:!0,buildLog:[]}),xe=(0,W.h_)(I.Dl),{retry:Ke}=(0,l.Z)(async()=>{re({type:"contentLoading"});try{const We=await xe.getEntityDocs({kind:ue,namespace:le,name:P},R);return re({type:"content",content:We,path:R}),We}catch(We){re({type:"content",contentError:We,path:R})}},[xe,ue,le,P,R]),Ye=(0,n.useRef)({content:void 0,reload:()=>{}});return Ye.current={content:T.content,reload:Ke},(0,S.default)(async()=>{re({type:"sync",state:"CHECKING"});const We=setTimeout(()=>{re({type:"sync",state:"BUILDING"})},1e3);try{switch(await xe.syncEntityDocs({kind:ue,namespace:le,name:P},Ne=>{re({type:"buildLog",log:Ne})})){case"updated":Ye.current.content?re({type:"sync",state:"BUILD_READY"}):(Ye.current.reload(),re({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":re({type:"sync",state:"UP_TO_DATE"});break;default:re({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(Ge){re({type:"sync",state:"ERROR",syncError:Ge})}finally{clearTimeout(We)}},[ue,P,le,xe,re,Ye]),{state:(0,n.useMemo)(()=>B({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Ke,path:T.path,content:T.content,contentErrorMessage:(D=T.contentError)===null||D===void 0?void 0:D.toString(),syncErrorMessage:(L=T.syncError)===null||L===void 0?void 0:L.toString(),buildLog:T.buildLog}}const q=(0,n.createContext)({}),F=()=>(0,n.useContext)(q),Q=({children:ue})=>{const{"*":le=""}=(0,v.UO)(),{entityRef:P}=(0,I.x1)(),{kind:R,namespace:D,name:L}=P,T=X(R,D,L,le);return(0,h.jsx)(q.Provider,{value:T,children:ue instanceof Function?ue(T):ue})},Y=ue=>le=>(0,h.jsx)(Q,{children:(0,h.jsx)(ue,{...le})})},95573:function(bt,Oe,t){"use strict";t.d(Oe,{Fw:function(){return v},_Z:function(){return n},pd:function(){return I}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),v=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),I=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(bt,Oe,t){"use strict";t.d(Oe,{S:function(){return R}});var h=t(52322),n=t(2784),v=t(79692),I=t(49378),W=t(38402),S=t(86136),l=t(85256),B=t(71399),se=t(25248),X=t(60712);const q=(0,v.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),F=D=>{const{result:L,highlight:T,rank:re,lineClamp:xe=5,asListItem:Ke=!0,asLink:Ye=!0,title:He,icon:We}=D,Ge=q(),Ne=(0,se.z$)(),Me=()=>{Ne.captureEvent("discover",L.title,{attributes:{to:L.location},value:re})},qe=()=>{const rt=T!=null&&T.fields.title?(0,h.jsx)(X.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):L.title,Ae=T!=null&&T.fields.entityTitle?(0,h.jsx)(X.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):L.entityTitle,tt=T!=null&&T.fields.name?(0,h.jsx)(X.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):L.name;return(0,h.jsx)(I.Z,{className:Ge.itemText,primaryTypographyProps:{variant:"h6"},primary:He||(0,h.jsxs)(h.Fragment,{children:[rt," | ",Ae!=null?Ae:tt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:xe,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(X.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):L.text})})},ct=({children:rt})=>Ye?(0,h.jsx)(B.rU,{noTrack:!0,to:L.location,onClick:Me,children:rt}):(0,h.jsx)(h.Fragment,{children:rt}),it=({children:rt})=>Ke?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(W.Z,{alignItems:"flex-start",children:[We&&(0,h.jsx)(S.Z,{children:We}),(0,h.jsx)("div",{className:Ge.flexContainer,children:rt})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:rt});return(0,h.jsx)(ct,{children:(0,h.jsx)(it,{children:(0,h.jsx)(qe,{})})})};var Q=t(27556),Y=t(10289);const ue=(0,v.Z)(D=>({root:{width:"100%"},bar:{padding:D.spacing(1)}})),le=D=>D==null?void 0:D.document,P=D=>{const{entityId:L,entityTitle:T,debounceTime:re=150}=D,[xe,Ke]=(0,n.useState)(!1),Ye=(0,Y.s0)(),{setFilters:He,result:{loading:We,value:Ge}}=(0,X.Rx)(),Ne=ue(),[Me,qe]=(0,n.useState)([]);(0,n.useEffect)(()=>{let tt=!0;if(tt&&Ge){const mt=Ge.results.slice(0,10);qe(mt)}return()=>{tt=!1}},[We,Ge]);const{kind:ct,name:it,namespace:rt}=L;(0,n.useEffect)(()=>{He(tt=>({...tt,kind:ct,namespace:rt,name:it}))},[ct,rt,it,He]);const Ae=(tt,mt)=>{if(le(mt)){const{location:Le}=mt.document;Ye(Le)}};return(0,h.jsx)(Q.Z,{className:Ne.bar,variant:"outlined",children:(0,h.jsx)(X.qO,{classes:{root:Ne.root},"data-testid":"techdocs-search-bar",size:"small",open:xe,getOptionLabel:()=>"",filterOptions:tt=>tt,onClose:()=>{Ke(!1)},onFocus:()=>{Ke(!0)},onChange:Ae,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Me,renderOption:({document:tt,highlight:mt})=>(0,h.jsx)(F,{result:tt,lineClamp:3,asListItem:!1,asLink:!1,title:tt.title,highlight:mt}),loading:We,inputDebounceTime:re,inputPlaceholder:`Search ${T||L.name} docs`,freeSolo:!1})})},R=D=>{const L={term:"",types:["techdocs"],pageCursor:"",filters:D.entityId};return(0,h.jsx)(X.Nd,{initialState:L,children:(0,h.jsx)(P,{...D})})}},53260:function(){}},function(bt){var Oe=function(h){return bt(bt.s=h)};bt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Oe(96215)});var t=bt.O()}]);})();
|
|
491
|
-
|
|
492
|
-
//# sourceMappingURL=main.e4032bfd.js.map
|