@techdocs/cli 1.4.7-next.0 → 1.4.7
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 +14 -3
- package/dist/embedded-app/.config-schema.json +0 -43
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js +3 -0
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js.map +1 -0
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js +3 -0
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js.map +1 -0
- package/dist/embedded-app/static/5458.4a158b26.chunk.js +3 -0
- package/dist/embedded-app/static/5458.4a158b26.chunk.js.map +1 -0
- package/dist/embedded-app/static/9770.1e5df227.chunk.js +3 -0
- package/dist/embedded-app/static/9770.1e5df227.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.4b61d1bd.js +522 -0
- package/dist/embedded-app/static/main.4b61d1bd.js.map +1 -0
- package/dist/embedded-app/static/{runtime.e2534c23.js → runtime.4b61d1bd.js} +2 -2
- package/dist/embedded-app/static/{runtime.e2534c23.js.map → runtime.4b61d1bd.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.e2534c23.js → vendor.4b61d1bd.js} +73 -73
- package/dist/embedded-app/static/vendor.4b61d1bd.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/1105.7ccea160.chunk.js +0 -3
- package/dist/embedded-app/static/1105.7ccea160.chunk.js.map +0 -1
- package/dist/embedded-app/static/2440.6a0e86dc.chunk.js +0 -3
- package/dist/embedded-app/static/2440.6a0e86dc.chunk.js.map +0 -1
- package/dist/embedded-app/static/5458.d7ed8b8e.chunk.js +0 -3
- package/dist/embedded-app/static/5458.d7ed8b8e.chunk.js.map +0 -1
- package/dist/embedded-app/static/9770.fbe5a663.chunk.js +0 -3
- package/dist/embedded-app/static/9770.fbe5a663.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.e2534c23.js +0 -522
- package/dist/embedded-app/static/main.e2534c23.js.map +0 -1
- package/dist/embedded-app/static/vendor.e2534c23.js.map +0 -1
|
@@ -1,522 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(Pt,Le,n){"use strict";n.d(Le,{n3:function(){return m},MS:function(){return ye}});var r=n(87612),h=n(25271),W=n(23054),f=n(96279),V=n.n(f);const m=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function p(le){return!le.cursor}function F(le){return!p(le)}class ye{async getEntityAncestors(z,de){const{kind:D,namespace:A,name:se}=(0,h.of)(z.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(A)}/${encodeURIComponent(se)}/ancestry`,de)}async getLocationById(z,de){return await this.requestOptional("GET",`/locations/${encodeURIComponent(z)}`,de)}async getEntities(z,de){const{filter:D=[],fields:A=[],order:se,offset:ie,limit:ne,after:X}=z!=null?z:{},K=this.getParams(D);if(A.length&&K.push(`fields=${A.map(encodeURIComponent).join(",")}`),se)for(const Z of[se].flat())Z&&K.push(`order=${encodeURIComponent(Z.order)}:${encodeURIComponent(Z.field)}`);ie!==void 0&&K.push(`offset=${ie}`),ne!==void 0&&K.push(`limit=${ne}`),X!==void 0&&K.push(`after=${encodeURIComponent(X)}`);const R=K.length?`?${K.join("&")}`:"",w=await this.requestRequired("GET",`/entities${R}`,de),I=(Z,xe)=>{var Ce,B;if(((Ce=Z.metadata)===null||Ce===void 0?void 0:Ce.name)===void 0||Z.kind===void 0||((B=xe.metadata)===null||B===void 0?void 0:B.name)===void 0||xe.kind===void 0)return 0;const Qe=(0,h.eE)(Z),St=(0,h.eE)(xe);return Qe<St?-1:Qe>St?1:0};return{items:w.sort(I)}}async getEntitiesByRefs(z,de){var D,A,se;const ie={entityRefs:z.entityRefs};!((D=z.fields)===null||D===void 0)&&D.length&&(ie.fields=z.fields);const X=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,K=await this.fetchApi.fetch(X,{headers:{"Content-Type":"application/json",...((A=de)===null||A===void 0?void 0:A.token)&&{Authorization:`Bearer ${(se=de)===null||se===void 0?void 0:se.token}`}},method:"POST",body:JSON.stringify(ie)});if(!K.ok)throw await W.VL.fromResponse(K);const{items:R}=await K.json();return{items:R.map(w=>w!=null?w:void 0)}}async queryEntities(z={},de){const D=[];if(p(z)){var A,se,ie,ne;const{fields:K=[],filter:R,limit:w,orderFields:I,fullTextFilter:Z}=z;D.push(...this.getParams(R)),w!==void 0&&D.push(`limit=${w}`),I!==void 0&&(Array.isArray(I)?I:[I]).forEach(({field:Ce,order:B})=>D.push(`orderField=${Ce},${B}`)),K.length&&D.push(`fields=${K.map(encodeURIComponent).join(",")}`);const xe=(se=Z)===null||se===void 0||(A=se.term)===null||A===void 0?void 0:A.trim();xe&&D.push(`fullTextFilterTerm=${xe}`),!((ne=Z)===null||ne===void 0||(ie=ne.fields)===null||ie===void 0)&&ie.length&&D.push(`fullTextFilterFields=${Z.fields.join(",")}`)}else{const{fields:K=[],limit:R,cursor:w}=z;D.push(`cursor=${w}`),R!==void 0&&D.push(`limit=${R}`),K.length&&D.push(`fields=${K.map(encodeURIComponent).join(",")}`)}const X=D.length?`?${D.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${X}`,de)}async getEntityByRef(z,de){const{kind:D,namespace:A,name:se}=(0,h.of)(z);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(A)}/${encodeURIComponent(se)}`,de)}async getEntityByName(z,de){const{kind:D,namespace:A="default",name:se}=z;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(D)}/${encodeURIComponent(A)}/${encodeURIComponent(se)}`,de)}async refreshEntity(z,de){var D,A;const se=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...((D=de)===null||D===void 0?void 0:D.token)&&{Authorization:`Bearer ${(A=de)===null||A===void 0?void 0:A.token}`}},method:"POST",body:JSON.stringify({entityRef:z})});if(se.status!==200)throw new Error(await se.text())}async getEntityFacets(z,de){const{filter:D=[],facets:A}=z,se=this.getParams(D);for(const ne of A)se.push(`facet=${encodeURIComponent(ne)}`);const ie=se.length?`?${se.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${ie}`,de)}async addLocation(z,de){var D,A;const{type:se="url",target:ie,dryRun:ne}=z,X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${ne?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...((D=de)===null||D===void 0?void 0:D.token)&&{Authorization:`Bearer ${(A=de)===null||A===void 0?void 0:A.token}`}},method:"POST",body:JSON.stringify({type:se,target:ie})});if(X.status!==201)throw new Error(await X.text());const{location:K,entities:R,exists:w}=await X.json();if(!K)throw new Error(`Location wasn't added: ${ie}`);return{location:K,entities:R,exists:w}}async getLocationByRef(z,de){return(await this.requestRequired("GET","/locations",de)).map(A=>A.data).find(A=>z===(0,h.NZ)(A))}async removeLocationById(z,de){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(z)}`,de)}async removeEntityByUid(z,de){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(z)}`,de)}async validateEntity(z,de,D){var A,se;const ie=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...((A=D)===null||A===void 0?void 0:A.token)&&{Authorization:`Bearer ${(se=D)===null||se===void 0?void 0:se.token}`}},method:"POST",body:JSON.stringify({entity:z,location:de})});if(ie.ok)return{valid:!0};if(ie.status!==400)throw await W.VL.fromResponse(ie);const{errors:ne=[]}=await ie.json();return{valid:!1,errors:ne}}async requestIgnored(z,de,D){var A;const se=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,ie=!((A=D)===null||A===void 0)&&A.token?{Authorization:`Bearer ${D.token}`}:{},ne=await this.fetchApi.fetch(se,{method:z,headers:ie});if(!ne.ok)throw await W.VL.fromResponse(ne)}async requestRequired(z,de,D){var A;const se=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,ie=!((A=D)===null||A===void 0)&&A.token?{Authorization:`Bearer ${D.token}`}:{},ne=await this.fetchApi.fetch(se,{method:z,headers:ie});if(!ne.ok)throw await W.VL.fromResponse(ne);return ne.json()}async requestOptional(z,de,D){var A;const se=`${await this.discoveryApi.getBaseUrl("catalog")}${de}`,ie=!((A=D)===null||A===void 0)&&A.token?{Authorization:`Bearer ${D.token}`}:{},ne=await this.fetchApi.fetch(se,{method:z,headers:ie});if(!ne.ok){if(ne.status===404)return;throw await W.VL.fromResponse(ne)}return await ne.json()}getParams(z=[]){const de=[];for(const D of[z].flat()){const A=[];for(const[se,ie]of Object.entries(D))for(const ne of[ie].flat())ne===m?A.push(encodeURIComponent(se)):typeof ne=="string"&&A.push(`${encodeURIComponent(se)}=${encodeURIComponent(ne)}`);A.length&&de.push(`filter=${A.join(",")}`)}return de}constructor(z){(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.discoveryApi=z.discoveryApi,this.fetchApi=z.fetchApi||{fetch:V()}}}},25271:function(Pt,Le,n){"use strict";n.d(Le,{Tf:function(){return W},P1:function(){return Un},q1:function(){return qn},M6:function(){return Ln},l2:function(){return h},zG:function(){return r},w$:function(){return xn},nP:function(){return hn},aS:function(){return _t},S4:function(){return vt},cz:function(){return rt},wI:function(){return xe},iB:function(){return Dt},CV:function(){return Pe},of:function(){return Xt},Ou:function(){return we},eE:function(){return ct},NZ:function(){return he}});const r="default",h="backstage.io/view-url",W="backstage.io/edit-url",f="kubernetes.io/api-server",V="kubernetes.io/api-server-certificate-authority",m="kubernetes.io/auth-provider";var p=n(76635),F=n.n(p);class ye{async enforce(N){return N.metadata.namespace?N:lodash.merge({metadata:{namespace:this.namespace}},N)}constructor(N=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=N}}class le{static isValidPrefixAndOrSuffix(N,ce,Ee,Ue){if(typeof N!="string")return!1;const qe=N.split(ce);return qe.length===1?Ue(qe[0]):qe.length===2?Ee(qe[0])&&Ue(qe[1]):!1}static isJsonSafe(N){try{return F().isEqual(N,JSON.parse(JSON.stringify(N)))}catch{return!1}}static isValidDnsSubdomain(N){return typeof N=="string"&&N.length>=1&&N.length<=253&&N.split(".").every(le.isValidDnsLabel)}static isValidDnsLabel(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(N)}static isValidTag(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(N)}static isValidUrl(N){if(typeof N!="string")return!1;try{return new URL(N),!0}catch{return!1}}static isValidString(N){var ce,Ee;return typeof N=="string"&&((Ee=N)===null||Ee===void 0||(ce=Ee.trim())===null||ce===void 0?void 0:ce.length)>=1}static isNonEmptyString(N){var ce,Ee;return typeof N=="string"&&((Ee=N)===null||Ee===void 0||(ce=Ee.trim())===null||ce===void 0?void 0:ce.length)>=1}}var z=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),de=n(27991),D=n.n(de),A=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),se=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),ie=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const ne=new Map,X=[z,A,se,ie];function K(G){var N;if(!(!((N=G)===null||N===void 0)&&N.length))throw new TypeError("Unknown error");const ce=G[0];throw new TypeError(`${ce.instancePath||"<root>"} ${ce.message}${ce.params?` - ${Object.entries(ce.params).map(([Ee,Ue])=>`${Ee}: ${Ue}`).join(", ")}`:""}`)}function R(G,N={}){var ce,Ee;const Ue=(Ee=(ce=N)===null||ce===void 0?void 0:ce.disableCache)!==null&&Ee!==void 0?Ee:!1,qe=Ue?"":JSON.stringify(G);if(!Ue){const sn=ne.get(qe);if(sn)return sn}const Tt=w(G),$t=new(D())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});Tt.length&&$t.addSchema(Tt,void 0,void 0,!0);const ln=$t.compile(G);return Ue||ne.set(qe,ln),ln}function w(G){if(typeof G!="object")return[];const N=new Set;G.$id&&N.add(G.$id);const ce=new Array,Ee=[G];for(;Ee.length;){const Ue=Ee.pop();for(const qe of I(Ue))if(!N.has(qe)){N.add(qe);const Tt=X.find($t=>$t.$id===qe);Tt&&(ce.push(Tt),Ee.push(Tt))}}return ce}function*I(G){const N=[G];for(;N.length;){const ce=N.pop();if(typeof ce=="object"&&ce)for(const[Ee,Ue]of Object.entries(ce))Ee==="$ref"&&typeof Ue=="string"?yield Ue.split("#")[0]:N.push(Ue)}}function Z(G){const N=compileAjvSchema(G||entityEnvelopeSchema);return ce=>{if(N(ce)===!0)return ce;throw throwAjvError(N.errors)}}function xe(G){const N=R(G);return ce=>{var Ee,Ue;if(N(ce)===!0)return ce;const Tt=(Ee=N.errors)===null||Ee===void 0?void 0:Ee.filter($t=>["/kind","/apiVersion"].includes($t.instancePath));if(!((Ue=Tt)===null||Ue===void 0)&&Ue.length&&Tt.every($t=>$t.keyword==="enum"))return!1;throw K(N.errors)}}function Ce(G){const N=compileAjvSchema(G||entitySchema);return ce=>{if(N(ce)===!0)return ce;throw throwAjvError(N.errors)}}class B{static isValidApiVersion(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,ce=>ce.length>=1&&ce.length<=63&&/^[a-z0-9A-Z]+$/.test(ce))}static isValidKind(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(N)}static isValidObjectName(N){return typeof N=="string"&&N.length>=1&&N.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(N)}static isValidNamespace(N){return le.isValidDnsLabel(N)}static isValidLabelKey(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,B.isValidObjectName)}static isValidLabelValue(N){return N===""||B.isValidObjectName(N)}static isValidAnnotationKey(N){return le.isValidPrefixAndOrSuffix(N,"/",le.isValidDnsSubdomain,B.isValidObjectName)}static isValidAnnotationValue(N){return typeof N=="string"}}const Qe={isValidApiVersion:B.isValidApiVersion,isValidKind:B.isValidKind,isValidEntityName:B.isValidObjectName,isValidNamespace:B.isValidNamespace,isValidLabelKey:B.isValidLabelKey,isValidLabelValue:B.isValidLabelValue,isValidAnnotationKey:B.isValidAnnotationKey,isValidAnnotationValue:B.isValidAnnotationValue,isValidTag:G=>typeof G=="string"&&G.length>=1&&G.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(G)};function St(G={}){return{...Qe,...G}}class Nt{async enforce(N){function ce(Y,v,k){if(v==null)throw new Error(`${Y} must have a value`);let M;try{M=k(v)}catch(H){throw new Error(`${Y} could not be validated, ${H}`)}if(!M){let H;switch(k.name){case"isValidLabelValue":case"isValidObjectName":H="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":H="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":H="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":H="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":H="a string";break;case"isValidKind":H="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":H="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":H="a non empty string";break;default:H=void 0;break}const pe=H?` expected ${H} but found "${v}".`:"";throw new Error(`"${Y}" is not valid;${pe} 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 Ee(Y,v,k){return v===void 0||ce(Y,v,k)}ce("apiVersion",N.apiVersion,this.validators.isValidApiVersion),ce("kind",N.kind,this.validators.isValidKind),ce("metadata.name",N.metadata.name,this.validators.isValidEntityName),Ee("metadata.namespace",N.metadata.namespace,this.validators.isValidNamespace);var Ue;for(const[Y,v]of Object.entries((Ue=N.metadata.labels)!==null&&Ue!==void 0?Ue:[]))ce(`labels.${Y}`,Y,this.validators.isValidLabelKey),ce(`labels.${Y}`,v,this.validators.isValidLabelValue);var qe;for(const[Y,v]of Object.entries((qe=N.metadata.annotations)!==null&&qe!==void 0?qe:[]))ce(`annotations.${Y}`,Y,this.validators.isValidAnnotationKey),ce(`annotations.${Y}`,v,this.validators.isValidAnnotationValue);var Tt;const $t=(Tt=N.metadata.tags)!==null&&Tt!==void 0?Tt:[];for(let Y=0;Y<$t.length;++Y)ce(`tags.${Y}`,$t[Y],this.validators.isValidTag);var ln;const sn=(ln=N.metadata.links)!==null&&ln!==void 0?ln:[];for(let Y=0;Y<sn.length;++Y){var nn,re,te;ce(`links.${Y}.url`,(nn=sn[Y])===null||nn===void 0?void 0:nn.url,CommonValidatorFunctions.isValidUrl),Ee(`links.${Y}.title`,(re=sn[Y])===null||re===void 0?void 0:re.title,CommonValidatorFunctions.isNonEmptyString),Ee(`links.${Y}.icon`,(te=sn[Y])===null||te===void 0?void 0:te.icon,KubernetesValidatorFunctions.isValidObjectName)}return N}constructor(N=makeValidator()){_define_property(this,"validators",void 0),this.validators=N}}class Wt{async enforce(N){if(!this.validate){const Ue=new Ajv({allowUnionTypes:!0});this.validate=Ue.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(N)===!0)return N;const[Ee]=this.validate.errors||[];throw Ee?new Error(`Malformed envelope, ${Ee.instancePath||"<root>"} ${Ee.message}`):new Error("Malformed envelope, Unknown error")}constructor(){_define_property(this,"validate",void 0)}}function kt(G){let N=G.indexOf(":");const ce=G.indexOf("/");ce!==-1&&ce<N&&(N=-1);const Ee=N===-1?void 0:G.slice(0,N),Ue=ce===-1?void 0:G.slice(N+1,ce),qe=G.slice(Math.max(N+1,ce+1));if(Ee===""||Ue===""||qe==="")throw new TypeError(`Entity reference "${G}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ee,namespace:Ue,name:qe}}function Dt(G){return{kind:G.kind,namespace:G.metadata.namespace||r,name:G.metadata.name}}function Xt(G,N){var ce,Ee;if(!G)throw new Error("Entity reference must not be empty");const Ue=(ce=N)===null||ce===void 0?void 0:ce.defaultKind,qe=((Ee=N)===null||Ee===void 0?void 0:Ee.defaultNamespace)||r;let Tt,$t,ln;if(typeof G=="string"){const Y=kt(G);var sn;Tt=(sn=Y.kind)!==null&&sn!==void 0?sn:Ue;var nn;$t=(nn=Y.namespace)!==null&&nn!==void 0?nn:qe,ln=Y.name}else{var re;Tt=(re=G.kind)!==null&&re!==void 0?re:Ue;var te;$t=(te=G.namespace)!==null&&te!==void 0?te:qe,ln=G.name}if(Tt)if($t){if(!ln){const Y=JSON.stringify(G);throw new Error(`Entity reference ${Y} had missing or empty name`)}}else{const Y=JSON.stringify(G);throw new Error(`Entity reference ${Y} had missing or empty namespace`)}else{const Y=JSON.stringify(G);throw new Error(`Entity reference ${Y} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:Tt,namespace:$t,name:ln}}function ct(G){let N,ce,Ee;if("metadata"in G){N=G.kind;var Ue;ce=(Ue=G.metadata.namespace)!==null&&Ue!==void 0?Ue:r,Ee=G.metadata.name}else{N=G.kind;var qe;ce=(qe=G.namespace)!==null&&qe!==void 0?qe:r,Ee=G.name}return`${N.toLocaleLowerCase("en-US")}:${ce.toLocaleLowerCase("en-US")}/${Ee.toLocaleLowerCase("en-US")}`}var ut=n(87612);class pt{async enforce(N){let ce=N;for(const Ee of this.policies){const Ue=await Ee.enforce(ce);if(!Ue)throw new Error(`Policy ${Ee.constructor.name} did not return a result`);ce=Ue}return ce}constructor(N){(0,ut._)(this,"policies",void 0),this.policies=N}}class ht{async enforce(N){for(const ce of this.policies){const Ee=await ce.enforce(N);if(Ee)return Ee}throw new Error("The entity did not match any known policy")}constructor(N){(0,ut._)(this,"policies",void 0),this.policies=N}}const Vt={allOf(G){return new pt(G)},oneOf(G){return new ht(G)}};var Jt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc","trpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function be(G){let N;return{async check(ce){return N||(N=xe(G)),N(ce)===ce}}}const Me=be(Jt);var Ye=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 ft=be(Ye);var st=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 nt=be(st);var gt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"GroupV1alpha1","description":"A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Group","metadata":{"name":"infrastructure","description":"The infra business unit"},"spec":{"type":"business-unit","profile":{"displayName":"Infrastructure","email":"infrastructure@example.com","picture":"https://example.com/groups/bu-infrastructure.jpeg"},"parent":"ops","children":["backstage","other"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Group"]},"spec":{"type":"object","required":["type","children"],"properties":{"type":{"type":"string","description":"The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.","examples":["team","business-unit","product-area","root"],"minLength":1},"profile":{"type":"object","description":"Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.","properties":{"displayName":{"type":"string","description":"A simple display name to present to users.","examples":["Infrastructure"],"minLength":1},"email":{"type":"string","description":"An email where this entity can be reached.","examples":["infrastructure@example.com"],"minLength":1},"picture":{"type":"string","description":"The URL of an image that represents this entity.","examples":["https://example.com/groups/bu-infrastructure.jpeg"],"minLength":1}}},"parent":{"type":"string","description":"The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.","examples":["ops"],"minLength":1},"children":{"type":"array","description":"The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.","items":{"type":"string","examples":["backstage","other"],"minLength":1}},"members":{"type":"array","description":"The users that are members of this group. The entries of this array are entity references.","items":{"type":"string","examples":["jdoe"],"minLength":1}}}}}}]}`);const ot=be(gt);var Xe=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 yt=be(Xe),vt="ownedBy",xt="ownerOf",wn="consumesApi",fn="apiConsumedBy",pn="providesApi",jn="apiProvidedBy",hn="dependsOn",xn="dependencyOf",En="parentOf",on="childOf",Sn="memberOf",An="hasMember",rt="partOf",_t="hasPart";var Mt=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 _e=be(Mt);var Pn=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 dn=be(Pn);var $n=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 Cn=be($n),Un="backstage.io/managed-by-location",qn="backstage.io/managed-by-origin-location",Ln="backstage.io/source-location",zn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function we(G){if(typeof G!="string")throw new TypeError(`Unable to parse location ref '${G}', unexpected argument ${typeof G}`);const N=G.indexOf(":");if(N<0)throw new TypeError(`Unable to parse location ref '${G}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ce=G.substring(0,N).trim(),Ee=G.substring(N+1).trim();if(!ce||!Ee)throw new TypeError(`Unable to parse location ref '${G}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ce==="http"||ce==="https")throw new TypeError(`Invalid location ref '${G}', please prefix it with 'url:', e.g. 'url:${G}'`);if(zn.test(Ee))throw new TypeError(`Invalid location ref '${G}', target is a javascript: URL`);return{type:ce,target:Ee}}function he(G){const{type:N,target:ce}=G;if(N){if(!ce)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(zn.test(ce))throw new TypeError(`Invalid location ref '${N}:${ce}', target is a javascript: URL`);return`${N}:${ce}`}function Pe(G){var N,ce,Ee,Ue,qe;const Tt=(qe=(ce=G.metadata)===null||ce===void 0||(N=ce.annotations)===null||N===void 0?void 0:N[Ln])!==null&&qe!==void 0?qe:(Ue=G.metadata)===null||Ue===void 0||(Ee=Ue.annotations)===null||Ee===void 0?void 0:Ee[Un];if(!Tt)throw new Error(`Entity '${ct(G)}' is missing location`);return we(Tt)}},98864:function(Pt,Le,n){"use strict";n.d(Le,{rU:function(){return I}});var r=n(52322),h=n(60871),W=n(86689),f=n(79692),V=n(90436),m=n(72779),p=n.n(m),F=n(76635),ye=n.n(F),le=n(2784),z=n(73557),de=n(71597);function D(){const[Z]=(0,z.is)((0,r.jsx)(z.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!Z.index}const A=(0,f.Z)({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"}},{name:"Link"}),se=Z=>/^([a-z+.-]+):/.test(Z),ie=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,ne=window.open;if(ne&&!ne.__backstage){const Z=function(...Ce){const B=String(Ce[0]);if(ie.test(B))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return ne.apply(this,Ce)};Z.__backstage=!0,window.open=Z}const X=()=>{try{return(0,h.h_)(h.Ds).getOptionalString("app.baseUrl")}catch{return}},K=()=>{const Z="http://sample.dev";var xe;const Ce=(xe=X())!==null&&xe!==void 0?xe:"/",{pathname:B}=new URL(Ce,Z);return(0,F.trimEnd)(B,"/")},R=Z=>{let xe=String(Z);const Ce=K(),B=se(xe),Qe=xe.startsWith(Ce);return!B&&!Qe&&(xe=Ce.concat(xe)),xe},w=Z=>{if(Z instanceof Array)return Z.map(w).join(" ").trim();if(typeof Z=="object"&&Z){var xe,Ce;return w((Ce=Z)===null||Ce===void 0||(xe=Ce.props)===null||xe===void 0?void 0:xe.children)}return["string","number"].includes(typeof Z)?String(Z):""},I=le.forwardRef(({onClick:Z,noTrack:xe,...Ce},B)=>{const Qe=A(),St=(0,h.z$)(),Nt=D()?R(Ce.to):Ce.to,Wt=w(Ce.children)||Nt,kt=se(Nt),Dt=kt&&!!/^https?:/.exec(Nt);if(ie.test(Nt))throw new Error("Link component rejected javascript: URL as a security precaution");const Xt=ct=>{var ut;(ut=Z)===null||ut===void 0||ut(ct),xe||St.captureEvent("click",Wt,{attributes:{to:Nt}})};return kt?(0,r.jsxs)(W.Z,{...Dt?{target:"_blank",rel:"noopener"}:{},...Ce,...Ce["aria-label"]?{"aria-label":`${Ce["aria-label"]}, Opens in a new window`}:{},ref:B,href:Nt,onClick:Xt,className:p()(Qe.externalLink,Ce.className),children:[Ce.children,(0,r.jsx)(V.Z,{component:"span",className:Qe.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(W.Z,{...Ce,ref:B,component:de.rU,to:Nt,onClick:Xt})})},43909:function(Pt,Le,n){"use strict";n.d(Le,{r:function(){return r.rU}});var r=n(98864)},53974:function(Pt,Le,n){"use strict";n.d(Le,{Oi:function(){return xe},VY:function(){return Ns},yW:function(){return Ua},XF:function(){return St},mn:function(){return xn},NX:function(){return pt},ub:function(){return zn},mf:function(){return Wa},yu:function(){return at},h4:function(){return _a},M6:function(){return Gr},i9:function(){return dl},aR:function(){return Gn},rJ:function(){return Wr},Oh:function(){return ml},hu:function(){return hl},rU:function(){return le.r},Qj:function(){return de},nU:function(){return ke},SA:function(){return rn},sk:function(){return qe},Or:function(){return Yr},T3:function(){return qa},g9:function(){return xl},Ex:function(){return wo},Gk:function(){return Yt},tn:function(){return Si},Ph:function(){return Oo},YE:function(){return sa},v7:function(){return xr},R6:function(){return Bt},tR:function(){return Qa},uw:function(){return as},qt:function(){return yi},iA:function(){return hs},GB:function(){return tt},po:function(){return Ar},mZ:function(){return Ks},Pf:function(){return vs}});var r=n(52322),h=n(60871),W=n(19928),f=n(2784);function V(e){const[s,l]=useState([]),u=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"},transientTimeoutMs:x}=e,T=x!=null?x:5e3;useEffect(()=>{const Q=u.alert$().subscribe(fe=>l(ge=>ge.concat(fe)));return()=>{Q.unsubscribe()}},[u]);const[$]=s;if(useEffect(()=>{if($&&$.display==="transient"){const Q=setTimeout(()=>{l(fe=>{const ge=fe.filter(Ze=>Ze!==$);return ge.length===fe.length?fe:ge})},T);return()=>clearTimeout(Q)}},[$,T]),s.length===0)return null;const q=()=>{l(Q=>Q.filter(fe=>fe!==$))};return _jsx(Snackbar,{open:!0,anchorOrigin:g,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:q,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:$.severity,children:_jsxs(Typography,{component:"span",children:[String($.message),s.length>1&&_jsx("em",{children:` (${s.length-1} older ${pluralize("message",s.length-1)})`})]})})})}var m=n(79692);const p=(0,m.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function F(e){const{displayName:s,picture:l,customStyles:u}=e,g=p();let x={...u};const T={fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight};return l||(x={backgroundColor:stringToColor(s||""),...u}),_jsx(MaterialAvatar,{alt:s,src:l,className:g.avatar,style:x,children:s&&_jsx(Typography,{variant:"h6",component:"span",className:g.avatarText,style:T,children:extractInitials(s)})})}var ye=n(77277),le=n(43909);const z=f.forwardRef((e,s)=>(0,r.jsx)(le.r,{ref:s,...e,color:"initial"})),de=f.forwardRef((e,s)=>(0,r.jsx)(ye.Z,{ref:s,component:z,...e})),D=null;var A=n(95544),se=n(60364),ie=n(83229),ne=n(26639),X=n(39595),K=n(61837),R=n(80030),w=n(19353),I=n(95074);function Z(e){const{text:s,tooltipDelay:l=1e3,tooltipText:u="Text copied to clipboard","aria-label":g="Copy text"}=e,x=(0,h.h_)(h.VE),[T,$]=(0,f.useState)(!1),[{error:q},Q]=(0,I.Z)();(0,f.useEffect)(()=>{q&&x.post(q)},[q,x]);const fe=ge=>{ge.stopPropagation(),$(!0),Q(s)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(R.ZP,{id:"copy-test-tooltip",title:u,placement:"top",leaveDelay:l,onClose:()=>$(!1),open:T,children:(0,r.jsx)(K.Z,{onClick:fe,"aria-label":g,children:(0,r.jsx)(w.Z,{})})})})}function xe(e){const{text:s,language:l,showLineNumbers:u=!1,highlightedNumbers:g,customStyle:x,showCopyCodeButton:T=!1}=e,$=(0,se.Z)(),q=$.palette.type==="dark"?ne.Z:X.Z,Q=$.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(A.Z,{position:"relative",children:[(0,r.jsx)(ie.Z,{customStyle:x,language:l,style:q,showLineNumbers:u,wrapLines:!0,lineNumberStyle:{color:$.palette.textVerySubtle},lineProps:fe=>{var ge;return!((ge=g)===null||ge===void 0)&&ge.includes(fe)?{style:{backgroundColor:Q}}:{}},children:s}),T&&(0,r.jsx)(A.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(Z,{text:s})})]})}var Ce=n(41156),B=n(71597),Qe=n(88188);function St(e){const{title:s,to:l}=e,u=(0,Ce.Z)(g=>g.breakpoints.down("xs"));return l?u?(0,r.jsx)(K.Z,{component:B.rU,color:"primary",title:s,size:"small",to:l,children:(0,r.jsx)(Qe.Z,{})}):(0,r.jsx)(ye.Z,{component:B.rU,variant:"contained",color:"primary",to:l,children:s}):null}var Nt=n(27397),Wt=n(11105),kt=n(97963),Dt=n(46506),Xt=n.n(Dt),ct=n(54073),ut=n.n(ct),pt;(function(e){let s;(function(x){x.TOP_BOTTOM="TB",x.BOTTOM_TOP="BT",x.LEFT_RIGHT="LR",x.RIGHT_LEFT="RL"})(s=e.Direction||(e.Direction={}));let l;(function(x){x.UP_LEFT="UL",x.UP_RIGHT="UR",x.DOWN_LEFT="DL",x.DOWN_RIGHT="DR"})(l=e.Alignment||(e.Alignment={}));let u;(function(x){x.NETWORK_SIMPLEX="network-simplex",x.TIGHT_TREE="tight-tree",x.LONGEST_PATH="longest-path"})(u=e.Ranker||(e.Ranker={}));let g;(function(x){x.LEFT="l",x.RIGHT="r",x.CENTER="c"})(g=e.LabelPosition||(e.LabelPosition={}))})(pt||(pt={}));var ht=n(10368);const Vt=(0,m.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function Jt({node:{id:e}}){const s=Vt(),[l,u]=f.useState(0),[g,x]=f.useState(0),T=f.useRef(null);f.useLayoutEffect(()=>{if(T.current){let{height:fe,width:ge}=T.current.getBBox();fe=Math.round(fe),ge=Math.round(ge),(fe!==g||ge!==l)&&(u(ge),x(fe))}},[l,g]);const $=10,q=l+$*2,Q=g+$*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:s.node,width:q,height:Q,rx:10}),(0,r.jsx)("text",{ref:T,className:s.text,y:Q/2,x:q/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const be="arrow-marker",Me="node",Ye="edge",ft="label",st=(0,ht.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),nt=e=>(0,r.jsx)(Jt,{...e});function gt({render:e=nt,setNode:s,node:l}){const{width:u,height:g,x=0,y:T=0}=l,$=l,q=st(),Q=f.useRef(null);return f.useLayoutEffect(()=>{if(Q.current){let{height:fe,width:ge}=Q.current.getBBox();fe=Math.round(fe),ge=Math.round(ge),(fe!==g||ge!==u)&&s(l.id,{...l,height:fe,width:ge})}},[l,u,g,s]),(0,r.jsx)("g",{ref:Q,"data-testid":Me,className:q.node,transform:`translate(${x-u/2},${T-g/2})`,children:e({node:$})})}var ot=n(76985),Xe=n(39829),yt=n(19574),vt=n.n(yt);const xt=(0,ht.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function wn({edge:{label:e}}){const s=xt();return(0,r.jsx)("text",{className:s.text,textAnchor:"middle",children:e})}const fn=(0,ht.Z)(e=>({path:{strokeWidth:1,stroke:e.palette.textSubtle,fill:"none",transition:`${e.transitions.duration.shortest}ms`},label:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),pn=e=>(0,r.jsx)(wn,{...e});function jn({render:e=pn,setEdge:s,id:l,edge:u,curve:g}){const{x=0,y:T=0,width:$,height:q,points:Q}=u,fe=u,ge=fn(),Ze=f.useRef(null);f.useLayoutEffect(()=>{if(Ze.current){let{height:mt,width:dt}=Ze.current.getBBox();mt=Math.round(mt),dt=Math.round(dt),(mt!==q||dt!==$)&&s(l,{...u,height:mt,width:dt})}},[u,q,$,s,l]);let Ie="";const Ke=f.useMemo(()=>ot.Z().x(mt=>mt.x).y(mt=>mt.y).curve(Xe[g]),[g]);if(Q){const mt=Q.filter(dt=>vt()(dt.x)&&vt()(dt.y));Ie=Ke(mt)||""}return(0,r.jsxs)(r.Fragment,{children:[Ie&&(0,r.jsx)("path",{"data-testid":Ye,className:ge.path,d:Ie}),fe.label?(0,r.jsx)("g",{ref:Ze,"data-testid":ft,className:ge.label,transform:`translate(${x},${T})`,children:e({edge:fe})}):null]})}const hn="workspace";function xn(e){var s,l;const{edges:u,nodes:g,renderNode:x,direction:T=pt.Direction.TOP_BOTTOM,align:$,nodeMargin:q=50,edgeMargin:Q=10,rankMargin:fe=50,paddingX:ge=0,paddingY:Ze=0,acyclicer:Ie,ranker:Ke=pt.Ranker.NETWORK_SIMPLEX,labelPosition:mt=pt.LabelPosition.RIGHT,labelOffset:dt=10,edgeRanks:Kt=1,edgeWeight:kn=1,renderLabel:Kn,defs:Ot,zoom:tn="enabled",curve:vn="curveMonotoneX",fit:Yn="grow",...cr}=e,Nn=(0,kt.Z)(),[Pr,lo]=f.useState(100),[Fr,Ho]=f.useState(100),yn=f.useRef(new(Xt()).graphlib.Graph),[co,ya]=f.useState(((s=yn.current.graph())===null||s===void 0?void 0:s.width)||0),[uo,xa]=f.useState(((l=yn.current.graph())===null||l===void 0?void 0:l.height)||0),[si,Ss]=f.useState([]),[ba,Xn]=f.useState([]),hr=Math.max(co,Pr),Lr=Math.max(uo,Fr),So=Math.min(uo,Fr),Jn=Yn==="grow"?Lr:So,fr=f.useMemo(()=>ut()(Fn=>{if(!Fn)return;const _n=Wt.Z(Fn),Bn=Wt.Z(Fn.getElementById(hn));function Ur(){_n.call(Nt.sP().scaleExtent([1,1/0]).on("zoom",qr=>{qr.transform.x=Math.min(0,Math.max(qr.transform.x,hr-hr*qr.transform.k)),qr.transform.y=Math.min(0,Math.max(qr.transform.y,Lr-Lr*qr.transform.k)),Bn.attr("transform",qr.transform)}))}tn==="enabled"?Ur():tn==="enable-on-click"&&_n.on("click",()=>Ur());const{width:Mr,height:ii}=Fn.getBoundingClientRect();Pr!==Mr&&lo(Mr),Fr!==ii&&Ho(ii)},100),[Fr,Pr,hr,Lr,tn]),Co=f.useCallback(()=>{const Fn=yn.current.nodes(),_n=yn.current.edges();Fn.forEach(Bn=>{g.some(Mr=>Mr.id===Bn)||yn.current.removeNode(Bn)}),_n.forEach(Bn=>{u.some(Mr=>Mr.from===Bn.v&&Mr.to===Bn.w)||yn.current.removeEdge(Bn.v,Bn.w)}),g.forEach(Bn=>{const Ur=yn.current.nodes().find(Mr=>Bn.id===Mr);if(Ur&&yn.current.node(Ur)){const{width:Mr,height:ii,x:qr,y:Nl}=yn.current.node(Ur);yn.current.setNode(Ur,{...Bn,width:Mr,height:ii,x:qr,y:Nl})}else yn.current.setNode(Bn.id,{...Bn,width:0,height:0})}),u.forEach(Bn=>{yn.current.setEdge(Bn.from,Bn.to,{...Bn,label:Bn.label,width:0,height:0,labelpos:mt,labeloffset:dt,weight:kn,minlen:Kt})})},[u,g,mt,dt,kn,Kt]),Zr=f.useMemo(()=>ut()(()=>{Xt().layout(yn.current);const{height:Fn,width:_n}=yn.current.graph(),Bn=Math.max(0,Fn||0),Ur=Math.max(0,_n||0);ya(Ur),xa(Bn),Ss(yn.current.nodes()),Xn(yn.current.edges())},250,{leading:!0}),[]);f.useEffect(()=>(yn.current.setGraph({rankdir:T,align:$,nodesep:q,edgesep:Q,ranksep:fe,marginx:ge,marginy:Ze,acyclicer:Ie,ranker:Ke}),Co(),Zr(),Zr.cancel),[Ie,$,T,Q,ge,Ze,q,fe,Ke,Co,Zr]);function Cs(Fn,_n){return yn.current.setNode(Fn,_n),Zr(),yn.current}function Dl(Fn,_n){return yn.current.setEdge(Fn,_n),Zr(),yn.current}return(0,r.jsxs)("svg",{ref:fr,...cr,width:"100%",height:Jn,viewBox:`0 0 ${hr} ${Lr}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:be,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:Nn.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Ot]}),(0,r.jsx)("g",{id:hn,children:(0,r.jsxs)("svg",{width:co,height:uo,y:Lr/2-uo/2,x:hr/2-co/2,viewBox:`0 0 ${co} ${uo}`,children:[ba.map(Fn=>{const _n=yn.current.edge(Fn);return _n?(0,r.jsx)(jn,{id:Fn,setEdge:Dl,render:Kn,edge:_n,curve:vn},`${Fn.v}-${Fn.w}`):null}),si.map(Fn=>{const _n=yn.current.node(Fn);return _n?(0,r.jsx)(gt,{setNode:Cs,render:x,node:_n},Fn):null})]})})]})}var En=n(72779),on=n.n(En),Sn,An;const rt=(0,m.Z)(e=>({root:{padding:e.spacing(0),marginBottom:e.spacing(0),marginTop:e.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:e.spacing(6),marginTop:-e.spacing(3),zIndex:"unset"},icon:{fontSize:e.typography.h6.fontSize},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap",color:e.palette.banner.text},message:{display:"flex",alignItems:"center","& a":{color:e.palette.banner.link}},button:{color:(Sn=e.palette.banner.closeButtonColor)!==null&&Sn!==void 0?Sn:"inherit"},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(An=e.palette.banner.warning)!==null&&An!==void 0?An:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),_t=e=>{var s;const{variant:l,message:u,id:g,fixed:x=!1}=e,T=rt(),q=useApi(storageApiRef).forBucket("notifications");var Q;const fe=(Q=q.snapshot("dismissedBanners").value)!==null&&Q!==void 0?Q:[],[ge,Ze]=useState(new Set(fe)),Ie=useObservable(q.observe$("dismissedBanners"));useEffect(()=>{var mt;if(!((mt=Ie)===null||mt===void 0)&&mt.value){var dt,Kt;const kn=(Kt=(dt=Ie)===null||dt===void 0?void 0:dt.value)!==null&&Kt!==void 0?Kt:[];Ze(new Set(kn))}},[(s=Ie)===null||s===void 0?void 0:s.value]);const Ke=()=>{q.set("dismissedBanners",[...ge,g])};return _jsx(Snackbar,{anchorOrigin:x?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!ge.has(g),classes:{root:classNames(T.root,!x&&T.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(T.content,T[l]),message:T.message},message:u,action:[_jsx(IconButton,{title:"Permanently dismiss this message",className:T.button,onClick:Ke,children:_jsx(Close,{className:T.icon})},"dismiss")]})})};var Mt=n(60905),_e=n(90436),Pn=n.p+"static/missingAnnotation.67f79e98..svg",dn=n.p+"static/noInformation.4b426325..svg",$n=n.p+"static/createComponent.975d1e1e..svg",Cn=n.p+"static/noBuild.1715fa71..svg";const Un=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),qn=({missing:e})=>{const s=Un();switch(e){case"field":return(0,r.jsx)("img",{src:Pn,className:s.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:dn,alt:"no Information",className:s.generalImg});case"content":return(0,r.jsx)("img",{src:$n,alt:"create Component",className:s.generalImg});case"data":return(0,r.jsx)("img",{src:Cn,alt:"no Build",className:s.generalImg});default:return null}},Ln=(0,m.Z)(e=>({root:{backgroundColor:e.palette.background.default,padding:e.spacing(2,0,0,0)},action:{marginTop:e.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function zn(e){const{title:s,description:l,missing:u,action:g}=e,x=Ln();return(0,r.jsxs)(Mt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:x.root,spacing:2,children:[(0,r.jsx)(Mt.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Mt.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Mt.Z,{item:!0,xs:!0,children:(0,r.jsx)(_e.Z,{variant:"h5",children:s})}),(0,r.jsx)(Mt.Z,{item:!0,xs:!0,children:(0,r.jsx)(_e.Z,{variant:"body1",children:l})}),(0,r.jsx)(Mt.Z,{item:!0,xs:!0,className:x.action,children:g})]})}),(0,r.jsx)(Mt.Z,{item:!0,xs:12,md:6,className:x.imageContainer,children:typeof u=="string"?(0,r.jsx)(qn,{missing:u}):u.customImage})]})}const we=`apiVersion: backstage.io/v1alpha1
|
|
2
|
-
kind: Component
|
|
3
|
-
metadata:
|
|
4
|
-
name: example
|
|
5
|
-
description: example.com
|
|
6
|
-
annotations:
|
|
7
|
-
ANNOTATION: value
|
|
8
|
-
spec:
|
|
9
|
-
type: website
|
|
10
|
-
lifecycle: production
|
|
11
|
-
owner: user:guest`,he=/^.*ANNOTATION.*$/m,Pe=we.match(he)[0],G=we.split(`
|
|
12
|
-
`).findIndex(e=>he.test(e)),N=(0,m.Z)(e=>({code:{borderRadius:6,margin:e.spacing(2,0),background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function ce(e){return Array.from(Array(e+1).keys(),s=>s+G)}function Ee(e){const s=e.map(l=>Pe.replace("ANNOTATION",l)).join(`
|
|
13
|
-
`);return we.replace(Pe,s)}function Ue(e){const s=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",s?"annotation":"annotations"," ",e.map(l=>(0,r.jsx)("code",{children:l})).reduce((l,u)=>(0,r.jsxs)(r.Fragment,{children:[l,", ",u]}))," ",s?"is":"are"," missing. You need to add the"," ",s?"annotation":"annotations"," to your component if you want to enable this tool."]})}function qe(e){const{annotation:s,readMoreUrl:l}=e,u=Array.isArray(s)?s:[s],g=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",x=N();return(0,r.jsx)(zn,{missing:"field",title:"Missing Annotation",description:Ue(u),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_e.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(A.Z,{className:x.code,children:(0,r.jsx)(xe,{text:Ee(u),language:"yaml",showLineNumbers:!0,highlightedNumbers:ce(u.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(ye.Z,{color:"primary",component:le.r,to:g,children:"Read more"})]})})}var Tt=n(11776),$t=n(38402),ln=n(49378),sn=n(41128),nn=n(27616),re=n(8284),te=n(70660),Y=n(91750),v=n(38016);const k=(e,s)=>(s.palette.type==="light"?sn._j:sn.$n)(s.palette[e].light,.6),M=(e,s)=>(s.palette.type==="light"?sn.$n:sn._j)(s.palette[e].light,.9),H=(0,m.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:s})=>k(s,e)}})),pe=({severity:e})=>{const s=H({severity:e});return(0,r.jsx)(Y.Z,{classes:s})},Se=({severity:e})=>{const s=H({severity:e});return(0,r.jsx)(v.Z,{classes:s})},Oe=(0,m.Z)(e=>({panel:{backgroundColor:({severity:s})=>M(s,e),color:({severity:s})=>k(s,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:s})=>k(s,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:s})=>k(s,e),backgroundColor:({severity:s})=>M(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"}),et=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function tt(e){const{severity:s="warning",title:l,message:u,children:g,defaultExpanded:x}=e,T=Oe({severity:s}),$=et(s)+(l?`: ${l}`:"");return(0,r.jsxs)(nn.Z,{defaultExpanded:x!=null?x:!1,className:T.panel,role:"alert",children:[(0,r.jsxs)(re.Z,{expandIcon:(0,r.jsx)(Se,{severity:s}),className:T.summary,children:[(0,r.jsx)(pe,{severity:s}),(0,r.jsx)(_e.Z,{className:T.summaryText,variant:"subtitle1",children:$})]}),(u||g)&&(0,r.jsx)(te.Z,{children:(0,r.jsxs)(Mt.Z,{container:!0,children:[u&&(0,r.jsx)(Mt.Z,{item:!0,xs:12,children:(0,r.jsx)(_e.Z,{className:T.message,variant:"body1",children:u})}),g&&(0,r.jsx)(Mt.Z,{item:!0,xs:12,className:T.details,children:g})]})})]})}const bt=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),wt=({error:e,message:s,stack:l,children:u})=>{const g=bt();return(0,r.jsxs)(Tt.Z,{dense:!0,children:[(0,r.jsxs)($t.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ln.Z,{classes:{secondary:g.text},primary:"Error",secondary:e}),(0,r.jsx)(Z,{text:e})]}),(0,r.jsxs)($t.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ln.Z,{classes:{secondary:g.text},primary:"Message",secondary:s}),(0,r.jsx)(Z,{text:s})]}),l&&(0,r.jsxs)($t.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ln.Z,{classes:{secondary:g.text},primary:"Stack Trace",secondary:l}),(0,r.jsx)(Z,{text:l})]}),u]})};function at(e){const{title:s,error:l,defaultExpanded:u,children:g}=e;return(0,r.jsx)(tt,{severity:"error",title:s!=null?s:l.message,defaultExpanded:u,children:(0,r.jsx)(wt,{error:l.name,message:l.message,stack:l.stack,children:g})})}var Be=n(85256);const Ct=(0,m.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function Yt(e){var s;const{title:l,error:u,defaultExpanded:g}=e,x=Ct();if(u.name!=="ResponseError")return(0,r.jsx)(at,{title:l!=null?l:u.message,defaultExpanded:g,error:u});const{body:T,cause:$}=u,{request:q,response:Q}=T,fe=`${Q.statusCode}: ${$.name}`,ge=q&&`${q.method} ${q.url}`,Ze=$.message.replace(/\\n/g,`
|
|
14
|
-
`),Ie=(s=$.stack)===null||s===void 0?void 0:s.replace(/\\n/g,`
|
|
15
|
-
`),Ke=JSON.stringify(T,void 0,2);return(0,r.jsxs)(at,{title:l!=null?l:u.message,defaultExpanded:g,error:{name:fe,message:Ze,stack:Ie},children:[ge&&(0,r.jsxs)($t.Z,{alignItems:"flex-start",children:[(0,r.jsx)(ln.Z,{classes:{secondary:x.text},primary:"Request",secondary:q?`${ge}`:void 0}),(0,r.jsx)(Z,{text:ge})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Be.Z,{component:"li",className:x.divider}),(0,r.jsx)($t.Z,{alignItems:"flex-start",children:(0,r.jsx)(ln.Z,{classes:{secondary:x.text},primary:"Full Error as JSON"})}),(0,r.jsx)(xe,{language:"json",text:Ke,showCopyCodeButton:!0})]})]})}var Et=n(28316);function Ft(e){const s=document.createElement("div");return s.setAttribute("id",e),s}function en(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Tn(e){const s=useRef(null);useEffect(function(){const g=document.querySelector(`#${e}`),x=g||Ft(e);return g||en(x),x.appendChild(s.current),function(){s.current.remove(),x.childNodes.length===-1&&x.remove()}},[e]);function l(){return s.current||(s.current=document.createElement("div")),s.current}return l()}var Zt=null;const lt="core.calloutSeen";function Rt(){const[e,s]=useState(()=>{const u=localStorage.getItem(lt);return u?JSON.parse(u):{}}),l=useCallback((u,g)=>{const x=localStorage.getItem(lt),$={...x?JSON.parse(x):{},[u]:g};s($),localStorage.setItem(lt,JSON.stringify($))},[]);return{states:e,setState:l}}function Ht(e){const{states:s,setState:l}=Rt(),u=useCallback(()=>{l(e,!0)},[l,e]);return{seen:s[e]===!0,markSeen:u}}function qt(e){const{seen:s,markSeen:l}=Ht(e);return{show:s===!1,hide:l}}const Sr=(0,m.Z)(e=>({"@keyframes pulsateSlightly":{"0%":{transform:"scale(1.0)"},"100%":{transform:"scale(1.1)"}},"@keyframes pulsateAndFade":{"0%":{transform:"scale(1.0)",opacity:.9},"100%":{transform:"scale(1.5)",opacity:0}},featureWrapper:{position:"relative"},backdrop:{zIndex:2e3,position:"fixed",overflow:"hidden",left:0,right:0,top:0,bottom:0},dot:{position:"absolute",backgroundColor:"transparent",borderRadius:"100%",border:"1px solid rgba(103, 146, 180, 0.98)",boxShadow:"0px 0px 0px 20000px rgba(0, 0, 0, 0.5)",zIndex:2001,transformOrigin:"center center",animation:"$pulsateSlightly 1744ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) alternate infinite"},pulseCircle:{width:"100%",height:"100%",backgroundColor:"transparent",borderRadius:"100%",border:`2px solid ${e.palette.common.white}`,zIndex:2001,transformOrigin:"center center",animation:"$pulsateAndFade 872ms 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite"},text:{position:"absolute",color:e.palette.common.white,zIndex:2003}}),{name:"BackstageFeatureCalloutCircular"});function Or(e){var s,l,u,g,x,T,$,q;const{featureId:Q,title:fe,description:ge,children:Ze}=e,{show:Ie,hide:Ke}=useShowCallout(Q),mt=usePortal("core.callout"),dt=useRef(null),[Kt,kn]=useState(),Kn=Sr(),Ot=useCallback(()=>{if(dt.current){const tn=dt.current.getBoundingClientRect(),vn=Math.max(tn.width,tn.height),Yn=800,cr=tn.x-(vn-tn.width)/2-Yn,Nn=tn.y-(vn-tn.height)/2-Yn,Pr=vn+2*Yn,lo=450,Fr=tn.x+tn.width/2-lo,Ho=tn.y-(vn-tn.height)/2+vn+20;kn({dotLeft:cr,dotTop:Nn,dotSize:Pr,borderWidth:Yn,textTop:Ho,textLeft:Fr,textWidth:lo})}},[]);return useEffect(()=>(window.addEventListener("resize",Ot),window.addEventListener("scroll",Ot),()=>{window.removeEventListener("resize",Ot),window.removeEventListener("scroll",Ot)}),[Ot]),useLayoutEffect(Ot,[dt.current,Ot]),Ie?_jsxs(_Fragment,{children:[_jsx(Box,{className:Kn.featureWrapper,ref:dt,children:Ze}),createPortal(_jsx(Box,{className:Kn.backdrop,children:_jsx(ClickAwayListener,{onClickAway:Ke,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:Kn.dot,"data-testid":"dot",style:{left:(s=Kt)===null||s===void 0?void 0:s.dotLeft,top:(l=Kt)===null||l===void 0?void 0:l.dotTop,width:(u=Kt)===null||u===void 0?void 0:u.dotSize,height:(g=Kt)===null||g===void 0?void 0:g.dotSize,borderWidth:(x=Kt)===null||x===void 0?void 0:x.borderWidth},onClick:Ke,onKeyDown:Ke,role:"button",tabIndex:0,children:_jsx(Box,{className:Kn.pulseCircle})}),_jsxs(Box,{className:Kn.text,"data-testid":"text",style:{left:(T=Kt)===null||T===void 0?void 0:T.textLeft,top:($=Kt)===null||$===void 0?void 0:$.textTop,width:(q=Kt)===null||q===void 0?void 0:q.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:fe}),_jsx(Typography,{children:ge})]})]})})}),mt)]}):_jsx(_Fragment,{children:Ze})}var er=n(35292);const bn=(0,m.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function tr({color:e="primary",disabled:s=!1,href:l="#",icon:u=(0,r.jsx)(er.Z,{}),label:g,onClick:x,title:T}){const $=bn();return s?(0,r.jsxs)(A.Z,{title:T,className:on()($.link,$.disabled),children:[u,(0,r.jsx)(_e.Z,{variant:"caption",component:"span",className:$.label,children:g})]}):(0,r.jsxs)(le.r,{title:T,className:on()($.link,$[e]),to:l,onClick:x,children:[u,(0,r.jsx)(_e.Z,{variant:"caption",component:"span",className:$.label,children:g})]})}const dr=(0,m.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Gr(e){const{links:s}=e,l=dr();return(0,r.jsx)("nav",{className:l.links,children:s.map((u,g)=>(0,r.jsx)(tr,{...u},g+1))})}const Wn=e=>{const s=e==="dark"?"16%":"97%";return`
|
|
16
|
-
hsl(0, 0%, ${s}) 0%,
|
|
17
|
-
hsla(0, 0%, ${s}, 0.987) 8.1%,
|
|
18
|
-
hsla(0, 0%, ${s}, 0.951) 15.5%,
|
|
19
|
-
hsla(0, 0%, ${s}, 0.896) 22.5%,
|
|
20
|
-
hsla(0, 0%, ${s}, 0.825) 29%,
|
|
21
|
-
hsla(0, 0%, ${s}, 0.741) 35.3%,
|
|
22
|
-
hsla(0, 0%, ${s}, 0.648) 41.2%,
|
|
23
|
-
hsla(0, 0%, ${s}, 0.55) 47.1%,
|
|
24
|
-
hsla(0, 0%, ${s}, 0.45) 52.9%,
|
|
25
|
-
hsla(0, 0%, ${s}, 0.352) 58.8%,
|
|
26
|
-
hsla(0, 0%, ${s}, 0.259) 64.7%,
|
|
27
|
-
hsla(0, 0%, ${s}, 0.175) 71%,
|
|
28
|
-
hsla(0, 0%, ${s}, 0.104) 77.5%,
|
|
29
|
-
hsla(0, 0%, ${s}, 0.049) 84.5%,
|
|
30
|
-
hsla(0, 0%, ${s}, 0.013) 91.9%,
|
|
31
|
-
hsla(0, 0%, ${s}, 0) 100%
|
|
32
|
-
`},Kr=100,Cr=10,C=(0,m.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Kr,height:`calc(100% + ${Cr}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-Cr,background:`linear-gradient(90deg, ${Wn(e.palette.type)})`},fadeRight:{right:-Cr,background:`linear-gradient(270deg, ${Wn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function c(e){const[[s,l],u]=React.useState([0,0]);return React.useLayoutEffect(()=>{const g=e.current;if(!g){u([0,0]);return}const x=()=>{const T=g.scrollLeft,$=g.scrollWidth-g.offsetWidth-g.scrollLeft;u([T,$])};return x(),g.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{g.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e]),[s,l]}function b(e,s,l){const[u,g]=React.useState(0);return React.useLayoutEffect(()=>{if(u===0)return;const x=window.performance.now(),T=requestAnimationFrame($=>{if(!e.current)return;const q=$-x,Q=Math.abs(u)*q/s,ge=Math.max(l,Q)*Math.sign(u);e.current.scrollBy({left:ge});const Ze=u-ge;Math.sign(u)!==Math.sign(Ze)?g(0):g(Ze)});return()=>cancelAnimationFrame(T)},[e,u,s,l]),g}function E(e){const{scrollStep:s=100,scrollSpeed:l=50,minScrollDistance:u=5,children:g,...x}=e,T=C(e),$=React.useRef(),[q,Q]=c($),fe=b($,l,u),ge=Ze=>{$.current&&fe(Ze?s:-s)};return _jsxs(Box,{...x,className:T.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:T.container,ref:$,children:g}),_jsx(Box,{className:classNames(T.fade,T.fadeLeft,{[T.fadeHidden]:q===0})}),_jsx(Box,{className:classNames(T.fade,T.fadeRight,{[T.fadeHidden]:Q===0})}),q>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>ge(!1),className:classNames(T.button,T.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Q>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>ge(!0),className:classNames(T.button,T.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const J=(0,m.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function me(e){const s=J(e),{shorthand:l,alpha:u}=e;return l?_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],style:{fontSize:"120%"},children:u?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:s[u?"alpha":"beta"],children:u?"Alpha":"Beta"})}const je=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function ke(e){const{Progress:s}=(0,h.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(je,{...e})})}var He=n(28865),Gt=n(60251);const cn=(0,m.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),gn=(e,s)=>s?typeof s=="string"?e+s:f.Children.toArray(s.props.children).reduce(gn,e):e,Vn=({level:e,children:s})=>{const g=f.Children.toArray(s).reduce(gn,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:g},s)},zt={code:({inline:e,className:s,children:l,...u})=>{const g=String(l).replace(/\n+$/,""),x=/language-(\w+)/.exec(s||"");return!e&&x?(0,r.jsx)(xe,{language:x[1],text:g}):(0,r.jsx)("code",{className:s,...u,children:l})},h1:Vn,h2:Vn,h3:Vn,h4:Vn,h5:Vn,h6:Vn};function rn(e){const{content:s,dialect:l="gfm",linkTarget:u,transformLinkUri:g,transformImageUri:x,className:T}=e,$=cn();return(0,r.jsx)(He.D,{remarkPlugins:l==="gfm"?[Gt.Z]:[],className:`${$.markdown} ${T}`,children:s,components:zt,linkTarget:u,transformLinkUri:g,transformImageUri:x})}var nr=n(23054);const rr=(0,m.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),wr=({request:e,busy:s,setBusy:l})=>{const u=rr(),[g,x]=useState(),T=async()=>{l(!0);try{await e.trigger()}catch(q){x(isError(q)?q.message:"An unspecified error occurred")}finally{l(!1)}},$=e.provider.icon;return _jsxs(ListItem,{disabled:s,classes:{root:u.root},children:[_jsx(ListItemAvatar,{children:_jsx($,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:g&&_jsx(Typography,{color:"error",children:g})}),_jsx(Button,{color:"primary",variant:"contained",onClick:T,children:"Log in"})]})};var or=null;const Go=(0,m.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function ws(e){const s=Go(),[l,u]=useState(!1),g=useApi(oauthRequestApiRef),x=useApi(configApiRef);var T;const $=(T=x.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&T!==void 0?T:!1,q=useObservable(useMemo(()=>g.authRequest$(),[g]),[]),Q=()=>{q.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(q.length),fullWidth:!0,maxWidth:"xs",classes:{paper:s.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:s.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:s.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),$?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:s.contentList},children:_jsx(List,{children:q.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:u},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:s.actionButtons},children:_jsx(Button,{onClick:Q,children:"Reject All"})})]})}var Ko=n(15277),Yo=n.n(Ko),kr=n(29862);const gr=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Yr(e){const[s,l]=(0,f.useState)(!1),u=(0,kr.t)(),g=gr(),x=$=>{u()&&l($)};var T;return(0,r.jsx)(R.ZP,{title:(T=e.title)!==null&&T!==void 0?T:e.text||"",placement:e.placement,disableHoverListener:!s,children:(0,r.jsx)(Yo(),{text:e.text,line:e.line,onToggled:x,containerClassName:g.container})})}var eo=n(67358);function wo(e){const s=(0,se.Z)(),[l,u]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const g=setTimeout(()=>u(!0),s.transitions.duration.short);return()=>clearTimeout(g)},[s.transitions.duration.short]),l?(0,r.jsx)(eo.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(A.Z,{display:"none"})}var jo=n(94339),zr=n(14503),Jo=n(24579),Eo=n(32552),Zn=n(15459),mr=n(27597);const Jr=(0,m.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function Qr(e){const{link:s,title:l,onClick:u}=e,g=Jr();return(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(Be.Z,{}),(0,r.jsx)(le.r,{to:s,onClick:u,underline:"none",children:(0,r.jsxs)(A.Z,{display:"flex",alignItems:"center",className:g.root,children:[(0,r.jsx)(A.Z,{className:g.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(_e.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(mr.Z,{className:g.arrow})]})})]})}const Qo=e=>{const{slackChannel:s}=e;if(s){if(typeof s=="string")return(0,r.jsxs)(_e.Z,{children:["Please contact ",s," for help."]});if(!s.href)return(0,r.jsxs)(_e.Z,{children:["Please contact ",s.name," for help."]})}else return null;return(0,r.jsx)(de,{to:s.href,variant:"contained",children:s.name})},jr=class extends f.Component{componentDidCatch(s,l){console.error(`ErrorBoundary, error: ${s}, info: ${l}`),this.setState({error:s,errorInfo:l})}render(){const{slackChannel:s,children:l}=this.props,{error:u}=this.state;return u?(0,r.jsx)(at,{title:"Something Went Wrong",error:u,children:(0,r.jsx)(Qo,{slackChannel:s})}):l}constructor(s){super(s),this.state={error:void 0,errorInfo:void 0}}},Ao=(0,m.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),To=(0,Zn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(zr.Z),Ro={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function Wr(e){const{title:s,subheader:l,divider:u=!0,deepLink:g,slackChannel:x,errorBoundaryProps:T,variant:$,children:q,headerStyle:Q,headerProps:fe,icon:ge,action:Ze,actionsClassName:Ie,actions:Ke,cardClassName:mt,actionsTopRight:dt,className:Kt,noPadding:kn,titleTypographyProps:Kn}=e,Ot=Ao();let tn={},vn={};$&&$.split(/[\s]+/g).forEach(Pr=>{tn={...tn,...Ro.card[Pr]},vn={...vn,...Ro.cardContent[Pr]}});const Yn=()=>!l&&!ge?null:(0,r.jsxs)("div",{className:Ot.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:Ot.subheader,children:l}),ge]}),cr=T||(x?{slackChannel:x}:{});return(0,r.jsx)(jo.Z,{style:tn,className:Kt,children:(0,r.jsxs)(jr,{...cr,children:[s&&(0,r.jsx)(Eo.Z,{classes:{root:Ot.header,title:Ot.headerTitle,subheader:Ot.headerSubheader,avatar:Ot.headerAvatar,action:Ot.headerAction,content:Ot.headerContent},title:s,subheader:Yn(),action:Ze,style:{...Q},titleTypographyProps:Kn,...fe}),dt&&(0,r.jsx)(To,{children:dt}),u&&(0,r.jsx)(Be.Z,{}),(0,r.jsx)(Jo.Z,{className:on()(mt,{[Ot.noPadding]:kn}),style:vn,children:q}),Ke&&(0,r.jsx)(zr.Z,{className:Ie,children:Ke}),g&&(0,r.jsx)(Qr,{...g})]})})}var Io=n(39307);const Xo=(0,m.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),po={fractional:!0,inverse:!1,unit:"%",max:100},Po=({palette:e,value:s,inverse:l,max:u})=>{if(isNaN(s))return"#ddd";const g=u||po.max,x=l?g-s:s;return x<g/3?e.status.error:x<g*(2/3)?e.status.warning:e.status.ok};function js(e){const[s,l]=useState(null),{getColor:u=Po}=e,g=Xo(e),{palette:x}=useTheme(),{value:T,fractional:$,inverse:q,unit:Q,max:fe,description:ge}={...po,...e},Ze=$?Math.round(T*fe):T,Ie=fe!==100?Math.round(T):Ze,[Ke,mt]=useState(!1);return useEffect(()=>{const dt=s,Kt=()=>mt(!0),kn=()=>mt(!1);return dt&&ge?(dt.addEventListener("mouseenter",Kt),dt.addEventListener("mouseleave",kn),()=>{dt.removeEventListener("mouseenter",Kt),dt.removeEventListener("mouseleave",kn)}):()=>{mt(!1)}},[ge,s]),_jsxs(Box,{ref:l,className:g.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Ze,strokeWidth:12,trailWidth:12,strokeColor:u({palette:x,value:Ie,inverse:q,max:fe}),className:g.circle}),ge&&Ke?_jsx(Box,{className:g.description,children:ge}):_jsx(Box,{className:g.overlay,children:isNaN(T)?"N/A":`${Ie}${Q}`})]})}const Lo=(0,m.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function vr(e){const s=Lo(e),{title:l,subheader:u,progress:g,inverse:x,deepLink:T,description:$,icon:q,variant:Q,getColor:fe}=e,ge={inverse:x,description:$,getColor:fe,value:g};return _jsx(Box,{className:s.root,children:_jsx(InfoCard,{title:l,subheader:u,deepLink:T,variant:Q,icon:q,children:_jsx(Gauge,{...ge})})})}function ai(e){const{value:s,getColor:l=getProgressColor,width:u="thick"}=e,{palette:g}=useTheme();if(isNaN(s))return null;let x=Math.round(s*100*100)/100;x>100&&(x=100);const T=u==="thick"?4:1,$=l({palette:g,value:x,inverse:!1,max:100});return _jsx(Tooltip,{title:`${x}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:x,strokeWidth:T,trailWidth:T,strokeColor:$})})})}var _o=n(21324),Es=n(7089),ho=n(42494),to=n(74603),no=n(56939),ro=n(12231),Br=n(73698),sr=n(12420),fo=n(72379);const qo=(0,m.Z)(e=>(0,sr.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var oo=()=>{const e=qo();return(0,r.jsx)(fo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const es=(0,m.Z)(e=>(0,sr.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var ts=()=>{const e=es();return(0,r.jsx)(fo.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const ns=(0,Zn.Z)(e=>(0,sr.Z)({root:{"label + &":{marginTop:e.spacing(3)},"&.Mui-focused > div[role=button]":{borderColor:e.palette.primary.main}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(to.Z),go=(0,m.Z)(e=>(0,sr.Z)({formControl:{margin:e.spacing(1,0),maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function Oo(e){const{multiple:s,items:l,label:u,placeholder:g,selected:x,onChange:T,triggerReset:$,native:q=!1,disabled:Q=!1,margin:fe}=e,ge=go(),[Ze,Ie]=(0,f.useState)(x||(s?[]:"")),[Ke,mt]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ie(s?[]:"")},[$,s]),(0,f.useEffect)(()=>{Ie(x||(s?[]:""))},[x,s]);const dt=Ot=>{Ie(Ot.target.value),T(Ot.target.value)},Kt=Ot=>{if(Q){Ot.preventDefault();return}mt(tn=>s&&!(Ot.target instanceof HTMLElement)?!0:!tn)},kn=()=>{mt(!1)},Kn=Ot=>()=>{const tn=Ze.filter(vn=>vn!==Ot);Ie(tn),T(tn)};return(0,r.jsx)(A.Z,{className:ge.root,children:(0,r.jsxs)(ho.Z,{className:ge.formControl,children:[(0,r.jsx)(no.Z,{className:ge.formLabel,children:u}),(0,r.jsxs)(Br.Z,{"aria-label":u,value:Ze,native:q,disabled:Q,"data-testid":"select",displayEmpty:!0,multiple:s,margin:fe,onChange:dt,open:Ke,onOpen:Kt,onClose:kn,input:(0,r.jsx)(ns,{}),label:u,renderValue:Ot=>{var tn;return s&&Ze.length!==0?(0,r.jsx)(A.Z,{className:ge.chips,children:Ot.map(vn=>{var Yn,cr;return(0,r.jsx)(Es.Z,{label:(Yn=l.find(Nn=>Nn.value===vn))===null||Yn===void 0?void 0:Yn.label,clickable:!0,onDelete:Kn(vn),className:ge.chip},(cr=l.find(Nn=>Nn.value===vn))===null||cr===void 0?void 0:cr.value)})}):(0,r.jsx)(_e.Z,{children:Ze.length===0?g||"":(tn=l.find(vn=>vn.value===Ot))===null||tn===void 0?void 0:tn.label})},IconComponent:()=>Ke?(0,r.jsx)(ts,{}):(0,r.jsx)(oo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[g&&!s&&(0,r.jsx)(ro.Z,{value:[],children:g}),q?l&&l.map(Ot=>(0,r.jsx)("option",{value:Ot.value,children:Ot.label},Ot.value)):l&&l.map(Ot=>(0,r.jsxs)(ro.Z,{value:Ot.value,children:[s&&(0,r.jsx)(_o.Z,{color:"primary",checked:Ze.includes(Ot.value)||!1,className:ge.checkbox}),Ot.label]},Ot.value))]})]})})}const mo=()=>{},Rs=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:mo,stepHistory:[],setStepHistory:mo,onStepChange:mo});function li(e){const{children:s,elevated:l,onStepChange:u,activeStep:g=0}=e,[x,T]=useState(g),[$,q]=useState([0]);useEffect(()=>{T(g)},[g]);const Q=[];let fe;return Children.forEach(s,ge=>{isValidElement(ge)&&(ge.props.end?fe=ge:Q.push(ge))}),_jsxs(_Fragment,{children:[_jsx(Rs.Provider,{value:{stepIndex:x,setStepIndex:T,stepHistory:$,setStepHistory:q,onStepChange:u,stepperLength:Children.count(s)},children:_jsx(MuiStepper,{activeStep:x,orientation:"vertical",elevation:l?2:0,children:Q})}),x>=Children.count(s)-1&&fe]})}const rs=(0,m.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),os=({text:e,handleClick:s})=>_jsx(Button,{onClick:s,children:e||"Reset"}),un=({text:e,handleClick:s,disabled:l,last:u,stepIndex:g})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${g}`,onClick:s,children:e||(u?"Finish":"Next")}),Is=({text:e,handleClick:s,disabled:l,stepIndex:u})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${u}`,onClick:s,children:e||"Skip"}),y=({text:e,handleClick:s,disabled:l,stepIndex:u})=>_jsx(Button,{onClick:s,"data-testid":`backButton-${u}`,disabled:l,children:e||"Back"}),j=({actions:e={},children:s})=>{const l=rs(),{stepperLength:u,stepIndex:g,setStepIndex:x,stepHistory:T,setStepHistory:$,onStepChange:q}=useContext(VerticalStepperContext),Q=(Ie,Ke)=>{Ke&&Ke(),q&&q(g,Ie),x(Ie)},fe=()=>{const Ie=e.nextStep?e.nextStep(g,u-1):g+1;Q(Ie,e.onNext),$([...T,Ie])},ge=()=>{T.pop(),Q(T[T.length-1],e.onBack),$([...T])},Ze=()=>{Q(0,e.onRestart),$([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&g!==0&&_jsx(y,{text:e.backText,handleClick:ge,disabled:g===0,stepIndex:g}),e.showSkip&&_jsx(Is,{text:e.skipText,handleClick:fe,disabled:!!u&&g>=u||!!e.canSkip&&!e.canSkip(),stepIndex:g}),[void 0,!0].includes(e.showNext)&&_jsx(un,{text:e.nextText,handleClick:fe,disabled:!!u&&g>=u||!!e.canNext&&!e.canNext(),stepIndex:g}),e.showRestart&&g!==0&&_jsx(os,{text:e.restartText,handleClick:Ze,stepIndex:g}),s]})},L=(0,m.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function P(e){const{title:s,children:l,end:u,actions:g,...x}=e,T=L();return u?_jsxs(Box,{className:T.end,children:[_jsx(Typography,{variant:"h6",children:s}),l,_jsx(SimpleStepperFooter,{actions:{...g||{},showNext:!1}})]}):_jsxs(MuiStep,{...x,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:s})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:g})]})]})}const ae=(0,m.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function oe(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function _(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ue(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ae(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Re(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.running),"aria-label":"Status running","aria-hidden":"true",...e})}function ze(e){const s=ae(e);return _jsx(Typography,{component:"span",className:classNames(s.status,s.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Ne=n(74600),We=n(15584);const it=e=>(0,sr.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),jt={root:{border:"0",verticalAlign:"top"}},$e=e=>(0,sr.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Je=e=>(0,sr.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),At=(0,Zn.Z)(it,{name:"BackstageMetadataTableTitleCell"})(We.Z),an=(0,Zn.Z)(jt,{name:"BackstageMetadataTableCell"})(We.Z),Rn=({dense:e,children:s})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:s})}),Lt=({title:e,children:s,...l})=>_jsxs(TableRow,{children:[e&&_jsx(At,{children:e}),_jsx(an,{colSpan:e?1:2,...l,children:s})]}),It=(0,Zn.Z)($e,{name:"BackstageMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(Tt.Z,{disablePadding:!0,className:e.root,children:s})),Qt=(0,Zn.Z)(Je,{name:"BackstageMetadataTableListItem"})(({classes:e,children:s})=>(0,r.jsx)($t.Z,{className:e.root,children:s})),In=(0,sr.Z)({root:{margin:"0 0",listStyleType:"none"}}),yr=e=>(0,sr.Z)({root:{...In.root,paddingLeft:e.spacing(1)}}),$r=(0,Zn.Z)(In,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:s})=>(0,r.jsx)(It,{classes:e,children:s})),Xr=(0,Zn.Z)(yr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:s})=>(0,r.jsx)(It,{classes:e,children:s}));function Hn(e,s){const l=e.map((u,g)=>_jsx(MetadataListItem,{children:Dn(u)},g));return s?_jsx(Xr,{children:l}):_jsx($r,{children:l})}function mn(e,s,l){const u=Object.keys(e).map(g=>{const x=Dn(e[g],!0),T=l&&l.titleFormat?l.titleFormat(g):startCase(g);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${T}: `}),x]},g)});return s?_jsx(Xr,{children:u}):_jsx($r,{children:u})}function Dn(e,s,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?mn(e,s,l):Array.isArray(e)?Hn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Er=({value:e,options:s})=>_jsx(Fragment,{children:Dn(e,s)}),ci=({title:e,value:s,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Er,{value:s,options:l})});function di(e,s){return Object.keys(e).map(l=>_jsx(ci,{title:l,value:e[l],options:s},l))}function Sa(e){const{metadata:s,dense:l=!0,options:u}=e,g=di(s,u||{});return _jsx(MetadataTable,{dense:l,children:g})}var ui=n(49429),Ps=n(86136),Ls=n(50758),vo=n(79784),so=n(76635),pi=n(19126),Os=n.n(pi);function hi(e){return qs.stringify(e,{strictNullHandling:!0})}function ks(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function ss(e,s){return ks(e)[s]}function yo(e,s,l){const u={...ks(e),[s]:l};return hi(u)}function fi(e,s=250){const[l,u]=useSearchParams(),g=l.toString(),[x,T]=useState(ss(g,e));return useEffect(()=>{const $=ss(g,e);T(q=>isEqual($,q)?q:$)},[g,T,e]),useDebouncedEffect(()=>{const $=yo(g,e,x);g!==$&&u($,{replace:!0})},[u,x,g,e],s),[x,T]}const Bs={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 gi(){var e;const u=(e=(0,h.I_)().get(h.Ds))===null||e===void 0?void 0:e.getOptionalConfig("app.support");if(!u)return Bs;var g;return{url:u.getString("url"),items:u.getConfigArray("items").flatMap(x=>({title:x.getString("title"),icon:x.getOptionalString("icon"),links:((g=x.getOptionalConfigArray("links"))!==null&&g!==void 0?g:[]).flatMap(T=>({url:T.getString("url"),title:T.getString("title")}))}))}}var ko=n(80079);function ur(e,s){const u=(0,h.qD)().getSystemIcon(e);return u?(0,r.jsx)(u,{...s}):(0,r.jsx)(ko.Z,{...s})}function Ca(e){return ur("brokenImage",e)}function wa(e){return ur("catalog",e)}function ja(e){return ur("chat",e)}function Ea(e){return ur("dashboard",e)}function Aa(e){return ur("docs",e)}function Ta(e){return ur("email",e)}function Ra(e){return ur("github",e)}function Ia(e){return ur("group",e)}function xo(e){return ur("help",e)}function Pa(e){return ur("user",e)}function La(e){return ur("warning",e)}const $s=(0,m.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),Oa=({icon:e})=>{const s=(0,h.qD)();var l;const u=e&&(l=s.getSystemIcon(e))!==null&&l!==void 0?l:xo;return(0,r.jsx)(u,{})};var Ds;const mi=({link:e})=>(0,r.jsx)(le.r,{to:e.url,children:(Ds=e.title)!==null&&Ds!==void 0?Ds:e.url}),vi=({item:e})=>{var s;return(0,r.jsxs)(ro.Z,{children:[(0,r.jsx)(Ps.Z,{children:(0,r.jsx)(Oa,{icon:e.icon})}),(0,r.jsx)(ln.Z,{primary:e.title,secondary:(s=e.links)===null||s===void 0?void 0:s.reduce((l,u,g)=>[...l,g>0&&(0,r.jsx)("br",{},g),(0,r.jsx)(mi,{link:u},u.url)],[])})]})};function yi(e){const{title:s,items:l,children:u}=e,{items:g}=gi(),[x,T]=(0,f.useState)(!1),[$,q]=(0,f.useState)(null),Q=$s(),fe=(0,Ce.Z)(Ie=>Ie.breakpoints.down("sm")),ge=Ie=>{q(Ie.currentTarget),T(!0)},Ze=()=>{T(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(K.Z,{color:"primary",size:"small",onClick:ge,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(xo,{})}):(0,r.jsx)(ye.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:ge,startIcon:(0,r.jsx)(xo,{}),children:"Support"})}),(0,r.jsxs)(vo.ZP,{"data-testid":"support-button-popover",open:x,anchorEl:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Ze,children:[(0,r.jsxs)(Ls.Z,{className:Q.popoverList,autoFocusItem:Boolean($),children:[s&&(0,r.jsx)(ro.Z,{alignItems:"flex-start",children:(0,r.jsx)(_e.Z,{variant:"subtitle1",children:s})}),f.Children.map(u,(Ie,Ke)=>(0,r.jsx)(ro.Z,{alignItems:"flex-start",children:Ie},`child-${Ke}`)),(l!=null?l:g).map((Ie,Ke)=>(0,r.jsx)(vi,{item:Ie},`item-${Ke}`))]}),(0,r.jsx)(ui.Z,{children:(0,r.jsx)(ye.Z,{color:"primary",onClick:Ze,"aria-label":"Close",children:"Close"})})]})]})}var is=n(18671),ir=n(73557),Bo=n(84800);const xi=(0,m.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Ns(e){const{className:s,stretch:l,noPadding:u,children:g,...x}=e,T=xi();return(0,r.jsx)("article",{...x,className:on()(T.root,s,{[T.stretch]:l,[T.noPadding]:u}),children:g})}var ka=n(6487),io=n(99152);const bi=(0,m.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Gn(e){const{tabs:s,onChange:l,selectedIndex:u}=e,[g,x]=(0,f.useState)(u!=null?u:0),T=bi(),$=(0,f.useCallback)((q,Q)=>{u===void 0&&x(Q),l&&u!==Q&&l(Q)},[u,l]);return(0,f.useEffect)(()=>{u!==void 0&&x(u)},[u]),(0,r.jsx)(A.Z,{className:T.tabsWrapper,children:(0,r.jsx)(io.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:$,value:g,children:s.map((q,Q)=>(0,f.createElement)(ka.Z,{...q.tabProps,"data-testid":`header-tab-${Q}`,label:q.label,key:q.id,value:Q,className:T.defaultTab,classes:{selected:T.selected,root:T.tabRoot}}))})})}function Ba(e){const s=(0,ir.UO)(),u=e.map(({path:Ze,children:Ie})=>({caseSensitive:!1,path:`${Ze}/*`,element:Ie})).sort((Ze,Ie)=>Ie.path.replace(/\/\*$/,"").localeCompare(Ze.path.replace(/\/\*$/,"")));var g;const x=(g=(0,ir.V$)(u))!==null&&g!==void 0?g:e[0].children;var T;let $=(T=s["*"])!==null&&T!==void 0?T:"";$.startsWith("/")||($=`/${$}`);var q;const[Q]=(q=(0,Bo.fp)(u,$))!==null&&q!==void 0?q:[],fe=Q?e.findIndex(Ze=>`${Ze.path}/*`===Q.route.path):0;var ge;return{index:fe===-1?0:fe,element:x,route:(ge=e[fe])!==null&&ge!==void 0?ge:e[0]}}function Si(e){const{routes:s}=e,l=(0,ir.s0)(),{index:u,route:g,element:x}=Ba(s),T=(0,f.useMemo)(()=>s.map(q=>({id:q.path,label:q.title,tabProps:q.tabProps})),[s]),$=q=>{let{path:Q}=s[q];Q=Q.replace(/\/\*$/,""),Q=Q.replace(/^\//,""),l(Q)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Gn,{tabs:T,selectedIndex:u,onChange:$}),(0,r.jsxs)(Ns,{children:[(0,r.jsx)(is.q,{title:g.title}),x]})]})}const Fs=()=>null;(0,h.R5)(Fs,"core.gatherMountPoints",!0);function Zs(e){const s=(0,r.jsx)(Fs,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return Zs(l.props.children);if(l.type!==s)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:u,title:g,children:x,tabProps:T}=l.props;return[{path:u,title:g,children:x,tabProps:T}]})}function $a(e){const s=Zs(e.children);return(0,r.jsx)(Si,{routes:s})}$a.Route=Fs;const Da=(0,m.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function as(e){const{value:s,subvalue:l}=e,u=Da();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{className:u.value,children:s}),(0,r.jsx)(A.Z,{className:u.subvalue,children:l})]})}var $o=n(67222),Do=n(21070),No=n(90324),Fo=n(98281),Ci=n(48049),ls=n(51209),cs=n(33375),wi=n(44233),ji=n(27604),ds=n(36444),Ei=n(37971),Ai=n(59709),Na=n(17373),Ti=n(3702),Ri=n(93111);const us=(0,m.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),Ii=e=>{var s;const l=us(),{onChangeFilters:u}=e,[g,x]=(0,f.useState)({...e.selectedFilters}),[T,$]=(0,f.useState)(!1),q=()=>{x({}),$(Q=>!Q)};return(0,f.useEffect)(()=>{u(g)},[g,u]),(0,r.jsxs)(A.Z,{className:l.root,children:[(0,r.jsxs)(A.Z,{className:l.header,children:[(0,r.jsx)(A.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ye.Z,{color:"primary",onClick:q,children:"Clear all"})]}),(0,r.jsx)(A.Z,{className:l.filters,children:((s=e.filters)===null||s===void 0?void 0:s.length)&&e.filters.map(Q=>(0,r.jsx)(Oo,{triggerReset:T,...Q.element,selected:g[Q.element.label],onChange:fe=>x({...g,[Q.element.label]:fe})},Q.element.label))})]})};var Pi=n(4614);const ps={Add:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Do.Z,{...e,ref:s})),Check:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Fo.Z,{...e,ref:s})),Clear:(0,f.forwardRef)((e,s)=>(0,r.jsx)(cs.Z,{...e,ref:s})),Delete:(0,f.forwardRef)((e,s)=>(0,r.jsx)(wi.Z,{...e,ref:s})),DetailPanel:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ls.Z,{...e,ref:s})),Edit:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ji.Z,{...e,ref:s})),Export:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ti.Z,{...e,ref:s})),Filter:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ds.Z,{...e,ref:s})),FirstPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ei.Z,{...e,ref:s})),LastPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ai.Z,{...e,ref:s})),NextPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ls.Z,{...e,ref:s})),PreviousPage:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ci.Z,{...e,ref:s})),ResetSearch:(0,f.forwardRef)((e,s)=>(0,r.jsx)(cs.Z,{...e,ref:s})),Search:(0,f.forwardRef)((e,s)=>(0,r.jsx)(ds.Z,{...e,ref:s})),SortArrow:(0,f.forwardRef)((e,s)=>(0,r.jsx)(No.Z,{...e,ref:s})),ThirdStateCheck:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Na.Z,{...e,ref:s})),ViewColumn:(0,f.forwardRef)((e,s)=>(0,r.jsx)(Ri.Z,{...e,ref:s}))};function Us(e,s){const l=s.split(".");let u=e[l[0]];for(let g=1;g<l.length;++g){if(u===void 0)return u;const x=l[g];u=u[x]}return u}const Li=(0,Zn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})($o.W$),Ms=(0,Zn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})($o.UW),Oi=(0,m.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Fa=(0,m.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function ki(e,s){return e.map(l=>{var u;const g=(u=l.headerStyle)!==null&&u!==void 0?u:{};let x=l.cellStyle||{};if(l.highlight)if(g.color=s.palette.textContrast,typeof x=="object")x.fontWeight=s.typography.fontWeightBold;else{const T=x;x=($,q,Q)=>({...T($,q,Q),fontWeight:s.typography.fontWeightBold})}return{...l,headerStyle:g,cellStyle:x}})}function Bi(e,s){return(0,so.transform)(e,(l,u,g)=>{(0,so.isEqual)(u,s[g])||(l[g]=u)})}const zs={search:"",filtersOpen:!1,filters:{}};function $i(e){const{toolbarRef:s,setSearch:l,hasFilters:u,selectedFiltersLength:g,toggleFilters:x}=e,T=Oi(),$=(0,f.useCallback)(q=>{e.onSearchChanged(q),l(q)},[e,l]);return u?(0,r.jsxs)(A.Z,{className:T.root,children:[(0,r.jsxs)(A.Z,{className:T.root,children:[(0,r.jsx)(K.Z,{onClick:x,"aria-label":"filter list",children:(0,r.jsx)(ds.Z,{})}),(0,r.jsxs)(_e.Z,{className:T.title,children:["Filters (",g,")"]})]}),(0,r.jsx)(Ms,{...e,ref:s,onSearchChanged:$})]}):(0,r.jsx)(Ms,{...e,ref:s,onSearchChanged:$})}function hs(e){var s,l;const{data:u,columns:g,options:x,title:T,subtitle:$,filters:q,initialState:Q,emptyContent:fe,onStateChange:ge,components:Ze,isLoading:Ie,...Ke}=e,mt=Fa(),dt=(0,se.Z)(),Kt={...zs,...Q},[kn,Kn]=(0,f.useState)(Kt.filtersOpen),Ot=(0,f.useCallback)(()=>Kn(Xn=>!Xn),[Kn]),[tn,vn]=(0,f.useState)(0),[Yn,cr]=(0,f.useState)(u),[Nn,Pr]=(0,f.useState)(Kt.filters),lo=ki(g,dt),[Fr,Ho]=(0,f.useState)(Kt.search);(0,f.useEffect)(()=>{if(ge){const Xn=Bi({search:Fr,filtersOpen:kn,filters:Nn},zs);ge(Xn)}},[Fr,kn,Nn,ge]);const yn={headerStyle:{textTransform:"uppercase"}},co=(0,f.useCallback)(Xn=>{var hr;return(hr=g.find(Lr=>Lr.title===Xn))===null||hr===void 0?void 0:hr.field},[g]);(0,f.useEffect)(()=>{if(typeof u=="function")return;if(!Nn){cr(u);return}const Xn=Object.values(Nn);if(u&&Xn.flat().length){const hr=u.filter(Lr=>!!Object.entries(Nn).filter(([,So])=>!!So.length).every(([So,Jn])=>{const fr=Us(Lr,co(So));return Array.isArray(fr)&&Array.isArray(Jn)?fr.some(Co=>Jn.includes(Co)):Array.isArray(fr)?fr.includes(Jn):Array.isArray(Jn)?Jn.includes(fr):fr===Jn}));cr(hr)}else cr(u);vn(Xn.flat().length)},[u,Nn,co]);const ya=(Xn,hr)=>{const Lr=Jn=>{const fr=new Set,Co=Zr=>{Zr!=null&&fr.add(Zr)};return hr&&hr.forEach(Zr=>{const Cs=Us(Zr,co(Jn));Array.isArray(Cs)?Cs.forEach(Co):Co(Cs)}),fr},So=Jn=>({placeholder:"All results",label:Jn.column,multiple:Jn.type==="multiple-select",items:[...Lr(Jn.column)].sort().map(fr=>({label:fr,value:fr}))});return Xn.map(Jn=>({type:Jn.type,element:So(Jn)}))},uo=!!(!((s=q)===null||s===void 0)&&s.length),xa=(0,f.useCallback)(Xn=>(0,r.jsx)($i,{setSearch:Ho,hasFilters:uo,selectedFiltersLength:tn,toggleFilters:Ot,...Xn}),[Ot,uo,tn,Ho]),si=typeof u!="function"&&u.length===0,Ss=g.length,ba=(0,f.useCallback)(Xn=>Ie?(0,r.jsx)("tbody",{"data-testid":"loading-indicator",children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Ss,children:(0,r.jsx)(A.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",minHeight:"15rem"},children:(0,r.jsx)(Pi.Z,{size:"5rem"})})})})}):fe&&si?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Ss,children:fe})})}):(0,r.jsx)($o.os,{...Xn}),[si,fe,Ss,Ie]);return(0,r.jsxs)(A.Z,{className:mt.root,children:[kn&&u&&typeof u!="function"&&((l=q)===null||l===void 0?void 0:l.length)&&(0,r.jsx)(Ii,{filters:ya(q,u),selectedFilters:Nn,onChangeFilters:Pr}),(0,r.jsx)($o.ZP,{components:{Header:Li,Toolbar:xa,Body:ba,...Ze},options:{...yn,...x},columns:lo,icons:ps,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_e.Z,{variant:"h5",component:"h2",children:T}),$&&(0,r.jsx)(_e.Z,{color:"textSecondary",variant:"body1",children:$})]}),data:typeof u=="function"?u:Yn,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...Ke})]})}hs.icons=Object.freeze(ps);var Ws=n(44311);function Di(e,s){const l=e[e.length-1];if(l)return l>=.9?s.palette.status.ok:l>=.5?s.palette.status.warning:s.palette.status.error}function Za(e){const s=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:Di(e.data,s)})]})}const Ni=e=>(0,m.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"}),Fi=({title:e="Unknown page",className:s})=>(0,r.jsx)(_e.Z,{variant:"h4",component:"h2",className:s,"data-testid":"header-title",children:e});function Ua(e){const{description:s,title:l,titleComponent:u=void 0,children:g,textAlign:x="left"}=e,T=Ni({textAlign:x})(),$=u||(0,r.jsx)(Fi,{title:l,className:T.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(is.q,{title:l}),(0,r.jsxs)(A.Z,{className:T.container,children:[(0,r.jsxs)(A.Z,{className:T.leftItemsBox,children:[$,s&&(0,r.jsx)(_e.Z,{className:T.description,variant:"body2",children:s})]}),(0,r.jsx)(A.Z,{className:T.rightItemsBox,children:g})]})]})}var bo=n.p+"static/mic-drop.fe3ef4d0..svg";const Ma=(0,m.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:e.spacing(10,"auto",4)}}}),{name:"BackstageErrorPageMicDrop"}),za=()=>{const e=Ma();return(0,r.jsx)("img",{src:bo,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Vs=(0,m.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Wa(e){const{status:s,statusMessage:l,additionalInfo:u,supportUrl:g}=e,x=Vs(),T=(0,ir.s0)(),$=gi();return(0,r.jsxs)(Mt.Z,{container:!0,spacing:0,className:x.container,children:[(0,r.jsxs)(Mt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(_e.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",s,": ",l]}),(0,r.jsx)(_e.Z,{variant:"body1",className:x.subtitle,children:u}),(0,r.jsx)(_e.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(_e.Z,{variant:"h6",children:[(0,r.jsx)(le.r,{to:"#","data-testid":"go-back-link",onClick:()=>T(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(le.r,{to:g||$.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(za,{})]})}var Va=n(16173);const Zi=(0,Zn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(_e.Z),fs=(0,Zn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(A.Z);function Hs(e){const{children:s,...l}=e,[u,g]=f.useState(null),x=f.Children.toArray(s),[T,$,...q]=x,Q=q.length?q.pop():x[x.length-1],fe=x.length>3,ge=Ke=>{g(Ke.currentTarget)},Ze=()=>{g(null)},Ie=Boolean(u);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Va.Z,{"aria-label":"breadcrumb",...l,children:[x.length>1&&(0,r.jsx)(fs,{clone:!0,children:T}),x.length>2&&(0,r.jsx)(fs,{clone:!0,children:$}),fe&&(0,r.jsx)(Zi,{onClick:ge,children:"..."}),(0,r.jsx)(A.Z,{style:{fontStyle:"italic"},children:Q})]}),(0,r.jsx)(vo.ZP,{open:Ie,anchorEl:u,onClose:Ze,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Tt.Z,{children:q.map((Ke,mt)=>(0,r.jsx)($t.Z,{button:!0,children:(0,r.jsx)(fs,{clone:!0,children:Ke})},mt))})})]})}const gs=72,Ui=24,ms=18,Ar={drawerWidthClosed:gs,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:gs,iconSize:gs-Ui*2,iconPadding:Ui,selectedIndicatorWidth:3,userBadgePadding:ms,userBadgeDiameter:gs-ms*2,mobileSidebarHeight:56},Mi=e=>({...Ar,...e,iconContainerWidth:Ar.drawerWidthClosed,iconSize:Ar.drawerWidthClosed-Ar.iconPadding*2,userBadgeDiameter:Ar.drawerWidthClosed-Ar.userBadgePadding*2}),Gs={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Ar.defaultOpenDelayMs+200},Zo=e=>({...Gs,...e}),il="@backstage/core/sidebar-intro-dismissed",Dr=(0,f.createContext)({sidebarConfig:Ar,submenuConfig:Gs}),zi=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Ha=n(50023),Wi=n(4190),Qn=n(87685),Ga=n(44882),Uo=n(51837);const Vi={isOpen:!1,setOpen:()=>{}},Hi=(0,f.createContext)(Vi),Gi=(0,Uo.CT)("sidebar-open-state-context");function Ki(e){const{children:s,value:l}=e;return(0,r.jsx)(Hi.Provider,{value:l,children:(0,r.jsx)(Gi.Provider,{value:(0,Uo.EI)({1:l}),children:s})})}const Ks=()=>{const e=(0,f.useContext)(Gi),s=(0,f.useContext)(Hi);if(e===void 0)return s||Vi;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var Ka=n(57998),Ya=n(98864);const Yi={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ji=(0,f.createContext)(Yi),Qi=(0,Uo.CT)("sidebar-pin-state-context");function Ja(e){const{children:s,value:l}=e;return(0,r.jsx)(Ji.Provider,{value:l,children:(0,r.jsx)(Qi.Provider,{value:(0,Uo.EI)({1:l}),children:s})})}const vs=()=>{const e=(0,f.useContext)(Qi),s=(0,f.useContext)(Ji);if(e===void 0)return s||Yi;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},Ys=(0,m.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"}})),Xi=e=>{const{to:s,label:l,icon:u,value:g}=e,{sidebarConfig:x}=(0,f.useContext)(Dr),T=Ys({sidebarConfig:x}),$=(0,ir.TH)(),{selectedMenuItemIndex:q,setSelectedMenuItemIndex:Q}=(0,f.useContext)(Xs),fe=(Ze,Ie)=>{Q(Ie===q?-1:Ie)},ge=g===q&&q>=0||g!==q&&!(q>=0)&&s===$.pathname;return(0,r.jsx)(Ka.Z,{"aria-label":l,label:l,icon:u,component:Ya.rU,to:s||$.pathname,onChange:fe,value:g,selected:ge,classes:T})},Js=e=>{const{children:s,to:l,label:u,icon:g,value:x}=e,{isMobile:T}=vs();return T?(0,r.jsx)(Xi,{to:l,label:u,icon:g,value:x}):(0,r.jsx)(r.Fragment,{children:s})},Qs=(0,m.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838","@media print":{display:"none"}},overlay: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`})})),_i=e=>(0,so.orderBy)(e,({props:{priority:s}})=>Number.isInteger(s)?s:-1,"desc"),qi=f.createElement(Js).type,ea=({children:e,label:s="Menu",open:l,onClose:u})=>{const{sidebarConfig:g}=(0,f.useContext)(Dr),x=Qs({sidebarConfig:g});return(0,r.jsxs)(Wi.ZP,{anchor:"bottom",open:l,onClose:u,ModalProps:{BackdropProps:{classes:{root:x.marginMobileSidebar}}},classes:{root:x.marginMobileSidebar,paperAnchorBottom:x.overlay},children:[(0,r.jsxs)(A.Z,{className:x.overlayHeader,children:[(0,r.jsx)(_e.Z,{variant:"h3",children:s}),(0,r.jsx)(K.Z,{onClick:u,classes:{root:x.overlayHeaderClose},children:(0,r.jsx)(Qn.Z,{})})]}),(0,r.jsx)(A.Z,{component:"nav",children:e})]})},Xs=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),ta=e=>{const{sidebarConfig:s}=(0,f.useContext)(Dr),{children:l}=e,u=Qs({sidebarConfig:s}),g=(0,ir.TH)(),[x,T]=(0,f.useState)(-1);(0,f.useEffect)(()=>{T(-1)},[g.pathname]);let $=(0,h.vJ)(l,Q=>Q.getElements().filter(fe=>fe.type===qi));if(l)$.length?$=_i($):$.push((0,r.jsx)(Js,{icon:(0,r.jsx)(Ga.Z,{}),children:l},"default_menu"));else return null;const q=x>=0&&!$[x].props.to;return(0,r.jsx)(Ki,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Xs.Provider,{value:{selectedMenuItemIndex:x,setSelectedMenuItemIndex:T},children:[(0,r.jsx)(ea,{label:$[x]&&$[x].props.label,open:q,onClose:()=>T(-1),children:$[x]&&$[x].props.children}),(0,r.jsx)(Ha.Z,{className:u.root,"data-testid":"mobile-sidebar-root",component:"nav",children:$})]})})};var Mo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Mo||(Mo={}));const na={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Mo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Mo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ra=(0,m.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},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),_s=(0,f.createContext)({content:{contentRef:void 0}});function Qa(e){const[s,l]=(0,f.useState)(()=>na.getSidebarPinState()),{sidebarConfig:u}=(0,f.useContext)(Dr),g=(0,f.useRef)(null),x=(0,f.useMemo)(()=>({content:{contentRef:g}}),[g]);(0,f.useEffect)(()=>{na.setSidebarPinState(s)},[s]);const T=(0,Ce.Z)(Q=>Q.breakpoints.down("xs"),{noSsr:!0}),$=()=>l(!s),q=ra({isPinned:s,sidebarConfig:u});return(0,r.jsx)(Ja,{value:{isPinned:s,toggleSidebarPinState:$,isMobile:T},children:(0,r.jsx)(_s.Provider,{value:x,children:(0,r.jsx)(A.Z,{className:q.root,children:e.children})})})}function ei(){var e;const{content:s}=(0,f.useContext)(_s);return{focusContent:(0,f.useCallback)(()=>{var u,g,x;(x=s)===null||x===void 0||(g=x.contentRef)===null||g===void 0||(u=g.current)===null||u===void 0||u.focus()},[s]),contentRef:(e=s)===null||e===void 0?void 0:e.contentRef}}const ti=(0,m.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"@media print":{display:"none"}},drawerWidth:s=>({width:s.sidebarConfig.drawerWidthClosed}),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 ar;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(ar||(ar={}));const oa=e=>{const{sidebarConfig:s}=(0,f.useContext)(Dr),{openDelayMs:l=s.defaultOpenDelayMs,closeDelayMs:u=s.defaultCloseDelayMs,disableExpandOnHover:g,children:x}=e,T=ti({sidebarConfig:s}),$=(0,Ce.Z)(Kt=>Kt.breakpoints.down("md"),{noSsr:!0}),[q,Q]=(0,f.useState)(ar.Closed),fe=(0,f.useRef)(),{isPinned:ge,toggleSidebarPinState:Ze}=vs(),Ie=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q!==ar.Open&&!$&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(ar.Open)},l),Q(ar.Idle)))},Ke=()=>{ge||g||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),q===ar.Idle?Q(ar.Closed):q===ar.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Q(ar.Closed)},u)))},mt=q===ar.Open&&!$||ge,dt=Kt=>{Kt?(Q(ar.Open),Ze()):(Q(ar.Closed),Ze())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(ia,{}),(0,r.jsx)(Ki,{value:{isOpen:mt,setOpen:dt},children:(0,r.jsx)(A.Z,{className:T.root,"data-testid":"sidebar-root",onMouseEnter:g?()=>{}:Ie,onFocus:g?()=>{}:Ie,onMouseLeave:g?()=>{}:Ke,onBlur:g?()=>{}:Ke,children:(0,r.jsx)(A.Z,{className:on()(T.drawer,T.drawerWidth,{[T.drawerOpen]:mt}),children:x})})})]})},sa=e=>{var s;const l=Mi((s=e.sidebarOptions)!==null&&s!==void 0?s:{});var u;const g=Zo((u=e.submenuOptions)!==null&&u!==void 0?u:{}),{children:x,disableExpandOnHover:T,openDelayMs:$,closeDelayMs:q}=e,{isMobile:Q}=vs();return Q?(0,r.jsx)(ta,{children:x}):(0,r.jsx)(Dr.Provider,{value:{sidebarConfig:l,submenuConfig:g},children:(0,r.jsx)(oa,{openDelayMs:$,closeDelayMs:q,disableExpandOnHover:T,children:x})})};function ia(){var e;const{sidebarConfig:s}=(0,f.useContext)(Dr),{focusContent:l,contentRef:u}=ei(),g=ti({sidebarConfig:s});return!((e=u)===null||e===void 0)&&e.current?(0,r.jsx)(ye.Z,{onClick:l,variant:"contained",className:on()(g.visuallyHidden),children:"Skip to content"}):null}function ni(e,s,l=!1){const u=new URLSearchParams(s.search).toString(),g=Os().parse(u),x=new URLSearchParams(e.search).toString(),T=Os().parse(x),$=l?so.isEqual:so.isMatch;return(0,so.isEqual)(s.pathname,e.pathname)&&$(T,g)}const Tr=(0,m.Z)(e=>{var s,l;return{item:{height:48,width:"100%","&:hover":{background:((s=e.palette.navigation.navItem)===null||s===void 0?void 0:s.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),Xa=e=>{const{title:s,subtitle:l,to:u,icon:g,dropdownItems:x,exact:T}=e,$=Tr(),{setIsHoveredOn:q}=useContext(SidebarItemWithSubmenuContext),Q=()=>{q(!1)},fe=useResolvedPath(u!=null?u:""),ge=useLocation();let Ze=isLocationMatch(ge,fe,T);const[Ie,Ke]=useState(!1),mt=()=>{Ke(!Ie)};return x!==void 0?(x.some(dt=>{const Kt=resolvePath(dt.to);return Ze=isLocationMatch(ge,Kt,T),Ze}),_jsxs(Box,{className:$.itemContainer,children:[_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:mt,onTouchStart:dt=>dt.stopPropagation(),className:classnames($.item,Ze?$.selected:void 0),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]}),Ie?_jsx(ArrowDropUpIcon,{className:$.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:$.dropdownArrow})]})}),x&&Ie&&_jsx(Box,{className:$.dropdown,children:x.map((dt,Kt)=>_jsx(Tooltip,{title:dt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:dt.to,underline:"none",className:$.dropdownItem,onClick:Q,onTouchStart:kn=>kn.stopPropagation(),children:_jsx(Typography,{component:"span",className:$.textContent,children:dt.title})})},Kt))})]})):_jsx(Box,{className:$.itemContainer,children:_jsx(Tooltip,{title:s,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:u,underline:"none",className:classnames($.item,Ze?$.selected:void 0),onClick:Q,onTouchStart:dt=>dt.stopPropagation(),children:[g&&_jsx(g,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:$.label,children:[s,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:$.subtitle,children:l})]})]})})})};var ys;const aa=(0,m.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:s=>{var l;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:(ys=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&ys!==void 0?ys:"#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:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),ri=e=>{const{isOpen:s}=Ks(),{sidebarConfig:l,submenuConfig:u}=(0,f.useContext)(Dr),g=s?l.drawerWidthOpen:l.drawerWidthClosed,x=aa({left:g,submenuConfig:u}),{isHoveredOn:T}=(0,f.useContext)(zi),[$,q]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{q(T)},[T]),(0,r.jsxs)(A.Z,{className:on()(x.drawer,{[x.drawerOpen]:$}),children:[(0,r.jsx)(_e.Z,{variant:"h5",component:"span",className:x.title,children:e.title}),e.children]})};var la=n(26739),zo=n(76600),ca=n(83543),da=n(59797),ua=n(98989);const pa=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),i=()=>{const e=pa();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var t=null;const o=(0,m.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),a=()=>{const e=o();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var d=null,S,O;const U=e=>(0,m.Z)(s=>{var l,u;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",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[s.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(S=(l=s.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&S!==void 0?S:"#404040"}},highlighted:{background:(O=(u=s.palette.navigation.navItem)===null||u===void 0?void 0:u.hoverBackground)!==null&&O!==void 0?O:"#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",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:s.typography.fontWeightBold,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 ee(e){return(0,f.useMemo)(()=>U(e),[e])()}const ve=(e,s)=>(0,h.vJ)(e.props.children,l=>{let u=!1;return l.getElements().forEach(({props:{to:g,dropdownItems:x}})=>{if(!u){var T;if(!((T=x)===null||T===void 0)&&T.length){x.forEach(({to:$})=>u=u||ni(s,(0,Bo.i3)($)));return}g&&(u=ni(s,(0,Bo.i3)(g)))}}),u},[s.pathname]);function Fe(e){return e.to===void 0}const Te=f.createElement(ri).type,De=f.forwardRef(function({to:s,end:l,style:u,className:g,activeStyle:x,caseSensitive:T,activeClassName:$="active","aria-current":q="page",...Q},fe){let{pathname:ge}=(0,ir.TH)(),{pathname:Ze}=(0,ir.WU)(s);T||(ge=ge.toLocaleLowerCase("en-US"),Ze=Ze.toLocaleLowerCase("en-US"));let Ie=ge===Ze;!Ie&&!l&&(Ie=ge.startsWith(`${Ze}/`));const Ke=Ie?q:void 0;return(0,r.jsx)(B.rU,{...Q,to:s,ref:fe,"aria-current":Ke,style:{...u,...Ie?x:void 0},className:on()([g,Ie?$:void 0])})}),Ve=(0,f.forwardRef)((e,s)=>{const{icon:l,text:u,hasNotifications:g=!1,hasSubmenu:x=!1,disableHighlight:T=!1,onClick:$,noTrack:q,children:Q,className:fe,...ge}=e,{sidebarConfig:Ze}=(0,f.useContext)(Dr),Ie=ee(Ze),{isOpen:Ke}=Ks(),mt=!Ke&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},dt=(0,r.jsxs)(A.Z,{style:mt,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ke&&x?(0,r.jsx)(ua.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Kt=(0,r.jsx)(la.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!g,className:on()({[Ie.closedItemIcon]:!Ke}),children:dt}),kn=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{"data-testid":"login-button",className:Ie.iconContainer,children:Kt}),u&&(0,r.jsx)(_e.Z,{variant:"subtitle2",component:"span",className:Ie.label,children:u}),(0,r.jsx)("div",{className:Ie.secondaryAction,children:Q})]}),Kn=Ke?kn:Kt,Ot={onClick:$,className:on()(fe,Ie.root,Ke?Ie.open:Ie.closed,Fe(e)&&Ie.buttonItem,{[Ie.highlightable]:!T})},tn=(0,h.z$)(),{pathname:vn}=(0,ir.WU)(!Fe(e)&&e.to?e.to:""),Yn=(0,f.useCallback)(cr=>{var Nn;if(!q){const Pr="click",lo=u!=null?u:"Sidebar Item",Fr=vn?{attributes:{to:vn}}:void 0;tn.captureEvent(Pr,lo,Fr)}(Nn=$)===null||Nn===void 0||Nn(cr)},[tn,u,vn,q,$]);return Fe(e)?(0,r.jsx)(ye.Z,{role:"button","aria-label":u,...Ot,ref:s,onClick:Yn,children:Kn}):(0,r.jsx)(De,{...Ot,activeClassName:Ie.selected,to:e.to?e.to:"",ref:s,"aria-label":u||e.to,...ge,onClick:Yn,children:Kn})}),Ge=({children:e,...s})=>{const{sidebarConfig:l}=(0,f.useContext)(Dr),u=ee(l),[g,x]=(0,f.useState)(!1),T=(0,ir.TH)(),$=ve(e,T),q=(0,Ce.Z)(Ze=>Ze.breakpoints.down("sm")),Q=()=>{x(!0)},fe=()=>{x(!1)},ge=()=>q?g?(0,r.jsx)(da.Z,{fontSize:"small",className:u.submenuArrow}):(0,r.jsx)(ca.Z,{fontSize:"small",className:u.submenuArrow}):!g&&(0,r.jsx)(ua.Z,{fontSize:"small",className:u.submenuArrow});return(0,r.jsx)(zi.Provider,{value:{isHoveredOn:g,setIsHoveredOn:x},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:g?fe:Q,onMouseEnter:Q,className:on()(g&&u.highlighted),children:[(0,r.jsx)(Ve,{hasSubmenu:!0,className:$?u.selected:"",...s,children:ge()}),g&&e]})})},Bt=(0,f.forwardRef)((e,s)=>{const[l]=(0,h.vJ)(e.children,u=>u.getElements().filter(g=>g.type===Te));return l?(0,r.jsx)(Ge,{...e,children:l}):(0,r.jsx)(Ve,{...e,ref:s})});function Ut(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),[l,u]=useState(""),g=ee(s),x=e.icon?e.icon:SearchIcon,T=()=>{e.onSearch(l),u("")},$=ge=>{ge.key==="Enter"&&(ge.preventDefault(),T())},q=ge=>{u(ge.target.value)},Q=ge=>{ge.preventDefault(),ge.stopPropagation()},fe=ge=>{T(),ge.preventDefault()};return _jsx(Box,{className:g.searchRoot,children:_jsx(Bt,{icon:x,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:Q,onChange:q,onKeyDown:$,className:g.searchContainer,InputProps:{disableUnderline:!0,className:g.searchField},inputProps:{className:g.searchFieldHTMLInput}})})})}const lr=(0,zo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),_r=(0,zo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),xr=(0,zo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),br=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),Rr=(0,zo.Z)("div")(({theme:e})=>{const s=br(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":s,"&:hover":s}}),Mn=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),s=ee(e),{isOpen:l,setOpen:u}=useSidebarOpenState();if(useMediaQuery(T=>T.breakpoints.down("md"),{noSsr:!0}))return null;const x=()=>{u(!l)};return _jsx(Button,{role:"button",onClick:x,className:s.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:s.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Nr=(0,m.Z)(e=>({introCard:s=>({color:"#b5b5b5",fontSize:12,width:s.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:s.sidebarConfig.iconPadding,paddingRight:s.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function Vr(e){const{sidebarConfig:s}=useContext(SidebarConfigContext),l=Nr({sidebarConfig:s}),{text:u,onClose:g}=e,x=()=>g();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:u}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:x,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Ir=e=>{const{text:s,onDismiss:l}=e,[u,g]=useState(!1),x=()=>{g(!0)};return _jsx(Collapse,{in:!u,onExited:l,children:_jsx(Vr,{text:s,onClose:x})})},On=null,Hr="And your recently viewed plugins will pop up here!";function Wo(e){const{isOpen:s}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:u,set:g}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:x,recentlyViewedItemsDismissed:T}=u!=null?u:{},$=()=>{g(Q=>({...l,...Q,starredItemsDismissed:!0}))},q=()=>{g(Q=>({...l,...Q,recentlyViewedItemsDismissed:!0}))};return s?_jsxs(_Fragment,{children:[!x&&_jsxs(_Fragment,{children:[_jsx(Ir,{text:On,onDismiss:$}),_jsx(SidebarDivider,{})]}),!T&&_jsx(Ir,{text:Hr,onDismiss:q})]}):null}const ha=(0,m.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),ao=({type:e,typeLink:s,classes:l,pageTitle:u})=>e?s?(0,r.jsxs)(Hs,{className:l.breadcrumb,children:[(0,r.jsx)(le.r,{to:s,children:e}),(0,r.jsx)(_e.Z,{children:u})]}):(0,r.jsx)(_e.Z,{className:l.type,children:e}):null,fa=({pageTitle:e,classes:s,tooltip:l})=>{const{contentRef:u}=ei(),g=(0,r.jsx)(_e.Z,{ref:u,tabIndex:-1,className:s.title,variant:"h1",children:e});return l?(0,r.jsx)(R.ZP,{title:l,placement:"top-start",children:g}):g},oi=({classes:e,subtitle:s})=>s?typeof s!="string"?(0,r.jsx)(r.Fragment,{children:s}):(0,r.jsx)(_e.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:s}):null;function _a(e){const{children:s,pageTitleOverride:l,style:u,subtitle:g,title:x,tooltip:T,type:$,typeLink:q}=e,Q=ha(),ge=(0,h.h_)(h.Ds).getOptionalString("app.title")||"Backstage",Ze=l||x,Ie=x||l,Ke=`${Ze} | %s | ${ge}`,mt=`${Ze} | ${ge}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(is.q,{titleTemplate:Ke,defaultTitle:mt}),(0,r.jsxs)("header",{style:u,className:Q.header,children:[(0,r.jsxs)(A.Z,{className:Q.leftItemsBox,children:[(0,r.jsx)(ao,{classes:Q,type:$,typeLink:q,pageTitle:Ie}),(0,r.jsx)(fa,{classes:Q,pageTitle:Ie,tooltip:T}),(0,r.jsx)(oi,{classes:Q,subtitle:g})]}),(0,r.jsx)(Mt.Z,{container:!0,className:Q.rightItemsBox,spacing:4,children:s})]})]})}const al=({label:e,secondaryLabel:s,icon:l,disabled:u=!1,onClick:g})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:u,button:!0,onClick:x=>{g&&g(x)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:s})]})});function Fl(e){const{palette:{common:{white:s}}}=useTheme(),{actionItems:l}=e,[u,g]=React.useState(!1),x=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>g(!0),"data-testid":"header-action-menu",ref:x,style:{color:s,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:u,anchorEl:x.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>g(!1),children:_jsx(List,{children:l.map((T,$)=>_jsx(al,{...T},`header-action-menu-${$}`))})})]})}const ll=(0,m.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,sn.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),cl=({value:e,className:s})=>(0,r.jsx)(_e.Z,{component:typeof e=="string"?"p":"span",className:s,children:e});function dl(e){const{label:s,value:l,url:u}=e,g=ll(),x=(0,r.jsx)(cl,{className:g.value,value:l||"<Unknown>"});return(0,r.jsx)(Mt.Z,{item:!0,children:(0,r.jsxs)(_e.Z,{component:"span",className:g.root,children:[(0,r.jsx)(_e.Z,{className:g.label,children:s}),u?(0,r.jsx)(le.r,{to:u,children:x}):x]})})}const ul=e=>(0,sr.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),pl=(0,m.Z)(ul,{name:"BackstageItemCardHeader"});function hl(e){const{title:s,subtitle:l,children:u}=e,g=pl(e);return(0,r.jsxs)(A.Z,{className:g.root,children:[l&&(0,r.jsx)(_e.Z,{variant:"subtitle2",component:"h3",children:l}),s&&(0,r.jsx)(_e.Z,{variant:"h6",component:"h4",children:s}),u]})}function Zl(e){var s;const{description:l,tags:u,title:g,type:x,subtitle:T,label:$,onClick:q,href:Q}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:g,subtitle:T||x})}),_jsxs(CardContent,{children:[!((s=u)===null||s===void 0)&&s.length?_jsx(Box,{children:u.map((fe,ge)=>_jsx(Chip,{size:"small",label:fe},ge))}):null,l]}),_jsxs(CardActions,{children:[!Q&&_jsx(LinkButton,{to:"#",onClick:q,color:"primary",children:$}),Q&&_jsx(LinkButton,{to:Q,color:"primary",children:$})]})]})}const fl=e=>(0,sr.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),gl=(0,m.Z)(fl,{name:"BackstageItemCardGrid"});function ml(e){const{children:s,...l}=e,u=gl(l);return(0,r.jsx)(A.Z,{className:u.root,...l,children:s})}var vl=n(41547);const yl=(0,m.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function qa(e){const{themeId:s,children:l}=e,u=yl();return(0,r.jsx)(vl.Z,{theme:g=>({...g,page:g.getPageTheme({themeId:s})}),children:(0,r.jsx)("main",{className:u.root,children:l})})}function xl(e){const{themeId:s,children:l,...u}=e;return(0,r.jsxs)(qa,{themeId:s,children:[(0,r.jsx)(_a,{...u}),l]})}var pr=n(30195);const Ul=pr.z.object({providerInfo:pr.z.object({}).catchall(pr.z.unknown()).optional(),profile:pr.z.object({email:pr.z.string().optional(),displayName:pr.z.string().optional(),picture:pr.z.string().optional()}),backstageIdentity:pr.z.object({token:pr.z.string(),identity:pr.z.object({type:pr.z.literal("user"),userEntityRef:pr.z.string(),ownershipEntityRefs:pr.z.array(pr.z.string())})})}),el={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function bl(e){const s=new Date(Date.now()+el.defaultTokenExpiryMillis);if(!e)return s;const[l,u,g]=e.split("."),x=JSON.parse(window.atob(u));return typeof x.exp!="number"?s:new Date(x.exp*1e3-el.tokenExpiryMarginMillis)}class Ml{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:s}=this.getSessionSync(),l=s.identity.userEntityRef,u=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!u)throw new TypeError(`Invalid user entity reference "${l}"`);return u[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const s=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(u=>(this.state={type:"active",session:u,expiresAt:bl(u.backstageIdentity.token)},u),u=>{throw this.state={type:"failed",error:u},u});return this.state={type:"fetching",promise:l,previous:s},l}async fetchSession(){const s=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,u=new Headers(l);u.set("X-Requested-With","XMLHttpRequest");const g=await fetch(`${s}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:u,credentials:"include"});if(!g.ok)throw await ResponseError.fromResponse(g);return proxiedSessionSchema.parse(await g.json())}constructor(s){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=s,this.abortController=new AbortController,this.state={type:"empty"}}}const zl=e=>{const s=useApi(discoveryApiRef),[{status:l,error:u},{execute:g}]=useAsync(async()=>{const x=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:s,headers:e.headers});await x.start(),e.onSignInSuccess(x)});return useMountEffect(g),l==="loading"?_jsx(Progress,{}):u?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:u}):null},Sl=(0,m.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ga=({children:e})=>{const s=Sl();return(0,r.jsx)(Mt.Z,{component:"li",item:!0,classes:s,children:e})};var xs=n(87612);class ma{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 Cl(e){const[s,l,u]=e.split(".");return JSON.parse(window.atob(l))}class va{getUserId(){return this.result.userId}static fromResult(s){return new va(s)}async getIdToken(){var s,l;return(s=(l=this.result).getIdToken)===null||s===void 0?void 0:s.call(l)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const s=await this.getIdToken();if(!s){const g=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:g,ownershipEntityRefs:[g]}}const{sub:l,ent:u}=Cl(s);return{type:"user",userEntityRef:l,ownershipEntityRefs:u!=null?u:[]}}async getCredentials(){var s,l;return{token:await((s=(l=this.result).getIdToken)===null||s===void 0?void 0:s.call(l))}}async signOut(){var s,l;return(s=(l=this.result).signOut)===null||s===void 0?void 0:s.call(l)}constructor(s){(0,xs._)(this,"result",void 0),this.result=s}}class bs{static createGuest(){return new ma}static fromLegacy(s){return va.fromResult(s)}static create(s){return new bs(s.identity,s.authApi,s.profile)}getUserId(){const s=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(s);if(!l)throw new TypeError(`Invalid user entity reference "${s}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(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,l,u){(0,xs._)(this,"identity",void 0),(0,xs._)(this,"authApi",void 0),(0,xs._)(this,"profile",void 0),(0,xs._)(this,"profilePromise",void 0),this.identity=s,this.authApi=l,this.profile=u}}const wl={Component:({config:e,onSignInStarted:s,onSignInSuccess:l,onSignInFailure:u})=>{const{apiRef:g,title:x,message:T}=e,$=(0,h.h_)(g),q=(0,h.h_)(h.VE),Q=async()=>{try{s();const fe=await $.getBackstageIdentity({instantPopup:!0});if(!fe)throw u(),new Error(`The ${x} provider is not configured to support sign-in`);const ge=await $.getProfile();l(bs.create({identity:fe.identity,profile:ge,authApi:$}))}catch(fe){u(),q.post(new nr.SP("Login failed",fe))}};return(0,r.jsx)(ga,{children:(0,r.jsx)(Wr,{variant:"fullHeight",title:x,actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:Q,children:"Sign In"}),children:(0,r.jsx)(_e.Z,{variant:"body1",children:T})})})},loader:async(e,s)=>{const l=e.get(s),u=await l.getBackstageIdentity({optional:!0});if(!u)return;const g=await l.getProfile();return bs.create({identity:u.identity,profile:g,authApi:l})}},jl={Component:({onSignInStarted:e,onSignInSuccess:s})=>(0,r.jsx)(ga,{children:(0,r.jsx)(Wr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ye.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),s(new ma)},children:"Enter"}),children:(0,r.jsxs)(_e.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ma};var El=n(63955),tl=n(86619),nl=n(74828),Al=n(45455),Tl=n.n(Al);const Rl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Il=(0,m.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),rl=e=>{const{ref:s,...l}=e;return{inputRef:s,...l}},Pl={Component:({onSignInStarted:e,onSignInSuccess:s})=>{var l;const u=Il(),{register:g,handleSubmit:x,formState:T}=(0,El.cI)({mode:"onChange"}),{errors:$}=T,q=({userId:Q,idToken:fe})=>{e(),s(bs.fromLegacy({userId:Q,getIdToken:fe!==void 0?async()=>fe:void 0,profile:{email:`${Q}@example.com`}}))};return(0,r.jsx)(ga,{children:(0,r.jsxs)(Wr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(_e.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:u.form,onSubmit:x(q),children:[(0,r.jsxs)(ho.Z,{children:[(0,r.jsx)(tl.Z,{...rl(g("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean($.userId)}),$.userId&&(0,r.jsx)(nl.Z,{error:!0,children:$.userId.message})]}),(0,r.jsxs)(ho.Z,{children:[(0,r.jsx)(tl.Z,{...rl(g("idToken",{required:!1,validate:Q=>!Q||Rl.test(Q)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean($.idToken)}),$.idToken&&(0,r.jsx)(nl.Z,{error:!0,children:$.idToken.message})]}),(0,r.jsx)(ye.Z,{type:"submit",color:"primary",variant:"outlined",className:u.button,disabled:!(!((l=T)===null||l===void 0)&&l.isDirty)||!Tl()($),children:"Continue"})]})]})})},loader:async()=>{}},Vo="@backstage/core:SignInPage:provider",ol={guest:jl,custom:Pl,common:wl};function sl(e,s){if(e in s)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Jl(e){return e.reduce((l,u)=>{if(typeof u=="string")return sl(u,l),l[u]={components:ol[u],id:u},l;const{id:g}=u;return sl(g,l),l[g]={components:ol.common,id:g,config:u},l},{})}const Ql=(e,s)=>{const l=useApi(errorApiRef),u=useApiHolder(),[g,x]=useState(!0),T=useCallback(q=>{s(IdentityApiSignOutProxy.from({identityApi:q,signOut:async()=>{var Q,fe;localStorage.removeItem(Vo),await((Q=(fe=q).signOut)===null||Q===void 0?void 0:Q.call(fe))}}))},[s]);useLayoutEffect(()=>{var q;if(!g)return;const Q=localStorage.getItem(Vo);if(Q===null){x(!1);return}const fe=e[Q];if(!fe){x(!1);return}let ge=!1;return fe.components.loader(u,(q=fe.config)===null||q===void 0?void 0:q.apiRef).then(Ze=>{if(ge){localStorage.removeItem(Vo);return}Ze?T(Ze):x(!1)}).catch(Ze=>{localStorage.removeItem(Vo),!ge&&(l.post(Ze),x(!1))}),()=>{ge=!0}},[g,l,s,u,e,T]);const $=useMemo(()=>Object.keys(e).map(q=>{const Q=e[q],{Component:fe}=Q.components,ge=Ke=>{T(Ke)},Ze=()=>{var Ke,mt;localStorage.setItem(Vo,((mt=Q)===null||mt===void 0||(Ke=mt.config)===null||Ke===void 0?void 0:Ke.id)||Q.id)},Ie=()=>{localStorage.removeItem(Vo)};return _jsx(fe,{config:Q.config,onSignInStarted:Ze,onSignInSuccess:ge,onSignInFailure:Ie},Q.id)}),[e,T]);return[g,$]},Ll=({onSignInSuccess:e,providers:s=[],title:l,align:u="left"})=>{const g=useApi(configApiRef),x=useStyles(),T=getSignInProviders(s),[$,q]=useSignInProviders(T,e);return $?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:g.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:u}),_jsx(Grid,{container:!0,justifyContent:u==="center"?u:"flex-start",spacing:2,component:"ul",classes:x,children:q})]})]})},Ol=({provider:e,auto:s,onSignInSuccess:l})=>{const u=useStyles(),g=useApi(e.apiRef),x=useApi(configApiRef),[T,$]=useState(),[q,Q]=useState(!1),fe=async({checkExisting:ge,showPopup:Ze})=>{try{let Ie;if(ge&&(Ie=await g.getBackstageIdentity({optional:!0})),!Ie&&(Ze||s)&&(Q(!0),Ie=await g.getBackstageIdentity({instantPopup:!0}),!Ie))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ie){Q(!0);return}const Ke=await g.getProfile();l(UserIdentity.create({identity:Ie.identity,authApi:g,profile:Ke}))}catch(Ie){$(Ie),Q(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),q?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:x.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:u,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),T&&T.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:T.message})]})})})})]}):_jsx(Progress,{})};function Xl(e){return"provider"in e?_jsx(Ol,{...e}):_jsx(Ll,{...e})}const kl=(0,m.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Bl=(0,Zn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Eo.Z);function _l(e){const{slackChannel:s,errorBoundaryProps:l,children:u,title:g,deepLink:x,value:T,onChange:$}=e,q=kl(),[Q,fe]=useState(0),ge=$||((Ke,mt)=>fe(mt));let Ze;T?React.Children.map(u,Ke=>{var mt;if(React.isValidElement(Ke)&&((mt=Ke)===null||mt===void 0?void 0:mt.props.value)===T){var dt;Ze=(dt=Ke)===null||dt===void 0?void 0:dt.props.children}}):React.Children.map(u,(Ke,mt)=>{if(React.isValidElement(Ke)&&mt===Q){var dt;Ze=(dt=Ke)===null||dt===void 0?void 0:dt.props.children}});const Ie=l||(s?{slackChannel:s}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ie,children:[g&&_jsx(Bl,{title:g}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:q,value:T||Q,onChange:ge,children:u}),_jsx(Divider,{}),_jsx(CardContent,{children:Ze}),x&&_jsx(BottomLink,{...x})]})})}const $l=(0,m.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function ql(e){const{children:s,...l}=e,u=$l();return _jsx(Tab,{disableRipple:!0,classes:u,...l})}},60871:function(Pt,Le,n){"use strict";n.d(Le,{fC:function(){return m},CL:function(){return kt},sM:function(){return se},$v:function(){return Ce},v_:function(){return B},hg:function(){return Qe},uB:function(){return xe},R5:function(){return nt},bq:function(){return I},Km:function(){return Z},Ds:function(){return St},ni:function(){return A},T0:function(){return D},CO:function(){return dn},x8:function(){return Sn},rx:function(){return zn},YO:function(){return $n},P4:function(){return Pn},NT:function(){return xt},NW:function(){return Nt},VE:function(){return Wt},W0:function(){return Dt},gP:function(){return Xt},IY:function(){return gt},F4:function(){return ne},ux:function(){return K},Kp:function(){return ie},$4:function(){return ct},p_:function(){return R},ZM:function(){return ut},D:function(){return X},gW:function(){return w},E6:function(){return pt},z$:function(){return Me},h_:function(){return ye},I_:function(){return F},qD:function(){return Ye},vJ:function(){return qn},tg:function(){return rt},Oi:function(){return _t}});var r=n(52322),h=n(51837),W=n(2784);const f=(0,h.CT)("analytics-context"),V=()=>{const we=(0,W.useContext)(f);if(we===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const he=we.atVersion(1);if(he===void 0)throw new Error("No context found for version 1.");return he},m=we=>{const{attributes:he,children:Pe}=we,N={...V(),...he},ce=(0,h.EI)({1:N});return(0,r.jsx)(f.Provider,{value:ce,children:Pe})};function p(we,he){const Pe=G=>_jsx(m,{attributes:he,children:_jsx(we,{...G})});return Pe.displayName=`WithAnalyticsContext(${we.displayName||we.name||"Component"})`,Pe}function F(){const we=(0,h.Vt)("api-context");if(!we)throw new Error("API context is not available");const he=we.atVersion(1);if(!he)throw new Error("ApiContext v1 not available");return he}function ye(we){const Pe=F().get(we);if(!Pe)throw new Error(`No implementation available for ${we}`);return Pe}function le(we){return function(Pe){const G=ce=>{const Ee=F(),Ue={};for(const qe in we)if(we.hasOwnProperty(qe)){const Tt=we[qe],$t=Ee.get(Tt);if(!$t)throw new Error(`No implementation available for ${Tt}`);Ue[qe]=$t}return _jsx(Pe,{...ce,...Ue})},N=Pe.displayName||Pe.name||"Component";return G.displayName=`withApis(${N})`,G}}var z=n(87612);class de{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(he){if((0,z._)(this,"config",void 0),this.config=he,!he.id.split(".").flatMap(G=>G.split("-")).every(G=>G.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${he.id}'`)}}function D(we){return new de(we)}function A(we,he){return"id"in we?{api:we,deps:{},factory:()=>he}:we}var se;(function(we){we.SignedIn="SignedIn",we.SignedOut="SignedOut"})(se||(se={}));const ie=D({id:"core.auth.google"}),ne=D({id:"core.auth.github"}),X=D({id:"core.auth.okta"}),K=D({id:"core.auth.gitlab"}),R=D({id:"core.auth.microsoft"}),w=D({id:"core.auth.onelogin"}),I=D({id:"core.auth.bitbucket"}),Z=D({id:"core.auth.bitbucket-server"}),xe=D({id:"core.auth.atlassian"}),Ce=D({id:"core.alert"}),B=D({id:"core.analytics"}),Qe=D({id:"core.apptheme"}),St=D({id:"core.config"}),Nt=D({id:"core.discovery"}),Wt=D({id:"core.error"});var kt;(function(we){we[we.None=0]="None",we[we.Active=1]="Active"})(kt||(kt={}));const Dt=D({id:"core.featureflags"}),Xt=D({id:"core.fetch"}),ct=D({id:"core.identity"}),ut=D({id:"core.oauthrequest"}),pt=D({id:"core.storage"}),ht=(0,h.uW)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),Vt="_ROUTABLE-EXTENSION-RENDERED";class Jt{setContext(he){this.context=he}captureEvent(he,Pe,{value:G,attributes:N}={}){const{_routeNodeType:ce,...Ee}=this.context;if(he===Vt){ht.mostRecentGatheredNavigation&&(ht.mostRecentRoutableExtensionRender={context:{...Ee,extension:"App"}});return}if(ht.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...ht.mostRecentGatheredNavigation,...ht.mostRecentRoutableExtensionRender})}catch(Ue){console.warn("Error during analytics event capture. %o",Ue)}ht.mostRecentGatheredNavigation=void 0,ht.mostRecentRoutableExtensionRender=void 0}if(he==="navigate"&&ce==="gathered"&&Ee.pluginId==="root"){ht.mostRecentGatheredNavigation={action:he,subject:Pe,value:G,attributes:N,context:Ee};return}try{this.analyticsApi.captureEvent({action:he,subject:Pe,value:G,attributes:N,context:Ee})}catch(Ue){console.warn("Error during analytics event capture. %o",Ue)}}constructor(he,Pe={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,z._)(this,"analyticsApi",void 0),(0,z._)(this,"context",void 0),this.analyticsApi=he,this.context=Pe,ht.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{ht.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({...ht.mostRecentGatheredNavigation,...ht.mostRecentRoutableExtensionRender}),ht.mostRecentGatheredNavigation=void 0,ht.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),ht.beforeUnloadRegistered=!0)}}function be(){try{return ye(B)}catch{return{captureEvent:()=>{}}}}function Me(){const we=(0,W.useRef)(null),he=V(),Pe=be();function G(){return we.current===null&&(we.current=new Jt(Pe)),we.current}const N=G();return N.setContext(he),N}const Ye=()=>{const we=(0,h.Vt)("app-context");if(!we)throw new Error("App context is not available");const he=we.atVersion(1);if(!he)throw new Error("AppContext v1 not available");return he},ft=(0,h.uW)("component-data-store",()=>new WeakMap),st="__backstage_data";function nt(we,he,Pe){const G=we;var N;let ce=(N=G[st])!==null&&N!==void 0?N:ft.get(we);if(ce||(ce={map:new Map},Object.defineProperty(G,st,{enumerable:!1,configurable:!0,writable:!1,value:ce}),ft.set(we,ce)),ce.map.has(he)){const Ee=we.displayName||we.name;throw new Error(`Attempted to attach duplicate data "${he}" to component "${Ee}"`)}ce.map.set(he,Pe)}function gt(we,he){if(!we)return;const Pe=we.type;if(!Pe)return;var G;const N=(G=Pe[st])!==null&&G!==void 0?G:ft.get(Pe);if(N)return N.map.get(he)}const ot=(0,h.uW)("route-ref-type",()=>Symbol("route-ref-type"));let Xe=ot,yt=Xe;class vt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(he,Pe){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,yt,void 0),this.id=he,this.params=Pe,this[Xe]="absolute"}}function xt(we){var he;return new vt(we.id,(he=we.params)!==null&&he!==void 0?he:[])}const wn=/^\w+$/;let fn=null,pn=null;class jn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(he,Pe,G,N){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,pn,void 0),this.id=he,this.path=Pe,this.parent=G,this.params=N,this[fn]="sub"}}function hn(we){const{id:he,path:Pe,parent:G}=we,N=Pe.split("/").filter(Ue=>Ue.startsWith(":")).map(Ue=>Ue.substring(1)),ce=[...G.params,...N];if(G.params.some(Ue=>N.includes(Ue)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Pe.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Pe}'`);if(Pe.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Pe}'`);for(const Ue of N)if(!wn.test(Ue))throw new Error(`SubRouteRef path has invalid param, got '${Ue}'`);return new jn(he,Pe,G,ce)}let xn=ot,En=xn;class on{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(he,Pe,G){(0,z._)(this,"id",void 0),(0,z._)(this,"params",void 0),(0,z._)(this,"optional",void 0),(0,z._)(this,En,void 0),this.id=he,this.params=Pe,this.optional=G,this[xn]="external"}}function Sn(we){var he;return new on(we.id,(he=we.params)!==null&&he!==void 0?he:[],Boolean(we.optional))}var An=n(73557);function rt(we){const{pathname:he}=(0,An.TH)(),Pe=(0,h.Vt)("routing-context");if(!Pe)throw new Error("Routing context is not available");const G=Pe.atVersion(1),N=(0,W.useMemo)(()=>G&&G.resolve(we,{pathname:he}),[G,we,he]);if(!Pe)throw new Error("useRouteRef used outside of routing context");if(!G)throw new Error("RoutingContext v1 not available");const ce="optional"in we&&we.optional;if(!N&&!ce)throw new Error(`No path for ${we}`);return N}function _t(we){return(0,An.UO)()}class Mt extends W.Component{static getDerivedStateFromError(he){return{error:he}}render(){const{error:he}=this.state,{app:Pe,plugin:G}=this.props,{ErrorBoundaryFallback:N}=Pe.getComponents();return he?(0,r.jsx)(N,{error:he,resetError:this.handleErrorReset,plugin:G}):this.props.children}constructor(...he){super(...he),(0,z._)(this,"state",{error:void 0}),(0,z._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var _e=n(64355);function Pn(we){const{component:he,mountPoint:Pe,name:G}=we;return $n({component:{lazy:()=>he().then(N=>{const ce=Ue=>{const qe=Me();try{rt(Pe)}catch(Tt){if(typeof Tt=="object"&&Tt!==null){const{message:$t}=Tt;if(typeof $t=="string"&&$t.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Pe} 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 Tt}return(0,W.useEffect)(()=>{qe.captureEvent(Vt,"")},[qe]),(0,r.jsx)(N,{...Ue})},Ee=G||N.displayName||N.name||"LazyComponent";return ce.displayName=`RoutableExtension(${Ee})`,ce},N=>Ee=>{const Ue=Ye(),{BootErrorPage:qe}=Ue.getComponents();return(0,r.jsx)(qe,{step:"load-chunk",error:N})})},data:{"core.mountPoint":Pe},name:G})}function dn(we){const{component:he,name:Pe}=we;return $n({component:he,name:Pe})}function $n(we){const{data:he={},name:Pe}=we;Pe||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let G;if("lazy"in we.component){const ce=we.component.lazy;G=(0,W.lazy)(()=>ce().then(Ee=>({default:Ee})))}else G=we.component.sync;const N=Pe||G.displayName||G.name||"Component";return{expose(ce){const Ee=Ue=>{var qe;const Tt=Ye(),{Progress:$t}=Tt.getComponents(),ln=(qe=he)===null||qe===void 0?void 0:qe["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)($t,{}),children:(0,r.jsx)(Mt,{app:Tt,plugin:ce,children:(0,r.jsx)(m,{attributes:{pluginId:ce.getId(),...Pe&&{extension:Pe},...ln&&{routeRef:ln.id}},children:(0,r.jsx)(_e.o,{plugin:ce,children:(0,r.jsx)(G,{...Ue})})})})})};nt(Ee,"core.plugin",ce),nt(Ee,"core.extensionName",Pe);for(const[Ue,qe]of Object.entries(he))nt(Ee,Ue,qe);return Ee.displayName=`Extension(${N})`,Ee}}}function Cn(we,he,Pe,G){return W.Children.toArray(we).flatMap(N=>{if(!(0,W.isValidElement)(N))return[];if(N.type===W.Fragment)return Cn(N.props.children,he,Pe,G);if(gt(N,"core.featureFlagged")){const ce=N.props;return("with"in ce?he.isActive(ce.with):!he.isActive(ce.without))?Cn(N.props.children,he,Pe,G):[]}if(Pe===void 0||Pe(N))return[N];if(G)throw new Error(G);return Cn(N.props.children,he,Pe,G)})}class Un{selectByComponentData(he){const Pe=Cn(this.node,this.featureFlagsApi,G=>gt(G,he.key)!==void 0,he.withStrictError);return new Un(Pe,this.featureFlagsApi)}findComponentData(he){return Cn(this.node,this.featureFlagsApi,G=>gt(G,he.key)!==void 0).map(G=>gt(G,he.key)).filter(G=>G!==void 0)}getElements(){return Cn(this.node,this.featureFlagsApi)}constructor(he,Pe){(0,z._)(this,"node",void 0),(0,z._)(this,"featureFlagsApi",void 0),this.node=he,this.featureFlagsApi=Pe}}function qn(we,he,Pe=[]){const G=ye(Dt),N=new Un(we,G);return(0,W.useMemo)(()=>he(N),[we,...Pe])}class Ln{getId(){return this.config.id}getApis(){var he;return(he=this.config.apis)!==null&&he!==void 0?he:[]}getFeatureFlags(){var he,Pe;return(Pe=(he=this.config.featureFlags)===null||he===void 0?void 0:he.slice())!==null&&Pe!==void 0?Pe:[]}get routes(){var he;return(he=this.config.routes)!==null&&he!==void 0?he:{}}get externalRoutes(){var he;return(he=this.config.externalRoutes)!==null&&he!==void 0?he:{}}provide(he){return he.expose(this)}__experimentalReconfigure(he){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(he))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var he;return(he=this.options)!==null&&he!==void 0?he:{}}toString(){return`plugin{${this.config.id}}`}constructor(he){(0,z._)(this,"config",void 0),(0,z._)(this,"options",void 0),this.config=he,this.options=void 0}}function zn(we){return new Ln(we)}},64355:function(Pt,Le,n){"use strict";n.d(Le,{o:function(){return V},y:function(){return m}});var r=n(52322),h=n(51837),W=n(2784);const f="plugin-context",V=p=>{const{children:F,plugin:ye}=p,{Provider:le}=(0,h.CT)(f);return(0,r.jsx)(le,{value:(0,h.EI)({1:{plugin:ye}}),children:F})};function m(){const p=(0,h.Vt)(f);if(!p)throw new Error("Plugin Options context is not available");const F=p.atVersion(1);if(!F)throw new Error("Plugin Options v1 is not available");return F.plugin.getPluginOptions()}},23054:function(Pt,Le,n){"use strict";n.d(Le,{SP:function(){return ne},dR:function(){return de},VL:function(){return K},BD:function(){return h}});function r(R){if(typeof R!="object"||R===null||Array.isArray(R))return!1;const w=R;return!(typeof w.name!="string"||w.name===""||typeof w.message!="string")}function h(R){if(typeof R!="object"||R===null||Array.isArray(R))throw new Error(`Encountered invalid error, not an object, got '${R}'`);const w=R;if(typeof w.name!="string"||w.name==="")throw new Error(`Encountered error object without a name, got '${R}'`);if(typeof w.message!="string")throw new Error(`Encountered error object without a message, got '${R}'`)}var W=n(87612),f=n(24852);function V(R,w){var I;const xe={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(R)};return!((I=w)===null||I===void 0)&&I.includeStack||delete xe.stack,xe}function m(R){const w=(0,f.deserializeError)(R);return R.stack||(w.stack=void 0),w}function p(R){if(r(R)){const w=String(R);return w!=="[object Object]"?w:`${R.name}: ${R.message}`}return`unknown error '${R}'`}class F extends Error{constructor(w,I){var Z,xe;let Ce=w;if(I!==void 0){const B=p(I);Ce?Ce+=`; caused by ${B}`:Ce=`caused by ${B}`}super(Ce),(0,W._)(this,"cause",void 0),(Z=(xe=Error).captureStackTrace)===null||Z===void 0||Z.call(xe,this,this.constructor),(!this.name||this.name==="Error")&&this.constructor.name!=="Error"&&(this.name=this.constructor.name),this.cause=r(I)?I:void 0}}class ye extends null{constructor(...w){super(...w),_define_property(this,"name","InputError")}}class le extends null{constructor(...w){super(...w),_define_property(this,"name","AuthenticationError")}}class z extends null{constructor(...w){super(...w),_define_property(this,"name","NotAllowedError")}}class de extends F{constructor(...w){super(...w),(0,W._)(this,"name","NotFoundError")}}class D extends null{constructor(...w){super(...w),_define_property(this,"name","ConflictError")}}class A extends null{constructor(...w){super(...w),_define_property(this,"name","NotModifiedError")}}class se extends null{constructor(...w){super(...w),_define_property(this,"name","NotImplementedError")}}class ie extends null{}class ne extends F{constructor(w,I){super(w,I),this.name=r(I)?I.name:"Error"}}async function X(R){try{const I=await R.text();if(I){var w;if(!((w=R.headers.get("content-type"))===null||w===void 0)&&w.startsWith("application/json"))try{const Z=JSON.parse(I);if(Z.error&&Z.response)return Z}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}, ${I}`},response:{statusCode:R.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${R.status} ${R.statusText}`},response:{statusCode:R.status}}}class K extends Error{static async fromResponse(w){const I=await X(w),Z=I.response.statusCode||w.status,xe=I.error.name||w.statusText,Ce=`Request failed with ${Z} ${xe}`,B=m(I.error);return new K({message:Ce,response:w,data:I,cause:B})}constructor(w){super(w.message),(0,W._)(this,"response",void 0),(0,W._)(this,"body",void 0),(0,W._)(this,"cause",void 0),this.name="ResponseError",this.response=w.response,this.body=w.data,this.cause=w.cause}}},32838:function(Pt,Le,n){"use strict";n.d(Le,{nW:function(){return ie},ae:function(){return z},q3:function(){return de}});var r=n(60871);const h=(0,r.T0)({id:"core.scmauth"});var W=new WeakMap;class f{async getCredentials(X){const K=new URL(X.url),R=_class_private_field_get(this,W).find(w=>w.isUrlSupported(K));if(!R)throw new Error(`No auth provider available for '${X.url}', see https://backstage.io/link?scm-auth`);return R.getCredentials(X)}constructor(X){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,X)}}var V=new WeakMap,m=new WeakMap,p=new WeakMap,F=new WeakMap;class ye{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:X,gitlab:K,azure:R,bitbucket:w})=>ye.merge(ye.forGithub(X),ye.forGitlab(K),ye.forAzure(R),ye.forBitbucket(w))})}static forAuthApi(X,K){return new ye("generic",X,K.host,K.scopeMapping)}static forGithub(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"github.com";return new ye("github",X,I,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"gitlab.com";return new ye("gitlab",X,I,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"dev.azure.com";return new ye("azure",X,I,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(X,K){var R,w;const I=(w=(R=K)===null||R===void 0?void 0:R.host)!==null&&w!==void 0?w:"bitbucket.org";return new ye("bitbucket",X,I,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...X){return new f(X)}isUrlSupported(X){return X.host===_class_private_field_get(this,m)}getAdditionalScopesForProvider(X){var K,R;if(!(!((K=X)===null||K===void 0)&&K.customScopes)||_class_private_field_get(this,F)==="generic")return[];var w;return(w=(R=X.customScopes)===null||R===void 0?void 0:R[_class_private_field_get(this,F)])!==null&&w!==void 0?w:[]}async getCredentials(X){var K;const{url:R,additionalScope:w,...I}=X,Z=_class_private_field_get(this,p).default.slice();!((K=w)===null||K===void 0)&&K.repoWrite&&Z.push(..._class_private_field_get(this,p).repoWrite);const xe=this.getAdditionalScopesForProvider(w);xe.length&&Z.push(...xe);const Ce=[...new Set(Z)],B=await _class_private_field_get(this,V).getAccessToken(Ce,I);return{token:B,headers:{Authorization:`Bearer ${B}`}}}constructor(X,K,R,w){_class_private_field_init(this,V,{writable:!0,value:void 0}),_class_private_field_init(this,m,{writable:!0,value:void 0}),_class_private_field_init(this,p,{writable:!0,value:void 0}),_class_private_field_init(this,F,{writable:!0,value:void 0}),_class_private_field_set(this,V,K),_class_private_field_set(this,m,R),_class_private_field_set(this,p,w),_class_private_field_set(this,F,X)}}var le=n(40556);class z{static fromConfig(X){return le.Lx.fromConfig(X)}}const de=(0,r.T0)({id:"integration.scmintegrations"});var D=n(52322),A=n(73250),se=n(2784);const ie=ne=>{const{type:X}=ne,K=(0,r.qD)(),R=A.Z;var w;const I=X&&(w=K.getSystemIcon(X))!==null&&w!==void 0?w:R;return(0,D.jsx)(I,{})}},40556:function(Pt,Le,n){"use strict";n.d(Le,{Lx:function(){return Cr},BT:function(){return Yt}});var r=n(87612),h=n(82717),W=n.n(h),f=n(76635);function V(C){const c=new URL("http://example.com");return c.host=C,c.host===C}function m(C){try{return new URL(C),!0}catch{return!1}}function p(C,c){return{list(){return C},byUrl(b){try{const E=typeof b=="string"?new URL(b):b;return C.find(J=>c(J)===E.host)}catch{return}},byHost(b){return C.find(E=>c(E)===b)}}}function F(C){const{url:c,base:b,lineNumber:E}=C;try{return new URL(c),c}catch{}let J;if(c.startsWith("/")){const{filepath:me}=W()(b);J=new URL(b);const je=(0,f.trimEnd)(J.pathname.substring(0,J.pathname.length-me.length),"/");J.pathname=`${je}${c}`}else J=new URL(c,b);return J.search=new URL(b).search,E&&(J.hash=`L${E}`),J.toString()}function ye(C){beforeAll(()=>C.listen({onUnhandledRequest:"error"})),afterAll(()=>C.close()),afterEach(()=>C.resetHandlers())}const le="amazonaws.com";function z(C){const c=C.getOptionalString("endpoint");var b;const E=(b=C.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let J,me;if(c){try{const cn=new URL(c);J=cn.host,me=cn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else J=le;const je=C.getOptionalString("accessKeyId"),ke=C.getOptionalString("secretAccessKey"),He=C.getOptionalString("roleArn"),Gt=C.getOptionalString("externalId");return{host:J,endpoint:c,s3ForcePathStyle:E,accessKeyId:je,secretAccessKey:ke,roleArn:He,externalId:Gt}}function de(C){const c=C.map(z);return c.some(b=>b.host===le)||c.push({host:le}),c}class D{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(D,"factory",({config:C})=>{var c;const b=de((c=C.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return p(b.map(E=>new D(E)),E=>E.config.host)});var A=n(88412),se=n(50629),ie=n(80956);const ne="GB";var X=new WeakMap,K=new WeakMap,R=new WeakMap,w=new WeakMap,I=new WeakMap,Z=new WeakMap,xe=new WeakMap;class Ce{static fromRepoUrl(c){const b=new URL(c);let E,J,me;const je=b.pathname.split("/").map(gn=>decodeURIComponent(gn));if(je[2]==="_git"?(E=je[1],J=me=je[3]):je[3]==="_git"?(E=je[1],J=je[2],me=je[4]):je[4]==="_git"&&(E=`${je[1]}/${je[2]}`,J=je[3],me=je[5]),!E||!J||!me)throw new Error("Azure URL must point to a git repository");var ke;const He=(ke=b.searchParams.get("path"))!==null&&ke!==void 0?ke:void 0;let Gt;const cn=b.searchParams.get("version");if(cn){if(cn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Gt=cn.slice(2)}return new Ce(b.origin,E,J,me,He,Gt)}toRepoUrl(){let c;return(0,A._)(this,R)===(0,A._)(this,w)?c=(0,A._)(this,xe).call(this,(0,A._)(this,K),"_git",(0,A._)(this,w)):c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_git",(0,A._)(this,w)),(0,A._)(this,I)&&c.searchParams.set("path",(0,A._)(this,I)),(0,A._)(this,Z)&&c.searchParams.set("version",ne+(0,A._)(this,Z)),c.toString()}toFileUrl(){if(!(0,A._)(this,I))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,A._)(this,I)),(0,A._)(this,Z)&&c.searchParams.set("version",(0,A._)(this,Z)),c.toString()}toArchiveUrl(){const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,A._)(this,I)&&c.searchParams.set("scopePath",(0,A._)(this,I)),(0,A._)(this,Z)&&c.searchParams.set("version",(0,A._)(this,Z)),c.toString()}toCommitsUrl(){const c=(0,A._)(this,xe).call(this,(0,A._)(this,K),(0,A._)(this,R),"_apis","git","repositories",(0,A._)(this,w),"commits");return c.searchParams.set("api-version","6.0"),(0,A._)(this,Z)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,A._)(this,Z)),c.toString()}getOwner(){return(0,A._)(this,K)}getProject(){return(0,A._)(this,R)}getRepo(){return(0,A._)(this,w)}getPath(){return(0,A._)(this,I)}getRef(){return(0,A._)(this,Z)}constructor(c,b,E,J,me,je){(0,se._)(this,X,{writable:!0,value:void 0}),(0,se._)(this,K,{writable:!0,value:void 0}),(0,se._)(this,R,{writable:!0,value:void 0}),(0,se._)(this,w,{writable:!0,value:void 0}),(0,se._)(this,I,{writable:!0,value:void 0}),(0,se._)(this,Z,{writable:!0,value:void 0}),(0,se._)(this,xe,{writable:!0,value:(...ke)=>{const He=new URL((0,A._)(this,X));return He.pathname=ke.map(Gt=>encodeURIComponent(Gt)).join("/"),He}}),(0,ie._)(this,X,c),(0,ie._)(this,K,b),(0,ie._)(this,R,E),(0,ie._)(this,w,J),(0,ie._)(this,I,me),(0,ie._)(this,Z,je)}}const B="dev.azure.com",Qe=["clientId","clientSecret","tenantId","personalAccessToken"],St=new Map([["ClientSecret",["clientId","clientSecret","tenantId"]],["ManagedIdentity",["clientId"]],["PersonalAccessToken",["personalAccessToken"]]]);function Nt(C){for(const c of St.entries()){const[b,E]=c,J=Qe.filter(me=>!E.includes(me));if(E.every(me=>C[me]!==void 0)&&J.every(me=>C[me]===void 0))return{kind:b,organizations:C.organizations,...E.reduce((me,je)=>(me[je]=C[je],me),{})}}throw new Error("is not a valid credential")}function Wt(C){var c,b;const E=(b=C.getOptionalString("host"))!==null&&b!==void 0?b:B;let J=(c=C.getOptionalConfigArray("credentials"))===null||c===void 0?void 0:c.map(zt=>({organizations:zt.getOptionalStringArray("organizations"),personalAccessToken:zt.getOptionalString("personalAccessToken"),tenantId:zt.getOptionalString("tenantId"),clientId:zt.getOptionalString("clientId"),clientSecret:zt.getOptionalString("clientSecret")}));const me=C.getOptionalString("token");if(C.getOptional("credential")!==void 0&&C.getOptional("credentials")!==void 0)throw new Error("Invalid Azure integration config, 'credential' and 'credentials' cannot be used together. Use 'credentials' instead.");if(C.getOptional("token")!==void 0&&C.getOptional("credentials")!==void 0)throw new Error("Invalid Azure integration config, 'token' and 'credentials' cannot be used together. Use 'credentials' instead.");if(me!==void 0){var je;const zt=[{personalAccessToken:me}];var ke;J=(ke=(je=J)===null||je===void 0?void 0:je.concat(zt))!==null&&ke!==void 0?ke:zt}if(C.getOptional("credential")!==void 0){var He;const zt=[{organizations:C.getOptionalStringArray("credential.organizations"),token:C.getOptionalString("credential.token"),tenantId:C.getOptionalString("credential.tenantId"),clientId:C.getOptionalString("credential.clientId"),clientSecret:C.getOptionalString("credential.clientSecret")}];var Gt;J=(Gt=(He=J)===null||He===void 0?void 0:He.concat(zt))!==null&&Gt!==void 0?Gt:zt}if(!V(E))throw new Error(`Invalid Azure integration config, '${E}' is not a valid host`);let cn;if(J!==void 0){var gn,Vn;const zt=(gn=J)===null||gn===void 0?void 0:gn.reduce((rn,nr,rr)=>{let wr;try{Nt(nr)}catch(or){wr=or.message}return wr!==void 0&&rn.push(`credential at position ${rr+1} ${wr}`),rn},Array.of()).concat(Object.entries(J.filter(rn=>rn.organizations!==void 0&&rn.organizations.length>0).reduce((rn,nr,rr)=>{var wr;return(wr=nr.organizations)===null||wr===void 0||wr.forEach(or=>{rn[or]||(rn[or]=[]),rn[or].push(rr+1)}),rn},{})).filter(([rn,nr])=>nr.length>1).reduce((rn,[nr,rr])=>(rn.push(`organization ${nr} is specified multiple times in credentials at positions ${rr.slice(0,rr.length-1).join(", ")} and ${rr[rr.length-1]}`),rn),Array.of()));if(((Vn=zt)===null||Vn===void 0?void 0:Vn.length)>0)throw new Error(`Invalid Azure integration config for ${E}: ${zt.join("; ")}`);if(cn=J.map(rn=>Nt(rn)),cn.some(rn=>rn.kind!=="PersonalAccessToken")&&E!==B)throw new Error(`Invalid Azure integration config for ${E}, only personal access tokens can be used with hosts other than ${B}`);if(cn.filter(rn=>rn.organizations===void 0||rn.organizations.length===0).length>1)throw new Error(`Invalid Azure integration config for ${E}, you cannot specify multiple credentials without organizations`)}return{host:E,credentials:cn}}function kt(C){const c=C.map(Wt);return c.some(b=>b.host===B)||c.push({host:B}),c}class Dt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E}=c;if(m(b))return b;try{const me=Ce.fromRepoUrl(E),je=new URL(E);var J;const ke=new URL(`https://a.com${(J=me.getPath())!==null&&J!==void 0?J:""}`),He=new URL(b,ke).pathname;return je.searchParams.set("path",He),c.lineNumber&&(je.searchParams.set("line",String(c.lineNumber)),je.searchParams.set("lineEnd",String(c.lineNumber+1)),je.searchParams.set("lineStartColumn","1"),je.searchParams.set("lineEndColumn","1")),je.toString()}catch{return new URL(b,E).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Dt,"factory",({config:C})=>{var c;const b=kt((c=C.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return p(b.map(E=>new Dt(E)),E=>E.config.host)});function Xt(C){return AzureUrl.fromRepoUrl(C).toFileUrl()}function ct(C){return AzureUrl.fromRepoUrl(C).toArchiveUrl()}function ut(C){return AzureUrl.fromRepoUrl(C).toCommitsUrl()}const pt="bitbucket.org",ht="https://api.bitbucket.org/2.0";function Vt(C){var c;const b=(c=C.getOptionalString("host"))!==null&&c!==void 0?c:pt;let E=C.getOptionalString("apiBaseUrl");const J=C.getOptionalString("token"),me=C.getOptionalString("username"),je=C.getOptionalString("appPassword");if(!V(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return E?E=(0,f.trimEnd)(E,"/"):b===pt?E=ht:E=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:E,token:J,username:me,appPassword:je}}function Jt(C){const c=C.map(Vt);return c.some(b=>b.host===pt)||c.push({host:pt,apiBaseUrl:ht}),c}class be{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(!c.lineNumber)return b;const E=new URL(b);return this.integrationConfig.host==="bitbucket.org"?E.hash=`lines-${c.lineNumber}`:E.hash=`${c.lineNumber}`,E.toString()}resolveEditUrl(c){const b=W()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("spa","0"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(be,"factory",({config:C})=>{var c,b,E;const J=Jt((E=C.getOptionalConfigArray("integrations.bitbucket"))!==null&&E!==void 0?E:[...(c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return p(J.map(me=>new be(me)),me=>me.config.host)});var Me=n(96279),Ye=n(48834).lW;async function ft(C,c){const{name:b,owner:E,resource:J}=parseGitUrl(C),me=J==="bitbucket.org";let je=me?`${c.apiBaseUrl}/repositories/${E}/${b}`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,ke=await fetch(je,gt(c));if(ke.status===404&&!me&&(je=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,ke=await fetch(je,gt(c))),!ke.ok){const Gt=`Failed to retrieve default branch from ${je}, ${ke.status} ${ke.statusText}`;throw new Error(Gt)}let He;if(me)He=(await ke.json()).mainbranch.name;else{const{displayId:Gt}=await ke.json();He=Gt}if(!He)throw new Error(`Failed to read default branch from ${je}. Response ${ke.status} ${ke.json()}`);return He}async function st(C,c){const{name:b,owner:E,ref:J,protocol:me,resource:je,filepath:ke}=parseGitUrl(C),He=je==="bitbucket.org";let Gt=J;Gt||(Gt=await ft(C,c));const cn=ke?`&path=${encodeURIComponent(decodeURIComponent(ke))}`:"";return He?`${me}://${je}/${E}/${b}/get/${Gt}.tar.gz`:`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${Gt}&prefix=${E}-${b}${cn}`}function nt(C,c){try{const{owner:b,name:E,ref:J,filepathtype:me,filepath:je}=parseGitUrl(C);if(!b||!E||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const ke=je.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!J)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${J}/${ke}`}return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function gt(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.appPassword){const b=Ye.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const ot="bitbucket.org",Xe="https://api.bitbucket.org/2.0";function yt(C){const c=ot,b=Xe,E=C.getString("username"),J=C.getString("appPassword");return{host:c,apiBaseUrl:b,username:E,appPassword:J}}function vt(C){const c=C.map(yt);return c.length===0&&c.push({host:ot,apiBaseUrl:Xe}),c}class xt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const E=new URL(b);return E.hash=`lines-${c.lineNumber}`,E.toString()}return b}resolveEditUrl(c){const b=W()(c),E=new URL(c);return E.searchParams.set("mode","edit"),E.searchParams.set("at",b.ref),E.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(xt,"factory",({config:C})=>{var c;const b=vt((c=C.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return p(b.map(E=>new xt(E)),E=>E.config.host)});var wn=n(48834).lW;async function fn(C,c){const{name:b,owner:E}=parseGitUrl(C),J=`${c.apiBaseUrl}/repositories/${E}/${b}`,me=await fetch(J,hn(c));if(!me.ok){const He=`Failed to retrieve default branch from ${J}, ${me.status} ${me.statusText}`;throw new Error(He)}const ke=(await me.json()).mainbranch.name;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${me.status} ${me.json()}`);return ke}async function pn(C,c){const{name:b,owner:E,ref:J,protocol:me,resource:je}=parseGitUrl(C);let ke=J;return ke||(ke=await fn(C,c)),`${me}://${je}/${E}/${b}/get/${ke}.tar.gz`}function jn(C,c){try{const{owner:b,name:E,ref:J,filepathtype:me,filepath:je}=parseGitUrl(C);if(!b||!E||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const ke=je.replace(/^\//,"");if(!J)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${E}/src/${J}/${ke}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function hn(C){const c={};if(C.username&&C.appPassword){const b=wn.from(`${C.username}:${C.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function xn(C){const c=C.getString("host");let b=C.getOptionalString("apiBaseUrl");const E=C.getOptionalString("token"),J=C.getOptionalString("username"),me=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:E,username:J,password:me}}function En(C){return C.map(xn)}class on{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=F(c);if(c.lineNumber){const E=new URL(b);return E.hash=c.lineNumber.toString(),E.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(on,"factory",({config:C})=>{var c;const b=En((c=C.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return p(b.map(E=>new on(E)),E=>E.config.host)});var Sn=n(48834).lW;async function An(C,c){const{name:b,owner:E}=parseGitUrl(C);let J=`${c.apiBaseUrl}/projects/${E}/repos/${b}/default-branch`,me=await fetch(J,Mt(c));if(me.status===404&&(J=`${c.apiBaseUrl}/projects/${E}/repos/${b}/branches/default`,me=await fetch(J,Mt(c))),!me.ok){const He=`Failed to retrieve default branch from ${J}, ${me.status} ${me.statusText}`;throw new Error(He)}const{displayId:je}=await me.json(),ke=je;if(!ke)throw new Error(`Failed to read default branch from ${J}. Response ${me.status} ${me.json()}`);return ke}async function rt(C,c){const{name:b,owner:E,ref:J,filepath:me}=parseGitUrl(C);let je=J;je||(je=await An(C,c));const ke=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${c.apiBaseUrl}/projects/${E}/repos/${b}/archive?format=tgz&at=${je}&prefix=${E}-${b}${ke}`}function _t(C,c){try{const{owner:b,name:E,ref:J,filepathtype:me,filepath:je}=parseGitUrl(C);if(!b||!E||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const ke=je.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${E}/raw/${ke}?at=${J}`}catch(b){throw new Error(`Incorrect URL: ${C}, ${b}`)}}function Mt(C){const c={};if(C.token)c.Authorization=`Bearer ${C.token}`;else if(C.username&&C.password){const b=Sn.from(`${C.username}:${C.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function _e(C){const c=C.getString("host");let b=C.getOptionalString("baseUrl"),E=C.getOptionalString("cloneUrl"),J=C.getOptionalString("gitilesBaseUrl");const me=C.getOptionalString("username"),je=C.getOptionalString("password");if(V(c)){if(b&&!m(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(E&&!m(E))throw new Error(`Invalid Gerrit integration config, '${E}' is not a valid cloneUrl`);if(J&&!m(J))throw new Error(`Invalid Gerrit integration config, '${J}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,E?E=(0,f.trimEnd)(E,"/"):E=b,{host:c,baseUrl:b,cloneUrl:E,gitilesBaseUrl:J,username:me,password:je}}function Pn(C){return C.map(_e)}var dn=n(48834).lW;const $n=")]}'";function Cn(C,c){const b=new URL(C.gitilesBaseUrl),E=new URL(c),me=E.pathname.substring(E.pathname.startsWith("/a/")?2:0).replace(b.pathname,"").split("/").filter(gn=>!!gn),je=me.indexOf("+");if(je<=0)throw new Error(`Unable to parse project from url: ${c}`);const ke=(0,f.trimStart)(me.slice(0,je).join("/"),"/"),He=me.indexOf("heads");if(He<=0)throw new Error(`Unable to parse branch from url: ${c}`);const Gt=me[He+1],cn=me.slice(He+2).join("/");return{branch:Gt,filePath:cn===""?"/":cn,project:ke}}function Un(C,c,b,E){return`${C.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(E,"/")}`}function qn(C,c,b,E){const J=E==="/"||E===""?".tar.gz":`/${E}.tar.gz`;return`${zn(C)}/${c}/+archive/refs/heads/${b}${J}`}function Ln(C){return C.password?"/a/":"/"}function zn(C){const c=new URL(C.gitilesBaseUrl);return c.pathname=c.pathname.replace(/\/?$/,""),c.pathname=c.pathname.replace(/\/([^\/]*)$/,`${Ln(C)}$1`),c.toString()}function we(C,c){const{branch:b,project:E}=Cn(C,c);return`${C.baseUrl}${Ln(C)}projects/${encodeURIComponent(E)}/branches/${b}`}function he(C,c){const{project:b}=Cn(C,c);return`${C.cloneUrl}${Ln(C)}${b}`}function Pe(C,c){const{branch:b,filePath:E,project:J}=Cn(C,c);return`${C.baseUrl}${Ln(C)}projects/${encodeURIComponent(J)}/branches/${b}/files/${encodeURIComponent(E)}/content`}function G(C){return`${C.baseUrl}${Ln(C)}projects/`}function N(C){const c={};if(!C.password)return c;const b=dn.from(`${C.username}:${C.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function ce(C){const c=await C.text();if(c.startsWith($n))try{return JSON.parse(c.slice($n.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class Ee{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:E,lineNumber:J}=c;let me;if(b.startsWith("/")){const{branch:je,project:ke}=Cn(this.config,E);return Un(this.config,ke,je,b)}return b?me=new URL(b,E):me=new URL(E),J&&(me.hash=J.toString()),me.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ee,"factory",({config:C})=>{var c;const b=Pn((c=C.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return p(b.map(E=>new Ee(E)),E=>E.config.host)});function Ue(C){const c=C.getString("host");let b=C.getOptionalString("baseUrl");const E=C.getOptionalString("username"),J=C.getOptionalString("password");if(!V(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:E,password:J}}var qe=n(48834).lW;function Tt(C,c){try{var b;const E=(b=C.baseUrl)!==null&&b!==void 0?b:`https://${C.host}`,[J,me,je,ke,He,Gt,...cn]=c.replace(E,"").split("/"),gn=cn.join("/").replace(/^\//,"");return`${E}/${me}/${je}/_edit/${Gt}/${gn}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function $t(C,c){try{var b;const E=(b=C.baseUrl)!==null&&b!==void 0?b:`https://${C.host}`,[J,me,je,ke,He,Gt,...cn]=c.replace(E,"").split("/"),gn=cn.join("/").replace(/^\//,"");return`${E}/api/v1/repos/${me}/${je}/contents/${gn}?ref=${Gt}`}catch(E){throw new Error(`Incorrect URL: ${c}, ${E}`)}}function ln(C){const c={},{username:b,password:E}=C;return E?(b?c.Authorization=`basic ${qe.from(`${b}:${E}`).toString("base64")}`:c.Authorization=`token ${E}`,{headers:c}):c}class sn{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return F(c)}resolveEditUrl(c){return Tt(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(sn,"factory",({config:C})=>{var c;const E=((c=C.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(J=>Ue(J));return p(E.map(J=>new sn(J)),J=>J.config.host)});const nn="github.com",re="https://api.github.com",te="https://raw.githubusercontent.com";function Y(C){var c,b;const E=(b=C.getOptionalString("host"))!==null&&b!==void 0?b:nn;let J=C.getOptionalString("apiBaseUrl"),me=C.getOptionalString("rawBaseUrl");const je=C.getOptionalString("token"),ke=(c=C.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(He=>({appId:He.getNumber("appId"),clientId:He.getString("clientId"),clientSecret:He.getString("clientSecret"),webhookSecret:He.getString("webhookSecret"),privateKey:He.getString("privateKey"),allowedInstallationOwners:He.getOptionalStringArray("allowedInstallationOwners")}));if(!V(E))throw new Error(`Invalid GitHub integration config, '${E}' is not a valid host`);return J?J=(0,f.trimEnd)(J,"/"):E===nn&&(J=re),me?me=(0,f.trimEnd)(me,"/"):E===nn&&(me=te),{host:E,apiBaseUrl:J,rawBaseUrl:me,token:je,apps:ke}}function v(C){const c=C.map(Y);return c.some(b=>b.host===nn)||c.push({host:nn,apiBaseUrl:re,rawBaseUrl:te}),c}function k(C,c,b){try{const{owner:E,name:J,ref:me,filepathtype:je,filepath:ke}=parseGitUrl(C);if(!E||!J||!me||je!=="blob"&&je!=="raw"&&je!=="tree")throw new Error("Invalid GitHub URL or file path");const He=ke.replace(/^\//,"");return H(c,b)==="api"?`${c.apiBaseUrl}/repos/${E}/${J}/contents/${He}?ref=${me}`:`${c.rawBaseUrl}/${E}/${J}/${me}/${He}`}catch(E){throw new Error(`Incorrect URL: ${C}, ${E}`)}}function M(C,c){const b={};return H(C,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function H(C,c){return C.apiBaseUrl&&(c.token||!C.rawBaseUrl)?"api":"raw"}var pe=n(35355),Se=n(89393),Oe=n(26228);class et{async getOrCreateToken(c,b,E){let J=this.tokenCache.get(c);if((!J||this.isExpired(J.expiresAt))&&(J=await E(),J.expiresAt=J.expiresAt.minus({minutes:10}),this.tokenCache.set(c,J)),!this.appliesToRepo(J,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:J.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>Oe.ou.local()>c)}}const tt={Accept:"application/vnd.github.machine-man-preview+json"};class bt{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var E;if(!(!((E=this.allowedInstallationOwners)===null||E===void 0)&&E.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:J,suspended:me}=await this.getInstallationData(c);if(me)throw new Error(`The GitHub application for ${c} is suspended`);const je=await this.appClient.apps.createInstallationAccessToken({installation_id:J,headers:tt});let ke;if(je.data.repository_selection==="selected"){const Gt=new Se.v({baseUrl:this.baseUrl,auth:je.data.token}),cn=await Gt.paginate(Gt.apps.listReposAccessibleToInstallation);var He;ke=((He=cn.repositories)!==null&&He!==void 0?He:cn).map(Vn=>Vn.name)}return{token:je.data.token,expiresAt:Oe.ou.fromISO(je.data.expires_at),repositories:ke}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const E=(await this.getInstallations()).find(me=>{var je;return me.account&&"login"in me.account&&((je=me.account.login)===null||je===void 0?void 0:je.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(E)return{installationId:E.id,suspended:Boolean(E.suspended_by)};const J=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw J.name="NotFoundError",J}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new et),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new Se.v({baseUrl:b,headers:tt,authStrategy:pe.i,auth:this.baseAuthConfig})}}class wt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const E=await Promise.all(this.apps.map(ke=>ke.getInstallationCredentials(c,b).then(He=>({credentials:He,error:void 0}),He=>({credentials:void 0,error:He})))),J=E.find(ke=>{var He;return(He=ke.credentials)===null||He===void 0?void 0:He.accessToken});if(J)return J.credentials.accessToken;const je=E.map(ke=>ke.error).find(ke=>{var He;return((He=ke)===null||He===void 0?void 0:He.name)!=="NotFoundError"});if(je)throw je}constructor(c){var b;(0,r._)(this,"apps",void 0);var E;this.apps=(E=(b=c.apps)===null||b===void 0?void 0:b.map(J=>new bt(J,c.apiBaseUrl)))!==null&&E!==void 0?E:[]}}class at{async getCredentials(c){const b=W()(c.url),E=b.owner||b.name,J=b.owner?b.name:void 0;let me="app",je=await this.githubAppCredentialsMux.getAppToken(E,J);return je||(me="token",je=this.token),{headers:je?{Authorization:`Bearer ${je}`}:void 0,token:je,type:me}}constructor(c,b){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,r._)(at,"create",C=>new at(new wt(C),C.token));class Be{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(E=>{const J=SingleInstanceGithubCredentialsProvider.create(E.config);b.set(E.config.host,J)}),new Be(b)}async getCredentials(c){const b=new URL(c.url),E=this.providers.get(b.host);if(!E)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ct{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return Yt(F(c),"tree")}resolveEditUrl(c){return Yt(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ct,"factory",({config:C})=>{var c;const b=v((c=C.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return p(b.map(E=>new Ct(E)),E=>E.config.host)});function Yt(C,c){return C.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,E,J,me)=>`//${E}/${J}/${me}/${c}/`)}const Et=null;class Ft extends Ct{get config(){return super.config}constructor(c){super(c)}}(0,r._)(Ft,"factory",Ct.factory);const en=null,Tn=null,Zt=null,lt="gitlab.com",Rt="https://gitlab.com/api/v4";function Ht(C){const c=C.getString("host");let b=C.getOptionalString("apiBaseUrl");const E=C.getOptionalString("token");let J=C.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===lt&&(b=Rt),J?J=(0,f.trimEnd)(J,"/"):J=`https://${c}`,V(c)){if(!b||!m(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!m(J))throw new Error(`Invalid GitLab integration config, '${J}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:E,apiBaseUrl:b,baseUrl:J}}function qt(C){const c=C.map(Ht);return c.some(b=>b.host===lt)||c.push({host:lt,apiBaseUrl:Rt,baseUrl:`https://${lt}`}),c}function Sr(C){let c="";return C.host!==lt&&(c=new URL(C.baseUrl).pathname),trimEnd(c,"/")}async function Or(C,c){const b=await tr(C,c);return bn(C,b,c).toString()}function er(C){const{token:c=""}=C;return{headers:{"PRIVATE-TOKEN":c}}}function bn(C,c,b){try{const E=new URL(C),J=E.pathname.split("/blob/").slice(1).join("/blob/"),[me,...je]=J.split("/"),ke=getGitLabIntegrationRelativePath(b);return E.pathname=[...ke?[ke]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(je.join("/"))),"raw"].join("/"),E.search=`?ref=${me}`,E}catch(E){throw new Error(`Incorrect url: ${C}, ${E}`)}}async function tr(C,c){const b=new URL(C);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let E=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const J=getGitLabIntegrationRelativePath(c);J&&(E=E.replace(J,""));const me=new URL(`${b.origin}${J}/api/v4/projects/${encodeURIComponent(E.replace(/^\//,""))}`),je=await fetch(me.toString(),er(c)),ke=await je.json();if(!je.ok)throw new Error(`GitLab Error '${ke.error}', ${ke.error_description}`);return Number(ke.id)}catch(E){throw new Error(`Could not get GitLab project ID for: ${C}, ${E}`)}}class dr{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return F(c)}resolveEditUrl(c){return Gr(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(dr,"factory",({config:C})=>{var c;const b=qt((c=C.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return p(b.map(E=>new dr(E)),E=>E.config.host)});function Gr(C,c){return C.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class Wn{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,r._)(this,"token",void 0),this.token=c}}(0,r._)(Wn,"create",C=>new Wn(C.token));class Kr{static fromIntegrations(c){const b=new Map;return c.gitlab.list().forEach(E=>{const J=SingleInstanceGitlabCredentialsProvider.create(E.config);b.set(E.config.host,J)}),new Kr(b)}async getCredentials(c){const b=new URL(c.url),E=this.providers.get(b.host);if(!E)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return E.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Cr{static fromConfig(c){return new Cr({awsS3:D.factory({config:c}),azure:Dt.factory({config:c}),bitbucket:be.factory({config:c}),bitbucketCloud:xt.factory({config:c}),bitbucketServer:on.factory({config:c}),gerrit:Ee.factory({config:c}),github:Ct.factory({config:c}),gitlab:dr.factory({config:c}),gitea:sn.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(E=>E.byUrl(c)).filter(Boolean);if(b.length>1){const E=b.filter(J=>!(J instanceof be));E.length!==0&&(b=E)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):F(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},48514:function(Pt,Le,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return w.s4}});var h=n(52322),W=n(2784),f=n(28316),V=n(73557),m=n(60871);const p=(0,m.T0)({id:"plugin.techdocs.storageservice"}),F=(0,m.T0)({id:"plugin.techdocs.service"});var ye=n(92077),le=n(95481),z=n(7476),de=n(93225),D=n(86317),A=n(65124),se=n(22478),ie=n(85478),ne=n(68435),X=n(3482),K=n(42081),R=n(48431),w=n(89258),I=n(52943),Z=n(61886),xe=n(13980),Ce=n.n(xe),B=n(87612);class Qe{get(t){for(const o of this.holders){const a=o.get(t);if(a)return a}}constructor(...t){(0,B._)(this,"holders",void 0),this.holders=t}}var St=n(51837);const Nt=(0,St.CT)("api-context"),Wt=i=>{var t;const{apis:o,children:a}=i,d=(t=(0,W.useContext)(Nt))===null||t===void 0?void 0:t.atVersion(1),S=d?new Qe(o,d):o;return(0,h.jsx)(Nt.Provider,{value:(0,St.EI)({1:S}),children:a})};Wt.propTypes={apis:Ce().shape({get:Ce().func.isRequired}).isRequired,children:Ce().node};class kt{static validateFactories(t,o){for(const a of o){const d=[a],S=new Set;for(;d.length;){const O=d.shift(),U=t.get(O);if(U)for(const ee of Object.values(U.deps)){if(ee.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);S.has(ee)||(S.add(ee),d.push(ee))}}}}get(t){return this.load(t)}load(t,o=[]){const a=this.apis.get(t.id);if(a)return a;const d=this.factories.get(t);if(!d)return;if(o.includes(d.api))throw new Error(`Circular dependency of api factory for ${d.api}`);const S=this.loadDeps(t,d.deps,[...o,d.api]),O=d.factory(S);return this.apis.set(t.id,O),O}loadDeps(t,o,a){const d={};for(const S in o)if(o.hasOwnProperty(S)){const O=o[S],U=this.load(O,a);if(!U)throw new Error(`No API factory available for dependency ${O} of dependent ${t}`);d[S]=U}return d}constructor(t){(0,B._)(this,"factories",void 0),(0,B._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Dt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Dt||(Dt={}));class Xt{register(t,o){const a=Dt[t],d=this.factories.get(o.api.id);return d&&d.priority>=a?!1:(this.factories.set(o.api.id,{priority:a,factory:o}),!0)}get(t){const o=this.factories.get(t.id);if(o)return o.factory}getAllApis(){const t=new Set;for(const{factory:o}of this.factories.values())t.add(o.api);return t}constructor(){(0,B._)(this,"factories",new Map)}}function ct(i){return new Promise((t,o)=>{const a=i.width||500,d=i.height||700,S=window.screen.width/2-a/2,O=window.screen.height/2-d/2,U=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${d},top=${O},left=${S}`);let ee="";if(!U||typeof U.closed=="undefined"||U.closed){const De=new Error("Failed to open auth popup.");De.name="PopupRejectedError",o(De);return}const ve=De=>{if(De.source!==U||De.origin!==i.origin)return;const{data:Ve}=De;if(Ve.type==="config_info"){ee=Ve.targetOrigin;return}if(Ve.type!=="authorization_response")return;const Ge=Ve;if("error"in Ge){const Bt=new Error(Ge.error.message);Bt.name=Ge.error.name,o(Bt)}else t(Ge.response);Te()},Fe=setInterval(()=>{if(U.closed){const De=`Login failed, ${ee&&ee!==window.location.origin?`Incorrect app origin, expected ${ee}`:"popup was closed"}`,Ve=new Error(De);Ve.name="PopupClosedError",o(Ve),Te()}},100);function Te(){window.removeEventListener("message",ve),clearInterval(Fe)}window.addEventListener("message",ve)})}let ut=!1;function pt(i){return[...i].join(" ")}class ht{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const o=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(d=>{throw new Error(`Auth refresh request failed, ${d}`)});if(!o.ok){const d=new Error(`Auth refresh request failed, ${o.statusText}`);throw d.status=o.status,d}const a=await o.json();if(a.error){const d=new Error(a.error.message);throw a.error.name&&(d.name=a.error.name),d}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(o=>{throw new Error(`Logout request failed, ${o}`)});if(!t.ok){const o=new Error(`Logout request failed, ${t.statusText}`);throw o.status=t.status,o}}async showPopup(t){var o,a,d,S,O,U,ee,ve;const Fe=this.joinScopesFunc(t),Te=await this.buildUrl("/start",{scope:Fe,origin:window.location.origin,flow:"popup"}),De=!((a=this.popupOptions)===null||a===void 0||(o=a.size)===null||o===void 0)&&o.fullscreen?window.screen.width:((S=this.popupOptions)===null||S===void 0||(d=S.size)===null||d===void 0?void 0:d.width)||450,Ve=!((U=this.popupOptions)===null||U===void 0||(O=U.size)===null||O===void 0)&&O.fullscreen?window.screen.height:((ve=this.popupOptions)===null||ve===void 0||(ee=ve.size)===null||ee===void 0?void 0:ee.height)||730,Ge=await ct({url:Te,name:`${this.provider.title} Login`,origin:new URL(Te).origin,width:De,height:Ve});return await this.sessionTransform(Ge)}async executeRedirect(t){const o=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:o,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,o){const a=await this.discoveryApi.getBaseUrl("auth"),d=this.buildQueryString({...o,env:this.environment});return`${a}/${this.provider.id}${t}${d}`}buildQueryString(t){if(!t)return"";const o=Object.entries(t).map(([a,d])=>{if(typeof d=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(d)}`;if(d)return encodeURIComponent(a)}).filter(Boolean).join("&");return o?`?${o}`:""}constructor(t){(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"environment",void 0),(0,B._)(this,"provider",void 0),(0,B._)(this,"joinScopesFunc",void 0),(0,B._)(this,"authRequester",void 0),(0,B._)(this,"sessionTransform",void 0),(0,B._)(this,"enableExperimentalRedirectFlow",void 0),(0,B._)(this,"popupOptions",void 0);const{configApi:o,discoveryApi:a,environment:d,provider:S,joinScopes:O=pt,oauthRequestApi:U,sessionTransform:ee=Te=>Te,popupOptions:ve}=t;!ut&&!o&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),ut=!0);var Fe;this.enableExperimentalRedirectFlow=o&&(Fe=o.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Fe!==void 0?Fe:!1,this.authRequester=U.createAuthRequester({provider:S,onAuthRequest:async Te=>this.enableExperimentalRedirectFlow?this.executeRedirect(Te):this.showPopup(Te)}),this.discoveryApi=a,this.environment=d,this.provider=S,this.joinScopesFunc=O,this.sessionTransform=ee,this.popupOptions=ve}}function Vt(i,t){for(const o of t)if(!i.has(o))return!1;return!0}class Jt{sessionExistsAndHasScope(t,o){if(!t)return!1;if(!o||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return Vt(a,o)}getExtendedScope(t,o){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const d=this.options.sessionScopes(t);for(const S of d)a.add(S)}if(o)for(const d of o)a.add(d);return a}constructor(t){(0,B._)(this,"options",void 0),this.options=t}}var be=n(82394),Me=n.n(be);let Ye=Symbol.observable;class ft{[Ye](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(){(0,B._)(this,"isClosed",!1),(0,B._)(this,"terminatingError",void 0),(0,B._)(this,"observable",new(Me())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,B._)(this,"subscribers",new Set)}}let st=Symbol.observable;class nt{[st](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(o=>o.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(o=>o.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,o,a){const d=typeof t=="function"?{next:t,error:o,complete:a}:t;return this.observable.subscribe(d)}constructor(t){(0,B._)(this,"isClosed",void 0),(0,B._)(this,"currentValue",void 0),(0,B._)(this,"terminatingError",void 0),(0,B._)(this,"observable",void 0),(0,B._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(Me())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}}class gt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?m.sM.SignedIn:m.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,B._)(this,"subject",new nt(m.sM.SignedOut)),(0,B._)(this,"signedIn",!1)}}class ot{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),d=this.sessionScopesFunc(this.currentSession),S=this.sessionScopesFunc(a);return Vt(S,d)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const o=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=o,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const o=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),o}finally{delete this.refreshPromise}}constructor(t){(0,B._)(this,"connector",void 0),(0,B._)(this,"helper",void 0),(0,B._)(this,"sessionScopesFunc",void 0),(0,B._)(this,"sessionShouldRefreshFunc",void 0),(0,B._)(this,"stateTracker",new gt),(0,B._)(this,"refreshPromise",void 0),(0,B._)(this,"currentSession",void 0);const{connector:o,defaultScopes:a=new Set,sessionScopes:d,sessionShouldRefresh:S}=t;this.connector=o,this.sessionScopesFunc=d,this.sessionShouldRefreshFunc=S,this.helper=new Jt({sessionScopes:d,defaultScopes:a})}}class Xe{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:o,defaultScopes:a=new Set,sessionScopes:d}=t;this.connector=o,this.helper=new SessionScopeHelper({sessionScopes:d,defaultScopes:a})}}const yt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class vt{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=yt,oauthRequestApi:O,defaultScopes:U=[],scopeTransform:ee=De=>De,popupOptions:ve}=t,Fe=new ht({configApi:o,discoveryApi:a,environment:d,provider:S,oauthRequestApi:O,sessionTransform({backstageIdentity:De,...Ve}){const Ge={...Ve,providerInfo:{idToken:Ve.providerInfo.idToken,accessToken:Ve.providerInfo.accessToken,scopes:vt.normalizeScopes(ee,Ve.providerInfo.scope),expiresAt:Ve.providerInfo.expiresInSeconds?new Date(Date.now()+Ve.providerInfo.expiresInSeconds*1e3):void 0}};if(De){var Bt;const Ut=(Bt=De.expiresInSeconds)!==null&&Bt!==void 0?Bt:Ve.providerInfo.expiresInSeconds;Ge.backstageIdentity={token:De.token,identity:De.identity,expiresAt:Ut?new Date(Date.now()+Ut*1e3):void 0}}return Ge},popupOptions:ve}),Te=new ot({connector:Fe,defaultScopes:new Set(U),sessionScopes:De=>De.providerInfo.scopes,sessionShouldRefresh:De=>{var Ve,Ge;let Bt=1/0;return!((Ve=De.providerInfo)===null||Ve===void 0)&&Ve.expiresAt&&(Bt=Math.min(Bt,(De.providerInfo.expiresAt.getTime()-Date.now())/1e3)),!((Ge=De.backstageIdentity)===null||Ge===void 0)&&Ge.expiresAt&&(Bt=Math.min(Bt,(De.backstageIdentity.expiresAt.getTime()-Date.now())/1e3)),Bt<60*5}});return new vt({sessionManager:Te,scopeTransform:ee})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,o){var a;const d=vt.normalizeScopes(this.scopeTransform,t),S=await this.sessionManager.getSession({...o,scopes:d});var O;return(O=(a=S)===null||a===void 0?void 0:a.providerInfo.accessToken)!==null&&O!==void 0?O:""}async getIdToken(t={}){var o;const a=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var d;return(d=(o=a)===null||o===void 0?void 0:o.providerInfo.idToken)!==null&&d!==void 0?d:""}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}static normalizeScopes(t,o){if(!o)return new Set;const a=Array.isArray(o)?o:o.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,B._)(this,"sessionManager",void 0),(0,B._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const xt={id:"github",title:"GitHub",icon:()=>null};class wn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=xt,oauthRequestApi:O,defaultScopes:U=["read:user"]}=t;return vt.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:S,environment:d,defaultScopes:U})}}const fn={id:"gitlab",title:"GitLab",icon:()=>null};class pn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=fn,oauthRequestApi:O,defaultScopes:U=["read_user"]}=t;return vt.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:S,environment:d,defaultScopes:U})}}const jn={id:"google",title:"Google",icon:()=>null},hn="https://www.googleapis.com/auth/";class xn{static create(t){const{configApi:o,discoveryApi:a,oauthRequestApi:d,environment:S="development",provider:O=jn,defaultScopes:U=["openid",`${hn}userinfo.email`,`${hn}userinfo.profile`]}=t;return vt.create({configApi:o,discoveryApi:a,oauthRequestApi:d,provider:O,environment:S,defaultScopes:U,scopeTransform(ee){return ee.map(ve=>ve==="openid"?ve:ve==="profile"||ve==="email"?`${hn}userinfo.${ve}`:ve.startsWith(hn)?ve:`${hn}${ve}`)}})}}const En={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Sn="okta.";class An{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=En,oauthRequestApi:O,defaultScopes:U=["openid","email","profile","offline_access"]}=t;return vt.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:S,environment:d,defaultScopes:U,scopeTransform(ee){return ee.map(ve=>on.has(ve)||ve.startsWith(Sn)?ve:`${Sn}${ve}`)}})}}var rt=n(30195);const _t=rt.z.object({profile:rt.z.object({email:rt.z.string().optional(),displayName:rt.z.string().optional(),picture:rt.z.string().optional()}),backstageIdentity:rt.z.object({token:rt.z.string(),identity:rt.z.object({type:rt.z.literal("user"),userEntityRef:rt.z.string(),ownershipEntityRefs:rt.z.array(rt.z.string())})})}),Mt={id:"saml",title:"SAML",icon:()=>null};class _e{static create(t){const{discoveryApi:o,environment:a="development",provider:d=Mt}=t,S=new DirectAuthConnector({discoveryApi:o,environment:a,provider:d}),O=new StaticAuthSessionManager({connector:S}),U=new AuthSessionStore({manager:O,storageKey:`${d.id}Session`,schema:samlSessionSchema});return new _e(U)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.backstageIdentity}async getProfile(t={}){var o;return(o=await this.sessionManager.getSession(t))===null||o===void 0?void 0:o.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const Pn={id:"microsoft",title:"Microsoft",icon:()=>null};class dn{static create(t){return new dn(t)}microsoftGraph(){return this.oauth2[dn.MicrosoftGraphID]}static resourceForScopes(t){const o=[...new Set(t.split(" ").map(dn.resourceForScope).filter(S=>S!=="openid"))];if(o.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${o.join(", ")}. Access tokens can only have a single audience.`));var a;const d=(a=o[0])!==null&&a!==void 0?a:dn.MicrosoftGraphID;return Promise.resolve(d)}static resourceForScope(t){var o;const a=(o=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||o===void 0?void 0:o.groups;if(a){const{resourceURI:d}=a;return d.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return dn.MicrosoftGraphID}}async getAccessToken(t,o){const a=t===void 0?dn.MicrosoftGraphID:await dn.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=vt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,o)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,B._)(this,"oauth2",void 0),(0,B._)(this,"configApi",void 0),(0,B._)(this,"environment",void 0),(0,B._)(this,"provider",void 0),(0,B._)(this,"oauthRequestApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"scopeTransform",void 0);const{configApi:o,environment:a="development",provider:d=Pn,oauthRequestApi:S,discoveryApi:O,defaultScopes:U=["openid","offline_access","profile","email","User.Read"],scopeTransform:ee=ve=>ve.concat("offline_access")}=t;this.configApi=o,this.environment=a,this.provider=d,this.oauthRequestApi=S,this.discoveryApi=O,this.scopeTransform=ee,this.oauth2={[dn.MicrosoftGraphID]:vt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:U})}}}(0,B._)(dn,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const $n={id:"onelogin",title:"onelogin",icon:()=>null},Cn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Un="onelogin.";class qn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=$n,oauthRequestApi:O}=t;return vt.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:S,environment:d,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(U){return U.map(ee=>Cn.has(ee)||ee.startsWith(Un)?ee:`${Un}${ee}`)}})}}const Ln={id:"bitbucket",title:"Bitbucket",icon:()=>null};class zn{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Ln,oauthRequestApi:O,defaultScopes:U=["team"]}=t;return vt.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:S,environment:d,defaultScopes:U})}}const we={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class he{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=we,oauthRequestApi:O,defaultScopes:U=["PROJECT_ADMIN"]}=t;return vt.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:S,environment:d,defaultScopes:U})}}const Pe={id:"atlassian",title:"Atlassian",icon:()=>null};class G{static create(t){const{configApi:o,discoveryApi:a,environment:d="development",provider:S=Pe,oauthRequestApi:O}=t;return vt.create({configApi:o,discoveryApi:a,oauthRequestApi:O,provider:S,environment:d})}}class N{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,B._)(this,"subject",new ft)}}class ce{captureEvent(t){}}const Ee="theme";class Ue{static createWithStorage(t){const o=new Ue(t);if(!window.localStorage)return o;var a;const d=(a=window.localStorage.getItem(Ee))!==null&&a!==void 0?a:void 0;return o.setActiveThemeId(d),o.activeThemeId$().subscribe(S=>{S?window.localStorage.setItem(Ee,S):window.localStorage.removeItem(Ee)}),window.addEventListener("storage",S=>{if(S.key===Ee){var O;const U=(O=localStorage.getItem(Ee))!==null&&O!==void 0?O:void 0;o.setActiveThemeId(U)}}),o}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,B._)(this,"themes",void 0),(0,B._)(this,"activeThemeId",void 0),(0,B._)(this,"subject",void 0),this.themes=t,this.subject=new nt(void 0)}}var qe=n(9850),Tt=n.n(qe),$t=n(12782),ln=n.n($t);const sn=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function nn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function re(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const te={type(i,t,o,a){return`Invalid type in config for key '${i}' in '${t}', got ${o}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,o){return`Unable to convert config value for key '${i}' in '${t}' to a ${o}`}};class Y{static fromConfigs(t){return t.length===0?new Y(void 0):t.reduce((o,{data:a,context:d,filteredKeys:S,deprecatedKeys:O})=>{const U=new Y(a,d,o);if(U.filteredKeys=S,O)for(const{key:ee,description:ve}of O)console.warn(`The configuration key '${ee}' of ${d} is deprecated and may be removed soon. ${ve||""}`);return U},void 0)}has(t){var o;if(this.readValue(t)!==void 0)return!0;var d;return(d=(o=this.fallback)===null||o===void 0?void 0:o.has(t))!==null&&d!==void 0?d:!1}keys(){var t;const o=this.data?Object.keys(this.data):[];var a;const d=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...o,...d])]}get(t){const o=this.getOptional(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t!=null?t:"")));return o}getOptional(t){var o;const a=Tt()(this.readValue(t)),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptional(t);if(a===void 0){if(!1)var S;return d}else if(d===void 0)return a;return ln()({},{value:d},{value:a},(O,U)=>!nn(U)||!nn(O)?U:void 0).value}getConfig(t){const o=this.getOptionalConfig(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalConfig(t){var o;const a=this.readValue(t),d=(o=this.fallback)===null||o===void 0?void 0:o.getOptionalConfig(t);if(nn(a))return this.copy(a,t,d);if(a!==void 0)throw new TypeError(te.type(this.fullKey(t),this.context,re(a),"object"));return d}getConfigArray(t){const o=this.getOptionalConfigArray(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalConfigArray(t){const o=this.readConfigValue(t,d=>{if(!Array.isArray(d))return{expected:"object-array"};for(const[S,O]of d.entries())if(!nn(O))return{expected:"object-array",value:O,key:`${t}[${S}]`};return!0});if(!o){if(!1)var a;return}return o.map((d,S)=>this.copy(d,`${t}[${S}]`))}getNumber(t){const o=this.getOptionalNumber(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalNumber(t){const o=this.readConfigValue(t,d=>typeof d=="number"||typeof d=="string"||{expected:"number"});if(typeof o=="number"||o===void 0)return o;const a=Number(o);if(!Number.isFinite(a))throw new Error(te.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const o=this.getOptionalBoolean(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalBoolean(t){const o=this.readConfigValue(t,d=>typeof d=="boolean"||typeof d=="number"||typeof d=="string"||{expected:"boolean"});if(typeof o=="boolean"||o===void 0)return o;const a=String(o).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(te.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const o=this.getOptionalString(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalString(t){return this.readConfigValue(t,o=>typeof o=="string"&&o!==""||{expected:"string"})}getStringArray(t){const o=this.getOptionalStringArray(t);if(o===void 0)throw new Error(te.missing(this.fullKey(t)));return o}getOptionalStringArray(t){return this.readConfigValue(t,o=>{if(!Array.isArray(o))return{expected:"string-array"};for(const[a,d]of o.entries())if(typeof d!="string"||d==="")return{expected:"string-array",value:d,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,o,a){const d=new Y(t,this.context,a,this.fullKey(o));return d.filteredKeys=this.filteredKeys,d}readConfigValue(t,o){const a=this.readValue(t);if(a===void 0){var d;if(!1)var S;return(d=this.fallback)===null||d===void 0?void 0:d.readConfigValue(t,o)}const O=o(a);if(O!==!0){const{key:U=t,value:ee=a,expected:ve}=O;throw new TypeError(te.type(this.fullKey(U),this.context,re(ee),ve))}return a}readValue(t){const o=t?t.split("."):[];for(const d of o)if(!sn.test(d))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[d,S]of o.entries())if(nn(a))a=a[S];else if(a!==void 0){const O=this.fullKey(o.slice(0,d).join("."));throw new TypeError(te.type(O,this.context,re(a),"object"))}return a}constructor(t,o="mock-config",a,d=""){(0,B._)(this,"data",void 0),(0,B._)(this,"context",void 0),(0,B._)(this,"fallback",void 0),(0,B._)(this,"prefix",void 0),(0,B._)(this,"filteredKeys",void 0),(0,B._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=o,this.fallback=a,this.prefix=d,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class k{static compile(t){const o=t.split(/\{\{\s*pluginId\s*\}\}/),a=o.join("pluginId");let d;try{d=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(d.hash)throw new Error(`${v} URL must not have a hash`);if(d.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new k(o)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,B._)(this,"parts",void 0),this.parts=t}}class M{post(t,o){var a;return!((a=o)===null||a===void 0)&&a.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,o)}error$(){return this.errorApi.error$()}constructor(t,o){(0,B._)(this,"alertApi",void 0),(0,B._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=o}}class H{post(t,o){this.subject.next({error:t,context:o})}error$(){return this.subject}constructor(){(0,B._)(this,"subject",new ft)}}class pe{static forward(t,o){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,o)})}}function Se(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Oe{registerFlag(t){Se(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===m.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,d]of Object.entries(t.states))this.flags.set(a,d);const o=Array.from(this.flags.entries()).filter(([,a])=>a===m.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(o)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const o=JSON.parse(t);if(typeof o!="object"||o===null||Array.isArray(o))return new Map;const a=Object.entries(o).filter(([d,S])=>(Se(d),S===m.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,B._)(this,"registeredFeatureFlags",[]),(0,B._)(this,"flags",void 0)}}function et(i){let t=i.baseImplementation||n.g.fetch;var o;const a=[(o=i.middleware)!==null&&o!==void 0?o:[]].flat().reverse();for(const d of a)t=d.apply(t);return{fetch:t}}class tt{static create(t){var o,a;const d=bt(t),S=((o=t.header)===null||o===void 0?void 0:o.name)||"authorization",O=((a=t.header)===null||a===void 0?void 0:a.value)||(U=>`Bearer ${U}`);return new tt(t.identityApi,d,S,O)}apply(t){return async(o,a)=>{const d=new Request(o,a),{token:S}=await this.identityApi.getCredentials();return d.headers.get(this.headerName)||typeof S!="string"||!S||!this.allowUrl(d.url)?t(o,a):(d.headers.set(this.headerName,this.headerValue(S)),t(d))}}constructor(t,o,a,d){(0,B._)(this,"identityApi",void 0),(0,B._)(this,"allowUrl",void 0),(0,B._)(this,"headerName",void 0),(0,B._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=o,this.headerName=a,this.headerValue=d}}function bt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?wt(i.urlPrefixAllowlist):i.config?wt([i.config.getString("backend.baseUrl")]):()=>!1}function wt(i){const t=i.map(o=>o.replace(/\/$/,""));return o=>t.some(a=>o===a||o.startsWith(`${a}/`))}function at(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Be{apply(t){return async(o,a)=>{const d=new Request(o,a),S="plugin://";if(!d.url.startsWith(S))return t(o,a);const{hostname:O,pathname:U,search:ee,hash:ve,username:Fe,password:Te}=new URL(`http://${d.url.substring(S.length)}`);let De=await this.discoveryApi.getBaseUrl(O);if(Fe||Te){const Ge=new URL(De),Bt=`${Fe}${Te?`:${Te}`:""}@`;De=`${Ge.protocol}//${Bt}${Ge.host}${Ge.pathname}`}const Ve=`${at(De,U)}${ee}${ve}`;return t(Ve,typeof o=="string"||Ct(o)?a:o)}}constructor(t){(0,B._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function Ct(i){var t;return typeof i=="object"&&((t=i)===null||t===void 0?void 0:t.constructor)===URL}class Yt{static resolvePluginProtocol(t){return new Be(t.discoveryApi)}static injectIdentityAuth(t){return tt.create(t)}constructor(){}}function Et(i,t){for(const o of t)if(!i.has(o))return!1;return!0}function Ft(i,...t){const o=new Set(i);for(const a of t)for(const d of a)o.add(d);return o}class en{request(t){return new Promise((o,a)=>{this.requests.push({scopes:t,resolve:o,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,o){this.requests=this.requests.filter(a=>Et(t,a.scopes)?(a.resolve(o),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(o=>o.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((o,a)=>Ft(o,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:o=>{t&&this.resolve(t,o)},reject:o=>{t&&this.reject(o)}}}constructor(){(0,B._)(this,"requests",[]),(0,B._)(this,"subject",new nt(this.getCurrentPending()))}}class Tn{createAuthRequester(t){const o=new en,a=this.handlerCount;return this.handlerCount++,o.pending().subscribe({next:d=>{const S=this.currentRequests.slice(),O=this.makeAuthRequest(d,t);O?S[a]=O:delete S[a],this.currentRequests=S,this.subject.next(S.filter(Boolean))}}),d=>o.request(d)}makeAuthRequest(t,o){const{scopes:a}=t;if(a)return{provider:o.provider,trigger:async()=>{const d=await o.onAuthRequest(a);t.resolve(d)},reject:()=>{const d=new Error("Login failed, rejected by user");d.name="RejectedError",t.reject(d)}}}authRequest$(){return this.subject}constructor(){(0,B._)(this,"subject",new nt([])),(0,B._)(this,"currentRequests",[]),(0,B._)(this,"handlerCount",0)}}const Zt=new Map;class lt{static create(t){var o;return new lt((o=t.namespace)!==null&&o!==void 0?o:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,d]of Zt.entries()){var o;!((o=t.key)===null||o===void 0)&&o.startsWith(a)&&d.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let o,a="absent";try{const d=localStorage.getItem(this.getKeyName(t));d&&(o=JSON.parse(d,(S,O)=>(typeof O=="object"&&O!==null&&Object.freeze(O),O)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:o,presence:a}}forBucket(t){const o=`${this.namespace}/${t}`;return Zt.has(o)||Zt.set(o,new lt(o,this.errorApi)),Zt.get(o)}async set(t,o){localStorage.setItem(this.getKeyName(t),JSON.stringify(o)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return lt.hasSubscribed||(lt.addStorageEventListener(),lt.hasSubscribed=!0),this.observable.filter(({key:o})=>o===t)}handleStorageChange(t){var o,a;if(!(!((o=t)===null||o===void 0)&&o.startsWith(this.namespace)))return;const d=(a=t)===null||a===void 0?void 0:a.slice(`${this.namespace}/`.length);d.includes("/")||this.notifyChanges(decodeURIComponent(d))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const o=this.snapshot(t);for(const a of this.subscribers)a.next(o)}constructor(t,o){(0,B._)(this,"namespace",void 0),(0,B._)(this,"errorApi",void 0),(0,B._)(this,"subscribers",void 0),(0,B._)(this,"observable",void 0),this.namespace=t,this.errorApi=o,this.subscribers=new Set,this.observable=new(Me())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,B._)(lt,"hasSubscribed",!1);const Rt=(0,W.createContext)(void 0);function Ht(){const[i]=(0,V.is)((0,h.jsx)(V.AW,{index:!0,element:(0,h.jsx)("div",{})}));return!i.index}var qt=n(84800);const Sr=(i,t)=>{try{var o,a,d,S;const U=(o=(0,qt.fp)(t,{pathname:i}))===null||o===void 0?void 0:o.filter(De=>{var Ve,Ge;return((Ge=De)===null||Ge===void 0||(Ve=Ge.route.routeRefs)===null||Ve===void 0?void 0:Ve.size)>0}).pop(),ee=(a=U)===null||a===void 0?void 0:a.route;if(!ee||ee.path===""&&i!=="/")return;let ve;ee.routeRefs.size===1&&(ve=ee.routeRefs.values().next().value);let Fe;ee.plugins.size===1&&(Fe=ee.plugins.values().next().value);const Te=Object.entries(((d=U)===null||d===void 0?void 0:d.params)||{}).reduce((De,[Ve,Ge])=>(Ge!==void 0&&Ve!=="*"&&(De[Ve]=Ge),De),{});return{extension:"App",pluginId:((S=Fe)===null||S===void 0?void 0:S.getId())||"root",...ve?{routeRef:ve.id}:{},_routeNodeType:ee.element,params:Te}}catch{return}},Or=({pathname:i,search:t,hash:o,attributes:a})=>{const d=(0,m.z$)();return(0,W.useEffect)(()=>{d.captureEvent("navigate",`${i}${t}${o}`,{attributes:a})},[d,i,t,o,a]),null},er=({routeObjects:i})=>{const{pathname:t,search:o,hash:a}=(0,V.TH)(),{params:d,...S}=Sr(t,i)||{params:{}};return(0,h.jsx)(m.fC,{attributes:S,children:(0,h.jsx)(Or,{pathname:t,search:o,hash:a,attributes:d})})};function bn(i){return Ht()?tr(i):""}function tr(i){var t;let{pathname:o}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return o=o.replace(/\/*$/,""),o}function dr({component:i,appIdentityProxy:t,children:o}){const[a,d]=(0,W.useState)(),S=(0,m.h_)(m.Ds),O=bn(S);return a?(t.setTarget(a,{signOutTargetUrl:O||"/"}),(0,h.jsx)(h.Fragment,{children:o})):(0,h.jsx)(i,{onSignInSuccess:d})}function Gr(i){const{Router:t,SignInPage:o}=(0,m.qD)().getComponents(),a=(0,m.h_)(m.Ds),d=tr(a),S=`${d}/*`,O=(0,W.useContext)(Rt);if(!O)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:U,appIdentityProxy:ee}=O;return o?Ht()?(0,h.jsxs)(t,{children:[(0,h.jsx)(er,{routeObjects:U}),(0,h.jsx)(dr,{component:o,appIdentityProxy:ee,children:(0,h.jsx)(V.Z5,{children:(0,h.jsx)(V.AW,{path:S,element:(0,h.jsx)(h.Fragment,{children:i.children})})})})]}):(0,h.jsxs)(t,{basename:d,children:[(0,h.jsx)(er,{routeObjects:U}),(0,h.jsx)(dr,{component:o,appIdentityProxy:ee,children:i.children})]}):(ee.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:d||"/"}),Ht()?(0,h.jsxs)(t,{children:[(0,h.jsx)(er,{routeObjects:U}),(0,h.jsx)(V.Z5,{children:(0,h.jsx)(V.AW,{path:S,element:(0,h.jsx)(h.Fragment,{children:i.children})})})]}):(0,h.jsxs)(t,{basename:d,children:[(0,h.jsx)(er,{routeObjects:U}),i.children]}))}var Wn=n(88412),Kr=n(50629),Cr=n(80956),C=n(64279);function c(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const o=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;o.length!==0;){const{node:a,parent:d,contexts:S}=o.shift();W.Children.forEach(a,O=>{if(!(0,W.isValidElement)(O))return;const U={};for(const ee in t)if(t.hasOwnProperty(ee)){const ve=t[ee];U[ee]=ve.visit(ve.accumulator,O,d,S[ee])}for(const ee of i.discoverers){const ve=ee(O);ve&&o.push({node:ve,parent:O,contexts:U})}})}return Object.fromEntries(Object.entries(t).map(([a,d])=>[a,d.accumulator]))}function b(i,t){return()=>({accumulator:i(),visit:t})}function E(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function J(i){var t,o;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((o=i.props)===null||o===void 0)&&o.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const me=b(()=>new Set,(i,t)=>{const o=(0,m.IY)(t,"core.plugin");o&&i.add(o)}),je=i=>{const{children:t}=i,o=(0,m.h_)(m.W0),a="with"in i?o.isActive(i.with):!o.isActive(i.without);return(0,h.jsx)(h.Fragment,{children:a?t:null})};(0,m.R5)(je,"core.featureFlagged",!0);const ke={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set,plugins:new Set};function He(i){var t;const o=i;if(!((t=o)===null||t===void 0)&&t.type){var a,d;return(d=(a=o.type.displayName)!==null&&a!==void 0?a:o.type.name)!==null&&d!==void 0?d:String(o.type)}return String(o)}const Gt=i=>{const t=new Set;return i&&t.add(i),t};function cn(i,t=new Array){return W.Children.forEach(i,o=>{if(!(0,W.isValidElement)(o))return;const a=(0,m.IY)(o,"core.mountPoint");if(a){const d=(0,m.IY)(o,"core.plugin");t.push({routeRef:a,plugin:d})}cn(o.props.children,t)}),t}const gn=b(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,S,O,U,ee;if(!((d=a)===null||d===void 0)&&d.isElementAncestor)return a;if(((S=o)===null||S===void 0?void 0:S.props.element)===t)return{...a,isElementAncestor:!0};const ve=(O=t.props)===null||O===void 0?void 0:O.path,Fe=(0,m.IY)(t,"core.mountPoint");if(Fe&&ve)throw new Error(`Path property may not be set directly on a routable extension "${He(t)}"`);var Te;const De=(Te=(ee=a)===null||ee===void 0||(U=ee.obj)===null||U===void 0?void 0:U.children)!==null&&Te!==void 0?Te:i.objects;if(ve!==void 0){if(typeof ve!="string")throw new Error(`Element path must be a string at "${He(t)}"`);const On=ve.startsWith("/")?ve.slice(1):ve,Hr=t.props.element;if((0,m.IY)(t,"core.gatherMountPoints")){var Ve,Ge,Bt;if(Hr)throw new Error(`Mount point gatherers may not have an element prop "${He(t)}"`);const Wo={path:On,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Ve=t.props)===null||Ve===void 0?void 0:Ve.caseSensitive),children:[ke],plugins:new Set};return De.push(Wo),{obj:Wo,gatherPath:On,routeRef:(Ge=a)===null||Ge===void 0?void 0:Ge.routeRef,gatherRouteRef:(Bt=a)===null||Bt===void 0?void 0:Bt.routeRef}}if(Hr){var Ut,lr,_r,xr;const[Wo,...ha]=cn(Hr);if(ha.length>0)throw new Error(`Route element with path "${ve}" may not contain multiple routable extensions`);if(!Wo)return a;const{routeRef:ao,plugin:fa}=Wo,oi={path:On,element:"mounted",routeRefs:new Set([ao]),caseSensitive:Boolean((Ut=t.props)===null||Ut===void 0?void 0:Ut.caseSensitive),children:[ke],plugins:Gt(fa)};return De.push(oi),i.paths.set(ao,On),i.parents.set(ao,(lr=a)===null||lr===void 0?void 0:lr.routeRef),{obj:oi,routeRef:ao!=null?ao:(_r=a)===null||_r===void 0?void 0:_r.routeRef,gatherPath:On,gatherRouteRef:(xr=a)===null||xr===void 0?void 0:xr.gatherRouteRef}}}if(Fe){var br,Rr,Mn,Nr;if(((br=a)===null||br===void 0?void 0:br.gatherPath)===void 0)throw new Error(`Routable extension "${He(t)}" with mount point "${Fe}" must be assigned a path`);(Mn=a)===null||Mn===void 0||(Rr=Mn.obj)===null||Rr===void 0||Rr.routeRefs.add(Fe);const On=(0,m.IY)(t,"core.plugin");if(On){var Vr,Ir;(Ir=a)===null||Ir===void 0||(Vr=Ir.obj)===null||Vr===void 0||Vr.plugins.add(On)}return i.paths.set(Fe,a.gatherPath),i.parents.set(Fe,(Nr=a)===null||Nr===void 0?void 0:Nr.gatherRouteRef),{...a,routeRef:Fe}}return a}),Vn=b(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,o,a)=>{var d,S,O,U,ee,ve,Fe,Te,De;if(((d=o)===null||d===void 0?void 0:d.props.element)===t)return a;let Ve=(S=a)===null||S===void 0?void 0:S.obj,Ge=(O=a)===null||O===void 0?void 0:O.routeRef,Bt=(U=a)===null||U===void 0?void 0:U.sticky;const Ut=(ee=t.props)===null||ee===void 0?void 0:ee.path;var lr;const _r=(lr=(ve=Ve)===null||ve===void 0?void 0:ve.children)!==null&&lr!==void 0?lr:i.objects,xr=Boolean((Fe=t.props)===null||Fe===void 0?void 0:Fe.caseSensitive);let br=(Te=a)===null||Te===void 0?void 0:Te.path;if((0,m.IY)(t,"core.gatherMountPoints")){if(!Ut)throw new Error("Mount point gatherer must have a path");br=Ut}const Rr=(De=t.props)===null||De===void 0?void 0:De.element;let Mn=(0,m.IY)(t,"core.mountPoint");if(!Mn&&(0,W.isValidElement)(Rr)&&(Mn=(0,m.IY)(Rr,"core.mountPoint")),Mn){let Hr=Ut;if(br&&(Hr?br=void 0:Hr=br),!Hr)throw new Error("Mounted routable extension must have a path");if(i.paths.set(Mn,Hr),Ge&&Bt?(i.parents.set(Mn,Ge),Ut&&(Ge=Mn,Bt=!1)):(i.parents.set(Mn,Ge),Ge=Mn),Ut)Ve={caseSensitive:xr,path:Ut,element:"mounted",routeRefs:new Set([Mn]),children:[ke],plugins:Gt((0,m.IY)(t.props.element,"core.plugin"))},_r.push(Ve);else{var Nr;(Nr=Ve)===null||Nr===void 0||Nr.routeRefs.add(Mn)}}if((0,m.IY)(t,"core.gatherMountPoints")&&(Bt=!0),(0,m.IY)(t,"core.gatherMountPoints")){if(!Ut)throw new Error("Mount point gatherer must have a path");if(!Mn){var Ir,On;Ve={caseSensitive:xr,path:Ut,element:"gathered",routeRefs:new Set,children:[ke],plugins:((On=a)===null||On===void 0||(Ir=On.obj)===null||Ir===void 0?void 0:Ir.plugins)||new Set},_r.push(Ve)}}return{obj:Ve,path:br,routeRef:Ge,sticky:Bt}}),zt=b(()=>new Set,(i,t)=>{if(t.type===je){const o=t.props;i.add("with"in o?o.with:o.without)}}),rn=(0,St.uW)("route-ref-type",()=>Symbol("route-ref-type"));function nr(i){return i[rn]==="absolute"}function rr(i){return i[rn]==="sub"}function wr(i){return i[rn]==="external"}function or(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function Go(i,t,o){let a,d="";if(nr(i))a=i;else if(rr(i))a=i.parent,d=i.path;else if(wr(i)){const U=o.get(i);if(!U)return[void 0,""];if(nr(U))a=U;else if(rr(U))a=U.parent,d=U.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${U}`)}else throw i[rn]?new Error(`Unknown or invalid route ref type, ${i[rn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const S=t.get(a);if(S===void 0)return[void 0,""];const O=or(S,d);return[a,O]}function ws(i,t,o,a,d){var S;const O=(S=(0,qt.fp)(d,t))!==null&&S!==void 0?S:[],U=Array();let ee=-1;for(let Te=i;Te&&(ee=O.findIndex(De=>De.route.routeRefs.has(Te)),ee===-1);Te=a.get(Te))U.unshift(Te);U.length===0&&(ee-=1);const ve=ee===-1?"":O[ee].pathname,Fe=U.slice(0,-1).map(Te=>{const De=o.get(Te);if(De===void 0)throw new Error(`No path for ${Te}`);if(De.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Te} as it has parameters`);return De});return`${or(ve,...Fe)}/`}class Ko{resolve(t,o){const[a,d]=Go(t,this.routePaths,this.routeBindings);if(!a)return;let S;typeof o=="string"?S=this.trimPath(o):o.pathname?S={...o,pathname:this.trimPath(o.pathname)}:S=o;const O=this.appBasePath+ws(a,S,this.routePaths,this.routeParents,this.routeObjects);return(...[ee])=>or(O,(0,qt.Gn)(d,ee))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,o,a,d,S){(0,B._)(this,"routePaths",void 0),(0,B._)(this,"routeParents",void 0),(0,B._)(this,"routeObjects",void 0),(0,B._)(this,"routeBindings",void 0),(0,B._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=o,this.routeObjects=a,this.routeBindings=d,this.appBasePath=S}}const Yo=(0,St.CT)("routing-context"),kr=({routePaths:i,routeParents:t,routeObjects:o,routeBindings:a,basePath:d="",children:S})=>{const O=new Ko(i,t,o,a,d),U=(0,St.EI)({1:O});return(0,h.jsx)(Yo.Provider,{value:U,children:S})};function gr(i,t){const o=new Set(t.values());o.delete(void 0);for(const a of t.keys()){if(o.has(a))continue;let d=a,S="";for(;d;){const U=i.get(d);if(U===void 0)throw new Error(`No path for ${d}`);S=or(U,S),d=t.get(d)}const O=S.match(/:(\w+)/g);if(O){for(let U=0;U<O.length;U++)for(let ee=U+1;ee<O.length;ee++)if(O[ee]===O[U])throw new Error(`Parameter ${O[ee]} is duplicated in path ${S}`)}}}function Yr(i,t){for(const o of t)if(o.externalRoutes){for(const[a,d]of Object.entries(o.externalRoutes))if(!d.optional&&!i.has(d))throw new Error(`External route '${a}' of the '${o.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const eo=(0,St.CT)("app-context"),wo=({appContext:i,children:t})=>{const o=(0,St.EI)({1:i});return(0,h.jsx)(eo.Provider,{value:o,children:t})};function jo(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function zr(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Jo{setTarget(t,o){this.target=t,this.signOutTargetUrl=o.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw jo("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return zr("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw jo("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return zr("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(o=>o.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return zr("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,B._)(this,"target",void 0),(0,B._)(this,"waitForTarget",void 0),(0,B._)(this,"resolveTarget",()=>{}),(0,B._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Eo=n(72164);function Zn(i,t,o){if(i!==void 0){const d=o.find(S=>S.id===i);if(d)return d}if(t){const d=o.find(S=>S.variant==="dark");if(d)return d}const a=o.find(d=>d.variant==="light");return a||o[0]}const mr=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,o]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const a=d=>{o(d.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Jr({children:i}){const t=(0,m.h_)(m.hg),o=(0,Eo.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?mr():!1,d=Zn(o,a,t.getInstalledThemes());if(!d)throw new Error("App has no themes");return(0,h.jsx)(d.Provider,{children:i})}const Qr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const o=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const d=JSON.parse(i);Array.isArray(d)?o.push(...d):o.push({data:d,context:"env"})}catch(d){throw new Error(`Failed to load runtime configuration, ${d}`)}const a=window.__APP_CONFIG__;return a&&o.push({context:"window",data:a}),o};class Qo{add(t,o){return this.apis.push([t.id,o]),o}build(){return new jr(new Map(this.apis))}constructor(){(0,B._)(this,"apis",[])}}class jr{static builder(){return new Qo}static from(t){return new jr(new Map(t.map(([o,a])=>[o.id,a])))}static with(t,o){return new jr(new Map([[t.id,o]]))}with(t,o){return new jr(new Map([...this.apis,[t.id,o]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,B._)(this,"apis",void 0),this.apis=t}}function Ao(i){const t=new Map;return i&&i({bind:(a,d)=>{for(const[S,O]of Object.entries(d)){const U=a[S];if(!U)throw new Error(`Key ${S} is not an existing external route`);if(!O&&!U.optional)throw new Error(`External route ${S} is required but was undefined`);O&&t.set(U,O)}}}),t}function To(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Ro(i,t,o){var a;const d=Boolean(i),S=(0,C.default)(i||(()=>Promise.resolve([])));let O;if(d&&S.loading){const{Progress:ve}=t;O=(0,h.jsx)(ve,{})}else if(S.error){const{BootErrorPage:ve}=t;O=(0,h.jsx)(ve,{step:"load-config",error:S.error})}const{ThemeProvider:U=Jr}=t;if(O)return{node:(0,h.jsx)(Wt,{apis:jr.with(m.hg,o),children:(0,h.jsx)(U,{children:O})})};let ee;if(!((a=S.value)===null||a===void 0)&&a.length){const ve=Y.fromConfigs(S.value),Fe=ve.getOptionalString("app.baseUrl"),Te=ve.getOptionalString("backend.baseUrl");let De=S.value;const Ve={data:{},context:"relative-resolver"};if(Fe&&Te){const Ge=new URL(Fe).origin,Bt=new URL(Te).origin;if(Ge===Bt){const Ut=To(Te);Te!==Ut&&(Ve.data.backend={baseUrl:Ut})}}if(Fe){const Ge=To(Fe);Fe!==Ge&&(Ve.data.app={baseUrl:Ge})}Object.keys(Ve.data).length&&(De=De.concat([Ve])),ee=Y.fromConfigs(De)}else ee=Y.fromConfigs([]);return{api:ee}}class Wr{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,B._)(this,"app",void 0),this.app=t}}var Io=new WeakMap;class Xo{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const o=this.getProvider();return()=>(0,h.jsx)(o,{children:t})}getProvider(){if((0,Wn._)(this,Io))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Cr._)(this,Io,!0);const t=new Wr(this);let o=!1;return({children:d})=>{const S=(0,W.useRef)(!0),O=(0,W.useMemo)(()=>Ue.createWithStorage(this.themes),[]),{routing:U,featureFlags:ee,routeBindings:ve}=(0,W.useMemo)(()=>{const Ve=c({root:d,discoverers:[E,J],collectors:{routing:Ht()?Vn:gn,collectedPlugins:me,featureFlags:zt}});return Ve.collectedPlugins.forEach(Ge=>this.plugins.add(Ge)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ve,routeBindings:Ao(this.bindRoutes)}},[d]);o||(o=!0,gr(U.paths,U.parents),Yr(ve,this.plugins));const Fe=Ro(this.configLoader,this.components,O),Te="api"in Fe;if(Te){const{api:Ve}=Fe;this.configApi=Ve}if("node"in Fe)return Fe.node;if(Te&&S.current){S.current=!1;const Ve=this.getApiHolder().get(m.W0);if(Ve){for(const Ut of this.featureFlags)Ve.registerFlag({...Ut,pluginId:""});for(const Ut of this.plugins.values())if("getFeatureFlags"in Ut)for(const lr of Ut.getFeatureFlags())Ve.registerFlag({name:lr.name,pluginId:Ut.getId()});else for(const lr of Ut.output())lr.type==="feature-flag"&&Ve.registerFlag({name:lr.name,pluginId:Ut.getId()});const Ge=Ve.getRegisteredFlags(),Bt=new Set(Ge.map(Ut=>Ut.name));for(const Ut of ee)Bt.has(Ut)||Ve.registerFlag({name:Ut,pluginId:""})}}const{ThemeProvider:De=Jr}=this.components;return(0,h.jsx)(Wt,{apis:this.getApiHolder(),children:(0,h.jsx)(wo,{appContext:t,children:(0,h.jsx)(De,{children:(0,h.jsx)(kr,{routePaths:U.paths,routeParents:U.parents,routeObjects:U.objects,routeBindings:ve,basePath:bn(Fe.api),children:(0,h.jsx)(Rt.Provider,{value:{routeObjects:U.objects,appIdentityProxy:this.appIdentityProxy},children:d})})})})})}}getRouter(){return Gr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const o of t.getApis())this.apiFactoryRegistry.get(o.api)||this.apiFactoryRegistry.register("default",o);return kt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:m.hg,deps:{},factory:()=>Ue.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:m.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:m.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:m.W0,deps:{},factory:()=>new Oe});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const o of t.getApis())if(!this.apiFactoryRegistry.register("default",o))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${o.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return kt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new kt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const o=new Set;for(const a of t){const d=a.getId();if(o.has(d))throw new Error(`Duplicate plugin found '${d}'`);o.add(d)}}constructor(t){(0,B._)(this,"apiHolder",void 0),(0,B._)(this,"configApi",void 0),(0,B._)(this,"apis",void 0),(0,B._)(this,"icons",void 0),(0,B._)(this,"plugins",void 0),(0,B._)(this,"featureFlags",void 0),(0,B._)(this,"components",void 0),(0,B._)(this,"themes",void 0),(0,B._)(this,"configLoader",void 0),(0,B._)(this,"defaultApis",void 0),(0,B._)(this,"bindRoutes",void 0),(0,B._)(this,"appIdentityProxy",new Jo),(0,B._)(this,"apiFactoryRegistry",void 0),(0,Kr._)(this,Io,{writable:!0,value:!1});var o;this.apis=(o=t.apis)!==null&&o!==void 0?o:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var d;this.featureFlags=(d=t.featureFlags)!==null&&d!==void 0?d:[],this.components=t.components,this.themes=t.themes;var S;this.configLoader=(S=t.configLoader)!==null&&S!==void 0?S:Qr;var O;this.defaultApis=(O=t.defaultApis)!==null&&O!==void 0?O:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Xt}}function po(i){return new Xo(i)}let Po=!1;const js=i=>{const t=(0,m.qD)(),{NotFoundErrorPage:o}=t.getComponents(),a=(0,W.useMemo)(()=>Ht(),[]),S=[...(0,m.vJ)(i.children,O=>O.getElements().flatMap(U=>{var ee;let ve=U.props.path;if(ve==="")return[];var Fe;ve=(Fe=(ee=ve)===null||ee===void 0?void 0:ee.replace(/\/\*$/,""))!==null&&Fe!==void 0?Fe:"/";let Te=a?U:U.props.element;return!a&&!Te&&(Te=U,Po||(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] />} />."),Po=!0)),[{path:ve,element:Te,children:U.props.children?[{path:ve==="/"?"/":"*",element:U.props.children}]:void 0}]}).sort((U,ee)=>ee.path.localeCompare(U.path)).map(U=>({...U,path:U.path==="/"?"/":`${U.path}/*`}))),{path:"*",element:(0,h.jsx)(o,{})}];return(0,V.V$)(S)},Lo=(0,m.T0)({id:"plugin.permission.api"});var vr;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(vr||(vr={}));function ai(i,t){return i.name===t.name}function _o(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function Es(i){return i.attributes.action==="create"}function ho(i){return i.attributes.action==="read"}function to(i){return i.attributes.action==="update"}function no(i){return i.attributes.action==="delete"}function ro(i){return{authorize:async(t,o)=>await i.authorize(t,o),authorizeConditional(t,o){const a=t;return i.authorize(a,o)}}}function Br({name:i,attributes:t,resourceType:o}){return o?{type:"resource",name:i,attributes:t,resourceType:o}:{type:"basic",name:i,attributes:t}}var sr=n(23054),fo=n(96279),qo=n.n(fo),As=n(9571);const oo=rt.z.lazy(()=>rt.z.object({rule:rt.z.string(),resourceType:rt.z.string(),params:rt.z.record(rt.z.any()).optional()}).or(rt.z.object({anyOf:rt.z.array(oo).nonempty()})).or(rt.z.object({allOf:rt.z.array(oo).nonempty()})).or(rt.z.object({not:oo}))),es=rt.z.object({result:rt.z.literal(vr.ALLOW).or(rt.z.literal(vr.DENY))}),Ts=rt.z.union([rt.z.object({result:rt.z.literal(vr.ALLOW).or(rt.z.literal(vr.DENY))}),rt.z.object({result:rt.z.literal(vr.CONDITIONAL),pluginId:rt.z.string(),resourceType:rt.z.string(),conditions:oo})]),ts=(i,t)=>rt.z.object({items:rt.z.array(rt.z.intersection(rt.z.object({id:rt.z.string()}),i)).refine(o=>o.length===t.size&&o.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class ns{async authorize(t,o){return this.makeRequest(t,es,o)}async authorizeConditional(t,o){return this.makeRequest(t,Ts,o)}async makeRequest(t,o,a){var d;if(!this.enabled)return t.map(Te=>({result:vr.ALLOW}));const S={items:t.map(Te=>({id:As.Z(),...Te}))},O=await this.discovery.getBaseUrl("permission"),U=await qo()(`${O}/authorize`,{method:"POST",body:JSON.stringify(S),headers:{...this.getAuthorizationHeader((d=a)===null||d===void 0?void 0:d.token),"content-type":"application/json"}});if(!U.ok)throw await sr.VL.fromResponse(U);const ee=await U.json(),Fe=ts(o,new Set(S.items.map(({id:Te})=>Te))).parse(ee).items.reduce((Te,De)=>(Te[De.id]=De,Te),{});return S.items.map(Te=>Fe[Te.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,B._)(this,"enabled",void 0),(0,B._)(this,"discovery",void 0),this.discovery=t.discovery;var o;this.enabled=(o=t.config.getOptionalBoolean("permission.enabled"))!==null&&o!==void 0?o:!1}}class go{static create(t){const{config:o,discovery:a,identity:d}=t,S=new ns({discovery:a,config:o});return new go(S,d)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,o){(0,B._)(this,"permissionClient",void 0),(0,B._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=o}}var Oo=n(69984);function mo(i){const t=(0,m.h_)(Lo),{data:o,error:a}=(0,Oo.ZP)(i,async d=>{if(_o(d.permission)&&!d.resourceRef)return vr.DENY;const{result:S}=await t.authorize(d);return S});return a?{error:a,loading:!1,allowed:!1}:o===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:o===vr.ALLOW}}const Rs=i=>{const{permission:t,resourceRef:o,errorComponent:a,...d}=i,S=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),O=useApp(),{NotFoundErrorPage:U}=O.getComponents();let ee=a===void 0?_jsx(U,{}):a;return S.loading?ee=null:S.allowed&&(ee=i.element),_jsx(Route,{...d,element:ee})};function li(i){const{permission:t,resourceRef:o}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:o}:{permission:t}),d=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:S}=d.getComponents();return _jsx(S,{})}const rs=[(0,m.ni)({api:m.NW,deps:{configApi:m.Ds},factory:({configApi:i})=>k.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,m.ni)({api:m.$v,deps:{},factory:()=>new N}),(0,m.ni)({api:m.v_,deps:{},factory:()=>new ce}),(0,m.ni)({api:m.VE,deps:{alertApi:m.$v},factory:({alertApi:i})=>{const t=new M(i,new H);return pe.forward(t,{hidden:!1}),t}}),(0,m.ni)({api:m.E6,deps:{errorApi:m.VE},factory:({errorApi:i})=>lt.create({errorApi:i})}),(0,m.ni)({api:m.gP,deps:{configApi:m.Ds,identityApi:m.$4,discoveryApi:m.NW},factory:({configApi:i,identityApi:t,discoveryApi:o})=>et({middleware:[Yt.resolvePluginProtocol({discoveryApi:o}),Yt.injectIdentityAuth({identityApi:t,config:i})]})}),(0,m.ni)({api:m.ZM,deps:{},factory:()=>new Tn}),(0,m.ni)({api:m.Kp,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>xn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.p_,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>dn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.F4,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>wn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.D,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>An.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.ux,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>pn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.gW,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>qn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.bq,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>zn.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:m.Km,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>he.create({configApi:o,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,m.ni)({api:m.uB,deps:{discoveryApi:m.NW,oauthRequestApi:m.ZM,configApi:m.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:o})=>G.create({configApi:o,discoveryApi:i,oauthRequestApi:t,environment:o.getOptionalString("auth.environment")})}),(0,m.ni)({api:Lo,deps:{discovery:m.NW,identity:m.$4,config:m.Ds},factory:({config:i,discovery:t,identity:o})=>go.create({config:i,discovery:t,identity:o})})];var os=n(77277),un=n(53974),Is=n(71597);function y({children:i}){return(0,V.GV)()?(0,h.jsx)(h.Fragment,{children:i}):(0,h.jsx)(V.VA,{children:i})}const j=()=>(0,h.jsx)(un.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),L=({step:i,error:t})=>{let o="";return i==="load-config"?o=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(o=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,h.jsx)(y,{children:(0,h.jsx)(un.mf,{status:"501",statusMessage:o})})},P=({error:i,resetError:t,plugin:o})=>{var a;return(0,h.jsx)(un.yu,{title:`Error in ${(a=o)===null||a===void 0?void 0:a.getId()}`,defaultExpanded:!0,error:i,children:(0,h.jsx)(os.Z,{variant:"outlined",onClick:t,children:"Retry"})})},ae={Progress:un.Ex,Router:Is.VK,NotFoundErrorPage:j,BootErrorPage:L,ErrorBoundaryFallback:P};var oe=n(43642),_=n(80079),ue=n(90941),Ae=n(32915),Re=n(40562),ze=n(21853),Ne=n(60744),We=n(66569),it=n(30254),jt=n(13384),$e=n(15933),Je=n(58838),At=n(86737),an=n(4989),Rn=n(44407),Lt=n(18628),It=n(84219),Qt=n(98685),In=n(39781),yr=n(39412);const $r={brokenImage:_.Z,catalog:Lt.Z,scaffolder:Ae.Z,techdocs:Re.Z,search:ze.Z,chat:Ne.Z,dashboard:We.Z,docs:it.Z,email:jt.Z,github:Je.Z,group:It.Z,help:At.Z,"kind:api":$e.Z,"kind:component":Rn.Z,"kind:domain":oe.Z,"kind:group":It.Z,"kind:location":an.Z,"kind:system":ue.Z,"kind:user":Qt.Z,"kind:resource":yr.Z,user:Qt.Z,warning:In.Z};var Xr=n(73689),Hn=n(77349);const mn={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")`},Dn={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 Er(i){var t;const{colors:o,shape:a,options:d}=i,O=`linear-gradient(90deg, ${(o.length===1?[o[0],o[0]]:o).join(", ")})`,U=`${a}, ${O}`;var ee;const ve=(ee=(t=d)===null||t===void 0?void 0:t.fontColor)!==null&&ee!==void 0?ee:"#FFFFFF";return{colors:o,shape:a,backgroundImage:U,fontColor:ve}}const ci={home:Er({colors:Dn.teal,shape:mn.wave}),documentation:Er({colors:Dn.pinkSea,shape:mn.wave2}),tool:Er({colors:Dn.purpleSky,shape:mn.round}),service:Er({colors:Dn.marineBlue,shape:mn.wave}),website:Er({colors:Dn.veryBlue,shape:mn.wave}),library:Er({colors:Dn.rubyRed,shape:mn.wave}),other:Er({colors:Dn.darkGrey,shape:mn.wave}),app:Er({colors:Dn.toastyOrange,shape:mn.wave}),apis:Er({colors:Dn.teal,shape:mn.wave2}),card:Er({colors:Dn.greens,shape:mn.wave})},di=16,Sa='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',ui="home";function Ps(i){const{palette:t,htmlFontSize:o=di,fontFamily:a=Sa,defaultPageTheme:d=ui,pageTheme:S=ci,typography:O}=i;if(!S[d])throw new Error(`${d} is not defined in pageTheme.`);const U={htmlFontSize:o,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}};var ee;return{palette:t,typography:O!=null?O:U,page:S[d],getPageTheme:({themeId:ve})=>(ee=S[ve])!==null&&ee!==void 0?ee:S[d]}}var Ls=n(47591);const vo={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Ls._j)(i.palette.link,.3),background:(0,Ls.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({marginRight:i.spacing(1),marginBottom:i.spacing(1)}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({width:i.spacing(3),height:i.spacing(3),margin:i.spacing(0,.75,0,-.75)}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:i.spacing(0,.5,0,-.5)})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}},MuiLink:{defaultProps:{underline:"hover"}}},so=i=>(...t)=>{const o=t.length===0?[1]:t,a=(d,S)=>typeof d=="string"?d:S*d;return o.map(d=>{const S=a(d,i);return typeof S=="number"?`${S}px`:S}).join(" ")};function pi(i,t){if(!t||typeof t=="string")return;const o=typeof t=="function"?t(i):t;if(o)return{"@global":o}}function Os(i,t){if(!(!t||typeof t=="string")){if(typeof t=="object"){const o={...i},a=i.spacing(1);return typeof a=="number"&&(o.spacing=so(a)),Object.fromEntries(Object.entries(t).map(([d,S])=>typeof S=="function"?[d,S({theme:o})]:[d,S]))}return t}}const hi=/^&.Mui-([\w-]+)$/;function ks(i){let t=i;if(!i||typeof i!="object")return t;for(const o of Object.keys(i)){const a=i[o];if(!(!a||typeof a!="object"))for(const d of Object.keys(a)){const S=d,O=S.match(hi);if(O){const[,U]=O,{[S]:ee,...ve}=a;ee&&(t={...t,[o]:ve,[U]:ee})}}}return t}function ss(i,t={}){const o={},a={};for(const d of Object.keys(t)){const S=t[d];S&&("styleOverrides"in S&&(d==="MuiCssBaseline"?o[d]=pi(i,S.styleOverrides):o[d]=ks(Os(i,S.styleOverrides))),"defaultProps"in S&&(a[d]=S.defaultProps))}return{overrides:o,props:a}}var yo=new WeakMap;class fi{getTheme(t){return(0,Wn._)(this,yo).get(t)}constructor(t,o){(0,Kr._)(this,yo,{writable:!0,value:new Map}),(0,Cr._)(this,yo,new Map),t&&(0,Wn._)(this,yo).set("v4",t),o&&(0,Wn._)(this,yo).set("v5",o)}}function Bs(i){const t=Ps(i),o={...vo,...i.components},a=(0,Hn.Z)({...t,components:o}),d=ss(a,o),S={...(0,Xr.Z)(t),...d};return new fi(S,a)}function gi(i){const t=adaptV4Theme(i),o=createTheme(i);return new fi(o,t)}const ko={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},ur={light:Bs({palette:ko.light}),dark:Bs({palette:ko.dark})};var Ca=n(68542);Ca.Z.configure(i=>`v5-${i}`);var wa=n(87561),ja=n(12536),Ea=n(19219),Aa=n(41547),Ta=n(3493),Ra=n(81887);const Ia=(0,ja.Z)({productionPrefix:"jss4-"});function xo(i){const{children:t,theme:o,noCssBaseline:a=!1}=i,d=o.getTheme("v4"),S=o.getTheme("v5");let O;a||(O=(0,h.jsx)(wa.ZP,{}));let U=(0,h.jsxs)(h.Fragment,{children:[O,t]});return d&&(U=(0,h.jsx)(Ea.ZP,{generateClassName:Ia,children:(0,h.jsx)(Aa.Z,{theme:d,children:U})})),S&&(U=(0,h.jsx)(Ta.Z,{injectFirst:!0,children:(0,h.jsx)(Ra.Z,{theme:S,children:U})})),U}function Pa(i){var t,o,a,d;return{props:{MuiGrid:(o=vo)===null||o===void 0||(t=o.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:(d=vo)===null||d===void 0||(a=d.MuiSwitch)===null||a===void 0?void 0:a.defaultProps},...Ps(i)}}function La(i){return ss(i,vo).overrides}function $s(i){const t=Pa(i),o=(0,Xr.Z)(t),a=La(o);return{...o,overrides:a}}const Oa=$s({palette:ko.light}),Ds=$s({palette:ko.dark});var mi=n(98192),vi=n(15222);const yi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,h.jsx)(vi.Z,{}),Provider:({children:i})=>(0,h.jsx)(xo,{theme:ur.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,h.jsx)(mi.Z,{}),Provider:({children:i})=>(0,h.jsx)(xo,{theme:ur.dark,children:i})}];function is(i){var t,o,a,d,S,O,U,ee,ve,Fe,Te,De;return po({...i,apis:(ve=(t=i)===null||t===void 0?void 0:t.apis)!==null&&ve!==void 0?ve:[],bindRoutes:(o=i)===null||o===void 0?void 0:o.bindRoutes,components:{...ae,...(a=i)===null||a===void 0?void 0:a.components},configLoader:(d=i)===null||d===void 0?void 0:d.configLoader,defaultApis:rs,icons:{...$r,...(S=i)===null||S===void 0?void 0:S.icons},plugins:(Fe=(O=i)===null||O===void 0?void 0:O.plugins)!==null&&Fe!==void 0?Fe:[],featureFlags:(Te=(U=i)===null||U===void 0?void 0:U.featureFlags)!==null&&Te!==void 0?Te:[],themes:(De=(ee=i)===null||ee===void 0?void 0:ee.themes)!==null&&De!==void 0?De:yi})}var ir=n(25271),Bo=n(76635);async function xi({storageApi:i}){const t=i.forBucket("settings"),o=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,Bo.isArray)(a))return;var d;const S=new Set((d=o.snapshot("entityRefs").value)!==null&&d!==void 0?d:[]);a.filter(Bo.isString).map(O=>O.split(":")).filter(O=>O.length===4&&O[0]==="entity").map(([O,U,ee,ve])=>(0,ir.eE)({kind:U,namespace:ee,name:ve})).forEach(O=>S.add(O)),await o.set("entityRefs",Array.from(S)),await t.remove("starredEntities")}class Ns{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,B._)(this,"settingsStore",void 0),(0,B._)(this,"starredEntities",void 0),(0,B._)(this,"subscribers",new Set),(0,B._)(this,"observable",new(Me())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),xi(t).then(),this.settingsStore=t.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:a=>{var d;this.starredEntities=new Set((d=a.value)!==null&&d!==void 0?d:[]),this.notifyChanges()}})}}var ka=n(8799),io=n(79692),bi=n(12420),Gn=n(39709),Ba=n(19928);function Si(){const i=useApi(catalogApiRef),{error:t,loading:o,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(S=>{var O;return((O=S.facets.kind)===null||O===void 0?void 0:O.map(U=>U.value).sort())||[]}),[i]);return{loading:o,error:t,allKinds:a!=null?a:[]}}function Fs(i,t,o){let a=i;return t&&(a=a.filter(S=>t.some(O=>O.toLocaleLowerCase("en-US")===S.toLocaleLowerCase("en-US")))),o&&!i.some(S=>S.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US"))&&(a=a.concat([o])),a.sort().reduce((S,O)=>(S[O.toLocaleLowerCase("en-US")]=O,S),{})}const Zs=(0,io.Z)(i=>(0,bi.Z)({root:{...i.typography.h4}}));function $a(i){var t;const{initialFilter:o="component",allowedKinds:a}=i,d=Zs(),{allKinds:S}=useAllKinds(),{filters:O,updateFilters:U,queryParameters:{kind:ee}}=useEntityList(),ve=useMemo(()=>[ee].flat()[0],[ee]);var Fe;const[Te,De]=useState((Fe=ve!=null?ve:(t=O.kind)===null||t===void 0?void 0:t.value)!==null&&Fe!==void 0?Fe:o);useEffect(()=>{ve&&De(ve)},[ve]),useEffect(()=>{var Ge;if(!((Ge=O.kind)===null||Ge===void 0)&&Ge.value){var Bt;De((Bt=O.kind)===null||Bt===void 0?void 0:Bt.value)}},[O.kind]),useEffect(()=>{U({kind:Te?new EntityKindFilter(Te):void 0})},[Te,U]);const Ve=filterKinds(S,a,Te);return _jsx(Select,{input:_jsx(InputBase,{}),value:Te.toLocaleLowerCase("en-US"),onChange:Ge=>De(Ge.target.value),classes:d,children:Object.keys(Ve).map(Ge=>_jsx(MenuItem,{value:Ge,children:`${pluralize(Ve[Ge])}`},Ge))})}var Da=n(86359),as=n(95544),$o=n(99688),Do=n(12231),No=n(86136),Fo=n(49378),Ci=n(85256),ls=n(80030),cs=n(61837),wi=n(79784),ji=n(50758),ds=n(31654),Ei=n(43054),Ai=n(65759),Na=n(49280),Ti=n(96641);function Ri(i){const{entity:t,loading:o,error:a}=(0,Ti.ce)(),{allowed:d,loading:S,error:O}=mo({permission:i,resourceRef:t?(0,ir.eE)(t):void 0});return o||S?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:d,error:O}}const us="catalog-entity",Ii=Br({name:"catalog.entity.read",attributes:{action:"read"},resourceType:us}),Pi=Br({name:"catalog.entity.create",attributes:{action:"create"}}),ps=Br({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:us}),Us=Br({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:us}),Li=Br({name:"catalog.location.read",attributes:{action:"read"}}),Ms=Br({name:"catalog.location.create",attributes:{action:"create"}}),Oi=Br({name:"catalog.location.delete",attributes:{action:"delete"}}),Fa=[Ii,Pi,ps,Us,Li,Ms,Oi];var ki=n(49166);function Bi(i){var t,o,a,d;const{unregisterEntityOptions:S,isUnregisterAllowed:O,onUnregisterEntity:U,onClose:ee}=i,ve=typeof((t=S)===null||t===void 0?void 0:t.disableUnregister)=="boolean";var Fe;const Te=(Fe=!O||(ve?!!(!((o=S)===null||o===void 0)&&o.disableUnregister):((a=S)===null||a===void 0?void 0:a.disableUnregister)==="disable"))!==null&&Fe!==void 0?Fe:!1;let De=(0,h.jsx)(h.Fragment,{});return((d=S)===null||d===void 0?void 0:d.disableUnregister)!=="hidden"&&(De=(0,h.jsxs)(Do.Z,{onClick:()=>{ee(),U()},disabled:Te,children:[(0,h.jsx)(No.Z,{children:(0,h.jsx)(ki.Z,{fontSize:"small"})}),(0,h.jsx)(Fo.Z,{primary:"Unregister entity"})]})),(0,h.jsx)(h.Fragment,{children:De})}const zs=(0,io.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function $i(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:o,onUnregisterEntity:a,onInspectEntity:d}=i,[S,O]=(0,W.useState)(),U=zs(),ve=Ri(ps).allowed,Fe=Bt=>{O(Bt.currentTarget)},Te=()=>{O(void 0)},De=(0,m.h_)(m.$v),Ve=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>De.post({message:"Copied!",severity:"info",display:"transient"}))},[De]),Ge=t&&[...t.map(Bt=>(0,h.jsxs)(Do.Z,{onClick:()=>{Te(),Bt.onClick()},children:[(0,h.jsx)(No.Z,{children:(0,h.jsx)(Bt.Icon,{fontSize:"small"})}),(0,h.jsx)(Fo.Z,{primary:Bt.title})]},Bt.title)),(0,h.jsx)(Ci.Z,{},"the divider is here!")];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ls.ZP,{title:"More",arrow:!0,children:(0,h.jsx)(cs.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!S,role:"button",onClick:Fe,"data-testid":"menu-button",className:U.button,id:"long-menu",children:(0,h.jsx)(Ei.Z,{})})}),(0,h.jsx)(wi.ZP,{open:Boolean(S),onClose:Te,anchorEl:S,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,h.jsxs)(ji.Z,{autoFocusItem:Boolean(S),children:[Ge,(0,h.jsx)(Bi,{unregisterEntityOptions:o,isUnregisterAllowed:ve,onUnregisterEntity:a,onClose:Te}),(0,h.jsxs)(Do.Z,{onClick:()=>{Te(),d()},children:[(0,h.jsx)(No.Z,{children:(0,h.jsx)(ds.Z,{fontSize:"small"})}),(0,h.jsx)(Fo.Z,{primary:"Inspect entity"})]}),(0,h.jsxs)(Do.Z,{onClick:()=>{Te(),Ve()},children:[(0,h.jsx)(No.Z,{children:(0,h.jsx)(Ai.Z,{fontSize:"small"})}),(0,h.jsx)(Fo.Z,{primary:"Copy entity URL"})]})]})})]})}const hs="plugin.catalog.entityLayoutRoute",Ws=()=>null;(0,m.R5)(Ws,hs,!0),(0,m.R5)(Ws,"core.gatherMountPoints",!0);function Di(i){const{entity:t,title:o}=i;return(0,h.jsxs)(as.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,h.jsx)(as.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:o}),t&&(0,h.jsx)(Gn.LH,{entity:t})]})}function Za(i,t,o,a){var d,S,O,U,ee;const ve=(ee=i!=null?i:(d=a)===null||d===void 0?void 0:d.kind)!==null&&ee!==void 0?ee:"";var Fe;const Te=(Fe=t!=null?t:(S=a)===null||S===void 0?void 0:S.metadata.namespace)!==null&&Fe!==void 0?Fe:"";var De,Ve,Ge;return{headerTitle:`${(Ge=(Ve=(De=(O=a)===null||O===void 0?void 0:O.metadata.title)!==null&&De!==void 0?De:o)!==null&&Ve!==void 0?Ve:(U=a)===null||U===void 0?void 0:U.metadata.name)!==null&&Ge!==void 0?Ge:""}${Te&&Te!==ir.zG?` in ${Te}`:""}`,headerType:(()=>{let Ut=ve.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(Ut+=" \u2014 ",Ut+=a.spec.type.toLocaleLowerCase("en-US")),Ut})()}}function Ni(i){var t;const{entity:o}=i,a=(0,Gn.hF)(o,ir.S4);return(0,h.jsxs)(h.Fragment,{children:[a.length>0&&(0,h.jsx)(un.i9,{label:"Owner",value:(0,h.jsx)(Gn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=o.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,h.jsx)(un.i9,{label:"Lifecycle",value:o.spec.lifecycle})]})}const Fi=i=>{var t,o,a;const{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:S,children:O,NotFoundComponent:U}=i,{kind:ee,namespace:ve,name:Fe}=(0,m.Oi)(Gn.wi),{entity:Te,loading:De,error:Ve}=(0,Gn.ce)(),Ge=(0,V.TH)(),Bt=(0,m.vJ)(O,Ir=>Ir.selectByComponentData({key:hs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:On})=>{if(Te){if(On.if&&!On.if(Te))return[]}else return[];return[{path:On.path,title:On.title,children:On.children,tabProps:On.tabProps}]}),[Te]),{headerTitle:Ut,headerType:lr}=Za(ee,ve,Fe,Te),[_r,xr]=(0,W.useState)(!1),[br,Rr]=(0,W.useState)(!1),Mn=(0,V.s0)(),Nr=async()=>{xr(!1),Rr(!1),Mn("/")};(0,W.useEffect)(()=>{xr(!1),Rr(!1)},[Ge.pathname]);var Vr;return(0,h.jsxs)(un.T3,{themeId:(Vr=(a=Te)===null||a===void 0||(o=a.spec)===null||o===void 0||(t=o.type)===null||t===void 0?void 0:t.toString())!==null&&Vr!==void 0?Vr:"home",children:[(0,h.jsx)(un.h4,{title:(0,h.jsx)(Di,{title:Ut,entity:Te}),pageTitleOverride:Ut,type:lr,children:Te&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ni,{entity:Te}),(0,h.jsx)($i,{UNSTABLE_extraContextMenuItems:d,UNSTABLE_contextMenuOptions:S,onUnregisterEntity:()=>xr(!0),onInspectEntity:()=>Rr(!0)})]})}),De&&(0,h.jsx)(un.Ex,{}),Te&&(0,h.jsx)(un.tn,{routes:Bt}),Ve&&(0,h.jsx)(un.VY,{children:(0,h.jsx)($o.Z,{severity:"error",children:Ve.toString()})}),!De&&!Ve&&!Te&&(0,h.jsx)(un.VY,{children:U||(0,h.jsxs)(un.GB,{title:"Entity not found",children:["There is no ",ee," with the requested"," ",(0,h.jsx)(un.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,h.jsx)(Gn.pp,{open:_r,entity:Te,onConfirm:Nr,onClose:()=>xr(!1)}),(0,h.jsx)(Gn.U_,{open:br,entity:Te,onClose:()=>Rr(!1)})]})};Fi.Route=Ws;function Ua(i){const{open:t,onClose:o,onConfirm:a,entity:d}=i,[S,O]=useState(!1),U=useApi(catalogApiRef),ee=useApi(alertApiRef),ve=async()=>{O(!0);try{const Fe=d.metadata.uid;await U.removeEntityByUid(Fe),a()}catch(Fe){assertError(Fe),ee.post({message:Fe.message})}finally{O(!1)}};return _jsxs(Dialog,{open:t,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:S,onClick:ve,children:"Delete"}),_jsx(Button,{onClick:o,color:"primary",children:"Cancel"})]})]})}var bo=n(19625);function Ma(i){var t,o,a;return((a=i)===null||a===void 0||(o=a.metadata)===null||o===void 0||(t=o.annotations)===null||t===void 0?void 0:t["backstage.io/orphan"])==="true"}function za(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[o,a]=useState(!1),{entity:d}=useEntity(),S=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:o,entity:d,onConfirm:S,onClose:()=>a(!1)})]})}async function Vs(i,t){var o,a;const d=(o=i.relations)===null||o===void 0?void 0:o.map(O=>O.targetRef);if(!d||((a=d)===null||a===void 0?void 0:a.length)<1||d.length>1e3)return[];const S=await t.getEntitiesByRefs({entityRefs:d,fields:["kind","metadata.name","metadata.namespace"]});return d.filter((O,U)=>S.items[U]===void 0)}async function Wa(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Vs(i,o)).length>0}function Va(){const{entity:i}=useEntity(),t=useApi(catalogApiRef),{loading:o,error:a,value:d}=useAsync(async()=>Vs(i,t),[i,t]);return a?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:a})}):o||!d||d.length===0?null:_jsx(_Fragment,{children:_jsxs(Alert,{severity:"warning",children:["This entity has relations to other entities, which can't be found in the catalog. ",_jsx("br",{}),"Entities not found are: ",d.join(", ")]})})}var Zi=n(4791);const fs=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Hs(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(d=>{var S,O;return{errors:((O=(S=d.entity.status)===null||S===void 0?void 0:S.items)!==null&&O!==void 0?O:[]).filter(fs).map(ve=>ve.error).filter(ve=>Boolean(ve)),entity:d.entity}}).filter(d=>d.errors.length>0)}}async function gs(i,t){const o=t.apis.get(catalogApiRef);if(!o)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Hs(stringifyEntityRef(i),o)).items.length>0}function Ui(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),o=useApi(catalogApiRef),{loading:a,error:d,value:S}=useAsync(async()=>Hs(t,o),[t,o]);return d?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:d})}):a||!S?null:_jsx(_Fragment,{children:S.items.map((O,U)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(O.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:O.entity})]}),O.errors.map((ee,ve)=>_jsx(ResponseErrorPanel,{error:ee},ve))]},U))})}const ms="core.backstage.entitySwitch",Ar=i=>null;(0,m.R5)(Ar,ms,!0);const Mi=i=>{var t;const{entity:o,loading:a}=(0,Gn.ce)(),d=(0,m.I_)(),S=(0,m.vJ)(i.children,ee=>ee.selectByComponentData({key:ms,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(ve=>{var Fe;if(a&&!o)return[];const{if:Te,children:De}=ve.props;return o?[{if:(Fe=Te)===null||Fe===void 0?void 0:Fe(o,{apis:d}),children:De}]:[{if:Te===void 0,children:De}]}),[d,o,a]);if(S.some(ee=>typeof ee.if=="object"&&"then"in ee.if))return(0,h.jsx)(Gs,{results:S,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ee=S.filter(ve=>ve.if).map(ve=>ve.children);return ee.length===0?Zo(S):(0,h.jsx)(h.Fragment,{children:ee})}var U;return(U=(t=S.find(ee=>ee.if))===null||t===void 0?void 0:t.children)!==null&&U!==void 0?U:Zo(S)};function Gs({results:i,renderMultipleMatches:t}){const{loading:o,value:a}=(0,C.default)(async()=>{const d=i.map(async({if:O,children:U})=>{try{if(await O)return U}catch{}return null});if(t==="all"){const O=(await Promise.all(d)).filter(Boolean);return O.length===0?Zo(i):(0,h.jsx)(h.Fragment,{children:O})}var S;return(S=(await Promise.all(d)).find(Boolean))!==null&&S!==void 0?S:Zo(i)},[i]);return o||!a?null:a}function Zo(i){var t,o;return(o=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&o!==void 0?o:null}Mi.Case=Ar;const il=null,Dr=Gn._i.Filters,zi=Gn._i.Content;var Ha=n(85877),Wi=n(15096);const Qn=(0,m.rx)({id:"catalog",apis:[(0,m.ni)({api:Gn.Ah,deps:{discoveryApi:m.NW,fetchApi:m.gP},factory:({discoveryApi:i,fetchApi:t})=>new Zi.MS({discoveryApi:i,fetchApi:t})}),(0,m.ni)({api:Gn.p3,deps:{storageApi:m.E6},factory:({storageApi:i})=>new Ns({storageApi:i})})],routes:{catalogIndex:bo._Z,catalogEntity:Gn.wi},externalRoutes:{createComponent:bo.yw,viewTechDoc:bo.jU,createFromTemplate:bo.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Ga=Qn.provide((0,m.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:bo._Z})),Uo=Qn.provide((0,m.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Gn.wi})),Vi=Qn.provide((0,m.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),Hi=Qn.provide((0,m.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),Gi=Qn.provide((0,m.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),Ki=Qn.provide((0,m.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Ks=Qn.provide((0,m.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Ka=Qn.provide((0,m.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Ya=Qn.provide((0,m.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),Yi=Qn.provide((0,m.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),Ji=Qn.provide((0,m.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Qi=Qn.provide((0,m.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),Ja=Qn.provide((0,m.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),vs=Qn.provide((0,Wi.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Ys=n(32838);class Xi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,o){const d=`${await this.getApiOrigin()}/${o}`,S=await fetch(`${d.endsWith("/")?d:`${d}/`}index.html`);if(S.status===404)throw new Error("Page not found");return S.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,o,a){const d=await this.getApiOrigin();return new URL(t,`${d}/${a}`).toString()}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,B._)(this,"configApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}class Js{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:o,identityApi:a}){(0,B._)(this,"configApi",void 0),(0,B._)(this,"discoveryApi",void 0),(0,B._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=o,this.identityApi=a}}const Qs=[(0,m.ni)({api:Z.Dl,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Xi({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:Z.gT,deps:{configApi:m.Ds,discoveryApi:m.NW,identityApi:m.$4},factory:({configApi:i,discoveryApi:t,identityApi:o})=>new Js({configApi:i,discoveryApi:t,identityApi:o})}),(0,m.ni)({api:Ys.q3,deps:{configApi:m.Ds},factory:({configApi:i})=>Ys.ae.fromConfig(i)})],_i={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},qi={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function ea(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Xs(){const i=await Qr(),t=await ea();return[...i,{context:"detected",data:t?_i:qi}]}var ta=n(58845);const Mo=(0,io.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var ra=()=>{const i=Mo();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,h.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const _s=(0,io.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var ei=()=>{const i=_s();return(0,h.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,h.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const ti=(0,io.Z)({root:{width:un.po.drawerWidthClosed,height:3*un.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:un.po.drawerWidthClosed,marginLeft:24}}),ar=()=>{const i=ti(),{isOpen:t}=(0,un.mZ)();return(0,h.jsx)("div",{className:i.root,children:(0,h.jsx)(un.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,h.jsx)(ra,{}):(0,h.jsx)(ei,{})})})},oa=({children:i})=>(0,h.jsxs)(un.tR,{children:[(0,h.jsxs)(un.YE,{children:[(0,h.jsx)(ar,{}),(0,h.jsx)(un.v7,{}),(0,h.jsx)(un.R6,{icon:ta.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var sa=n(32388),ia=n(4142);const ni=(0,io.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var Tr;(function(i){i.LIGHT="light",i.DARK="dark"})(Tr||(Tr={}));const Xa=()=>{const i=(0,m.h_)(m.hg),t=ni(),[o,a]=(0,W.useState)(i.getActiveThemeId()===Tr.DARK?Tr.DARK:Tr.LIGHT),d={[Tr.LIGHT]:{icon:ia.Z,title:"Dark theme"},[Tr.DARK]:{icon:sa.Z,title:"Light theme"}},{title:S,icon:O}=d[o],U=()=>{a(ee=>{const ve=ee===Tr.LIGHT?Tr.DARK:Tr.LIGHT;return i.setActiveThemeId(ve),ve})};return(0,h.jsx)(as.Z,{display:"flex",alignItems:"center",mr:2,children:(0,h.jsx)(ls.ZP,{title:S,arrow:!0,children:(0,h.jsx)(cs.Z,{size:"small",onClick:U,children:(0,h.jsx)(O,{className:t.headerIcon})})})})},ys=()=>(0,h.jsxs)(w.I6,{children:[(0,h.jsx)(de.S,{}),(0,h.jsx)(D.F,{withSearch:!1})]}),aa=(0,h.jsx)(ys,{}),ri=is({apis:Qs,configLoader:Xs,plugins:Object.values(r)}),la=ri.getProvider(),zo=ri.getRouter(),ca=w.s4.provide((0,Z.KY)({name:"ThemeToggleAddon",component:Xa,location:Z.oZ.Header})),da=(0,h.jsxs)(js,{children:[(0,h.jsx)(V.Fg,{to:"/docs/default/component/local/"},"/"),(0,h.jsx)(V.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,h.jsx)(Uo,{})}),(0,h.jsx)(V.AW,{path:"/docs",element:(0,h.jsx)(w.Jl,{}),children:(0,h.jsx)(X.u,{})}),(0,h.jsxs)(V.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,h.jsx)(w.I6,{}),children:[aa,(0,h.jsx)(Z.DR,{children:(0,h.jsx)(ca,{})})]})]});var pa=()=>(0,h.jsx)(la,{children:(0,h.jsx)(zo,{children:(0,h.jsx)(oa,{children:da})})});f.render((0,h.jsx)(pa,{}),document.getElementById("root"))},51837:function(Pt,Le,n){"use strict";n.d(Le,{CT:function(){return m},EI:function(){return ye},uW:function(){return f},Vt:function(){return p}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const h=r(),W=le=>`__@backstage/${le}__`;function f(le,z){const de=W(le);let D=h[de];return D||(D=z(),h[de]=D,D)}var V=n(2784);function m(le){return f(le,()=>(0,V.createContext)(void 0))}function p(le){return(0,V.useContext)(m(le))}function F(le){return{set(z){globalThis[`__@backstage/${le}__`]=createContext(createVersionedValueMap(z))},reset(){delete globalThis[`__@backstage/${le}__`]}}}function ye(le){Object.freeze(le);const z={atVersion(de){return le[de]}};return Object.defineProperty(z,"$map",{configurable:!0,enumerable:!0,get(){return le}}),z}},96641:function(Pt,Le,n){"use strict";n.d(Le,{X2:function(){return ye},ce:function(){return le},h$:function(){return p}});var r=n(52322),h=n(25271),W=n(60871),f=n(51837),V=n(2784);const m=(0,f.CT)("entity-context"),p=z=>{const{children:de,entity:D,loading:A,error:se,refresh:ie}=z,ne={entity:D,loading:A,error:se,refresh:ie};return(0,r.jsx)(m.Provider,{value:(0,f.EI)({1:ne}),children:(0,r.jsx)(W.fC,{attributes:{...D?{entityRef:(0,h.eE)(D)}:void 0},children:de})})},F=z=>_jsx(p,{entity:z.entity,loading:!Boolean(z.entity),error:void 0,refresh:void 0,children:z.children});function ye(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");if(!de.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:de.entity}}function le(){const z=(0,f.Vt)("entity-context");if(!z)throw new Error("Entity context is not available");const de=z.atVersion(1);if(!de)throw new Error("EntityContext v1 not available");const{entity:D,loading:A,error:se,refresh:ie}=de;return{entity:D,loading:A,error:se,refresh:ie}}},39709:function(Pt,Le,n){"use strict";n.d(Le,{h$:function(){return ct.h$},n3:function(){return r.n3},_i:function(){return K},tW:function(){return rt},df:function(){return Ue},UO:function(){return ft},ph:function(){return un},dq:function(){return wt},nl:function(){return rs},dx:function(){return Et},rI:function(){return en},u3:function(){return Wn},xE:function(){return Cr},sL:function(){return C},LH:function(){return je},U_:function(){return ro},pp:function(){return oo},EW:function(){return Oo},Ah:function(){return W},wi:function(){return Be},hF:function(){return Z.hF},CV:function(){return Z.CV},$3:function(){return nn},p3:function(){return f},ce:function(){return ct.ce},X2:function(){return ct.X2},wp:function(){return st},ZW:function(){return En},eK:function(){return xt},CR:function(){return pn}});var r=n(4791),h=n(60871);const W=(0,h.T0)({id:"plugin.catalog.service"}),f=(0,h.T0)({id:"catalog-react.starred-entities"});var V=n(82394);class m{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const L of this.subscribers)L.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(j=>(j.next(new Set(this.starredEntities)),this.subscribers.add(j),()=>{this.subscribers.delete(j)})))}}var p=n(52322),F=n(2784),ye=n(41156),le=n(60364),z=n(77277),de=n(4190),D=n(95544),A=n(90436),se=n(60905),ie=n(36444);const ne=y=>{var j,L;const P=(0,ye.Z)(Ae=>{var Re;return Ae.breakpoints.down((L=(Re=y.options)===null||Re===void 0?void 0:Re.drawerBreakpoint)!==null&&L!==void 0?L:"md")}),ae=(0,le.Z)(),[oe,_]=(0,F.useState)(!1);var ue;return P?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(z.Z,{style:{marginTop:ae.spacing(1),marginLeft:ae.spacing(1)},onClick:()=>_(!0),startIcon:(0,p.jsx)(ie.Z,{}),children:"Filters"}),(0,p.jsx)(de.ZP,{open:oe,onClose:()=>_(!1),anchor:(ue=(j=y.options)===null||j===void 0?void 0:j.drawerAnchor)!==null&&ue!==void 0?ue:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,p.jsxs)(D.Z,{m:2,children:[(0,p.jsx)(A.Z,{variant:"h6",component:"h2",style:{marginBottom:ae.spacing(1)},children:"Filters"}),y.children]})})]}):(0,p.jsx)(se.Z,{item:!0,lg:2,children:y.children})},X=y=>(0,p.jsx)(se.Z,{item:!0,xs:12,lg:10,children:y.children}),K=y=>(0,p.jsx)(se.Z,{container:!0,style:{position:"relative"},children:y.children});K.Filters=ne,K.Content=X;var R=n(53974),w=n(87612),I=n(25271),Z=n(49280);class xe{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Ce{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class B{filterEntity(j){var L;return this.values.every(P=>((L=j.metadata.tags)!==null&&L!==void 0?L:[]).includes(P))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Qe{filterEntity(j){const L=this.toUpperArray(this.value.split(/\s/)),P=this.toUpperArray([j.metadata.tags]),ae=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const oe of L)if(P.every(_=>_!==oe)&&ae.every(_=>!_.includes(oe)))return!1;return!0}toUpperArray(j){return j.flat().filter(L=>Boolean(L)).map(L=>L.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class St{filterEntity(j){return this.values.some(L=>(0,Z.hF)(j,I.S4).some(P=>(0,I.eE)(P)===L))}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j.reduce((L,P)=>{try{return L.push((0,I.eE)((0,I.of)(P,{defaultKind:"Group"}))),L}catch{return L}},[])}}class Nt{filterEntity(j){return this.values.some(L=>{var P;return((P=j.spec)===null||P===void 0?void 0:P.lifecycle)===L})}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class Wt{filterEntity(j){return this.values.some(L=>j.metadata.namespace===L)}toQueryValue(){return this.values}constructor(j){(0,w._)(this,"values",void 0),this.values=j}}class kt{filterEntity(j){switch(this.value){case"owned":return this.isOwnedEntity(j);case"starred":return this.isStarredEntity(j);default:return!0}}toQueryValue(){return this.value}constructor(j,L,P){(0,w._)(this,"value",void 0),(0,w._)(this,"isOwnedEntity",void 0),(0,w._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=L,this.isStarredEntity=P}}class Dt{filterEntity(j){var L;const P=(L=j.metadata.annotations)===null||L===void 0?void 0:L["backstage.io/orphan"];return P!==void 0&&this.value.toString()===P}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}class Xt{filterEntity(j){var L,P,ae;const oe=((ae=j)===null||ae===void 0||(P=ae.status)===null||P===void 0||(L=P.items)===null||L===void 0?void 0:L.length)>0;return oe!==void 0&&this.value===oe}constructor(j){(0,w._)(this,"value",void 0),this.value=j}}var ct=n(96641),ut=n(76635),pt=n(19126),ht=n.n(pt),Vt=n(73557),Jt=n(69294),be=n(48760),Me=n(90736);const Ye=(0,F.createContext)(void 0),ft=y=>{const j=(0,Me.default)(),L=(0,h.h_)(W),[P,ae]=(0,F.useState)({}),oe=(0,Vt.TH)();var _;const ue=(0,F.useMemo)(()=>(_=ht().parse(oe.search,{ignoreQueryPrefix:!0}).filters)!==null&&_!==void 0?_:{},[oe]),[Ae,Re]=(0,F.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:ze,error:Ne},We]=(0,Jt.default)(async()=>{const $e=(0,ut.compact)(Object.values(P)),Je=(0,Z.Gz)($e),At=(0,Z.wq)($e),an=(0,Z.wq)((0,ut.compact)(Object.values(Ae.appliedFilters))),Rn=Object.keys(P).reduce((It,Qt)=>{var In;const yr=P[Qt];return!((In=yr)===null||In===void 0)&&In.toQueryValue&&(It[Qt]=yr.toQueryValue()),It},{});if((0,ut.isEqual)(an,At))Re({appliedFilters:P,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(Je)});else{const It=await L.getEntities({filter:At});Re({appliedFilters:P,backendEntities:It.items,entities:It.items.filter(Je)})}if(j()){var Lt;const It=ht().parse(oe.search,{ignoreQueryPrefix:!0}),Qt=ht().stringify({...It,filters:Rn},{addQueryPrefix:!0,arrayFormat:"repeat"}),In=`${window.location.pathname}${Qt}`;(Lt=window.history)===null||Lt===void 0||Lt.replaceState(null,document.title,In)}},[L,ue,P,Ae],{loading:!0});(0,be.Z)(We,10,[P]);const it=(0,F.useCallback)($e=>{ae(Je=>{const At=typeof $e=="function"?$e(Je):$e;return{...Je,...At}})},[]),jt=(0,F.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:it,queryParameters:ue,loading:ze,error:Ne}),[Ae,it,ue,ze,Ne]);return(0,p.jsx)(Ye.Provider,{value:jt,children:y.children})};function st(){const y=(0,F.useContext)(Ye);if(!y)throw new Error("useEntityList must be used within EntityListProvider");return y}var nt=n(64279),gt=n(18149),ot=n.n(gt),Xe=n(829),yt=n.n(Xe);function vt(){var y;const j=(0,h.h_)(W),{filters:{kind:L,type:P},queryParameters:{type:ae},updateFilters:oe}=st(),_=(0,F.useMemo)(()=>[ae].flat().filter(Boolean),[ae]);var ue;const[Ae,Re]=(0,F.useState)(_.length?_:(ue=(y=P)===null||y===void 0?void 0:y.getTypes())!==null&&ue!==void 0?ue:[]);(0,F.useEffect)(()=>{_.length&&Re(_)},[_]);const[ze,Ne]=(0,F.useState)([]),We=(0,F.useMemo)(()=>{var At;return(At=L)===null||At===void 0?void 0:At.value},[L]),{error:it,loading:jt,value:$e}=(0,nt.default)(async()=>We?await j.getEntityFacets({filter:{kind:We},facets:["spec.type"]}).then(an=>an.facets["spec.type"]||[]):[],[We,j]),Je=(0,F.useRef)($e);return(0,F.useEffect)(()=>{const At=Je.current;if(Je.current=$e,jt||!We||At===$e||!$e)return;const an=[...new Set(yt()($e,Lt=>-Lt.count).map(Lt=>Lt.value.toLocaleLowerCase("en-US")))];Ne(an);const Rn=Ae.filter(Lt=>an.includes(Lt));ot()(Ae,Rn)||Re(Rn)},[jt,We,Ae,Re,$e]),(0,F.useEffect)(()=>{oe({type:Ae.length?new Ce(Ae):void 0})},[Ae,oe]),{loading:jt,error:it,availableTypes:ze,selectedTypes:Ae,setSelectedTypes:Re}}function xt(y,j){var L,P,ae,oe;const _=(P=j)===null||P===void 0||(L=P.type)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"),ue=(oe=j)===null||oe===void 0||(ae=oe.kind)===null||ae===void 0?void 0:ae.toLocaleLowerCase("en-US"),Ae=(0,h.h_)(W),{loading:Re,value:ze,error:Ne}=(0,nt.default)(async()=>{var We,it;const jt=(We=y.relations)===null||We===void 0?void 0:We.filter(Je=>(!_||Je.type.toLocaleLowerCase("en-US")===_)&&(!ue||(0,I.of)(Je.targetRef).kind===ue));if(!(!((it=jt)===null||it===void 0)&&it.length))return[];const{items:$e}=await Ae.getEntitiesByRefs({entityRefs:jt.map(Je=>Je.targetRef)});return $e.filter(Je=>Boolean(Je))},[y,_,ue]);return{entities:ze,loading:Re,error:Ne}}var wn=n(72164);function fn(y){return typeof y=="string"?y:(0,I.eE)(y)}function pn(){const y=(0,h.h_)(f),j=(0,wn.Z)(y.starredEntitie$(),new Set),L=(0,F.useCallback)(ae=>j.has(fn(ae)),[j]),P=(0,F.useCallback)(ae=>y.toggleStarred(fn(ae)).then(),[y]);return{starredEntities:j,toggleStarredEntity:P,isStarredEntity:L}}function jn(y){return typeof y=="string"?y:(0,I.eE)(y)}function hn(y){const j=(0,h.h_)(f),[L,P]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{const oe=j.starredEntitie$().subscribe({next(_){P(_.has(jn(y)))}});return()=>{oe.unsubscribe()}},[y,j]),{toggleStarredEntity:(0,F.useCallback)(()=>j.toggleStarred(jn(y)).then(),[y,j]),isStarredEntity:L}}var xn=n(75435);function En(){const y=(0,h.h_)(h.$4),{loading:j,value:L}=(0,nt.default)(async()=>{const{ownershipEntityRefs:ae}=await y.getBackstageIdentity();return ae},[]),P=(0,F.useMemo)(()=>{const ae=new Set(L!=null?L:[]);return oe=>{const _=(0,xn.h)(oe,I.S4).map(I.eE);for(const ue of _)if(ae.has(ue))return!0;return!1}},[L]);return(0,F.useMemo)(()=>({loading:j,isOwnedEntity:P}),[j,P])}function on(){const y=(0,h.h_)(W),{error:j,loading:L,value:P}=(0,nt.default)(async()=>await y.getEntityFacets({facets:["kind"]}).then(oe=>{var _;return((_=oe.facets.kind)===null||_===void 0?void 0:_.map(ue=>ue.value).sort())||[]}),[y]);return{loading:L,error:j,allKinds:P!=null?P:[]}}function Sn(y,j,L){let P=y;return j&&(P=P.filter(oe=>j.some(_=>_.toLocaleLowerCase("en-US")===oe.toLocaleLowerCase("en-US")))),L&&!y.some(oe=>oe.toLocaleLowerCase("en-US")===L.toLocaleLowerCase("en-US"))&&(P=P.concat([L])),P.sort().reduce((oe,_)=>(oe[_.toLocaleLowerCase("en-US")]=_,oe),{})}function An(y){var j;const{filters:L,queryParameters:{kind:P},updateFilters:ae}=st(),oe=(0,F.useMemo)(()=>[P].flat()[0],[P]);var _;const[ue,Ae]=(0,F.useState)((_=oe!=null?oe:(j=L.kind)===null||j===void 0?void 0:j.value)!==null&&_!==void 0?_:y.initialFilter);(0,F.useEffect)(()=>{oe&&Ae(oe)},[oe]),(0,F.useEffect)(()=>{var We;if(!((We=L.kind)===null||We===void 0)&&We.value){var it;Ae((it=L.kind)===null||it===void 0?void 0:it.value)}},[L.kind]),(0,F.useEffect)(()=>{ae({kind:ue?new xe(ue):void 0})},[ue,ae]);const{allKinds:Re,loading:ze,error:Ne}=on();return{loading:ze,error:Ne,allKinds:Re!=null?Re:[],selectedKind:ue,setSelectedKind:Ae}}const rt=y=>{const{allowedKinds:j,hidden:L,initialFilter:P="component"}=y,ae=(0,h.h_)(h.$v),{error:oe,allKinds:_,selectedKind:ue,setSelectedKind:Ae}=An({initialFilter:P});if((0,F.useEffect)(()=>{oe&&ae.post({message:"Failed to load entity kinds",severity:"error"})},[oe,ae]),oe)return null;const Re=Sn(_,j,ue),ze=Object.keys(Re).map(Ne=>({value:Ne,label:Re[Ne]}));return L?null:(0,p.jsx)(D.Z,{pb:1,pt:1,children:(0,p.jsx)(R.Ph,{label:"Kind",items:ze,selected:ue.toLocaleLowerCase("en-US"),onChange:Ne=>Ae(String(Ne))})})};var _t=n(79692),Mt=n(38016),_e=n(88013),Pn=n(21324),dn=n(5806),$n=n(19996),Cn=n(25505);const Un=(0,p.jsx)(Cn.Z,{fontSize:"small"}),qn=(0,p.jsx)($n.Z,{fontSize:"small"});function Ln({selected:y}){return(0,p.jsx)(Pn.Z,{icon:Un,checkedIcon:qn,checked:y})}const zn=(0,F.memo)(y=>{var j;const{selected:L,value:P,availableOptions:ae,showCounts:oe}=y,_=oe?`${P} (${(j=ae)===null||j===void 0?void 0:j[P]})`:P;return(0,p.jsx)(dn.Z,{control:(0,p.jsx)(Ln,{selected:L}),label:_,onClick:ue=>ue.preventDefault()})});var we=n(86619),he=n(72779),Pe=n.n(he);const G=(0,_t.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function N(y){const j=G();return(0,p.jsx)(we.Z,{variant:"outlined",...y,className:Pe()(j.input,y.className)})}function ce(y){var j;const{label:L,name:P,path:ae,showCounts:oe,Filter:_,InputProps:ue,initialSelectedOptions:Ae=[]}=y,{updateFilters:Re,filters:ze,queryParameters:{[P]:Ne}}=st(),We=(0,h.h_)(W),{value:it}=(0,nt.default)(async()=>{var It;const Qt=ae,{facets:In}=await We.getEntityFacets({facets:[Qt],filter:(It=ze.kind)===null||It===void 0?void 0:It.getCatalogFilters()});return Object.fromEntries(In[Qt].map(({value:yr,count:$r})=>[yr,$r]))},[ze.kind]),jt=(0,F.useMemo)(()=>[Ne].flat().filter(Boolean),[Ne]);var $e;const[Je,At]=(0,F.useState)(jt.length?jt:($e=(j=ze[P])===null||j===void 0?void 0:j.values)!==null&&$e!==void 0?$e:Ae);(0,F.useEffect)(()=>{jt.length&&At(jt)},[jt]);const an=Object.keys(it!=null?it:{}),Rn=Je.length&&an.length;(0,F.useEffect)(()=>{Re({[P]:Rn?new _(Je):void 0})},[P,Rn,Je,_,Re]);const Lt=ze[P];return Lt&&typeof Lt=="object"&&!("values"in Lt)||!an.length||an.length<=1?null:(0,p.jsx)(D.Z,{pb:1,pt:1,children:(0,p.jsxs)(A.Z,{variant:"button",component:"label",children:[L,(0,p.jsx)(_e.ZP,{multiple:!0,disableCloseOnSelect:!0,options:an,value:Je,onChange:(It,Qt)=>At(Qt),renderOption:(It,{selected:Qt})=>(0,p.jsx)(zn,{selected:Qt,value:It,availableOptions:it,showCounts:!!oe}),size:"small",popupIcon:(0,p.jsx)(Mt.Z,{"data-testid":`${String(P)}-picker-expand`}),renderInput:It=>(0,p.jsx)(N,{...It,...ue})})]})})}const Ee=(0,_t.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ue=y=>{const{initialFilter:j=[]}=y,L=Ee();return(0,p.jsx)(ce,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:Nt,InputProps:{className:L.input},initialSelectedOptions:j})};var qe=n(6232),Tt=n(98685),$t=n(62367),ln=n(72579),sn=n.n(ln);function nn(y,j){var L,P;const ae=(L=j)===null||L===void 0?void 0:L.defaultKind;let oe,_,ue;if("metadata"in y?(oe=y.kind,_=y.metadata.namespace,ue=y.metadata.name):(oe=y.kind,_=y.namespace,ue=y.name),(_===void 0||_==="")&&(_=I.zG),((P=j)===null||P===void 0?void 0:P.defaultNamespace)!==void 0){var Ae;((Ae=j)===null||Ae===void 0?void 0:Ae.defaultNamespace)===_&&(_=void 0)}else _===I.zG&&(_=void 0);return oe=oe.toLocaleLowerCase("en-US"),oe=ae&&ae.toLocaleLowerCase("en-US")===oe?void 0:oe,`${oe?`${oe}:`:""}${_?`${_}/`:""}${ue}`}function re(y,j){for(const L of["spec.profile.displayName","metadata.title"]){const P=sn()(y,L);if(P&&typeof P=="string")return P}return j}function te({enabled:y}){const j=(0,h.h_)(W),[L]=(0,F.useState)(async()=>{if(!y)return[];const P="relations.ownedBy";return j.getEntityFacets({facets:[P]}).then(ae=>ae.facets[P].map(oe=>oe.value).map(oe=>{const{kind:_,name:ue,namespace:Ae}=(0,I.of)(oe);return{apiVersion:"backstage.io/v1beta1",kind:_,metadata:{name:ue,namespace:Ae}}}).sort((oe,_)=>(oe.metadata.namespace||"").localeCompare(_.metadata.namespace||"","en-US")||oe.metadata.name.localeCompare(_.metadata.name,"en-US")||oe.kind.localeCompare(_.kind,"en-US"))).catch(()=>[])});return(0,Jt.default)(async(P,ae)=>{var oe;const _=await L;if(!_)return{items:[]};var ue;const Ae=(ue=(oe=ae)===null||oe===void 0?void 0:oe.limit)!==null&&ue!==void 0?ue:20,{text:Re,start:ze}=Y(P),Ne=_.filter(it=>M(Re,it)),We=ze+Ae;return{items:Ne.slice(0,We),...k({entities:Ne,limit:We,payload:{text:Re,start:We}})}},[L],{loading:!0,value:{items:[]}})}function Y(y){return v(y)&&y.cursor?JSON.parse(atob(y.cursor)):{text:y.text||"",start:0}}function v(y){return!!y.cursor}function k({entities:y,limit:j,payload:L}){return y.length>j?{cursor:btoa(JSON.stringify(L))}:{}}function M(y,j){var L;const P=y.trim();return j.kind.includes(P)||((L=j.metadata.namespace)===null||L===void 0?void 0:L.includes(P))||j.metadata.name.includes(P)}function H(){const y=(0,h.h_)(W);return(0,Jt.default)(async(j,L)=>{var P;const ae=j,oe=j;var _;const ue=(_=(P=L)===null||P===void 0?void 0:P.limit)!==null&&_!==void 0?_:20;if(oe.cursor){const Re=await y.queryEntities({cursor:oe.cursor,limit:ue});return{cursor:Re.pageInfo.nextCursor,items:[...oe.items,...Re.items]}}const Ae=await y.queryEntities({fullTextFilter:{term:ae.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:ue});return{cursor:Ae.pageInfo.nextCursor,items:Ae.items}},[],{loading:!0})}var pe=n(21638);function Se({mode:y,initialSelectedOwnersRefs:j}){const L=y==="owners-only",P=H(),ae=te({enabled:L}),[oe,_]=L?ae:P;return[oe,_,Oe({enabled:!L,initialSelectedOwnersRefs:j})]}function Oe({enabled:y,initialSelectedOwnersRefs:j}){const L=(0,F.useRef)({}),P=(0,h.h_)(W),[,ae]=(0,Jt.default)(async()=>{(await P.getEntitiesByRefs({entityRefs:j})).items.forEach(_=>{_&&(L.current[(0,I.eE)(_)]=_)})},[]);return(0,pe.n)(()=>{y&&j.length>0&&ae()}),{getEntity:oe=>L.current[oe],setEntity:oe=>{L.current[(0,I.eE)(oe)]=oe}}}const et=(0,_t.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),tt=(0,p.jsx)(Cn.Z,{fontSize:"small"}),bt=(0,p.jsx)($n.Z,{fontSize:"small"}),wt=y=>{var j,L,P;const ae=et(),{mode:oe="owners-only"}=y||{},{updateFilters:_,filters:ue,queryParameters:{owners:Ae}}=st(),[Re,ze]=(0,F.useState)(""),Ne=(0,F.useMemo)(()=>[Ae].flat().filter(Boolean),[Ae]);var We;const[it,jt]=(0,F.useState)(Ne.length?Ne:(We=(j=ue.owners)===null||j===void 0?void 0:j.values)!==null&&We!==void 0?We:[]),[{value:$e,loading:Je},At,an]=Se({mode:oe,initialSelectedOwnersRefs:it});(0,qe.b)(()=>At({text:Re}),[Re,At],250);const Rn=((L=$e)===null||L===void 0?void 0:L.items)||[];return(0,F.useEffect)(()=>{if(Ne.length){const Lt=new St(Ne);jt(Lt.values)}},[Ne]),(0,F.useEffect)(()=>{_({owners:it.length?new St(it):void 0})},[it,_]),["user","group"].includes(((P=ue.kind)===null||P===void 0?void 0:P.value.toLocaleLowerCase("en-US"))||"")?null:(0,p.jsx)(D.Z,{pb:1,pt:1,children:(0,p.jsxs)(A.Z,{variant:"button",component:"label",children:["Owner",(0,p.jsx)(_e.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:Je,options:Rn,value:it,getOptionSelected:(Lt,It)=>typeof It=="string"?(0,I.eE)(Lt)===It:Lt===It,getOptionLabel:Lt=>{const It=typeof Lt=="string"?an.getEntity(Lt)||(0,I.of)(Lt,{defaultKind:"group",defaultNamespace:"default"}):Lt;return re(It,nn(It))},onChange:(Lt,It)=>{ze(""),jt(It.map(Qt=>{const In=typeof Qt=="string"?Qt:(0,I.eE)(Qt);return typeof Qt!="string"&&an.setEntity(Qt),In}))},filterOptions:Lt=>Lt,renderOption:(Lt,{selected:It})=>{const Qt=Lt.kind.toLocaleLowerCase("en-US")==="group";return(0,p.jsx)(dn.Z,{control:(0,p.jsx)(Pn.Z,{icon:tt,checkedIcon:bt,checked:It}),onClick:In=>In.preventDefault(),label:(0,p.jsxs)(D.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[Qt?(0,p.jsx)($t.Z,{fontSize:"small"}):(0,p.jsx)(Tt.Z,{fontSize:"small"}),"\xA0",re(Lt,nn(Lt,{defaultKind:Lt.kind}))]})})},size:"small",popupIcon:(0,p.jsx)(Mt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Lt=>(0,p.jsx)(we.Z,{...Lt,className:ae.input,onChange:It=>{ze(It.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Lt=>{var It;const Qt=Lt.currentTarget;Math.abs(Qt.scrollHeight-Qt.clientHeight-Qt.scrollTop)<1&&(!((It=$e)===null||It===void 0)&&It.cursor)&&At({items:$e.items,cursor:$e.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var at=n(51837);const Be=(0,at.uW)("catalog:entity-route-ref",()=>(0,h.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ct(y){var j,L;return{kind:y.kind.toLocaleLowerCase("en-US"),namespace:(L=(j=y.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&L!==void 0?L:DEFAULT_NAMESPACE,name:y.metadata.name}}var Yt=n(80030);const Et=(0,F.forwardRef)((y,j)=>{var L;const{entityRef:P,defaultKind:ae,title:oe,children:_,...ue}=y,Ae=(0,h.tg)(Be);let Re,ze,Ne;if(typeof P=="string"){const Je=(0,I.of)(P);Re=Je.kind,ze=Je.namespace,Ne=Je.name}else"metadata"in P?(Re=P.kind,ze=P.metadata.namespace,Ne=P.metadata.name):(Re=P.kind,ze=P.namespace,Ne=P.name);Re=Re.toLocaleLowerCase("en-US");var We;ze=(We=(L=ze)===null||L===void 0?void 0:L.toLocaleLowerCase("en-US"))!==null&&We!==void 0?We:I.zG;const it={kind:Re,namespace:ze,name:Ne},jt=nn({kind:Re,namespace:ze,name:Ne},{defaultKind:ae}),$e=(0,p.jsxs)(R.rU,{...ue,ref:j,to:Ae(it),children:[_,!_&&(oe!=null?oe:jt)]});return oe?(0,p.jsx)(Yt.ZP,{title:jt,children:$e}):$e});function Ft(y){const{entityRefs:j,defaultKind:L,getTitle:P,...ae}=y,oe=(0,h.h_)(W),{value:_=new Array,loading:ue,error:Ae}=(0,nt.default)(async()=>{const Re=j.reduce((Ne,We)=>typeof We=="object"&&"metadata"in We?Ne:[...Ne,(0,I.of)(We)],new Array),ze=j.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return Re.length>0?[...(await oe.getEntities({filter:Re.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...ze]:ze},[j]);return ue?(0,p.jsx)(R.Ex,{}):Ae?(0,p.jsx)(R.yu,{error:Ae}):(0,p.jsx)(p.Fragment,{children:_.map((Re,ze)=>(0,p.jsxs)(F.Fragment,{children:[ze>0&&", ",(0,p.jsx)(Et,{...ae,defaultKind:L,entityRef:Re,title:P(Re)})]},ze))})}function en(y){const{entityRefs:j,defaultKind:L,fetchEntities:P,getTitle:ae,...oe}=y;return P?(0,p.jsx)(Ft,{...oe,defaultKind:L,entityRefs:j,getTitle:ae}):(0,p.jsx)(p.Fragment,{children:j.map((_,ue)=>(0,p.jsxs)(F.Fragment,{children:[ue>0&&", ",(0,p.jsx)(Et,{...oe,defaultKind:L,entityRef:_,title:ae?ae(_):void 0})]},ue))})}const Tn=y=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(y.entity)),children:_jsx(InfoIcon,{})})},Zt=y=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${y.email}`,to:`mailto:${y.email}`,children:_jsx(EmailIcon,{})}),lt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Rt=y=>{var j;const L=(j=y.entity.spec.profile)===null||j===void 0?void 0:j.email;return L?_jsx(EmailCardAction,{email:L}):null},Ht=(0,_t.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),qt=4,Sr=y=>{var j,L,P;const{entityRef:ae,children:oe,delayTime:_=500}=y,ue=Ht(),Ae=useApiHolder(),Re=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[ze,Ne]=useState(!1),We=useMemo(()=>debounce(()=>Ne(!0),_),[_]),[{loading:it,error:jt,value:$e},Je]=useAsyncFn(async()=>{const an=Ae.get(catalogApiRef);if(an){const Rn=await an.getEntityByRef(ae);if(!Rn)throw new Error(`${ae} not found`);return Rn}},[Ae,ae]),At=()=>{Ne(!1),We.cancel()};return useEffect(()=>{Re.isOpen&&!$e&&!jt&&!it&&Je()},[Re.isOpen,Je,$e,jt,it]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:We,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Re),children:oe})}),ze&&_jsx(HoverPopover,{PaperProps:{className:ue.popoverPaper},...bindPopover(Re),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:At,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[jt&&_jsx(ResponseErrorPanel,{error:jt}),it&&_jsx(Progress,{}),$e&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:$e.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:$e.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:$e.kind}),$e.metadata.description&&_jsx(Typography,{className:ue.descriptionTypography,paragraph:!0,children:$e.metadata.description}),_jsx(Typography,{children:(j=$e.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[($e.metadata.tags||[]).slice(0,qt).map(an=>_jsx(Chip,{size:"small",label:an},an)),((L=$e.metadata.tags)===null||L===void 0?void 0:L.length)&&((P=$e.metadata.tags)===null||P===void 0?void 0:P.length)>qt&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!jt&&$e&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity($e)&&_jsx(UserCardActions,{entity:$e}),isGroupEntity($e)&&_jsx(GroupCardActions,{entity:$e}),_jsx(EntityCardActions,{entity:$e})]})})]})})]})},Or=(0,_t.Z)(y=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),er=()=>{var y;const j=Or(),{filters:L,updateFilters:P}=useEntityList();var ae;const[oe,_]=useState((ae=(y=L.text)===null||y===void 0?void 0:y.value)!==null&&ae!==void 0?ae:"");return useDebounce(()=>{P({text:oe.length?new EntityTextFilter(oe):void 0})},250,[oe,P]),_jsx(Toolbar,{className:j.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:j.input,placeholder:"Search",autoComplete:"off",onChange:ue=>_(ue.target.value),value:oe,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>_(""),edge:"end",disabled:oe.length===0,children:_jsx(Clear,{})})})})})})},bn=Object.freeze({createEntityRefColumn(y){const{defaultKind:j}=y;function L(P){var ae;return((ae=P.metadata)===null||ae===void 0?void 0:ae.title)||nn(P,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(P,ae){return L(ae).includes(P)},customSort(P,ae){return L(P).localeCompare(L(ae))},render:P=>{var ae;return(0,p.jsx)(Et,{entityRef:P,defaultKind:j,title:(ae=P.metadata)===null||ae===void 0?void 0:ae.title})}}},createEntityRelationColumn(y){const{title:j,relation:L,defaultKind:P,filter:ae}=y;function oe(ue){return(0,Z.hF)(ue,L,ae)}function _(ue){return oe(ue).map(Ae=>nn(Ae,{defaultKind:P})).join(", ")}return{title:j,customFilterAndSearch(ue,Ae){return _(Ae).includes(ue)},customSort(ue,Ae){return _(ue).localeCompare(_(Ae))},render:ue=>(0,p.jsx)(en,{entityRefs:oe(ue),defaultKind:P})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:I.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:I.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:I.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,p.jsx)(R.Or,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),tr=[bn.createEntityRefColumn({defaultKind:"system"}),bn.createDomainColumn(),bn.createOwnerColumn(),bn.createMetadataDescriptionColumn()],dr=[bn.createEntityRefColumn({defaultKind:"component"}),bn.createSystemColumn(),bn.createOwnerColumn(),bn.createSpecTypeColumn(),bn.createSpecLifecycleColumn(),bn.createMetadataDescriptionColumn()],Gr=(0,_t.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),Wn=y=>{const{entities:j,title:L,emptyContent:P,variant:ae="gridItem",columns:oe,tableOptions:_={}}=y,ue=Gr(),Ae={minWidth:"0",width:"100%"};return ae==="gridItem"&&(Ae.height="calc(100% - 10px)"),(0,p.jsx)(R.iA,{columns:oe,title:L,style:Ae,emptyContent:P&&(0,p.jsx)("div",{className:ue.empty,children:P}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,..._},data:j})};Wn.columns=bn,Wn.systemEntityColumns=tr,Wn.componentEntityColumns=dr;const Kr=(0,_t.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Cr=y=>{const j=Kr();return(0,p.jsx)(ce,{label:"Tags",name:"tags",path:"metadata.tags",Filter:B,showCounts:y.showCounts,InputProps:{className:j.input}})},C=y=>{const{hidden:j,initialFilter:L}=y,P=(0,h.h_)(h.$v),{error:ae,availableTypes:oe,selectedTypes:_,setSelectedTypes:ue}=vt();if((0,F.useEffect)(()=>{ae&&P.post({message:"Failed to load entity types",severity:"error"}),L&&ue([L])},[ae,P,L,ue]),oe.length===0||ae)return null;const Ae=[{value:"all",label:"all"},...oe.map(ze=>({value:ze,label:ze}))];var Re;return j?null:(0,p.jsx)(D.Z,{pb:1,pt:1,children:(0,p.jsx)(R.Ph,{label:"Type",items:Ae,selected:(Re=Ae.length>1?_[0]:void 0)!==null&&Re!==void 0?Re:"all",onChange:ze=>ue(ze==="all"?[]:[String(ze)])})})};var c=n(15459),b=n(61837),E=n(11640),J=n(28347);const me=(0,c.Z)({root:{color:"#f3ba37"}})(E.Z),je=y=>{const{toggleStarredEntity:j,isStarredEntity:L}=hn(y.entity);return(0,p.jsx)(b.Z,{"aria-label":"favorite",color:"inherit",...y,onClick:()=>j(),children:(0,p.jsx)(Yt.ZP,{title:L?"Remove from favorites":"Add to favorites",children:L?(0,p.jsx)(me,{}):(0,p.jsx)(J.Z,{})})})};var ke=n(8629),He=n(79249),Gt=n(38724),cn=n(99152),gn=n(6487),Vn=n(49429),zt=n(55999),rn=n(39412);const nr=rn.Z;function rr(y,j){if(y)return y.toLocaleLowerCase("en-US");if(j)try{return(0,I.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function wr(y,j){const L=(0,h.qD)(),P=rr(y,j);return P&&L.getSystemIcon(`kind:${P}`)||nr}function or(y){const{kind:j,entityRef:L,...P}=y,ae=wr(j,L);return(0,p.jsx)(ae,{...P})}const Go=(0,_t.Z)(y=>({node:{fill:y.palette.grey[300],stroke:y.palette.grey[300],"&.primary":{fill:y.palette.primary.light,stroke:y.palette.primary.light},"&.secondary":{fill:y.palette.secondary.light,stroke:y.palette.secondary.light}},text:{fill:y.palette.getContrastText(y.palette.grey[300]),"&.primary":{fill:y.palette.primary.contrastText},"&.secondary":{fill:y.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function ws(y){var j,L;const P=(0,h.h_)(W),ae=(0,I.eE)(y),{loading:oe,error:_,value:ue}=(0,nt.default)(async()=>{const Ae=await P.getEntityAncestors({entityRef:ae}),Re=new Array,ze=new Array;for(const Ne of Ae.items){const We=(0,I.eE)(Ne.entity),it=We===Ae.rootEntityRef;Re.push({id:We,root:it,...Ne.entity});for(const jt of Ne.parentEntityRefs)ze.push({from:We,to:jt})}return{nodes:Re,edges:ze}},[ae]);return{loading:oe,error:_,nodes:((j=ue)===null||j===void 0?void 0:j.nodes)||[],edges:((L=ue)===null||L===void 0?void 0:L.edges)||[]}}function Ko({node:y}){const j=Go(),L=(0,Vt.s0)(),P=(0,h.tg)(Be),[ae,oe]=(0,F.useState)(0),[_,ue]=(0,F.useState)(0),Ae=(0,F.useRef)(null);(0,F.useLayoutEffect)(()=>{if(Ae.current){let{height:Je,width:At}=Ae.current.getBBox();Je=Math.round(Je),At=Math.round(At),(Je!==_||At!==ae)&&(oe(At),ue(Je))}},[ae,_]);const Re=10,ze=_,Ne=ze+Re,We=Ne+ae+Re*2,it=_+Re*2,jt=y.metadata.title||(y.kind&&y.metadata.name&&y.metadata.namespace?nn({kind:y.kind,name:y.metadata.name,namespace:y.metadata.namespace||""}):y.id),$e=()=>{L(P({kind:y.kind,namespace:y.metadata.namespace||I.zG,name:y.metadata.name}))};return(0,p.jsxs)("g",{onClick:$e,className:j.clickable,children:[(0,p.jsx)("rect",{className:Pe()(j.node,y.root?"secondary":"primary"),width:We,height:it,rx:10}),(0,p.jsx)(or,{kind:y.kind,y:Re,x:Re,width:ze,height:ze,className:Pe()(j.text,y.root?"secondary":"primary")}),(0,p.jsx)("text",{ref:Ae,className:Pe()(j.text,y.root?"secondary":"primary"),y:it/2,x:Ne+(ae+Re*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:jt})]})}function Yo(y){const{loading:j,error:L,nodes:P,edges:ae}=ws(y.entity);return j?(0,p.jsx)(R.Ex,{}):L?(0,p.jsx)(R.Gk,{error:L}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zt.Z,{variant:"h2",children:"Ancestry"}),(0,p.jsxs)(zt.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,p.jsx)(R.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,p.jsx)(D.Z,{mt:4,children:(0,p.jsx)(R.mn,{nodes:P,edges:ae,renderNode:Ko,direction:R.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var kr=n(11776),gr=n(38402),Yr=n(86136),eo=n(99688),wo=n(49378),jo=n(54506),zr=n(94339),Jo=n(24579),Eo=n(27685);const Zn=(0,_t.Z)(y=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:y.spacing(2)},helpIcon:{marginLeft:y.spacing(1),color:y.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function mr(y){const j=Zn();return(0,p.jsx)(wo.Z,{...y,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Jr(y){const j=Zn();return(0,p.jsx)(jo.Z,{className:j.monospace,children:y.children})}function Qr(y){return(0,p.jsx)(D.Z,{mt:2,children:(0,p.jsx)(zr.Z,{variant:"outlined",children:(0,p.jsxs)(Jo.Z,{children:[(0,p.jsxs)(A.Z,{variant:"h6",gutterBottom:!0,children:[y.title,y.helpLink&&(0,p.jsx)(Ao,{to:y.helpLink})]}),y.children]})})})}function Qo(y){if(y.match(/^url:https?:\/\//))return y.slice(4);if(y.match(/^https?:\/\//))return y}function jr(y){const[j,L]=y.entry,P=Qo(L);return(0,p.jsxs)(gr.Z,{children:[y.indent&&(0,p.jsx)(Yr.Z,{}),(0,p.jsx)(mr,{primary:j,secondary:P?(0,p.jsx)(R.rU,{to:P,children:L}):L})]})}function Ao(y){const j=Zn();return(0,p.jsx)(R.rU,{to:y.to,className:j.helpIcon,children:(0,p.jsx)(Eo.Z,{fontSize:"inherit"})})}const To=(0,_t.Z)({root:{display:"flex",flexDirection:"column"}});function Ro(y){var j,L,P;const ae=(0,h.h_)(W),oe=(0,I.eE)(y),_=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.P1],ue=(L=y.metadata.annotations)===null||L===void 0?void 0:L[I.q1],{loading:Ae,error:Re,value:ze}=(0,nt.default)(async()=>!_&&!ue?[]:(await ae.getEntities({filter:[..._?[{[`metadata.annotations.${I.P1}`]:_}]:[],...ue?[{[`metadata.annotations.${I.q1}`]:ue}]:[]]})).items,[_,ue]);return{loading:Ae,error:Re,location:_,originLocation:ue,colocatedEntities:(P=ze)===null||P===void 0?void 0:P.filter(Ne=>(0,I.eE)(Ne)!==oe)}}function Wr(y){return(0,p.jsxs)(kr.Z,{dense:!0,children:[y.header&&(0,p.jsx)(jr,{entry:y.header},"header"),y.entities.map(j=>(0,p.jsxs)(gr.Z,{children:[(0,p.jsx)(Yr.Z,{children:(0,p.jsx)(or,{kind:j.kind})}),(0,p.jsx)(mr,{primary:(0,p.jsx)(Et,{entityRef:j})})]},(0,I.eE)(j)))]})}function Io(y){var j;const{entity:L}=y,{loading:P,error:ae,location:oe,originLocation:_,colocatedEntities:ue}=Ro(L);if(P)return(0,p.jsx)(R.Ex,{});if(ae)return(0,p.jsx)(R.Gk,{error:ae});if(!oe&&!_)return(0,p.jsx)(eo.Z,{severity:"warning",children:"Entity had no location information."});if(!(!((j=ue)===null||j===void 0)&&j.length))return(0,p.jsx)(eo.Z,{severity:"info",children:"There were no other entities on this location."});if(oe===_)return(0,p.jsx)(Wr,{entities:ue});const Ae=ue.filter(ze=>{var Ne;return((Ne=ze.metadata.annotations)===null||Ne===void 0?void 0:Ne[I.P1])===oe}),Re=ue.filter(ze=>{var Ne;return((Ne=ze.metadata.annotations)===null||Ne===void 0?void 0:Ne[I.q1])===_});return(0,p.jsxs)(p.Fragment,{children:[Ae.length>0&&(0,p.jsx)(Wr,{entities:Ae,header:["At the same location",oe]}),Re.length>0&&(0,p.jsx)(Wr,{entities:Re,header:["At the same origin",_]})]})}function Xo(y){const j=To();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zt.Z,{variant:"h2",children:"Colocated"}),(0,p.jsx)(zt.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,p.jsx)("div",{className:j.root,children:(0,p.jsx)(Io,{entity:y.entity})})]})}function po(y){return Object.fromEntries([...Object.entries(y)].sort((j,L)=>j[0]<L[0]?-1:1))}function Po(y){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zt.Z,{variant:"h2",children:"Entity as JSON"}),(0,p.jsx)(zt.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,p.jsx)(zt.Z,{children:(0,p.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,p.jsx)(R.Oi,{text:JSON.stringify(po(y.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var js=n(3440),Lo=n.n(js);const vr=(0,_t.Z)({root:{display:"flex",flexDirection:"column"}});function ai(y){var j,L,P;const ae=vr(),{apiVersion:oe,kind:_,metadata:ue,spec:Ae,relations:Re=[],status:ze={}}=y.entity,Ne=Lo()(yt()(Re,We=>We.targetRef),"type");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zt.Z,{variant:"h2",children:"Overview"}),(0,p.jsxs)("div",{className:ae.root,children:[(0,p.jsx)(Qr,{title:"Identity",children:(0,p.jsxs)(kr.Z,{dense:!0,children:[(0,p.jsx)(gr.Z,{children:(0,p.jsx)(mr,{primary:"apiVersion",secondary:oe})}),(0,p.jsx)(gr.Z,{children:(0,p.jsx)(mr,{primary:"kind",secondary:_})}),((j=Ae)===null||j===void 0?void 0:j.type)&&(0,p.jsx)(gr.Z,{children:(0,p.jsx)(mr,{primary:"spec.type",secondary:Ae.type})}),ue.uid&&(0,p.jsx)(gr.Z,{children:(0,p.jsx)(mr,{primary:"uid",secondary:ue.uid})}),ue.etag&&(0,p.jsx)(gr.Z,{children:(0,p.jsx)(mr,{primary:"etag",secondary:ue.etag})})]})}),(0,p.jsxs)(Qr,{title:"Metadata",children:[!!Object.keys(ue.annotations||{}).length&&(0,p.jsx)(kr.Z,{dense:!0,subheader:(0,p.jsxs)(Jr,{children:["Annotations",(0,p.jsx)(Ao,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ue.annotations).map(We=>(0,p.jsx)(jr,{indent:!0,entry:We},We[0]))}),!!Object.keys(ue.labels||{}).length&&(0,p.jsx)(kr.Z,{dense:!0,subheader:(0,p.jsx)(Jr,{children:"Labels"}),children:Object.entries(ue.labels).map(We=>(0,p.jsx)(jr,{indent:!0,entry:We},We[0]))}),!!(!((L=ue.tags)===null||L===void 0)&&L.length)&&(0,p.jsx)(kr.Z,{dense:!0,subheader:(0,p.jsx)(Jr,{children:"Tags"}),children:ue.tags.map((We,it)=>(0,p.jsxs)(gr.Z,{children:[(0,p.jsx)(Yr.Z,{}),(0,p.jsx)(mr,{primary:We})]},`${We}-${it}`))})]}),!!Re.length&&(0,p.jsx)(Qr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Ne).map(([We,it],jt)=>(0,p.jsx)("div",{children:(0,p.jsx)(kr.Z,{dense:!0,subheader:(0,p.jsx)(Jr,{children:We}),children:it.map($e=>(0,p.jsxs)(gr.Z,{children:[(0,p.jsx)(Yr.Z,{children:(0,p.jsx)(or,{entityRef:$e.targetRef})}),(0,p.jsx)(mr,{primary:(0,p.jsx)(Et,{entityRef:$e.targetRef})})]},$e.targetRef))})},jt))}),!!(!((P=ze.items)===null||P===void 0)&&P.length)&&(0,p.jsx)(Qr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:ze.items.map((We,it)=>(0,p.jsxs)("div",{children:[(0,p.jsxs)(A.Z,{children:[We.level,": ",We.type]}),(0,p.jsx)(D.Z,{ml:2,children:We.message})]},it))})]})]})}var _o=n(10921);function Es(y){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zt.Z,{variant:"h2",children:"Entity as YAML"}),(0,p.jsx)(zt.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,p.jsx)(zt.Z,{children:(0,p.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,p.jsx)(R.Oi,{text:_o.ZP.stringify(po(y.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const ho=(0,_t.Z)(y=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:y.palette.background.paper},tabs:{borderRight:`1px solid ${y.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function to(y){const{children:j,value:L,index:P,...ae}=y,oe=ho();return(0,p.jsx)("div",{role:"tabpanel",hidden:L!==P,id:`vertical-tabpanel-${P}`,"aria-labelledby":`vertical-tab-${P}`,className:oe.tabContents,...ae,children:L===P&&(0,p.jsx)(D.Z,{pl:3,pr:3,children:j})})}function no(y){return{id:`vertical-tab-${y}`,"aria-controls":`vertical-tabpanel-${y}`}}function ro(y){const j=ho(),[L,P]=F.useState(0);return(0,F.useEffect)(()=>{P(0)},[y.open]),y.entity?(0,p.jsxs)(ke.Z,{fullWidth:!0,maxWidth:"xl",open:y.open,onClose:y.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,p.jsx)(He.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,p.jsx)(Gt.Z,{dividers:!0,children:(0,p.jsxs)("div",{className:j.root,children:[(0,p.jsxs)(cn.Z,{orientation:"vertical",variant:"scrollable",value:L,onChange:(ae,oe)=>P(oe),"aria-label":"Inspector options",className:j.tabs,children:[(0,p.jsx)(gn.Z,{label:"Overview",...no(0)}),(0,p.jsx)(gn.Z,{label:"Ancestry",...no(1)}),(0,p.jsx)(gn.Z,{label:"Colocated",...no(2)}),(0,p.jsx)(gn.Z,{label:"Raw JSON",...no(3)}),(0,p.jsx)(gn.Z,{label:"Raw YAML",...no(4)})]}),(0,p.jsx)(to,{value:L,index:0,children:(0,p.jsx)(ai,{entity:y.entity})}),(0,p.jsx)(to,{value:L,index:1,children:(0,p.jsx)(Yo,{entity:y.entity})}),(0,p.jsx)(to,{value:L,index:2,children:(0,p.jsx)(Xo,{entity:y.entity})}),(0,p.jsx)(to,{value:L,index:3,children:(0,p.jsx)(Po,{entity:y.entity})}),(0,p.jsx)(to,{value:L,index:4,children:(0,p.jsx)(Es,{entity:y.entity})})]})}),(0,p.jsx)(Vn.Z,{children:(0,p.jsx)(z.Z,{onClick:y.onClose,color:"primary",children:"Close"})})]}):null}var Br=n(85256);function sr(y){var j;const L=(0,h.h_)(W),P=(j=y.metadata.annotations)===null||j===void 0?void 0:j[I.q1],ae=y.metadata.uid,oe=P==="bootstrap:bootstrap",_=(0,nt.default)(async()=>{const jt=L.getLocationByRef(P);let $e;if(!P)$e=Promise.resolve([]);else{const Je=`metadata.annotations.${I.q1}`;$e=L.getEntities({filter:{[Je]:P},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(At=>At.items)}return Promise.all([jt,$e]).then(([Je,At])=>({location:Je,colocatedEntities:At}))},[L,y]),ue=(0,F.useCallback)(async function(){const{location:$e}=_.value;await L.removeLocationById($e.id)},[L,_]),Ae=(0,F.useCallback)(async function(){await L.removeEntityByUid(ae)},[L,ae]);if(oe)return{type:"bootstrap",location:P,deleteEntity:Ae};const{loading:Re,error:ze,value:Ne}=_;if(Re)return{type:"loading"};if(ze)return{type:"error",error:ze};const{location:We,colocatedEntities:it}=Ne;return We?{type:"unregister",location:P,colocatedEntities:it.map(I.iB),unregisterLocation:ue,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var fo=n(23054);const qo=(0,_t.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),As=({entity:y,onConfirm:j,onClose:L})=>{const P=(0,h.h_)(h.$v),ae=(0,h.h_)(h.Ds),oe=qo(),_=sr(y),[ue,Ae]=(0,F.useState)(!1),[Re,ze]=(0,F.useState)(!1);var Ne;const We=(Ne=ae.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",it=(0,F.useCallback)(async function(){if("unregisterLocation"in _){ze(!0);try{await _.unregisterLocation(),j()}catch(At){(0,fo.BD)(At),P.post({message:At.message})}finally{ze(!1)}}},[P,j,_]),jt=(0,F.useCallback)(async function(){if("deleteEntity"in _){ze(!0);try{await _.deleteEntity(),j()}catch(At){(0,fo.BD)(At),P.post({message:At.message})}finally{ze(!1)}}},[P,j,_]),$e=()=>(0,p.jsx)(Vn.Z,{className:oe.dialogActions,children:(0,p.jsx)(z.Z,{onClick:L,color:"primary",children:"Cancel"})});return _.type==="loading"?(0,p.jsx)(R.Ex,{}):_.type==="error"?(0,p.jsx)(R.Gk,{error:_.error}):_.type==="bootstrap"?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(eo.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',_.location,'"). If you believe this is in error, please contact the ',We," ","integrator."]}),(0,p.jsxs)(D.Z,{marginTop:2,children:[!ue&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:oe.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,p.jsx)($e,{})]}),ue&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zt.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,p.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:jt,children:"Delete Entity"}),(0,p.jsx)($e,{})]})]})]}):_.type==="only-delete"?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zt.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,p.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:jt,children:"Delete Entity"}),(0,p.jsx)($e,{})]}):_.type==="unregister"?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(zt.Z,{children:"This action will unregister the following entities:"}),(0,p.jsx)(zt.Z,{component:"ul",children:_.colocatedEntities.map(Je=>(0,p.jsx)("li",{children:(0,p.jsx)(Et,{entityRef:Je})},`${Je.kind}:${Je.namespace}/${Je.name}`))}),(0,p.jsx)(zt.Z,{children:"Located at the following location:"}),(0,p.jsx)(zt.Z,{component:"ul",children:(0,p.jsx)("li",{children:_.location})}),(0,p.jsxs)(zt.Z,{children:["To undo, just re-register the entity in ",We,"."]}),(0,p.jsxs)(D.Z,{marginTop:2,children:[(0,p.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:it,children:"Unregister Location"}),!ue&&(0,p.jsx)(D.Z,{component:"span",marginLeft:2,children:(0,p.jsx)(z.Z,{variant:"text",size:"small",color:"primary",className:oe.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),ue&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(D.Z,{paddingTop:4,paddingBottom:4,children:(0,p.jsx)(Br.Z,{})}),(0,p.jsx)(zt.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,p.jsx)(z.Z,{variant:"contained",color:"secondary",disabled:Re,onClick:jt,children:"Delete Entity"})]})]}):(0,p.jsx)(eo.Z,{severity:"error",children:"Internal error: Unknown state"})},oo=y=>{const{open:j,onConfirm:L,onClose:P,entity:ae}=y;return(0,p.jsxs)(ke.Z,{open:j,onClose:P,children:[(0,p.jsx)(He.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,p.jsx)(Gt.Z,{children:(0,p.jsx)(As,{entity:ae,onConfirm:L,onClose:P})})]})};var es=n(12231),Ts=n(9520),ts=n(47603);const ns=(0,_t.Z)(y=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:y.spacing(1,0,1,0)},title:{margin:y.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:y.palette.text.primary},menuItem:{minHeight:y.spacing(6)},groupWrapper:{margin:y.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function go(y){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:ts.Z},{id:"starred",label:"Starred",icon:E.Z}]},{name:y!=null?y:"Company",items:[{id:"all",label:"All"}]}]}const Oo=y=>{const{initialFilter:j,availableFilters:L}=y,P=ns(),ae=(0,h.h_)(h.Ds);var oe;const _=(oe=ae.getOptionalString("organization.name"))!==null&&oe!==void 0?oe:"Company",{filters:ue,updateFilters:Ae,backendEntities:Re,queryParameters:{kind:ze,user:Ne},loading:We}=st(),it=["starred","all"],jt=go(_).map(Hn=>({...Hn,items:Hn.items.filter(({id:mn})=>["group","user"].some(Dn=>Dn===ze)?it.includes(mn):!L||L.includes(mn))})).filter(({items:Hn})=>!!Hn.length),{isStarredEntity:$e}=pn(),{isOwnedEntity:Je,loading:At}=En(),an=We||At,Rn=(0,F.useMemo)(()=>new kt("owned",Je,$e),[Je,$e]),Lt=(0,F.useMemo)(()=>new kt("starred",Je,$e),[Je,$e]),It=(0,F.useMemo)(()=>[Ne].flat()[0],[Ne]),[Qt,In]=(0,F.useState)(It!=null?It:j),yr=(0,F.useMemo)(()=>Re.filter((0,Z.Gz)((0,ut.compact)(Object.values({...ue,user:void 0})))),[ue,Re]),$r=(0,F.useMemo)(()=>({all:yr.length,starred:yr.filter(Hn=>Lt.filterEntity(Hn)).length,owned:yr.filter(Hn=>Rn.filterEntity(Hn)).length}),[yr,Lt,Rn]);(0,F.useEffect)(()=>{It&&In(It)},[It]),(0,F.useEffect)(()=>{!an&&Qt&&Qt!=="all"&&$r[Qt]===0&&In("all")},[an,$r,Qt,In]),(0,F.useEffect)(()=>{Ae({user:Qt?new kt(Qt,Je,$e):void 0})},[Qt,Je,$e,Ae]);var Xr;return(0,p.jsx)(zr.Z,{className:P.root,children:jt.map(Hn=>(0,p.jsxs)(F.Fragment,{children:[(0,p.jsx)(A.Z,{variant:"subtitle2",component:"span",className:P.title,children:Hn.name}),(0,p.jsx)(zr.Z,{className:P.groupWrapper,children:(0,p.jsx)(kr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Hn.name,children:Hn.items.map(mn=>{var Dn;return(0,p.jsxs)(es.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>In(mn.id),selected:mn.id===((Dn=ue.user)===null||Dn===void 0?void 0:Dn.value),className:P.menuItem,disabled:$r[mn.id]===0,"data-testid":`user-picker-${mn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[mn.icon&&(0,p.jsx)(Yr.Z,{className:P.listIcon,children:(0,p.jsx)(mn.icon,{fontSize:"small"})}),(0,p.jsx)(wo.Z,{children:(0,p.jsxs)(A.Z,{variant:"body1",children:[mn.label," "]})}),(0,p.jsx)(Ts.Z,{children:(Xr=$r[mn.id])!==null&&Xr!==void 0?Xr:"-"})]},mn.id)})})})]},Hn.name))})},mo=(0,_t.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Rs=(0,p.jsx)(Cn.Z,{fontSize:"small"}),li=(0,p.jsx)($n.Z,{fontSize:"small"}),rs=()=>{const y=mo(),{updateFilters:j}=st(),[L,P]=(0,F.useState)([]);function ae(ue){j({orphan:ue?new Dt(ue):void 0})}function oe(ue){j({error:ue?new Xt(ue):void 0})}const _=["Is Orphan","Has Error"];return(0,p.jsx)(D.Z,{pb:1,pt:1,children:(0,p.jsxs)(A.Z,{variant:"button",component:"label",children:["Processing Status",(0,p.jsx)(_e.ZP,{multiple:!0,disableCloseOnSelect:!0,options:_,value:L,onChange:(ue,Ae)=>{P(Ae),ae(Ae.includes("Is Orphan")),oe(Ae.includes("Has Error"))},renderOption:(ue,{selected:Ae})=>(0,p.jsx)(dn.Z,{control:(0,p.jsx)(Pn.Z,{icon:Rs,checkedIcon:li,checked:Ae}),onClick:Re=>Re.preventDefault(),label:ue}),size:"small",popupIcon:(0,p.jsx)(Mt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ue=>(0,p.jsx)(we.Z,{...ue,className:y.input,variant:"outlined"})})]})})},os=(0,_t.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),un=()=>{const y=os();return(0,p.jsx)(ce,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:Wt,InputProps:{className:y.input}})};function Is(y){var j;const{children:L,value:P}=y;var ae;const[oe,_]=useState((ae=(j=P)===null||j===void 0?void 0:j.filters)!==null&&ae!==void 0?ae:{}),ue=useCallback($e=>{_(Je=>{const At=typeof $e=="function"?$e(Je):$e;return{...Je,...At}})},[]),Ae=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Re,ze,Ne,We,it;const jt=useMemo(()=>{var $e,Je,At,an,Rn,Lt;return{entities:(Re=($e=P)===null||$e===void 0?void 0:$e.entities)!==null&&Re!==void 0?Re:Ae.entities,backendEntities:(ze=(Je=P)===null||Je===void 0?void 0:Je.backendEntities)!==null&&ze!==void 0?ze:Ae.backendEntities,updateFilters:(Ne=(At=P)===null||At===void 0?void 0:At.updateFilters)!==null&&Ne!==void 0?Ne:ue,filters:oe,loading:(We=(an=P)===null||an===void 0?void 0:an.loading)!==null&&We!==void 0?We:!1,queryParameters:(it=(Rn=P)===null||Rn===void 0?void 0:Rn.queryParameters)!==null&&it!==void 0?it:Ae.queryParameters,error:(Lt=P)===null||Lt===void 0?void 0:Lt.error}},[P,Ae,oe,ue]);return _jsx(EntityListContext.Provider,{value:jt,children:L})}},75435:function(Pt,Le,n){"use strict";n.d(Le,{h:function(){return h}});var r=n(25271);function h(W,f,V){var m,p,F;let ye=((p=W)===null||p===void 0||(m=p.relations)===null||m===void 0?void 0:m.filter(le=>le.type===f).map(le=>(0,r.of)(le.targetRef)))||[];return!((F=V)===null||F===void 0)&&F.kind&&(ye=ye.filter(le=>le.kind.toLocaleLowerCase("en-US")===V.kind.toLocaleLowerCase("en-US"))),ye}},49280:function(Pt,Le,n){"use strict";n.d(Le,{hF:function(){return W.h},CV:function(){return V},wq:function(){return r},Gz:function(){return h}});function r(p){return p.reduce((F,ye)=>({...F,...ye.getCatalogFilters?ye.getCatalogFilters():{}}),{})}function h(p){return F=>p.every(ye=>!ye.filterEntity||ye.filterEntity(F))}var W=n(75435),f=n(25271);function V(p,F){var ye;const le=(ye=p.metadata.annotations)===null||ye===void 0?void 0:ye[f.M6];if(le)try{var z;const de=(0,f.Ou)(le),D=F.byUrl(de.target);return{locationTargetUrl:de.target,integrationType:(z=D)===null||z===void 0?void 0:z.type}}catch{return}}function m(p,F){const ye=new Set([...getEntityRelations(p,RELATION_MEMBER_OF,{kind:"group"}),...p?[getCompoundEntityRef(p)]:[]].map(stringifyEntityRef)),le=getEntityRelations(F,RELATION_OWNED_BY).map(stringifyEntityRef);for(const z of le)if(ye.has(z))return!0;return!1}},8799:function(Pt,Le,n){"use strict";n.r(Le),n.d(Le,{AboutCard:function(){return Xt},AboutContent:function(){return kt},AboutField:function(){return Qe}});var r=n(52322),h=n(25271),W=n(53974),f=n(60871),V=n(32838),m=n(39709),p=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const F=(0,h.wI)(p),ye={async check(ct){return F(ct)===ct}},le=ct=>ct.apiVersion==="scaffolder.backstage.io/v1beta3"&&ct.kind==="Template";var z=n(79692),de=n(94339),D=n(32552),A=n(61837),se=n(85256),ie=n(24579),ne=n(88188),X=n(52866),K=n(30254),R=n(27604),w=n(2784),I=n(19625),Z=n(60905),xe=n(7089),Ce=n(90436);const B=(0,z.Z)(ct=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:ct.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function Qe(ct){const{label:ut,value:pt,gridSizes:ht,children:Vt}=ct,Jt=B(),be=(0,f.vJ)(Vt,Ye=>Ye.getElements()),Me=be.length>0?be:(0,r.jsx)(Ce.Z,{variant:"body2",className:Jt.value,children:pt||"unknown"});return(0,r.jsxs)(Z.Z,{item:!0,...ht,children:[(0,r.jsx)(Ce.Z,{variant:"h2",className:Jt.label,children:ut}),Me]})}var St=n(24851);const Nt=(0,z.Z)({description:{wordBreak:"break-word"}});function Wt(ct,ut,pt){if(ut==="url"||ct.includes("://"))return ct;const ht=pt.type==="file"?`file://${pt.target}`:pt.target;return ut==="file"||pt.type==="file"?new URL(ct,ht).href:ht}function kt(ct){var ut,pt,ht,Vt,Jt,be,Me,Ye,ft,st,nt,gt,ot,Xe,yt,vt;const{entity:xt}=ct,wn=Nt(),fn=xt.kind.toLocaleLowerCase("en-US")==="system",pn=xt.kind.toLocaleLowerCase("en-US")==="resource",jn=xt.kind.toLocaleLowerCase("en-US")==="component",hn=xt.kind.toLocaleLowerCase("en-US")==="api",xn=xt.kind.toLocaleLowerCase("en-US")==="template",En=xt.kind.toLocaleLowerCase("en-US")==="location",on=xt.kind.toLocaleLowerCase("en-US")==="group",Sn=(0,m.hF)(xt,h.cz,{kind:"system"}),An=(0,m.hF)(xt,h.cz,{kind:"component"}),rt=(0,m.hF)(xt,h.cz,{kind:"domain"}),_t=(0,m.hF)(xt,h.S4);let Mt;try{Mt=(0,h.CV)(xt)}catch{Mt=void 0}return(0,r.jsxs)(Z.Z,{container:!0,children:[(0,r.jsx)(Qe,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(W.SA,{className:wn.description,content:((pt=xt)===null||pt===void 0||(ut=pt.metadata)===null||ut===void 0?void 0:ut.description)||"No description"})}),(0,r.jsx)(Qe,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:_t.length>0&&(0,r.jsx)(m.rI,{entityRefs:_t,defaultKind:"group"})}),(fn||rt.length>0)&&(0,r.jsx)(Qe,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:rt.length>0&&(0,r.jsx)(m.rI,{entityRefs:rt,defaultKind:"domain"})}),(hn||jn||pn||Sn.length>0)&&(0,r.jsx)(Qe,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Sn.length>0&&(0,r.jsx)(m.rI,{entityRefs:Sn,defaultKind:"system"})}),jn&&An.length>0&&(0,r.jsx)(Qe,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(m.rI,{entityRefs:An,defaultKind:"component"})}),(hn||jn||pn||xn||on||En||typeof((Vt=xt)===null||Vt===void 0||(ht=Vt.spec)===null||ht===void 0?void 0:ht.type)=="string")&&(0,r.jsx)(Qe,{label:"Type",value:(be=xt)===null||be===void 0||(Jt=be.spec)===null||Jt===void 0?void 0:Jt.type,gridSizes:{xs:12,sm:6,lg:4}}),(hn||jn||typeof((Ye=xt)===null||Ye===void 0||(Me=Ye.spec)===null||Me===void 0?void 0:Me.lifecycle)=="string")&&(0,r.jsx)(Qe,{label:"Lifecycle",value:(st=xt)===null||st===void 0||(ft=st.spec)===null||ft===void 0?void 0:ft.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(Qe,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:(((gt=xt)===null||gt===void 0||(nt=gt.metadata)===null||nt===void 0?void 0:nt.tags)||[]).map(_e=>(0,r.jsx)(xe.Z,{size:"small",label:_e},_e))}),En&&(((Xe=xt)===null||Xe===void 0||(ot=Xe.spec)===null||ot===void 0?void 0:ot.targets)||((vt=xt)===null||vt===void 0||(yt=vt.spec)===null||yt===void 0?void 0:yt.target))&&(0,r.jsx)(Qe,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(St.s,{cols:1,items:(xt.spec.targets||[xt.spec.target]).map(_e=>_e).map(_e=>{var Pn,dn;return{text:_e,href:Wt(_e,((dn=xt)===null||dn===void 0||(Pn=dn.spec)===null||Pn===void 0?void 0:Pn.type)||"unknown",Mt)}})})})]})}const Dt=(0,z.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function Xt(ct){var ut,pt,ht,Vt,Jt,be,Me;const{variant:Ye}=ct,ft=(0,f.qD)(),st=Dt(),{entity:nt}=(0,m.X2)(),gt=(0,f.h_)(V.q3),ot=(0,f.h_)(m.Ah),Xe=(0,f.h_)(f.$v),yt=(0,f.h_)(f.VE),vt=(0,f.tg)(I.jU),xt=(0,f.tg)(I.ql),wn=(0,m.CV)(nt,gt),fn=(ut=nt.metadata.annotations)===null||ut===void 0?void 0:ut[h.Tf],pn={label:"View Source",disabled:!wn,icon:(0,r.jsx)(V.nW,{type:(pt=wn)===null||pt===void 0?void 0:pt.integrationType}),href:(ht=wn)===null||ht===void 0?void 0:ht.locationTargetUrl},jn={label:"View TechDocs",disabled:!(!((Vt=nt.metadata.annotations)===null||Vt===void 0)&&Vt["backstage.io/techdocs-ref"])||!vt,icon:(0,r.jsx)(K.Z,{}),href:vt&&vt({namespace:nt.metadata.namespace||h.zG,kind:nt.kind,name:nt.metadata.name})},hn=[pn,jn];if(le(nt)){var xn;const _t=(xn=ft.getSystemIcon("scaffolder"))!==null&&xn!==void 0?xn:ne.Z,Mt={label:"Launch Template",icon:(0,r.jsx)(_t,{}),disabled:!xt,href:xt&&xt({templateName:nt.metadata.name,namespace:nt.metadata.namespace||h.zG})};hn.push(Mt)}let En="";Ye==="gridItem"?En=st.gridItemCard:Ye==="fullHeight"&&(En=st.fullHeightCard);let on="";Ye==="gridItem"?on=st.gridItemCardContent:Ye==="fullHeight"&&(on=st.fullHeightCardContent);const Sn=(Jt=nt.metadata.annotations)===null||Jt===void 0?void 0:Jt[h.P1],An=((be=Sn)===null||be===void 0?void 0:be.startsWith("url:"))||((Me=Sn)===null||Me===void 0?void 0:Me.startsWith("file:")),rt=(0,w.useCallback)(async()=>{try{await ot.refreshEntity((0,h.eE)(nt)),Xe.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(_t){yt.post(_t)}},[ot,Xe,yt,nt]);return(0,r.jsxs)(de.Z,{className:En,children:[(0,r.jsx)(D.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[An&&(0,r.jsx)(A.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:rt,children:(0,r.jsx)(X.Z,{})}),(0,r.jsx)(A.Z,{component:W.rU,"aria-label":"Edit",disabled:!fn,title:"Edit Metadata",to:fn!=null?fn:"#",children:(0,r.jsx)(R.Z,{})})]}),subheader:(0,r.jsx)(W.M6,{links:hn})}),(0,r.jsx)(se.Z,{}),(0,r.jsx)(ie.Z,{className:on,children:(0,r.jsx)(kt,{entity:nt})})]})}},86359:function(Pt,Le,n){"use strict";n.d(Le,{E:function(){return K}});var r=n(52322),h=n(25271),W=n(53974),f=n(39709),V=n(90436),m=n(15459),p=n(27604),F=n(2997),ye=n(11640),le=n(28347),z=n(76635),de=n(2784),D=n(7089);const A=Object.freeze({createNameColumn(R){function w(I){var Z,xe;return((Z=I.metadata)===null||Z===void 0?void 0:Z.title)||(0,f.$3)(I,{defaultKind:(xe=R)===null||xe===void 0?void 0:xe.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:I},{entity:Z}){return w(I).localeCompare(w(Z))},render:({entity:I})=>{var Z,xe;return(0,r.jsx)(f.dx,{entityRef:I,defaultKind:((Z=R)===null||Z===void 0?void 0:Z.defaultKind)||"Component",title:(xe=I.metadata)===null||xe===void 0?void 0:xe.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:R})=>(0,r.jsx)(f.rI,{entityRefs:R.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:R})=>(0,r.jsx)(f.rI,{entityRefs:R.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:R})=>{var w,I,Z,xe;return(0,r.jsx)(r.Fragment,{children:(((I=R)===null||I===void 0||(w=I.spec)===null||w===void 0?void 0:w.targets)||((xe=R)===null||xe===void 0||(Z=xe.spec)===null||Z===void 0?void 0:Z.target))&&(0,r.jsx)(W.Or,{text:(R.spec.targets||[R.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:R})=>(0,r.jsx)(W.Or,{text:R.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:R})=>(0,r.jsx)(r.Fragment,{children:R.metadata.tags&&R.metadata.tags.map(w=>(0,r.jsx)(D.Z,{label:w,size:"small",variant:"outlined",style:{marginBottom:"0px"}},w))}),width:"auto"}},createTitleColumn(R){var w;return{title:"Title",field:"entity.metadata.title",hidden:(w=R)===null||w===void 0?void 0:w.hidden,searchable:!0}},createLabelColumn(R,w){var I;return{title:((I=w)===null||I===void 0?void 0:I.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:Z})=>{var xe,Ce;const B=(xe=Z.metadata)===null||xe===void 0?void 0:xe.labels,Qe=B&&B[R]||((Ce=w)===null||Ce===void 0?void 0:Ce.defaultValue);return(0,r.jsx)(r.Fragment,{children:Qe&&(0,r.jsx)(D.Z,{label:Qe,size:"small",variant:"outlined"},Qe)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var se=n(19928),ie=n.n(se);const ne=(0,m.Z)({root:{color:"#f3ba37"}})(ye.Z),X=(R,w)=>{const I=Z=>Z.metadata.title||(0,f.$3)(Z,{defaultKind:"Component"});return I(R).localeCompare(I(w))},K=R=>{var w,I,Z,xe;const{columns:Ce,actions:B,tableOptions:Qe,subtitle:St,emptyContent:Nt}=R,{isStarredEntity:Wt,toggleStarredEntity:kt}=(0,f.CR)(),{loading:Dt,error:Xt,entities:ct,filters:ut}=(0,f.wp)(),pt=(0,de.useMemo)(()=>{var ot;return[A.createTitleColumn({hidden:!0}),A.createNameColumn({defaultKind:(ot=ut.kind)===null||ot===void 0?void 0:ot.value}),...Xe(),A.createMetadataDescriptionColumn(),A.createTagsColumn()];function Xe(){var yt;const vt=[A.createSystemColumn(),A.createOwnerColumn(),A.createSpecTypeColumn(),A.createSpecLifecycleColumn()];switch((yt=ut.kind)===null||yt===void 0?void 0:yt.value){case"user":return[];case"domain":case"system":return[A.createOwnerColumn()];case"group":case"template":return[A.createSpecTypeColumn()];case"location":return[A.createSpecTypeColumn(),A.createSpecTargetsColumn()];default:return ct.every(xt=>xt.metadata.namespace==="default")?vt:[...vt,A.createNamespaceColumn()]}}},[(w=ut.kind)===null||w===void 0?void 0:w.value,ct]),ht=ut.type===void 0;var Vt;const Jt=(0,z.capitalize)((Vt=(I=ut.user)===null||I===void 0?void 0:I.value)!==null&&Vt!==void 0?Vt:"all");if(Xt)return(0,r.jsx)("div",{children:(0,r.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(W.Oi,{language:"text",text:Xt.toString()})})});const be=[({entity:ot})=>{var Xe;const yt=(Xe=ot.metadata.annotations)===null||Xe===void 0?void 0:Xe[h.l2],vt="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:vt}),(0,r.jsx)(F.Z,{fontSize:"small"})]}),tooltip:vt,disabled:!yt,onClick:()=>{yt&&window.open(yt,"_blank")}}},({entity:ot})=>{var Xe;const yt=(Xe=ot.metadata.annotations)===null||Xe===void 0?void 0:Xe[h.Tf],vt="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:vt}),(0,r.jsx)(p.Z,{fontSize:"small"})]}),tooltip:vt,disabled:!yt,onClick:()=>{yt&&window.open(yt,"_blank")}}},({entity:ot})=>{const Xe=Wt(ot),yt=Xe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"srOnly",children:yt}),Xe?(0,r.jsx)(ne,{}):(0,r.jsx)(le.Z,{})]}),tooltip:yt,onClick:()=>kt(ot)}}],Me=ct.sort(X).map(ot=>{const Xe=(0,f.hF)(ot,h.cz,{kind:"system"}),yt=(0,f.hF)(ot,h.S4);return{entity:ot,resolved:{name:(0,f.$3)(ot,{defaultKind:"Component"}),ownedByRelationsTitle:yt.map(vt=>(0,f.$3)(vt,{defaultKind:"group"})).join(", "),ownedByRelations:yt,partOfSystemRelationTitle:Xe.map(vt=>(0,f.$3)(vt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Xe}}}),Ye=(Ce||pt).find(ot=>ot.title==="Type");Ye&&(Ye.hidden=!ht);const ft=Me.length>20,st=((Z=ut.kind)===null||Z===void 0?void 0:Z.value)||"",nt=((xe=ut.type)===null||xe===void 0?void 0:xe.value)||"",gt=[Jt,nt,ie()(st)].filter(ot=>ot).join(" ");return(0,r.jsx)(W.iA,{isLoading:Dt,columns:Ce||pt,options:{paging:ft,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Dt,padding:"dense",pageSizeOptions:[20,50,100],...Qe},title:`${gt} (${ct.length})`,data:Me,actions:B||be,subtitle:St,emptyContent:Nt})};K.columns=A},85877:function(Pt,Le,n){"use strict";n.r(Le),n.d(Le,{EntityLabelsCard:function(){return de},hasLabels:function(){return D}});var r=n(52322),h=n(39709),W=n(2784),f=n(53974),V=n(79692),m=n(90436),p=n(77277);const F=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,ye=(0,V.Z)(A=>({code:{borderRadius:6,margin:A.spacing(2,0),background:A.palette.type==="dark"?"#444":A.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function le(){const A=ye();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Z,{variant:"body1",children:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:"}),(0,r.jsx)("div",{className:A.code,children:(0,r.jsx)(f.Oi,{text:F,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(p.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const z=(0,V.Z)(A=>({key:{fontWeight:"bold"}})),de=A=>{var se,ie;const{variant:ne,title:X}=A,{entity:K}=(0,h.X2)(),R=z(),w=[{render:Z=>(0,r.jsx)(m.Z,{className:R.key,variant:"body2",children:Z.key})},{field:"value"}],I=(ie=K)===null||ie===void 0||(se=ie.metadata)===null||se===void 0?void 0:se.labels;return(0,r.jsx)(f.rJ,{title:X||"Labels",variant:ne,children:!I||Object.keys(I).length===0?(0,r.jsx)(le,{}):(0,r.jsx)(f.iA,{columns:w,data:Object.keys(I).map(Z=>({key:Z,value:I[Z]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(I).length>5}})})};function D(A){var se,ie,ne,X;return!((ie=A)===null||ie===void 0||(se=ie.metadata)===null||se===void 0)&&se.labels?Object.keys((X=A)===null||X===void 0||(ne=X.metadata)===null||ne===void 0?void 0:ne.labels).some(Boolean):!1}},24851:function(Pt,Le,n){"use strict";n.d(Le,{s:function(){return se}});var r=n(52322),h=n(90348),W=n(11861),f=n(2784),V=n(79692),m=n(95544),p=n(90436),F=n(52160),ye=n(53974);const le=(0,V.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function z(ie){const{href:ne,text:X,Icon:K}=ie,R=le();return(0,r.jsxs)(m.Z,{display:"flex",children:[(0,r.jsx)(m.Z,{mr:1,className:R.svgIcon,children:(0,r.jsx)(p.Z,{component:"div",children:K?(0,r.jsx)(K,{}):(0,r.jsx)(F.Z,{})})}),(0,r.jsx)(m.Z,{flexGrow:"1",children:(0,r.jsx)(ye.rU,{to:ne,target:"_blank",rel:"noopener",children:X||ne})})]})}var de=n(41156);const D={xs:1,sm:1,md:1,lg:2,xl:3};function A(ie){const ne=[(0,de.Z)(I=>I.breakpoints.up("xl"))?"xl":null,(0,de.Z)(I=>I.breakpoints.up("lg"))?"lg":null,(0,de.Z)(I=>I.breakpoints.up("md"))?"md":null,(0,de.Z)(I=>I.breakpoints.up("sm"))?"sm":null,(0,de.Z)(I=>I.breakpoints.up("xs"))?"xs":null];let X=1;if(typeof ie=="number")X=ie;else{var K,R;const I=(R=ne.find(Z=>Z!==null))!==null&&R!==void 0?R:"xs";var w;X=(w=(K=ie)===null||K===void 0?void 0:K[I])!==null&&w!==void 0?w:D[I]}return X}function se(ie){const{items:ne,cols:X=void 0}=ie,K=A(X);return(0,r.jsx)(h.Z,{rowHeight:"auto",cols:K,children:ne.map(({text:R,href:w,Icon:I},Z)=>(0,r.jsx)(W.Z,{children:(0,r.jsx)(z,{href:w,text:R!=null?R:w,Icon:I})},Z))})}},19625:function(Pt,Le,n){"use strict";n.d(Le,{_Z:function(){return V},jU:function(){return W},ql:function(){return f},yw:function(){return h}});var r=n(60871);const h=(0,r.x8)({id:"create-component",optional:!0}),W=(0,r.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),f=(0,r.x8)({id:"create-from-template",optional:!0,params:["namespace","templateName"]}),V=(0,r.NT)({id:"catalog"})},15096:function(Pt,Le,n){"use strict";n.d(Le,{FA:function(){return ye},qO:function(){return pt},Nd:function(){return B},E5:function(){return ln},Rx:function(){return w}});var r=n(60871);const h=(0,r.T0)({id:"plugin.search.queryservice"});class W{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(te){_define_property(this,"mockedResults",void 0),this.mockedResults=te}}var f=n(52322),V=n(2784),m=n(38402),p=n(79692);const F=(0,p.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),ye=re=>{const{text:te,preTag:Y,postTag:v}=re,k=F(),M=(0,V.useMemo)(()=>te.split(new RegExp(`(${Y}.+?${v})`)),[v,Y,te]);return(0,f.jsx)(f.Fragment,{children:M.map((H,pe)=>H.includes(Y)?(0,f.jsx)("mark",{className:k.highlight,children:H.replace(new RegExp(`${Y}|${v}`,"g"),"")},pe):H)})};var le=n(50581),z=n(61837),de=n(86619),D=n(77277),A=n(21853),se=n(48760),ie=n(76635),ne=n(64279),X=n(1849),K=n(51837);const R=(0,K.CT)("search-context"),w=()=>{const re=(0,V.useContext)(R);if(!re)throw new Error("useSearch must be used within a SearchContextProvider");const te=re.atVersion(1);if(!te)throw new Error("No SearchContext v1 found");return te},I=()=>(0,V.useContext)(R)!==void 0,Z={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},xe=(re=Z)=>{var te,Y,v,k;const M=(0,r.h_)(h),[H,pe]=(0,V.useState)(re.term),[Se,Oe]=(0,V.useState)(re.types),[et,tt]=(0,V.useState)(re.filters),[bt,wt]=(0,V.useState)(re.pageLimit),[at,Be]=(0,V.useState)(re.pageCursor),Ct=(0,X.Z)(H),Yt=(0,X.Z)(et),Et=(0,ne.default)(()=>M.query({term:H,types:Se,filters:et,pageLimit:bt,pageCursor:at}),[H,Se,et,bt,at]),Ft=!Et.loading&&!Et.error&&((te=Et.value)===null||te===void 0?void 0:te.nextPageCursor),en=!Et.loading&&!Et.error&&((Y=Et.value)===null||Y===void 0?void 0:Y.previousPageCursor),Tn=(0,V.useCallback)(()=>{var Rt;Be((Rt=Et.value)===null||Rt===void 0?void 0:Rt.nextPageCursor)},[(v=Et.value)===null||v===void 0?void 0:v.nextPageCursor]),Zt=(0,V.useCallback)(()=>{var Rt;Be((Rt=Et.value)===null||Rt===void 0?void 0:Rt.previousPageCursor)},[(k=Et.value)===null||k===void 0?void 0:k.previousPageCursor]);return(0,V.useEffect)(()=>{Ct!==void 0&&H!==Ct&&Be(void 0)},[H,Ct,Be]),(0,V.useEffect)(()=>{Yt!==void 0&&!(0,ie.isEqual)(et,Yt)&&Be(void 0)},[et,Yt,Be]),{result:Et,term:H,setTerm:pe,types:Se,setTypes:Oe,filters:et,setFilters:tt,pageLimit:bt,setPageLimit:wt,pageCursor:at,setPageCursor:Be,fetchNextPage:Ft?Tn:void 0,fetchPreviousPage:en?Zt:void 0}},Ce=re=>{const{initialState:te,children:Y}=re,v=xe(te);return(0,f.jsx)(r.fC,{attributes:{searchTypes:v.types.sort().join(",")},children:(0,f.jsx)(R.Provider,{value:(0,K.EI)({1:v}),children:Y})})},B=re=>{const{initialState:te,inheritParentContextIfAvailable:Y,children:v}=re;return I()&&Y?(0,f.jsx)(f.Fragment,{children:v}):(0,f.jsx)(Ce,{initialState:te,children:v})},Qe=({children:re})=>{var te;const Y=et=>(0,X.Z)(et)!==et,v=(0,r.z$)(),{term:k,result:M}=w();var H;const pe=(H=(te=M.value)===null||te===void 0?void 0:te.numberOfResults)!==null&&H!==void 0?H:void 0,Oe=Y(M.loading)&&!M.loading;return(0,V.useEffect)(()=>{k&&Oe&&v.captureEvent("search",k,{value:pe})},[v,k,pe,Oe]),(0,f.jsx)(f.Fragment,{children:re})};function St(re){return(0,V.forwardRef)((te,Y)=>(0,f.jsx)(B,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(re,{...te,ref:Y})}))}const Nt=St((0,V.forwardRef)((re,te)=>{const{onChange:Y,onKeyDown:v=()=>{},onClear:k=()=>{},onSubmit:M=()=>{},debounceTime:H=200,clearButton:pe=!0,fullWidth:Se=!0,value:Oe,label:et,placeholder:tt,inputProps:bt={},InputProps:wt={},endAdornment:at,...Be}=re,Ct=(0,r.h_)(r.Ds),[Yt,Et]=(0,V.useState)("");(0,V.useEffect)(()=>{Et(qt=>qt!==Oe?String(Oe):qt)},[Oe]),(0,se.Z)(()=>Y(Yt),H,[Yt]);const Ft=(0,V.useCallback)(qt=>{Et(qt.target.value)},[Et]),en=(0,V.useCallback)(qt=>{v&&v(qt),M&&qt.key==="Enter"&&M()},[v,M]),Tn=(0,V.useCallback)(()=>{Y(""),k&&k()},[Y,k]),Zt=et?void 0:"Search",lt=tt!=null?tt:`Search in ${Ct.getOptionalString("app.title")||"Backstage"}`,Rt=(0,f.jsx)(le.Z,{position:"start",children:(0,f.jsx)(z.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,f.jsx)(A.Z,{})})}),Ht=(0,f.jsx)(le.Z,{position:"end",children:(0,f.jsx)(D.Z,{"aria-label":"Clear",size:"small",onClick:Tn,onKeyDown:qt=>{qt.key==="Enter"&&qt.stopPropagation()},children:"Clear"})});return(0,f.jsx)(Qe,{children:(0,f.jsx)(de.Z,{id:"search-bar-text-field","data-testid":"search-bar-next",variant:"outlined",margin:"normal",inputRef:te,value:Yt,label:et,placeholder:lt,InputProps:{startAdornment:Rt,endAdornment:pe?Ht:at,...wt},inputProps:{"aria-label":Zt,...bt},fullWidth:Se,onChange:Ft,onKeyDown:en,...Be})})})),Wt=St((0,V.forwardRef)((re,te)=>{const{value:Y="",onChange:v,...k}=re,{term:M,setTerm:H}=w();(0,V.useEffect)(()=>{Y&&H(String(Y))},[Y,H]);const pe=(0,V.useCallback)(Se=>{v?v(Se):H(Se)},[v,H]);return(0,f.jsx)(r.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,f.jsx)(Nt,{...k,ref:te,value:M,onChange:pe})})}));var kt=n(4614),Dt=n(88013);const Xt=(0,p.Z)(re=>({loading:{right:re.spacing(1),position:"absolute"}})),ct=re=>te=>(0,f.jsx)(B,{inheritParentContextIfAvailable:!0,children:(0,f.jsx)(re,{...te})}),ut=()=>{const re=Xt();return(0,f.jsx)(kt.Z,{className:re.loading,"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20})},pt=ct(function(te){const{loading:Y,value:v,onChange:k=()=>{},options:M=[],getOptionLabel:H=Ft=>String(Ft),inputPlaceholder:pe,inputDebounceTime:Se,freeSolo:Oe=!0,fullWidth:et=!0,clearOnBlur:tt=!1,"data-testid":bt="search-autocomplete",...wt}=te,{setTerm:at}=w(),Be=(0,V.useCallback)(Ft=>Ft?typeof Ft=="string"?Ft:H(Ft):"",[H]),Ct=(0,V.useMemo)(()=>Be(v),[v,Be]),Yt=(0,V.useCallback)((Ft,en,Tn,Zt)=>{at(Be(en)),k(Ft,en,Tn,Zt)},[Be,at,k]),Et=(0,V.useCallback)(({InputProps:{ref:Ft,className:en,endAdornment:Tn},InputLabelProps:Zt,...lt})=>(0,f.jsx)(Wt,{...lt,ref:Ft,clearButton:!1,value:Ct,placeholder:pe,debounceTime:Se,endAdornment:Y?(0,f.jsx)(ut,{}):Tn,InputProps:{className:en}}),[Y,Ct,pe,Se]);return(0,f.jsx)(Dt.ZP,{...wt,"data-testid":bt,value:v,onChange:Yt,options:M,getOptionLabel:H,renderInput:Et,freeSolo:Oe,fullWidth:et,clearOnBlur:tt})}),ht=re=>{const{icon:te,primaryText:Y,primaryTextTypographyProps:v,secondaryText:k,secondaryTextTypographyProps:M,disableTextTypography:H}=re;return _jsxs(_Fragment,{children:[te?_jsx(ListItemIcon,{children:te}):null,_jsx(ListItemText,{primary:Y,primaryTypographyProps:v,secondary:k,secondaryTypographyProps:M,disableTypography:H})]})};var Vt=n(42494),Jt=n(84899),be=n(5806),Me=n(21324),Ye=n(56939),ft=n(73698),st=n(12231),nt=n(90436),gt=n(7089),ot=n(69294);const Xe=(re,te,Y=[],v=250)=>{const k=(0,V.useRef)({}),M=re||(()=>Promise.resolve([])),[H,pe]=(0,ot.default)(M,[te],{loading:!0});if((0,se.Z)(()=>{k.current[te]===void 0&&(k.current[te]=pe(te).then(Oe=>(k.current[te]=Oe,Oe)))},v,[pe,te]),Y.length)return{loading:!1,value:Y};const Se=k.current[te];return Array.isArray(Se)?{loading:!1,value:Se}:H},yt=(re,te)=>{const{setFilters:Y}=w();(0,V.useEffect)(()=>{te&&[te].flat().length>0&&Y(v=>({...v,[re]:te}))},[])},vt=re=>{const{className:te,defaultValue:Y,name:v,values:k,valuesDebounceMs:M,label:H,filterSelectedOptions:pe,limitTags:Se,multiple:Oe}=re,[et,tt]=(0,V.useState)("");yt(v,Y);const bt=typeof k=="function"?k:void 0,wt=typeof k=="function"?void 0:k,{value:at,loading:Be}=Xe(bt,et,wt,M),{filters:Ct,setFilters:Yt}=w(),Et=Ct[v]||(Oe?[]:null),Ft=(Zt,lt)=>{Yt(Rt=>{const{[v]:Ht,...qt}=Rt;return lt?{...qt,[v]:lt}:{...qt}})},en=Zt=>(0,f.jsx)(de.Z,{...Zt,name:"search",variant:"outlined",label:H,fullWidth:!0}),Tn=(Zt,lt)=>Zt.map((Rt,Ht)=>(0,f.jsx)(gt.Z,{label:Rt,color:"primary",...lt({index:Ht})}));return(0,f.jsx)(Dt.ZP,{filterSelectedOptions:pe,limitTags:Se,multiple:Oe,className:te,id:`${Oe?"multi-":""}select-filter-${v}--select`,options:at||[],loading:Be,value:Et,onChange:Ft,onInputChange:(Zt,lt)=>tt(lt),renderInput:en,renderTags:Tn})},xt=(0,p.Z)({label:{textTransform:"capitalize"},checkboxWrapper:{display:"flex",alignItems:"center",width:"100%"},textWrapper:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),wn=re=>{const{className:te,defaultValue:Y,label:v,name:k,values:M=[],valuesDebounceMs:H}=re,pe=xt(),{filters:Se,setFilters:Oe}=w();yt(k,Y);const et=typeof M=="function"?M:void 0,tt=typeof M=="function"?void 0:M,{value:bt=[],loading:wt}=Xe(et,"",tt,H),at=Ct=>{const{target:{value:Yt,checked:Et}}=Ct;Oe(Ft=>{const{[k]:en,...Tn}=Ft,Zt=(en||[]).filter(Rt=>Rt!==Yt),lt=Et?[...Zt,Yt]:Zt;return lt.length?{...Tn,[k]:lt}:Tn})};var Be;return(0,f.jsxs)(Vt.Z,{className:te,disabled:wt,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[v?(0,f.jsx)(Jt.Z,{className:pe.label,children:v}):null,bt.map(Ct=>(0,f.jsx)(be.Z,{classes:{root:pe.checkboxWrapper,label:pe.textWrapper},label:Ct,control:(0,f.jsx)(Me.Z,{color:"primary",inputProps:{"aria-labelledby":Ct},value:Ct,name:Ct,onChange:at,checked:((Be=Se[k])!==null&&Be!==void 0?Be:[]).includes(Ct)})},Ct))]})},fn=re=>{const{className:te,defaultValue:Y,label:v,name:k,values:M,valuesDebounceMs:H}=re,pe=xt();yt(k,Y);const Se=typeof M=="function"?M:void 0,Oe=typeof M=="function"?void 0:M,{value:et=[],loading:tt}=Xe(Se,"",Oe,H),{filters:bt,setFilters:wt}=w(),at=Be=>{const{target:{value:Ct}}=Be;wt(Yt=>{const{[k]:Et,...Ft}=Yt;return Ct?{...Ft,[k]:Ct}:Ft})};return(0,f.jsxs)(Vt.Z,{disabled:tt,className:te,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[v?(0,f.jsx)(Ye.Z,{className:pe.label,margin:"dense",children:v}):null,(0,f.jsxs)(ft.Z,{variant:"outlined",value:bt[k]||"",onChange:at,children:[(0,f.jsx)(st.Z,{value:"",children:(0,f.jsx)("em",{children:"All"})}),et.map(Be=>(0,f.jsx)(st.Z,{value:Be,children:(0,f.jsx)(nt.Z,{variant:"inherit",noWrap:!0,children:Be})},Be))]})]})},pn=re=>{const{component:te,...Y}=re;return(0,f.jsx)(te,{...Y})};pn.Checkbox=re=>(0,f.jsx)(pn,{...re,component:wn}),pn.Select=re=>(0,f.jsx)(pn,{...re,component:fn}),pn.Autocomplete=re=>(0,f.jsx)(pn,{...re,component:vt});var jn=n(48834).lW;const hn=re=>jn.from(re.toString(),"utf-8").toString("base64"),xn=re=>re?Number(jn.from(re,"base64").toString("utf-8")):0,En=re=>{const{total:te=-1,cursor:Y,hasNextPage:v,onCursorChange:k,limit:M=25,limitLabel:H="Results per page:",limitText:pe=({from:at,to:Be})=>te>0?`of ${te}`:`${at}-${Be}`,limitOptions:Se,onLimitChange:Oe,...et}=re,tt=useMemo(()=>xn(Y),[Y]),bt=useCallback((at,Be)=>{var Ct;(Ct=k)===null||Ct===void 0||Ct(hn(Be))},[k]),wt=useCallback(at=>{var Be;const Ct=at.target.value;(Be=Oe)===null||Be===void 0||Be(parseInt(Ct,10))},[Oe]);return _jsx(TablePagination,{...et,component:"div",count:te,page:tt,nextIconButtonProps:{...v!==void 0&&{disabled:!v}},onPageChange:bt,rowsPerPage:M,labelRowsPerPage:H,labelDisplayedRows:pe,rowsPerPageOptions:Se,onRowsPerPageChange:wt})},on=re=>{const{pageLimit:te,setPageLimit:Y,pageCursor:v,setPageCursor:k,fetchNextPage:M}=useSearch(),H=useCallback(pe=>{Y(pe),k(void 0)},[Y,k]);return _jsx(En,{...re,hasNextPage:!!M,limit:te,onLimitChange:H,cursor:v,onCursorChange:k})};var Sn=n(53974);const An=re=>{const{children:te}=re,Y=useSearch(),{result:v,...k}=Y;return te(v,k)},rt=re=>{const{query:te,children:Y}=re,v=useApi(searchApiRef),k=useAsync(()=>{const{term:M="",types:H=[],filters:pe={},...Se}=te;return v.query({...Se,term:M,types:H,filters:pe})},[te]);return Y(k,te)},_t=re=>{const{query:te,children:Y}=re;return te?_jsx(rt,{query:te,children:Y}):_jsx(An,{children:Y})},Mt=re=>{const{query:te,children:Y,noResultsComponent:v=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...k}=re;return _jsx(_t,{query:te,children:({loading:M,error:H,value:pe})=>{var Se;return M?_jsx(Progress,{}):H?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:H}):!((Se=pe)===null||Se===void 0)&&Se.results.length?isFunction(Y)?Y(pe):_jsx(SearchResultListItemExtensions,{...k,results:pe.results,children:Y}):v}})},_e=re=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(Mt,{...re})}),Pn=({result:re,highlight:te,icon:Y,secondaryAction:v,lineClamp:k=5})=>{var M,H,pe,Se,Oe;return re?_jsxs(_Fragment,{children:[Y&&_jsx(ListItemIcon,{children:Y}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:re.location,children:!((M=te)===null||M===void 0)&&M.fields.title?_jsx(HighlightedSearchResultText,{text:((H=te)===null||H===void 0?void 0:H.fields.title)||"",preTag:((pe=te)===null||pe===void 0?void 0:pe.preTag)||"",postTag:((Se=te)===null||Se===void 0?void 0:Se.postTag)||""}):re.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:k,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((Oe=te)===null||Oe===void 0)&&Oe.fields.text?_jsx(HighlightedSearchResultText,{text:te.fields.text,preTag:te.preTag,postTag:te.postTag}):re.text})}),v&&_jsx(Box,{alignItems:"flex-end",children:v})]}):null},dn=re=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(Pn,{...re})}),$n=re=>{var te;const{error:Y,loading:v,resultItems:k,renderResultItem:M=Oe=>_jsx(DefaultResultListItem,{result:Oe.document},Oe.document.location),disableRenderingWithNoResults:H,noResultsComponent:pe=H?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Se}=re;return v?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):!((te=k)===null||te===void 0)&&te.length?_jsx(List,{...Se,children:k.map(M)}):_jsx(_Fragment,{children:pe})},Cn=re=>{const{query:te,renderResultItem:Y,children:v,...k}=re,M=useSearchResultListItemExtensions(v);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:te,children:({loading:H,error:pe,value:Se})=>{var Oe;return _jsx($n,{...k,error:pe,loading:H,resultItems:(Oe=Se)===null||Oe===void 0?void 0:Oe.results,renderResultItem:Y!=null?Y:M})}})})};var Un=n(19126);const qn=(0,p.Z)(re=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:re.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:re.palette.text.secondary,margin:re.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:re.palette.text.secondary,margin:re.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:re.spacing(.5)}})),Ln=re=>{const te=qn(),{label:Y,children:v,...k}=re;return _jsx(Chip,{...k,className:te.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[Y,": ",v]})})},zn=()=>null,we=(0,p.Z)(re=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:re.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:re.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),he=re=>{const te=we(),{label:Y,value:v="None",onChange:k,onDelete:M}=re,H=useCallback(pe=>{k(pe.target.value)},[k]);return _jsx(Ln,{label:Y,onDelete:M,children:_jsx(Typography,{role:"textbox",component:"span",className:te.root,onChange:H,contentEditable:!0,suppressContentEditableWarning:!0,children:v})})},Pe=(0,p.Z)(re=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:re.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),G=re=>{const te=Pe(),{label:Y,value:v="none",onChange:k,onDelete:M,children:H}=re,pe=useCallback(Se=>{k(Se.target.value)},[k]);return _jsx(Ln,{label:Y,onDelete:M,children:_jsxs(Select,{className:te.root,value:v,onChange:pe,input:_jsx(InputBase,{}),IconComponent:zn,children:[_jsx(MenuItem,{value:"none",children:"None"}),H]})})};function N(re){var te,Y;const v=qn(),[k,M]=useState(null),{error:H,loading:pe,icon:Se,title:Oe,titleProps:et={},link:tt=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:v.listSubheaderLinkIcon})]}),linkProps:bt={},filterOptions:wt,renderFilterOption:at=Ht=>_jsx(MenuItem,{value:String(Ht),children:Ht},String(Ht)),filterFields:Be,renderFilterField:Ct,resultItems:Yt,renderResultItem:Et=Ht=>_jsx(DefaultResultListItem,{result:Ht.document},Ht.document.location),disableRenderingWithNoResults:Ft,noResultsComponent:en=Ft?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Tn}=re,Zt=useCallback(Ht=>{M(Ht.currentTarget)},[]),lt=useCallback(()=>{M(null)},[]);if(pe)return _jsx(Progress,{});if(H)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:H});if(!(!((te=Yt)===null||te===void 0)&&te.length))return _jsx(_Fragment,{children:en});var Rt;return _jsxs(List,{...Tn,children:[_jsxs(ListSubheader,{className:v.listSubheader,children:[Se,_jsx(Typography,{className:v.listSubheaderName,component:"strong",...et,children:Oe}),wt?_jsx(Chip,{className:v.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Zt}):null,wt?_jsx(Menu,{id:"filters-menu",anchorEl:k,open:Boolean(k),onClose:lt,onClick:lt,keepMounted:!0,children:wt.map(at)}):null,(Y=Be)===null||Y===void 0?void 0:Y.map(Ht=>{var qt;return(Rt=(qt=Ct)===null||qt===void 0?void 0:qt(Ht))!==null&&Rt!==void 0?Rt:null}),_jsx(Link,{className:v.listSubheaderLink,to:"/search",...bt,children:tt})]}),Yt.map(Et)]})}function ce(re){const{query:te,children:Y,renderResultItem:v,linkProps:k={},...M}=re,H=useSearchResultListItemExtensions(Y);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:te,children:({loading:pe,error:Se,value:Oe},{term:et,types:tt,pageCursor:bt,filters:wt={}})=>{var at;const Be=`/search?${qs.stringify({term:et,types:tt,filters:wt,pageCursor:bt,query:et},{arrayFormat:"brackets"})}`;return _jsx(N,{...M,error:Se,loading:pe,linkProps:{to:Be,...k},filterFields:Object.keys(wt),resultItems:(at=Oe)===null||at===void 0?void 0:at.results,renderResultItem:v!=null?v:H})}})})}const Ee=(0,p.Z)(re=>({root:{display:"flex",justifyContent:"space-between",gap:re.spacing(2),margin:re.spacing(2,0)}})),Ue=()=>{const{fetchNextPage:re,fetchPreviousPage:te}=useSearch(),Y=Ee();return!re&&!te?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:Y.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!te,onClick:te,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!re,onClick:re,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},qe="search.results.list.items.extensions.v1",Tt=(re,te)=>{for(const v of re){var Y;if(!(!isValidElement(v)||!(!((Y=getComponentData(v,qe))===null||Y===void 0)&&Y(te))))return cloneElement(v,{rank:te.rank,highlight:te.highlight,result:te.document,...v.props})}return null},$t=re=>{const{rank:te,result:Y,noTrack:v,children:k,alignItems:M="flex-start",...H}=re,pe=(0,r.z$)(),Se=(0,V.useCallback)(()=>{v||Y&&pe.captureEvent("discover",Y.title,{attributes:{to:Y.location},value:te})},[te,Y,v,pe]);return(0,f.jsx)(m.Z,{divider:!0,alignItems:M,onClickCapture:Se,...H,children:k})},ln=re=>{const{name:te,component:Y,predicate:v=()=>!0}=re;return(0,r.YO)({name:te,component:{lazy:()=>Y().then(k=>M=>(0,f.jsx)($t,{rank:M.rank,result:M.result,noTrack:M.noTrack,children:(0,V.createElement)(k,M)}))},data:{[qe]:v}})},sn=re=>{const te=useElementFilter(re,Y=>Y.selectByComponentData({key:qe}).getElements(),[re]);return useCallback((Y,v)=>{const k=Tt(te,Y);return _jsx(Fragment,{children:k!=null?k:_jsx($t,{rank:Y.rank,result:Y.document,children:_jsx(DefaultResultListItem,{rank:Y.rank,highlight:Y.highlight,result:Y.document})})},v)},[te])},nn=re=>{const{results:te,children:Y,...v}=re,k=sn(Y);return _jsx(List,{...v,children:te.map(k)})}},61886:function(Pt,Le,n){"use strict";n.d(Le,{Ox:function(){return kt},jM:function(){return V},Zz:function(){return m},oZ:function(){return B},DR:function(){return p},ZS:function(){return xe},VA:function(){return ct},KY:function(){return ye},gT:function(){return A},Dl:function(){return se},ux:function(){return Xt},$L:function(){return D},x1:function(){return Ce}});var r=n(52322),h=n(2784),W=n(73557),f=n(60871);const V="techdocs.addons.addon.v1",m="techdocs.addons.wrapper.v1",p=()=>null;(0,f.R5)(p,m,!0);const F=be=>`${V}.${be.toLocaleLowerCase("en-US")}`;function ye(be){const{name:Me,component:Ye}=be;return(0,f.YO)({name:Me,component:{sync:ft=>(0,r.jsx)(Ye,{...ft})},data:{[V]:be,[F(Me)]:!0}})}const le=(be,Me)=>be.selectByComponentData({key:Me}).getElements()[0],z=be=>be.selectByComponentData({key:m}).selectByComponentData({key:V}),de=be=>be.selectByComponentData({key:m}).findComponentData({key:V}),D=()=>{const be=(0,W.pC)(),Me=(0,f.vJ)(be,z),Ye=(0,f.vJ)(be,de),ft=(0,h.useCallback)(gt=>{if(!Me||!gt)return null;const ot=F(gt.name);var Xe;return(Xe=le(Me,ot))!==null&&Xe!==void 0?Xe:null},[Me]),st=(0,h.useCallback)(gt=>{const ot=Ye.find(Xe=>Xe.name===gt);return ot?ft(ot):null},[Ye,ft]),nt=(0,h.useCallback)(gt=>{const ot=Ye.filter(Xe=>Xe.location===gt);return ot.length?ot.map(ft):null},[Ye,ft]);return{renderComponentByName:st,renderComponentsByLocation:nt}},A=(0,f.T0)({id:"plugin.techdocs.service"}),se=(0,f.T0)({id:"plugin.techdocs.storageservice"});var ie=n(64279),ne=n(77446),X=n(25271),K=n(51837);function R(be,Me){return Me.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(be.kind=be.kind.toLocaleLowerCase(),be.name=be.name.toLocaleLowerCase(),be.namespace=be.namespace.toLocaleLowerCase()),be}const w=(be,Me)=>(0,X.eE)(be)===(0,X.eE)(Me),I={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},Z=(0,K.CT)("techdocs-reader-page-context"),xe=(0,h.memo)(be=>{const{entityRef:Me,children:Ye}=be,ft=(0,f.h_)(A),st=(0,f.h_)(f.Ds),nt=(0,ie.default)(async()=>ft.getEntityMetadata(Me),[Me]),gt=(0,ne.Z)(async()=>ft.getTechDocsMetadata(Me),[Me]),[ot,Xe]=(0,h.useState)(I.title),[yt,vt]=(0,h.useState)(I.subtitle),[xt,wn]=(0,h.useState)(I.shadowRoot);(0,h.useEffect)(()=>{xt&&!gt.value&&!gt.loading&>.retry()},[gt.value,gt.loading,xt,gt.retry,gt]);const fn={metadata:gt,entityRef:R(Me,st),entityMetadata:nt,shadowRoot:xt,setShadowRoot:wn,title:ot,setTitle:Xe,subtitle:yt,setSubtitle:vt},pn=(0,K.EI)({1:fn});return(0,r.jsx)(f.fC,{attributes:{entityRef:(0,X.eE)(Me)},children:(0,r.jsx)(Z.Provider,{value:pn,children:Ye instanceof Function?Ye(fn):Ye})})},(be,Me)=>w(be.entityRef,Me.entityRef)),Ce=()=>{const be=(0,h.useContext)(Z);if(be===void 0)return I;const Me=be.atVersion(1);if(Me===void 0)throw new Error("No context found for version 1.");return Me},B=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var Qe=n(70882),St=n(50236),Nt=n(19219),Wt=n(53974);const kt="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",Dt=be=>{(0,h.useEffect)(()=>{var Me,Ye;if(!be)return()=>{};const ft=be.querySelectorAll('head > link[rel="stylesheet"]');var st;let nt=(st=(Me=ft)===null||Me===void 0?void 0:Me.length)!==null&&st!==void 0?st:0;const gt=new CustomEvent(kt);if(!nt)return be.dispatchEvent(gt),()=>{};const ot=()=>{--nt===0&&be.dispatchEvent(gt)};return(Ye=ft)===null||Ye===void 0||Ye.forEach(Xe=>{Xe.addEventListener("load",ot)}),()=>{var Xe;(Xe=ft)===null||Xe===void 0||Xe.forEach(yt=>{yt.removeEventListener("load",ot)})}},[be])},Xt=be=>{const[Me,Ye]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{if(!be)return()=>{};Ye(!0);const ft=be.style;ft.setProperty("opacity","0");const st=()=>{Ye(!1),ft.setProperty("opacity","1")};return be.addEventListener(kt,st),()=>{be.removeEventListener(kt,st)}},[be]),Me},ct=be=>{const{element:Me,onAppend:Ye,children:ft}=be,[st,nt]=(0,h.useState)((0,Qe.Ue)({...(0,St.Z)(),insertionPoint:void 0}));Dt(Me);const gt=Xt(Me),ot=(0,h.useCallback)(Xe=>{if(!Me||!Xe)return;nt((0,Qe.Ue)({...(0,St.Z)(),insertionPoint:Me.querySelector("head")||void 0}));let yt=Xe.shadowRoot;yt||(yt=Xe.attachShadow({mode:"open"})),yt.replaceChildren(Me),typeof Ye=="function"&&Ye(yt)},[Me,Ye]);return(0,r.jsxs)(r.Fragment,{children:[gt&&(0,r.jsx)(Wt.Ex,{}),(0,r.jsxs)(Nt.ZP,{jss:st,sheetsManager:new Map,children:[(0,r.jsx)("div",{ref:ot,"data-testid":"techdocs-native-shadowroot"}),ft]})]})};var ut=n(54073);const pt=()=>{const{shadowRoot:be}=useTechDocsReaderPage();return be},ht=be=>{const Me=pt();return Me?be.map(Ye=>{var ft;return(ft=Me)===null||ft===void 0?void 0:ft.querySelectorAll(Ye)}).filter(Ye=>Ye.length).map(Ye=>Array.from(Ye)).flat():[]},Vt=be=>be.toString()&&be.rangeCount&&be.getRangeAt(0).getBoundingClientRect().top,Jt=(be=0)=>{const Me=pt(),[Ye,ft]=useState(null),st=useMemo(()=>debounce(()=>{const nt=Me,gt=nt.getSelection?nt.getSelection():document.getSelection();gt&&Vt(gt)?ft(gt):ft(null)},be),[Me,ft,be]);return useEffect(()=>(window.document.addEventListener("selectionchange",st),()=>{st.cancel(),window.document.removeEventListener("selectionchange",st)}),[st]),Ye}},52943:function(Pt,Le,n){"use strict";n.r(Le),n.d(Le,{EmbeddedDocsRouter:function(){return ie},Router:function(){return se},isTechDocsAvailable:function(){return A}});var r=n(52322),h=n(2784),W=n(73557),f=n(39709),V=n(53974),m=n(25271),p=n(89258),F=n(65124),ye=n(86317);const le=({entity:ne})=>{const X=(0,m.iB)(ne);return(0,r.jsxs)(p.I6,{entityRef:X,children:[(0,r.jsx)(F.b,{}),(0,r.jsx)(ye.F,{withSearch:!1})]})};var z=n(18662),de=n(7476);const D="backstage.io/techdocs-ref",A=ne=>{var X,K,R;return Boolean((R=ne)===null||R===void 0||(K=R.metadata)===null||K===void 0||(X=K.annotations)===null||X===void 0?void 0:X[D])},se=()=>(0,r.jsxs)(W.Z5,{children:[(0,r.jsx)(W.AW,{path:"/",element:(0,r.jsx)(z.TechDocsIndexPage,{})}),(0,r.jsx)(W.AW,{path:"/:namespace/:kind/:name/*",element:(0,r.jsx)(de.TechDocsReaderPage,{})})]}),ie=ne=>{var X;const{children:K}=ne,{entity:R}=(0,f.X2)(),w=(0,W.V$)([{path:"/*",element:(0,r.jsx)(le,{entity:R}),children:[{path:"*",element:K}]}]);return((X=R.metadata.annotations)===null||X===void 0?void 0:X[D])?w:(0,r.jsx)(V.sk,{annotation:D})}},92077:function(Pt,Le,n){"use strict";n.d(Le,{k:function(){return m},p:function(){return V}});var r=n(87612),h=n(23054),W=n(54847),f=n.n(W);class V{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(F){const{kind:ye,namespace:le,name:z}=F,D=`${await this.getApiOrigin()}/metadata/techdocs/${le}/${ye}/${z}`,A=await this.fetchApi.fetch(`${D}`);if(!A.ok)throw await h.VL.fromResponse(A);return await A.json()}async getEntityMetadata(F){const{kind:ye,namespace:le,name:z}=F,D=`${await this.getApiOrigin()}/metadata/entity/${le}/${ye}/${z}`,A=await this.fetchApi.fetch(`${D}`);if(!A.ok)throw await h.VL.fromResponse(A);return await A.json()}constructor(F){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=F.configApi,this.discoveryApi=F.discoveryApi,this.fetchApi=F.fetchApi}}class m{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var F;return(F=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&F!==void 0?F:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(F,ye){const{kind:le,namespace:z,name:de}=F,A=`${await this.getStorageUrl()}/${z}/${le}/${de}/${ye}`,se=await this.fetchApi.fetch(`${A.endsWith("/")?A:`${A}/`}index.html`);let ie="";switch(se.status){case 404:throw ie="Page not found. ",ye||(ie+="This could be because there is no index.md file in the root of the docs directory of this repository."),new h.dR(ie);case 500:throw ie="Could not generate documentation or an error in the TechDocs backend. ",new Error(ie);default:break}return se.text()}async syncEntityDocs(F,ye=()=>{}){const{kind:le,namespace:z,name:de}=F,A=`${await this.getApiOrigin()}/sync/${z}/${le}/${de}`,{token:se}=await this.identityApi.getCredentials();return new Promise((ie,ne)=>{const X=new W.EventSourcePolyfill(A,{withCredentials:!0,headers:se?{Authorization:`Bearer ${se}`}:{}});X.addEventListener("log",K=>{K.data&&ye(JSON.parse(K.data))}),X.addEventListener("finish",K=>{let R=!1;K.data&&({updated:R}=JSON.parse(K.data)),ie(R?"updated":"cached")}),X.onerror=K=>{switch(X.close(),K.status){case 404:ne(new h.dR(K.message));return;default:ne(new Error(K.data));return}}})}async getBaseUrl(F,ye,le){const{kind:z,namespace:de,name:D}=ye,se=`${await this.getApiOrigin()}/static/docs/${de}/${z}/${D}/${le}`;return new URL(F,se.endsWith("/")?se:`${se}/`).toString()}constructor(F){(0,r._)(this,"configApi",void 0),(0,r._)(this,"discoveryApi",void 0),(0,r._)(this,"identityApi",void 0),(0,r._)(this,"fetchApi",void 0),this.configApi=F.configApi,this.discoveryApi=F.discoveryApi,this.identityApi=F.identityApi,this.fetchApi=F.fetchApi}}},51953:function(Pt,Le,n){"use strict";n.d(Le,{D:function(){return r}});function r(h,W){return W.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?h:h.toLocaleLowerCase("en-US")}},3482:function(Pt,Le,n){"use strict";n.d(Le,{u:function(){return F}});var r=n(52322),h=n(2784),W=n(53974),f=n(39709),V=n(42081),m=n(48431),p=n(68435);const F=ye=>{const{initialFilter:le="owned",columns:z,actions:de}=ye;return(0,r.jsx)(V.j,{children:(0,r.jsxs)(W.VY,{children:[(0,r.jsx)(W.yW,{title:"",children:(0,r.jsx)(W.qt,{children:"Discover documentation in your ecosystem."})}),(0,r.jsx)(f.UO,{children:(0,r.jsxs)(f._i,{children:[(0,r.jsxs)(f._i.Filters,{children:[(0,r.jsx)(m.f,{}),(0,r.jsx)(f.EW,{initialFilter:le}),(0,r.jsx)(f.dq,{}),(0,r.jsx)(f.xE,{})]}),(0,r.jsx)(f._i.Content,{children:(0,r.jsx)(p.n,{actions:de,columns:z})})]})})]})})}},85478:function(Pt,Le,n){"use strict";n.d(Le,{f:function(){return z}});var r=n(52322),h=n(95573),W=n(51953),f=n(60871),V=n(53974),m=n(94339),p=n(16111),F=n(24579),ye=n(14503),le=n(2784);const z=ie=>{var ne;const{entities:X}=ie,K=(0,f.tg)(h.Fw),R=(0,f.h_)(f.Ds);if(!X)return null;var w,I;return(0,r.jsx)(V.Oh,{"data-testid":"docs-explore",children:!((ne=X)===null||ne===void 0)&&ne.length?X.map((Z,xe)=>(0,r.jsxs)(m.Z,{children:[(0,r.jsx)(p.Z,{children:(0,r.jsx)(V.hu,{title:(w=Z.metadata.title)!==null&&w!==void 0?w:Z.metadata.name})}),(0,r.jsx)(F.Z,{children:Z.metadata.description}),(0,r.jsx)(ye.Z,{children:(0,r.jsx)(V.Qj,{to:K({namespace:(0,W.D)((I=Z.metadata.namespace)!==null&&I!==void 0?I:"default",R),kind:(0,W.D)(Z.kind,R),name:(0,W.D)(Z.metadata.name,R)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},xe)):null})};var de=n(39709);const D={title:"All Documentation",filterPredicate:()=>!0},A=ie=>{const{entities:ne,group:X}=ie,{loading:K,isOwnedEntity:R}=useEntityOwnership(),w=ne.filter(Z=>X.filterPredicate==="ownedByUser"?K?!1:R(Z):typeof X.filterPredicate=="function"&&X.filterPredicate(Z)),I=(()=>typeof X.title=="string"?_jsx(ContentHeader,{title:X.title}):X.title)();return w.length===0?null:_jsxs(Content,{children:[I,_jsx(DocsCardGrid,{entities:w})]})},se=ie=>{const{loading:ne,error:X,entities:K}=useEntityList();if(X)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:X.toString()})});if(ne)return _jsx(Progress,{});if(K.length===0)return _jsx("div",{"data-testid":"doc-not-found",children:_jsxs(Typography,{variant:"body2",children:["No documentation found that match your filter. Learn more about"," ",_jsx(Link,{to:"https://backstage.io/docs/features/techdocs/creating-and-publishing",children:"publishing documentation"}),"."]})});var R,w;return K.sort((I,Z)=>((R=I.metadata.title)!==null&&R!==void 0?R:I.metadata.name).localeCompare((w=Z.metadata.title)!==null&&w!==void 0?w:Z.metadata.name)),_jsx(Content,{children:(ie.groups||[D]).map((I,Z)=>_jsx(A,{entities:K,group:I},`${I.title}-${Z}`))})}},68435:function(Pt,Le,n){"use strict";n.d(Le,{H:function(){return K},n:function(){return R}});var r=n(52322),h=n(2784),W=n(95074),f=n(76635),V=n(53974),m=n(39709),p=n(60871),F=n(25271),ye=n(95573),le=n(39981),z=n(2337),de=n(11640),D=n(28347);const A=(0,z.Z)({root:{color:"#f3ba37"}})(de.Z),se={createCopyDocsUrlAction(w){return I=>({icon:()=>(0,r.jsx)(le.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>w(`${window.location.origin}${I.resolved.docsUrl}`)})},createStarEntityAction(w,I){return Z=>{const xe=Z.entity,Ce=w(xe);return{cellStyle:{paddingLeft:"1em"},icon:()=>Ce?(0,r.jsx)(A,{}):(0,r.jsx)(D.Z,{}),tooltip:Ce?"Remove from favorites":"Add to favorites",onClick:()=>I(xe)}}}};function ie(w){return w.metadata.title||w.metadata.name}const ne={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:w=>(0,r.jsx)(V.uw,{value:(0,r.jsx)(V.rU,{to:w.resolved.docsUrl,children:ie(w.entity)}),subvalue:w.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:w})=>(0,r.jsx)(m.rI,{entityRefs:w.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var X=n(51953);const K=w=>{const{entities:I,title:Z,loading:xe,columns:Ce,actions:B,options:Qe}=w,[,St]=(0,W.Z)(),Nt=(0,p.tg)(ye.Fw),Wt=(0,p.h_)(p.Ds);if(!I)return null;const kt=I.map(ct=>{const ut=(0,m.hF)(ct,F.S4);var pt;return{entity:ct,resolved:{docsUrl:Nt({namespace:(0,X.D)((pt=ct.metadata.namespace)!==null&&pt!==void 0?pt:"default",Wt),kind:(0,X.D)(ct.kind,Wt),name:(0,X.D)(ct.metadata.name,Wt)}),ownedByRelations:ut,ownedByRelationsTitle:ut.map(ht=>(0,m.$3)(ht,{defaultKind:"group"})).join(", ")}}}),Dt=[ne.createNameColumn(),ne.createOwnerColumn(),ne.createTypeColumn()],Xt=[se.createCopyDocsUrlAction(St)];return(0,r.jsx)(r.Fragment,{children:xe||kt&&kt.length>0?(0,r.jsx)(V.iA,{isLoading:xe,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...Qe},data:kt,columns:Ce||Dt,actions:B||Xt,title:Z?`${Z} (${kt.length})`:`All (${kt.length})`}):(0,r.jsx)(V.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,r.jsx)(V.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};K.columns=ne,K.actions=se;const R=w=>{var I;const{columns:Z,actions:xe,options:Ce}=w,{loading:B,error:Qe,entities:St,filters:Nt}=(0,m.wp)(),{isStarredEntity:Wt,toggleStarredEntity:kt}=(0,m.CR)(),[,Dt]=(0,W.Z)();var Xt;const ct=(0,f.capitalize)((Xt=(I=Nt.user)===null||I===void 0?void 0:I.value)!==null&&Xt!==void 0?Xt:"all"),ut=[se.createCopyDocsUrlAction(Dt),se.createStarEntityAction(Wt,kt)];return Qe?(0,r.jsx)(V.GB,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(V.Oi,{language:"text",text:Qe.toString()})}):(0,r.jsx)(K,{title:ct,entities:St,loading:B,actions:xe||ut,columns:Z,options:Ce})};R.columns=ne,R.actions=se},18662:function(Pt,Le,n){"use strict";n.r(Le),n.d(Le,{TechDocsIndexPage:function(){return V}});var r=n(52322),h=n(2784),W=n(73557),f=n(3482);const V=m=>(0,W.pC)()||(0,r.jsx)(f.u,{...m})},42081:function(Pt,Le,n){"use strict";n.d(Le,{j:function(){return V}});var r=n(52322),h=n(2784),W=n(53974),f=n(60871);const V=m=>{const{children:p}=m,F=(0,f.h_)(f.Ds);var ye;const le=`Documentation available in ${(ye=F.getOptionalString("organization.name"))!==null&&ye!==void 0?ye:"Backstage"}`;return(0,r.jsx)(W.g9,{title:"Documentation",subtitle:le,themeId:"documentation",children:p})}},48431:function(Pt,Le,n){"use strict";n.d(Le,{f:function(){return f}});var r=n(2784),h=n(39709);class W{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":h.n3}}}const f=()=>{const{updateFilters:V}=(0,h.wp)();return(0,r.useEffect)(()=>{V({techdocs:new W})},[V]),null}},89258:function(Pt,Le,n){"use strict";n.d(Le,{I6:function(){return z},Jl:function(){return le},s4:function(){return m}});var r=n(61886),h=n(92077),W=n(95573),f=n(60871),V=n(15096);const m=(0,f.rx)({id:"techdocs",apis:[(0,f.ni)({api:r.Dl,deps:{configApi:f.Ds,discoveryApi:f.NW,identityApi:f.$4,fetchApi:f.gP},factory:({configApi:D,discoveryApi:A,identityApi:se,fetchApi:ie})=>new h.k({configApi:D,discoveryApi:A,identityApi:se,fetchApi:ie})}),(0,f.ni)({api:r.gT,deps:{configApi:f.Ds,discoveryApi:f.NW,fetchApi:f.gP},factory:({configApi:D,discoveryApi:A,fetchApi:se})=>new h.p({configApi:D,discoveryApi:A,fetchApi:se})})],routes:{root:W._Z,docRoot:W.Fw,entityContent:W.pd}}),p=m.provide((0,f.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(D=>D.Router),mountPoint:W._Z})),F=m.provide((0,f.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(D=>D.EmbeddedDocsRouter),mountPoint:W.pd})),ye=m.provide((0,f.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(D=>D.TechDocsCustomHome),mountPoint:W._Z})),le=m.provide((0,f.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(D=>D.TechDocsIndexPage),mountPoint:W._Z})),z=m.provide((0,f.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(D=>D.TechDocsReaderPage),mountPoint:W.Fw})),de=m.provide((0,V.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(D=>D.TechDocsSearchResultListItem),predicate:D=>D.type==="techdocs"}))},7476:function(Pt,Le,n){"use strict";n.r(Le),n.d(Le,{TechDocsReaderLayout:function(){return z},TechDocsReaderPage:function(){return de}});var r=n(52322),h=n(2784),W=n(73557),f=n(53974),V=n(61886),m=n(86317),p=n(93225),F=n(65124),ye=n(95573),le=n(60871);const z=D=>{const{withSearch:A,withHeader:se=!0}=D;return(0,r.jsxs)(f.T3,{themeId:"documentation",children:[se&&(0,r.jsx)(p.S,{}),(0,r.jsx)(F.b,{}),(0,r.jsx)(m.F,{withSearch:A})]})},de=D=>{const{kind:A,name:se,namespace:ie}=(0,le.Oi)(ye.Fw),{children:ne,entityRef:X={kind:A,name:se,namespace:ie}}=D,K=(0,W.pC)();if(!ne){const w=K?h.Children.toArray(K.props.children):[];var R;const Z=w.flatMap(xe=>{var Ce,B;return(R=(B=xe)===null||B===void 0||(Ce=B.props)===null||Ce===void 0?void 0:Ce.children)!==null&&R!==void 0?R:[]}).find(xe=>!(0,le.IY)(xe,V.Zz)&&!(0,le.IY)(xe,V.jM));return(0,r.jsx)(V.ZS,{entityRef:X,children:Z||(0,r.jsx)(z,{})})}return(0,r.jsx)(V.ZS,{entityRef:X,children:({metadata:w,entityMetadata:I,onReady:Z})=>(0,r.jsx)("div",{className:"techdocs-reader-page",children:(0,r.jsx)(f.T3,{themeId:"documentation",children:ne instanceof Function?ne({entityRef:X,techdocsMetadataValue:w.value,entityMetadataValue:I.value,onReady:Z}):ne})})})}},86317:function(Pt,Le,n){"use strict";n.d(Le,{F:function(){return te}});var r=n(52322),h=n(2784),W=n(79692),f=n(60905),V=n(61886),m=n(53974),p=n(22478),F=n(4614),ye=n(77277),le=n(99688),z=n(12420),de=n(90436),D=n(61837),A=n(4190),se=n(87685);const ie=(0,W.Z)(v=>(0,z.Z)({paper:{width:"100%",[v.breakpoints.up("sm")]:{width:"75%"},[v.breakpoints.up("md")]:{width:"50%"},padding:v.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:v.palette.background.default}})),ne=({buildLog:v,onClose:k})=>{const M=ie(),H=v.length===0?"Waiting for logs...":v.join(`
|
|
37
|
-
`);return(0,r.jsxs)(f.Z,{container:!0,direction:"column",className:M.root,spacing:0,wrap:"nowrap",children:[(0,r.jsxs)(f.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,r.jsx)(de.Z,{variant:"h5",children:"Build Details"}),(0,r.jsx)(D.Z,{title:"Close the drawer",onClick:k,color:"inherit",children:(0,r.jsx)(se.Z,{})},"dismiss")]}),(0,r.jsx)(f.Z,{item:!0,xs:!0,children:(0,r.jsx)(m.nU,{text:H,classes:{root:M.logs}})})]})},X=({buildLog:v})=>{const k=ie(),[M,H]=(0,h.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ye.Z,{color:"inherit",onClick:()=>H(!0),children:"Show Build Logs"}),(0,r.jsx)(A.ZP,{classes:{paper:k.paper},anchor:"right",open:M,onClose:()=>H(!1),children:(0,r.jsx)(ne,{buildLog:v,onClose:()=>H(!1)})})]})};var K=n(60871);const R=({errorMessage:v})=>{const k=(0,K.h_)(K.Ds).getOptionalString("techdocs.builder");let M="";return k!=="local"&&(M="Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance."),(0,r.jsx)(m.mf,{status:"404",statusMessage:v||"Documentation not found",additionalInfo:M})};var w=n(95481);const I=(0,W.Z)(v=>({root:{marginBottom:v.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),Z=()=>{let v=null;const k=I(),{state:M,contentReload:H,contentErrorMessage:pe,syncErrorMessage:Se,buildLog:Oe}=(0,w.DK)();return M==="INITIAL_BUILD"&&(v=(0,r.jsx)(le.Z,{classes:{root:k.root},variant:"outlined",severity:"info",icon:(0,r.jsx)(F.Z,{size:"24px"}),action:(0,r.jsx)(X,{buildLog:Oe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),M==="CONTENT_STALE_REFRESHING"&&(v=(0,r.jsx)(le.Z,{variant:"outlined",severity:"info",icon:(0,r.jsx)(F.Z,{size:"24px"}),action:(0,r.jsx)(X,{buildLog:Oe}),classes:{root:k.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),M==="CONTENT_STALE_READY"&&(v=(0,r.jsx)(le.Z,{variant:"outlined",severity:"success",action:(0,r.jsx)(ye.Z,{color:"inherit",onClick:()=>H(),children:"Refresh"}),classes:{root:k.root},children:"A newer version of this documentation is now available, please refresh to view."})),M==="CONTENT_STALE_ERROR"&&(v=(0,r.jsxs)(le.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(X,{buildLog:Oe}),classes:{root:k.root,message:k.message},children:["Building a newer version of this documentation failed."," ",Se]})),M==="CONTENT_NOT_FOUND"&&(v=(0,r.jsxs)(r.Fragment,{children:[Se&&(0,r.jsxs)(le.Z,{variant:"outlined",severity:"error",action:(0,r.jsx)(X,{buildLog:Oe}),classes:{root:k.root,message:k.message},children:["Building a newer version of this documentation failed."," ",Se]}),(0,r.jsx)(R,{errorMessage:pe})]})),v};var xe=n(60364),Ce=n(41156),B=n(32838),Qe=n(35368),St=n.n(Qe);const Nt=/main\.[A-Fa-f0-9]{8}\.min\.css$/,Wt=/^https:\/\/fonts\.googleapis\.com/,kt=/^https:\/\/fonts\.gstatic\.com/,Dt=v=>v.nodeName==="LINK",Xt=v=>{var k;const M=((k=v)===null||k===void 0?void 0:k.getAttribute("href"))||"",H=M.match(Nt),pe=M.match(Wt),Se=M.match(kt);return H||pe||Se},ct=v=>(Dt(v)&&!Xt(v)&&v.remove(),v),ut=v=>v.nodeName==="IFRAME",pt=(v,k)=>{const M=v.getAttribute("src")||"";try{const{host:H}=new URL(M);return k.includes(H)}catch{return!1}},ht=v=>k=>(ut(k)&&!pt(k,v)&&k.remove(),k),Vt=()=>{const v=(0,K.h_)(K.Ds);return(0,h.useMemo)(()=>v.getOptionalConfig("techdocs.sanitizer"),[v])},Jt=()=>{const v=Vt();return(0,h.useCallback)(async k=>{var M;const H=(M=v)===null||M===void 0?void 0:M.getOptionalStringArray("allowedIframeHosts");St().addHook("beforeSanitizeElements",ct);const pe=["link"];return H&&(pe.push("iframe"),St().addHook("beforeSanitizeElements",ht(H))),St().sanitize(k.outerHTML,{ADD_TAGS:pe,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[v])};var be=n(41128),Me=({theme:v})=>`
|
|
38
|
-
/*================== Variables ==================*/
|
|
39
|
-
/*
|
|
40
|
-
As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
|
|
41
|
-
As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
:host {
|
|
45
|
-
/* FONT */
|
|
46
|
-
--md-default-fg-color: ${v.palette.text.primary};
|
|
47
|
-
--md-default-fg-color--light: ${v.palette.text.secondary};
|
|
48
|
-
--md-default-fg-color--lighter: ${(0,be.$n)(v.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,be.$n)(v.palette.text.secondary,.3)};
|
|
50
|
-
|
|
51
|
-
/* BACKGROUND */
|
|
52
|
-
--md-default-bg-color:${v.palette.background.default};
|
|
53
|
-
--md-default-bg-color--light: ${v.palette.background.paper};
|
|
54
|
-
--md-default-bg-color--lighter: ${(0,be.$n)(v.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,be.$n)(v.palette.background.paper,.3)};
|
|
56
|
-
|
|
57
|
-
/* PRIMARY */
|
|
58
|
-
--md-primary-fg-color: ${v.palette.primary.main};
|
|
59
|
-
--md-primary-fg-color--light: ${v.palette.primary.light};
|
|
60
|
-
--md-primary-fg-color--dark: ${v.palette.primary.dark};
|
|
61
|
-
--md-primary-bg-color: ${v.palette.primary.contrastText};
|
|
62
|
-
--md-primary-bg-color--light: ${(0,be.$n)(v.palette.primary.contrastText,.7)};
|
|
63
|
-
|
|
64
|
-
/* ACCENT */
|
|
65
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
-
|
|
67
|
-
/* SHADOW */
|
|
68
|
-
--md-shadow-z1: ${v.shadows[1]};
|
|
69
|
-
--md-shadow-z2: ${v.shadows[2]};
|
|
70
|
-
--md-shadow-z3: ${v.shadows[3]};
|
|
71
|
-
|
|
72
|
-
/* EXTENSIONS */
|
|
73
|
-
--md-admonition-fg-color: var(--md-default-fg-color);
|
|
74
|
-
--md-admonition-bg-color: var(--md-default-bg-color);
|
|
75
|
-
/* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
|
|
76
|
-
--md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
|
|
77
|
-
--md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
|
|
78
|
-
--md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
|
|
79
|
-
--md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
|
|
80
|
-
--md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
81
|
-
--md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
|
|
82
|
-
--md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
|
|
83
|
-
--md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
|
|
84
|
-
--md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
|
|
85
|
-
--md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
|
|
86
|
-
--md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
|
|
87
|
-
--md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
|
|
88
|
-
--md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
|
|
89
|
-
--md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
90
|
-
--md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
|
|
91
|
-
--md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
|
92
|
-
--md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
|
|
93
|
-
--md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
|
|
94
|
-
--md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
|
|
95
|
-
--md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
|
|
96
|
-
--md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
|
|
97
|
-
--md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
|
|
98
|
-
--md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
|
|
99
|
-
--md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
|
|
100
|
-
--md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
|
|
101
|
-
--md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
:host > * {
|
|
105
|
-
/* CODE */
|
|
106
|
-
--md-code-fg-color: ${v.palette.text.primary};
|
|
107
|
-
--md-code-bg-color: ${v.palette.background.paper};
|
|
108
|
-
--md-code-hl-color: ${(0,be.Fq)(v.palette.warning.main,.5)};
|
|
109
|
-
--md-code-hl-keyword-color: ${v.palette.type==="dark"?v.palette.primary.light:v.palette.primary.dark};
|
|
110
|
-
--md-code-hl-function-color: ${v.palette.type==="dark"?v.palette.secondary.light:v.palette.secondary.dark};
|
|
111
|
-
--md-code-hl-string-color: ${v.palette.type==="dark"?v.palette.success.light:v.palette.success.dark};
|
|
112
|
-
--md-code-hl-number-color: ${v.palette.type==="dark"?v.palette.error.light:v.palette.error.dark};
|
|
113
|
-
--md-code-hl-constant-color: var(--md-code-hl-function-color);
|
|
114
|
-
--md-code-hl-special-color: var(--md-code-hl-function-color);
|
|
115
|
-
--md-code-hl-name-color: var(--md-code-fg-color);
|
|
116
|
-
--md-code-hl-comment-color: var(--md-default-fg-color--light);
|
|
117
|
-
--md-code-hl-generic-color: var(--md-default-fg-color--light);
|
|
118
|
-
--md-code-hl-variable-color: var(--md-default-fg-color--light);
|
|
119
|
-
--md-code-hl-operator-color: var(--md-default-fg-color--light);
|
|
120
|
-
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
|
|
121
|
-
|
|
122
|
-
/* TYPESET */
|
|
123
|
-
--md-typeset-font-size: 1rem;
|
|
124
|
-
--md-typeset-color: var(--md-default-fg-color);
|
|
125
|
-
--md-typeset-a-color: ${v.palette.link};
|
|
126
|
-
--md-typeset-table-color: ${v.palette.text.primary};
|
|
127
|
-
--md-typeset-del-color: ${v.palette.type==="dark"?(0,be.Fq)(v.palette.error.dark,.5):(0,be.Fq)(v.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${v.palette.type==="dark"?(0,be.Fq)(v.palette.success.dark,.5):(0,be.Fq)(v.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${v.palette.type==="dark"?(0,be.Fq)(v.palette.warning.dark,.5):(0,be.Fq)(v.palette.warning.light,.5)};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 76.1875em) {
|
|
133
|
-
:host > * {
|
|
134
|
-
/* TYPESET */
|
|
135
|
-
--md-typeset-font-size: .9rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media screen and (max-width: 600px) {
|
|
140
|
-
:host > * {
|
|
141
|
-
/* TYPESET */
|
|
142
|
-
--md-typeset-font-size: .7rem;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,Ye=({theme:v})=>`
|
|
146
|
-
/*================== Reset ==================*/
|
|
147
|
-
|
|
148
|
-
body {
|
|
149
|
-
--md-text-color: var(--md-default-fg-color);
|
|
150
|
-
--md-text-link-color: var(--md-accent-fg-color);
|
|
151
|
-
--md-text-font-family: ${v.typography.fontFamily};
|
|
152
|
-
font-family: var(--md-text-font-family);
|
|
153
|
-
background-color: unset;
|
|
154
|
-
}
|
|
155
|
-
`;const ft="224px";var st=({theme:v,sidebar:k})=>`
|
|
156
|
-
/*================== Layout ==================*/
|
|
157
|
-
|
|
158
|
-
/* mkdocs material v9 compat */
|
|
159
|
-
.md-nav__title {
|
|
160
|
-
color: var(--md-default-fg-color);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.md-grid {
|
|
164
|
-
max-width: 100%;
|
|
165
|
-
margin: 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.md-nav {
|
|
169
|
-
font-size: calc(var(--md-typeset-font-size) * 0.9);
|
|
170
|
-
}
|
|
171
|
-
.md-nav__link {
|
|
172
|
-
display: flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
justify-content: space-between;
|
|
175
|
-
}
|
|
176
|
-
.md-nav__icon {
|
|
177
|
-
height: 20px !important;
|
|
178
|
-
width: 20px !important;
|
|
179
|
-
margin-left:${v.spacing(1)}px;
|
|
180
|
-
}
|
|
181
|
-
.md-nav__icon svg {
|
|
182
|
-
margin: 0;
|
|
183
|
-
width: 20px !important;
|
|
184
|
-
height: 20px !important;
|
|
185
|
-
}
|
|
186
|
-
.md-nav__icon:after {
|
|
187
|
-
width: 20px !important;
|
|
188
|
-
height: 20px !important;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.md-nav__item--active > .md-nav__link, a.md-nav__link--active {
|
|
192
|
-
text-decoration: underline;
|
|
193
|
-
color: var(--md-typeset-a-color);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.md-main__inner {
|
|
197
|
-
margin-top: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.md-sidebar {
|
|
201
|
-
bottom: 75px;
|
|
202
|
-
position: fixed;
|
|
203
|
-
width: 16rem;
|
|
204
|
-
overflow-y: auto;
|
|
205
|
-
overflow-x: hidden;
|
|
206
|
-
scrollbar-color: rgb(193, 193, 193) #eee;
|
|
207
|
-
scrollbar-width: thin;
|
|
208
|
-
}
|
|
209
|
-
.md-sidebar .md-sidebar__scrollwrap {
|
|
210
|
-
width: calc(12.1rem);
|
|
211
|
-
}
|
|
212
|
-
.md-sidebar--secondary {
|
|
213
|
-
right: ${v.spacing(3)}px;
|
|
214
|
-
}
|
|
215
|
-
.md-sidebar::-webkit-scrollbar {
|
|
216
|
-
width: 5px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
219
|
-
width: 5px;
|
|
220
|
-
height: 5px;
|
|
221
|
-
}
|
|
222
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
223
|
-
background: #eee;
|
|
224
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
225
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
226
|
-
border-radius: 3px;
|
|
227
|
-
}
|
|
228
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
229
|
-
width: 5px;
|
|
230
|
-
background: rgb(193, 193, 193);
|
|
231
|
-
border: transparent;
|
|
232
|
-
border-radius: 3px;
|
|
233
|
-
}
|
|
234
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
235
|
-
background: rgb(125, 125, 125);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.md-content {
|
|
239
|
-
max-width: calc(100% - 16rem * 2);
|
|
240
|
-
margin-left: 16rem;
|
|
241
|
-
margin-bottom: 50px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.md-footer {
|
|
245
|
-
position: fixed;
|
|
246
|
-
bottom: 0px;
|
|
247
|
-
pointer-events: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.md-footer-nav__link, .md-footer__link {
|
|
251
|
-
pointer-events: all;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.md-footer__title {
|
|
255
|
-
background-color: unset;
|
|
256
|
-
}
|
|
257
|
-
.md-footer-nav__link, .md-footer__link {
|
|
258
|
-
width: 16rem;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.md-dialog {
|
|
262
|
-
background-color: unset;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@media screen and (min-width: 76.25em) {
|
|
266
|
-
.md-sidebar {
|
|
267
|
-
height: auto;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@media screen and (max-width: 76.1875em) {
|
|
272
|
-
.md-nav {
|
|
273
|
-
transition: none !important;
|
|
274
|
-
background-color: var(--md-default-bg-color)
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title {
|
|
277
|
-
cursor: auto;
|
|
278
|
-
color: var(--md-default-fg-color);
|
|
279
|
-
font-weight: 700;
|
|
280
|
-
white-space: normal;
|
|
281
|
-
line-height: 1rem;
|
|
282
|
-
height: auto;
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-flow: column;
|
|
285
|
-
row-gap: 1.6rem;
|
|
286
|
-
padding: 1.2rem .8rem .8rem;
|
|
287
|
-
background-color: var(--md-default-bg-color);
|
|
288
|
-
}
|
|
289
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
290
|
-
box-shadow: none;
|
|
291
|
-
}
|
|
292
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
293
|
-
border-top: none;
|
|
294
|
-
}
|
|
295
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
296
|
-
display: none;
|
|
297
|
-
}
|
|
298
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
299
|
-
color: var(--md-default-fg-color);
|
|
300
|
-
position: static;
|
|
301
|
-
height: auto;
|
|
302
|
-
margin: 0 0 0 -0.2rem;
|
|
303
|
-
}
|
|
304
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
305
|
-
padding-top: 0;
|
|
306
|
-
}
|
|
307
|
-
.md-nav--primary .md-nav__item {
|
|
308
|
-
border-top: none;
|
|
309
|
-
}
|
|
310
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
311
|
-
font-size : var(--md-typeset-font-size);
|
|
312
|
-
}
|
|
313
|
-
.md-nav .md-source {
|
|
314
|
-
display: none;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.md-sidebar {
|
|
318
|
-
height: 100%;
|
|
319
|
-
}
|
|
320
|
-
.md-sidebar--primary {
|
|
321
|
-
width: 12.1rem !important;
|
|
322
|
-
z-index: 200;
|
|
323
|
-
left: ${k.isPinned?`calc(-12.1rem + ${ft})`:"calc(-12.1rem + 72px)"} !important;
|
|
324
|
-
}
|
|
325
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
326
|
-
display: none;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.md-content {
|
|
330
|
-
max-width: 100%;
|
|
331
|
-
margin-left: 0;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.md-header__button {
|
|
335
|
-
margin: 0.4rem 0;
|
|
336
|
-
margin-left: 0.4rem;
|
|
337
|
-
padding: 0;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.md-overlay {
|
|
341
|
-
left: 0;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.md-footer {
|
|
345
|
-
position: static;
|
|
346
|
-
padding-left: 0;
|
|
347
|
-
}
|
|
348
|
-
.md-footer-nav__link {
|
|
349
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
350
|
-
width: 50%;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@media screen and (max-width: 600px) {
|
|
355
|
-
.md-sidebar--primary {
|
|
356
|
-
left: -12.1rem !important;
|
|
357
|
-
width: 12.1rem;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
@media print {
|
|
363
|
-
.md-sidebar,
|
|
364
|
-
#toggle-sidebar {
|
|
365
|
-
display: none;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.md-content {
|
|
369
|
-
margin: 0;
|
|
370
|
-
width: 100%;
|
|
371
|
-
max-width: 100%;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
`;const nt=["h1","h2","h3","h4","h5","h6"];var gt=({theme:v})=>`
|
|
375
|
-
/*================== Typeset ==================*/
|
|
376
|
-
|
|
377
|
-
.md-typeset {
|
|
378
|
-
font-size: var(--md-typeset-font-size);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
${nt.reduce((k,M)=>{var H;const pe=(H=v.typography.htmlFontSize)!==null&&H!==void 0?H:16,Se=v.typography[M],{lineHeight:Oe,fontFamily:et,fontWeight:tt,fontSize:bt}=Se,wt=at=>{let Be=1;return typeof at=="number"&&(Be=at/pe*.6),typeof at=="string"&&(Be=at.replace("rem","")),`calc(${Be} * var(--md-typeset-font-size))`};return k.concat(`
|
|
382
|
-
.md-typeset ${M} {
|
|
383
|
-
color: var(--md-default-fg-color);
|
|
384
|
-
line-height: ${Oe};
|
|
385
|
-
font-family: ${et};
|
|
386
|
-
font-weight: ${tt};
|
|
387
|
-
font-size: ${wt(bt)};
|
|
388
|
-
}
|
|
389
|
-
`)},"")}
|
|
390
|
-
|
|
391
|
-
.md-typeset .md-content__button {
|
|
392
|
-
color: var(--md-default-fg-color);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.md-typeset hr {
|
|
396
|
-
border-bottom: 0.05rem dotted ${v.palette.divider};
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.md-typeset details {
|
|
400
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
401
|
-
}
|
|
402
|
-
.md-typeset details summary {
|
|
403
|
-
padding-left: 2.5rem !important;
|
|
404
|
-
}
|
|
405
|
-
.md-typeset details summary:before,
|
|
406
|
-
.md-typeset details summary:after {
|
|
407
|
-
top: 50% !important;
|
|
408
|
-
width: 20px !important;
|
|
409
|
-
height: 20px !important;
|
|
410
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
411
|
-
}
|
|
412
|
-
.md-typeset details[open] > summary:after {
|
|
413
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.md-typeset blockquote {
|
|
417
|
-
color: var(--md-default-fg-color--light);
|
|
418
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
.md-typeset table:not([class]) {
|
|
422
|
-
font-size: var(--md-typeset-font-size);
|
|
423
|
-
border: 1px solid var(--md-default-fg-color);
|
|
424
|
-
border-bottom: none;
|
|
425
|
-
border-collapse: collapse;
|
|
426
|
-
}
|
|
427
|
-
.md-typeset table:not([class]) th {
|
|
428
|
-
font-weight: bold;
|
|
429
|
-
}
|
|
430
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
431
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
435
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
436
|
-
}
|
|
437
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
438
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
439
|
-
}
|
|
440
|
-
`,ot=()=>`
|
|
441
|
-
/*================== Animations ==================*/
|
|
442
|
-
/*
|
|
443
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
444
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
445
|
-
*/
|
|
446
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
447
|
-
transition: none;
|
|
448
|
-
}
|
|
449
|
-
`,Xe=({theme:v})=>`
|
|
450
|
-
/*================== Extensions ==================*/
|
|
451
|
-
|
|
452
|
-
/* HIGHLIGHT */
|
|
453
|
-
.highlight .md-clipboard:after {
|
|
454
|
-
content: unset;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
.highlight .nx {
|
|
458
|
-
color: ${v.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/* CODE HILITE */
|
|
462
|
-
.codehilite .gd {
|
|
463
|
-
background-color: ${v.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.codehilite .gi {
|
|
467
|
-
background-color: ${v.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/* TABBED */
|
|
471
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
472
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
473
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
474
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
475
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
476
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
477
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
478
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
479
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
480
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
481
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
482
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
483
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
484
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
485
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
486
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
487
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
488
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
489
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
490
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
491
|
-
color: var(--md-accent-fg-color);
|
|
492
|
-
border-color: var(--md-accent-fg-color);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/* TASK-LIST */
|
|
496
|
-
.task-list-control .task-list-indicator::before {
|
|
497
|
-
background-color: ${v.palette.action.disabledBackground};
|
|
498
|
-
}
|
|
499
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
500
|
-
background-color: ${v.palette.success.main};
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/* ADMONITION */
|
|
504
|
-
.admonition {
|
|
505
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
506
|
-
}
|
|
507
|
-
.admonition .admonition-title {
|
|
508
|
-
padding-left: 2.5rem !important;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.admonition .admonition-title:before {
|
|
512
|
-
top: 50% !important;
|
|
513
|
-
width: 20px !important;
|
|
514
|
-
height: 20px !important;
|
|
515
|
-
transform: translateY(-50%) !important;
|
|
516
|
-
}
|
|
517
|
-
`;const yt=[Me,Ye,st,gt,ot,Xe],vt=()=>(0,m.Pf)(),xt=()=>{const v=vt(),k=(0,xe.Z)();return(0,h.useMemo)(()=>{const M={theme:k,sidebar:v};return yt.reduce((H,pe)=>H+pe(M),"")},[k,v])},wn=()=>{const v=xt();return(0,h.useCallback)(k=>(k.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${v}</style>`),k),[v])},fn=(v,k,M)=>{const H=v==="src"&&k.endsWith(".svg"),pe=!k.match(/^([a-z]*:)?\/\//i),Se=k.startsWith(M);return H&&(pe||Se)},pn=({techdocsStorageApi:v,entityId:k,path:M})=>async H=>{const pe=await v.getApiOrigin(),Se=async(Oe,et)=>{for(const tt of Oe)if(tt.hasAttribute(et)){const bt=tt.getAttribute(et);if(!bt)return;const wt=await v.getBaseUrl(bt,k,M);if(fn(et,bt,pe))try{const Be=await(await fetch(wt,{credentials:"include"})).text();tt.setAttribute(et,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(Be)))}`)}catch{tt.setAttribute("alt",`Error: ${bt}`)}else tt.setAttribute(et,wt)}};return await Promise.all([Se(H.querySelectorAll("img"),"src"),Se(H.querySelectorAll("script"),"src"),Se(H.querySelectorAll("source"),"src"),Se(H.querySelectorAll("link"),"href"),Se(H.querySelectorAll("a[download]"),"href")]),H};var jn=n(40556),hn=n(67097),xn=n(28316),En=n(82717),on=n.n(En);const Sn=v=>k=>{var M,H,pe,Se,Oe,et;const tt=k.querySelector('[title="Edit this page"]');if(!tt||!tt.href)return k;const bt=new URL(tt.href),wt=v.byUrl(bt);if(((M=wt)===null||M===void 0?void 0:M.type)!=="github"&&((H=wt)===null||H===void 0?void 0:H.type)!=="gitlab")return k;const at=((pe=k.querySelector("article>h1"))===null||pe===void 0?void 0:pe.childNodes[0].textContent)||"",Be=encodeURIComponent(`Documentation Feedback: ${at}`),Ct=encodeURIComponent(`Page source:
|
|
518
|
-
${tt.href}
|
|
519
|
-
|
|
520
|
-
Feedback:`),Yt=((Se=wt)===null||Se===void 0?void 0:Se.type)==="github"?(0,jn.BT)(bt.href,"blob"):bt.href,Et=on()(Yt),Ft=`/${Et.organization}/${Et.name}`,en=tt.cloneNode();switch((Oe=wt)===null||Oe===void 0?void 0:Oe.type){case"gitlab":en.href=`${bt.origin}${Ft}/issues/new?issue[title]=${Be}&issue[description]=${Ct}`;break;case"github":en.href=`${bt.origin}${Ft}/issues/new?title=${Be}&body=${Ct}`;break;default:return k}return xn.render(h.createElement(hn.Z),en),en.style.paddingLeft="5px",en.title="Leave feedback for this page",en.id="git-feedback-link",(et=tt)===null||et===void 0||et.insertAdjacentElement("beforebegin",en),k};var An=n(44882);const rt=()=>v=>{var k;const M=v.querySelector('.md-header label[for="__drawer"]'),H=v.querySelector("article");if(!M||!H)return v;const pe=M.cloneNode();return xn.render(h.createElement(An.Z),pe),pe.id="toggle-sidebar",pe.title="Toggle Sidebar",pe.classList.add("md-content__button"),pe.style.setProperty("padding","0 0 0 5px"),pe.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),(k=H)===null||k===void 0||k.prepend(pe),v},_t=()=>v=>(((M,H)=>{Array.from(M).filter(pe=>pe.hasAttribute(H)).forEach(pe=>{const Se=pe.getAttribute(H);if(Se){Se.match(/^https?:\/\//i)&&pe.setAttribute("target","_blank");try{const Oe=Mt(window.location.href);pe.setAttribute(H,new URL(Se,Oe).toString())}catch{pe.replaceWith(pe.textContent||Se)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Mt(v){const k=new URL(v);return!k.pathname.endsWith("/")&&!k.pathname.endsWith(".html")&&(k.pathname+="/"),k.toString()}const _e=({baseUrl:v,onClick:k})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(H=>{H.addEventListener("click",pe=>{const Oe=H.getAttribute("href");Oe&&Oe.startsWith(v)&&!H.hasAttribute("download")&&(pe.preventDefault(),k(pe,Oe))})}),M);var Pn=n(15459),dn=n(80030),$n=n(72379),Cn=n(41547),Un=n(95074);const qn=(0,Pn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(dn.ZP),Ln=()=>(0,r.jsx)($n.Z,{children:(0,r.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),zn=({text:v})=>{const[k,M]=(0,h.useState)(!1),[,H]=(0,Un.Z)(),pe=(0,h.useCallback)(()=>{H(v),M(!0)},[v,H]),Se=(0,h.useCallback)(()=>{M(!1)},[M]);return(0,r.jsx)(qn,{title:"Copied to clipboard",placement:"left",open:k,onClose:Se,leaveDelay:1e3,children:(0,r.jsx)(D.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:pe,children:(0,r.jsx)(Ln,{})})})},we=v=>k=>{const M=k.querySelectorAll("pre > code");for(const Se of M){var H,pe;const Oe=Se.textContent||"",et=document.createElement("div");(pe=Se)===null||pe===void 0||(H=pe.parentElement)===null||H===void 0||H.prepend(et),xn.render((0,r.jsx)(Cn.Z,{theme:v,children:(0,r.jsx)(zn,{text:Oe})}),et)}return k},he=()=>v=>{var k;return(k=v.querySelector(".md-header"))===null||k===void 0||k.remove(),v},Pe=()=>v=>{var k,M;return(k=v.querySelector(".md-footer .md-copyright"))===null||k===void 0||k.remove(),(M=v.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),v},G=({onLoading:v,onLoaded:k})=>M=>(v(),M.addEventListener(V.Ox,function H(){k(),M.removeEventListener(V.Ox,H)}),M),N=()=>v=>(v.addEventListener(V.Ox,function k(){if(window.location.hash){var M,H;const pe=window.location.hash.slice(1);(H=v)===null||H===void 0||(M=H.querySelector(`[id="${pe}"]`))===null||M===void 0||M.scrollIntoView()}v.removeEventListener(V.Ox,k)}),v),ce=()=>v=>(setTimeout(()=>{var k;const M=(k=v)===null||k===void 0?void 0:k.querySelectorAll("li.md-nav__item--active");M.length!==0&&(M.forEach(pe=>{var Se,Oe;const et=(Se=pe)===null||Se===void 0?void 0:Se.querySelector("input");if(!(!((Oe=et)===null||Oe===void 0)&&Oe.checked)){var tt;(tt=et)===null||tt===void 0||tt.click()}}),M[M.length-1].scrollIntoView())},200),v),Ee=async(v,k)=>{let M;if(typeof v=="string")M=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)M=v;else throw new Error("dom is not a recognized type");for(const H of k)M=await H(M);return M};var Ue=n(73557);function qe(v,k){const M=new URL(k),H=`${M.origin}${M.pathname.replace(/\/$/,"")}`,pe=v.replace(H,"").replace(/^\/+/,""),Se=new URL(`http://localhost/${pe}`);return`${Se.pathname}${Se.search}${Se.hash}`}function Tt(){const v=(0,Ue.s0)(),M=(0,K.h_)(K.Ds).getOptionalString("app.baseUrl");return(0,h.useCallback)(pe=>{let Se=pe;if(M)try{Se=qe(pe,M)}catch{}v(Se)},[v,M])}const $t="screen and (max-width: 76.1875em)",ln=v=>{const k=Tt(),M=(0,xe.Z)(),H=(0,Ce.Z)($t),pe=Jt(),Se=wn(),Oe=(0,K.z$)(),et=(0,K.h_)(V.Dl),tt=(0,K.h_)(B.q3),{state:bt,path:wt,content:at}=(0,w.DK)(),[Be,Ct]=(0,h.useState)(null),Yt=(0,V.ux)(Be),Et=(0,h.useCallback)(()=>{if(!Be)return;Be.querySelectorAll(".md-sidebar").forEach(lt=>{if(H)lt.style.top="0px";else{var Rt,Ht,qt;const bn=(Rt=document)===null||Rt===void 0?void 0:Rt.querySelector(".techdocs-reader-page");var Sr;const tr=(Sr=(Ht=bn)===null||Ht===void 0?void 0:Ht.getBoundingClientRect().top)!==null&&Sr!==void 0?Sr:0;var Or;let dr=(Or=Be.getBoundingClientRect().top)!==null&&Or!==void 0?Or:0;const Gr=Be.querySelector(".md-container > .md-tabs");var er;const Wn=(er=(qt=Gr)===null||qt===void 0?void 0:qt.getBoundingClientRect().height)!==null&&er!==void 0?er:0;dr<tr&&(dr=tr),lt.style.top=`${Math.max(dr,0)+Wn}px`}lt.style.setProperty("opacity","1")})},[Be,H]);(0,h.useEffect)(()=>(window.addEventListener("resize",Et),window.addEventListener("scroll",Et,!0),()=>{window.removeEventListener("resize",Et),window.removeEventListener("scroll",Et,!0)}),[Be,Et]);const Ft=(0,h.useCallback)(()=>{if(!Be)return;const Zt=Be.querySelector(".md-footer");Zt&&(Zt.style.width=`${Be.getBoundingClientRect().width}px`)},[Be]);(0,h.useEffect)(()=>(window.addEventListener("resize",Ft),()=>{window.removeEventListener("resize",Ft)}),[Be,Ft]),(0,h.useEffect)(()=>{Yt||(Ft(),Et())},[bt,Yt,Ft,Et]);const en=(0,h.useCallback)((Zt,lt)=>Ee(Zt,[pe,pn({techdocsStorageApi:et,entityId:v,path:lt}),_t(),rt(),he(),Pe(),Sn(tt),Se]),[v,tt,et,pe,Se]),Tn=(0,h.useCallback)(async Zt=>Ee(Zt,[N(),ce(),we(M),_e({baseUrl:window.location.origin,onClick:(lt,Rt)=>{var Ht;const qt=lt.ctrlKey||lt.metaKey,Sr=new URL(Rt),Or=((Ht=lt.target)===null||Ht===void 0?void 0:Ht.innerText)||Rt,er=Rt.replace(window.location.origin,"");if(Oe.captureEvent("click",Or,{attributes:{to:er}}),Sr.hash)if(qt)window.open(Rt,"_blank");else{var bn,tr;k(Rt),(tr=Zt)===null||tr===void 0||(bn=tr.querySelector(`[id="${Sr.hash.slice(1)}"]`))===null||bn===void 0||bn.scrollIntoView()}else qt?window.open(Rt,"_blank"):k(Rt)}}),G({onLoading:()=>{},onLoaded:()=>{var lt;(lt=Zt.querySelector(".md-nav__title"))===null||lt===void 0||lt.removeAttribute("for")}}),G({onLoading:()=>{Array.from(Zt.querySelectorAll(".md-sidebar")).forEach(Rt=>{Rt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,k,Oe]);return(0,h.useEffect)(()=>{if(!at)return()=>{};let Zt=!0;return en(at,wt).then(async lt=>{var Rt;if(!(!((Rt=lt)===null||Rt===void 0)&&Rt.innerHTML)||!Zt)return;window.scroll({top:0});const Ht=await Tn(lt);Ct(Ht)}),()=>{Zt=!1}},[at,wt,en,Tn]),Be};var sn=n(8560);const nn=()=>{var v,k,M,H,pe;const Se=(0,V.$L)(),{shadowRoot:Oe}=(0,V.x1)(),et=(v=Oe)===null||v===void 0?void 0:v.querySelector('[data-md-component="content"]'),tt=(k=Oe)===null||k===void 0?void 0:k.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let bt=(M=tt)===null||M===void 0?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');if(!bt){var wt;bt=document.createElement("div"),bt.setAttribute("data-techdocs-addons-location","primary sidebar"),(wt=tt)===null||wt===void 0||wt.prepend(bt)}const at=(H=Oe)===null||H===void 0?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Be=(pe=at)===null||pe===void 0?void 0:pe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');if(!Be){var Ct;Be=document.createElement("div"),Be.setAttribute("data-techdocs-addons-location","secondary sidebar"),(Ct=at)===null||Ct===void 0||Ct.prepend(Be)}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(sn.Z,{container:bt,children:Se.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,r.jsx)(sn.Z,{container:et,children:Se.renderComponentsByLocation(V.oZ.Content)}),(0,r.jsx)(sn.Z,{container:Be,children:Se.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},re=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),te=(0,w.m1)(v=>{var k,M;const{withSearch:H=!0,onReady:pe}=v,Se=re(),{entityMetadata:{value:Oe,loading:et},entityRef:tt,setShadowRoot:bt}=(0,V.x1)(),wt=ln(tt),at=(0,h.useCallback)(Be=>{bt(Be),pe instanceof Function&&pe()},[bt,pe]);return et===!1&&!Oe?(0,r.jsx)(m.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):wt?(0,r.jsx)(m.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(Z,{})}),H&&(0,r.jsx)(f.Z,{className:Se.search,xs:"auto",item:!0,children:(0,r.jsx)(p.S,{entityId:tt,entityTitle:(M=Oe)===null||M===void 0||(k=M.metadata)===null||k===void 0?void 0:k.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(V.VA,{element:wt,onAppend:at,children:(0,r.jsx)(nn,{})})})]})}):(0,r.jsx)(m.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(Z,{})})})})}),Y=null},93225:function(Pt,Le,n){"use strict";n.d(Le,{S:function(){return ie}});var r=n(52322),h=n(2784),W=n(18671),f=n(60905),V=n(98069),m=n(60364),p=n(73250),F=n(61886),ye=n(39709),le=n(25271),z=n(53974),de=n(60871),D=n(76635),A=n(95573);const se=(0,r.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),ie=ne=>{var X,K,R;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:I}=ne,Z=(0,F.$L)(),xe=(0,de.h_)(de.Ds),{title:Ce,setTitle:B,subtitle:Qe,setSubtitle:St,entityRef:Nt,metadata:{value:Wt,loading:kt},entityMetadata:{value:Dt,loading:Xt}}=(0,F.x1)();(0,h.useEffect)(()=>{Wt&&(B(Wt.site_name),St(()=>{let{site_description:st}=Wt;return(!st||st==="None")&&(st=""),st}))},[Wt,B,St]);const ct=xe.getOptional("app.title")||"Backstage",ut=[Ce,Qe,ct].filter(Boolean).join(" | "),{locationMetadata:pt,spec:ht}=Dt||{},Vt=(X=ht)===null||X===void 0?void 0:X.lifecycle,Jt=Dt?(0,ye.hF)(Dt,le.S4):[],be=(0,de.tg)(A._Z)(),Me=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.i9,{label:(0,D.capitalize)(((K=Dt)===null||K===void 0?void 0:K.kind)||"entity"),value:(0,r.jsx)(ye.dx,{color:"inherit",entityRef:Nt,title:(R=Dt)===null||R===void 0?void 0:R.metadata.title,defaultKind:"Component"})}),Jt.length>0&&(0,r.jsx)(z.i9,{label:"Owner",value:(0,r.jsx)(ye.rI,{color:"inherit",entityRefs:Jt,defaultKind:"group"})}),Vt?(0,r.jsx)(z.i9,{label:"Lifecycle",value:Vt}):null,pt&&pt.type!=="dir"&&pt.type!=="file"?(0,r.jsx)(z.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:w},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(p.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:pt.target}):null]});return!Xt&&Dt===void 0||!kt&&Wt===void 0?null:(0,r.jsxs)(z.h4,{type:"Documentation",typeLink:be,title:Ce||se,subtitle:Qe===""?void 0:Qe||se,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:ut})}),Me,I,Z.renderComponentsByLocation(F.oZ.Header)]})}},65124:function(Pt,Le,n){"use strict";n.d(Le,{b:function(){return de}});var r=n(52322),h=n(2784),W=n(79692),f=n(15223),V=n(95544),m=n(80030),p=n(61837),F=n(48348),ye=n(47603),le=n(61886);const z=(0,W.Z)(D=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:D.spacing(3,3,0),"@media print":{display:"none"}}})),de=D=>{const A=z(),[se,ie]=(0,h.useState)(null),ne=(0,h.useCallback)(xe=>{ie(xe.currentTarget)},[]),X=(0,h.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:K,loading:R}}=(0,le.x1)(),w=(0,le.$L)(),I=w.renderComponentsByLocation(le.oZ.Subheader),Z=w.renderComponentsByLocation(le.oZ.Settings);return!I&&!Z||R===!1&&!K?null:(0,r.jsx)(f.Z,{classes:A,...D.toolbarProps,children:(0,r.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[I,Z?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{title:"Settings",children:(0,r.jsx)(p.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ne,children:(0,r.jsx)(ye.Z,{})})}),(0,r.jsx)(F.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:se,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(se),onClose:X,keepMounted:!0,children:(0,r.jsx)("div",{children:Z})})]}):null]})})}},95481:function(Pt,Le,n){"use strict";n.d(Le,{DK:function(){return de},m1:function(){return A}});var r=n(52322),h=n(2784),W=n(73557),f=n(61886),V=n(60871),m=n(64279),p=n(77446);function F({contentLoading:se,content:ie,activeSyncState:ne}){return se||ne==="BUILD_READY_RELOAD"||!ie&&ne==="CHECKING"?"CHECKING":!ie&&ne==="BUILDING"?"INITIAL_BUILD":ie?ne==="BUILDING"?"CONTENT_STALE_REFRESHING":ne==="BUILD_READY"?"CONTENT_STALE_READY":ne==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ye(se,ie){const ne={...se};switch(ie.type){case"sync":ie.state==="CHECKING"&&(ne.buildLog=[]),ne.activeSyncState=ie.state,ne.syncError=ie.syncError;break;case"contentLoading":ne.contentLoading=!0,ne.contentError=void 0;break;case"content":typeof ie.path=="string"&&(ne.path=ie.path),ne.contentLoading=!1,ne.content=ie.content,ne.contentError=ie.contentError;break;case"buildLog":ne.buildLog=ne.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ne.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(ne.activeSyncState="UP_TO_DATE",ne.buildLog=[]),ne}function le(se,ie,ne,X){var K,R;const[w,I]=(0,h.useReducer)(ye,{activeSyncState:"CHECKING",path:X,contentLoading:!0,buildLog:[]}),Z=(0,V.h_)(f.Dl),{retry:xe}=(0,p.Z)(async()=>{I({type:"contentLoading"});try{const Qe=await Z.getEntityDocs({kind:se,namespace:ie,name:ne},X);return I({type:"content",content:Qe,path:X}),Qe}catch(Qe){I({type:"content",contentError:Qe,path:X})}},[Z,se,ie,ne,X]),Ce=(0,h.useRef)({content:void 0,reload:()=>{}});return Ce.current={content:w.content,reload:xe},(0,m.default)(async()=>{I({type:"sync",state:"CHECKING"});const Qe=setTimeout(()=>{I({type:"sync",state:"BUILDING"})},1e3);try{switch(await Z.syncEntityDocs({kind:se,namespace:ie,name:ne},Nt=>{I({type:"buildLog",log:Nt})})){case"updated":Ce.current.content?I({type:"sync",state:"BUILD_READY"}):(Ce.current.reload(),I({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":I({type:"sync",state:"UP_TO_DATE"});break;default:I({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(St){I({type:"sync",state:"ERROR",syncError:St})}finally{clearTimeout(Qe)}},[se,ne,ie,Z,I,Ce]),{state:(0,h.useMemo)(()=>F({activeSyncState:w.activeSyncState,contentLoading:w.contentLoading,content:w.content}),[w.activeSyncState,w.content,w.contentLoading]),contentReload:xe,path:w.path,content:w.content,contentErrorMessage:(K=w.contentError)===null||K===void 0?void 0:K.toString(),syncErrorMessage:(R=w.syncError)===null||R===void 0?void 0:R.toString(),buildLog:w.buildLog}}const z=(0,h.createContext)({}),de=()=>(0,h.useContext)(z),D=se=>{const{children:ie}=se,{"*":ne=""}=(0,W.UO)(),{entityRef:X}=(0,f.x1)(),{kind:K,namespace:R,name:w}=X,I=le(K,R,w,ne);return(0,r.jsx)(z.Provider,{value:I,children:ie instanceof Function?ie(I):ie})},A=se=>ie=>(0,r.jsx)(D,{children:(0,r.jsx)(se,{...ie})})},95573:function(Pt,Le,n){"use strict";n.d(Le,{Fw:function(){return W},_Z:function(){return h},pd:function(){return f}});var r=n(60871);const h=(0,r.NT)({id:"techdocs:index-page"}),W=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Pt,Le,n){"use strict";n.r(Le),n.d(Le,{TechDocsSearchResultListItem:function(){return le}});var r=n(52322),h=n(2784),W=n(79692),f=n(49378),V=n(86136),m=n(90436),p=n(53974),F=n(15096);const ye=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),le=z=>{const{result:de,highlight:D,lineClamp:A=5,asListItem:se=!0,asLink:ie=!0,title:ne,icon:X}=z,K=ye(),R=({children:Z})=>ie?(0,r.jsx)(p.rU,{noTrack:!0,to:de.location,children:Z}):(0,r.jsx)(r.Fragment,{children:Z}),w=()=>{var Z,xe,Ce,B;const Qe=!((Z=D)===null||Z===void 0)&&Z.fields.title?(0,r.jsx)(F.FA,{text:D.fields.title,preTag:D.preTag,postTag:D.postTag}):de.title,St=!((xe=D)===null||xe===void 0)&&xe.fields.entityTitle?(0,r.jsx)(F.FA,{text:D.fields.entityTitle,preTag:D.preTag,postTag:D.postTag}):de.entityTitle,Nt=!((Ce=D)===null||Ce===void 0)&&Ce.fields.name?(0,r.jsx)(F.FA,{text:D.fields.name,preTag:D.preTag,postTag:D.postTag}):de.name;return de?(0,r.jsx)(f.Z,{className:K.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(R,{children:ne||(0,r.jsxs)(r.Fragment,{children:[Qe," | ",St!=null?St:Nt," docs"]})}),secondary:(0,r.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((B=D)===null||B===void 0)&&B.fields.text?(0,r.jsx)(F.FA,{text:D.fields.text,preTag:D.preTag,postTag:D.postTag}):de.text})}):null},I=({children:Z})=>se?(0,r.jsxs)(r.Fragment,{children:[X&&(0,r.jsx)(V.Z,{children:typeof X=="function"?X(de):X}),(0,r.jsx)("div",{className:K.flexContainer,children:Z})]}):(0,r.jsx)(r.Fragment,{children:Z});return(0,r.jsx)(I,{children:(0,r.jsx)(w,{})})}},22478:function(Pt,Le,n){"use strict";n.d(Le,{S:function(){return F}});var r=n(52322),h=n(15096),W=n(2784),f=n(73557),V=n(55511);const m=ye=>{var le;return(le=ye)===null||le===void 0?void 0:le.document},p=ye=>{const{entityId:le,entityTitle:z,debounceTime:de=150}=ye,[D,A]=(0,W.useState)(!1),se=(0,f.s0)(),{setFilters:ie,result:{loading:ne,value:X}}=(0,h.Rx)(),[K,R]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Ce=!0;if(Ce&&X){const B=X.results.slice(0,10);R(B)}return()=>{Ce=!1}},[ne,X]);const{kind:w,name:I,namespace:Z}=le;(0,W.useEffect)(()=>{ie(Ce=>({...Ce,kind:w,namespace:Z,name:I}))},[w,Z,I,ie]);const xe=(Ce,B)=>{if(m(B)){const{location:Qe}=B.document;se(Qe)}};return(0,r.jsx)(h.qO,{"data-testid":"techdocs-search-bar",size:"small",open:D,getOptionLabel:()=>"",filterOptions:Ce=>Ce,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:xe,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:K,renderOption:({document:Ce,highlight:B})=>(0,r.jsx)(V.TechDocsSearchResultListItem,{result:Ce,lineClamp:3,asListItem:!1,asLink:!1,title:Ce.title,highlight:B}),loading:ne,inputDebounceTime:de,inputPlaceholder:`Search ${z||le.name} docs`,freeSolo:!1})},F=ye=>{const le={term:"",types:["techdocs"],pageCursor:"",filters:ye.entityId};return(0,r.jsx)(h.Nd,{initialState:le,children:(0,r.jsx)(p,{...ye})})}},53260:function(){}},function(Pt){var Le=function(r){return Pt(Pt.s=r)};Pt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Le(48514)});var n=Pt.O()}]);})();
|
|
521
|
-
|
|
522
|
-
//# sourceMappingURL=main.e2534c23.js.map
|