@techdocs/cli 1.4.1-next.3 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.94c986d1.chunk.js → 1032.16924053.chunk.js} +2 -2
- package/dist/embedded-app/static/{1032.94c986d1.chunk.js.map → 1032.16924053.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1049.dd1f0d99.chunk.js +7 -0
- package/dist/embedded-app/static/1049.dd1f0d99.chunk.js.map +1 -0
- package/dist/embedded-app/static/{1105.facb65a8.chunk.js → 1105.0b45e765.chunk.js} +2 -2
- package/dist/embedded-app/static/{1105.facb65a8.chunk.js.map → 1105.0b45e765.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{184.c1c44877.chunk.js → 184.90489ed7.chunk.js} +2 -2
- package/dist/embedded-app/static/{184.c1c44877.chunk.js.map → 184.90489ed7.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2440.e147b5dc.chunk.js → 2440.fa0c12ae.chunk.js} +2 -2
- package/dist/embedded-app/static/{2440.e147b5dc.chunk.js.map → 2440.fa0c12ae.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5458.742cd271.chunk.js → 5458.fe2a0a6d.chunk.js} +2 -2
- package/dist/embedded-app/static/{5458.742cd271.chunk.js.map → 5458.fe2a0a6d.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6051.56a76749.chunk.js +4 -0
- package/dist/embedded-app/static/6051.56a76749.chunk.js.map +1 -0
- package/dist/embedded-app/static/{732.b2dac5c3.chunk.js → 732.e935fc39.chunk.js} +2 -2
- package/dist/embedded-app/static/{732.b2dac5c3.chunk.js.map → 732.e935fc39.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.4cfb6ad7.chunk.js → 7560.bb8f0386.chunk.js} +2 -2
- package/dist/embedded-app/static/{7560.4cfb6ad7.chunk.js.map → 7560.bb8f0386.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7670.d2126c9e.chunk.js → 7670.ae73207b.chunk.js} +2 -2
- package/dist/embedded-app/static/{7670.d2126c9e.chunk.js.map → 7670.ae73207b.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.7cd64666.chunk.js → 7750.6fd0ac0b.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.7cd64666.chunk.js.map → 7750.6fd0ac0b.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9323.0aa3540d.chunk.js → 9323.4703a3d8.chunk.js} +2 -2
- package/dist/embedded-app/static/{9323.0aa3540d.chunk.js.map → 9323.4703a3d8.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.fab4c42c.chunk.js → 9545.b25a5c55.chunk.js} +2 -2
- package/dist/embedded-app/static/{9545.fab4c42c.chunk.js.map → 9545.b25a5c55.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9770.b5b411d2.chunk.js → 9770.d2ae96e3.chunk.js} +2 -2
- package/dist/embedded-app/static/{9770.b5b411d2.chunk.js.map → 9770.d2ae96e3.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.7f000815.js +508 -0
- package/dist/embedded-app/static/main.7f000815.js.map +1 -0
- package/dist/embedded-app/static/module-luxon.ee277e4b.js +3 -0
- package/dist/embedded-app/static/module-luxon.ee277e4b.js.map +1 -0
- package/dist/embedded-app/static/{module-material-ui.1f3c23cb.js → module-material-ui.821488a0.js} +1 -1
- package/dist/embedded-app/static/{module-material-ui.1f3c23cb.js.map → module-material-ui.821488a0.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.0f1c16cc.js → runtime.7f000815.js} +2 -2
- package/dist/embedded-app/static/{runtime.0f1c16cc.js.map → runtime.7f000815.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.0f1c16cc.js → vendor.7f000815.js} +44 -44
- package/dist/embedded-app/static/vendor.7f000815.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/6051.bd9f4d48.chunk.js +0 -4
- package/dist/embedded-app/static/6051.bd9f4d48.chunk.js.map +0 -1
- package/dist/embedded-app/static/6174.55ddb654.chunk.js +0 -3
- package/dist/embedded-app/static/6174.55ddb654.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.0f1c16cc.js +0 -508
- package/dist/embedded-app/static/main.0f1c16cc.js.map +0 -1
- package/dist/embedded-app/static/module-luxon.f096b58d.js +0 -3
- package/dist/embedded-app/static/module-luxon.f096b58d.js.map +0 -1
- package/dist/embedded-app/static/vendor.0f1c16cc.js.map +0 -1
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{4791:function(wt,De,n){"use strict";n.d(De,{n3:function(){return v},MS:function(){return Ie}});var d=n(87612),r=n(25271),z=n(23054),I=n(96279),g=n.n(I);const v=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");function c(fe){return!fe.cursor}function B(fe){return!c(fe)}class Ie{async getEntityAncestors(G,$){const{kind:R,namespace:O,name:re}=(0,r.of)(G.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(R)}/${encodeURIComponent(O)}/${encodeURIComponent(re)}/ancestry`,$)}async getLocationById(G,$){return await this.requestOptional("GET",`/locations/${encodeURIComponent(G)}`,$)}async getEntities(G,$){const{filter:R=[],fields:O=[],order:re,offset:X,limit:te,after:D}=G!=null?G:{},A=this.getParams(R);if(O.length&&A.push(`fields=${O.map(encodeURIComponent).join(",")}`),re)for(const me of[re].flat())me&&A.push(`order=${encodeURIComponent(me.order)}:${encodeURIComponent(me.field)}`);X!==void 0&&A.push(`offset=${X}`),te!==void 0&&A.push(`limit=${te}`),D!==void 0&&A.push(`after=${encodeURIComponent(D)}`);const L=A.length?`?${A.join("&")}`:"",P=await this.requestRequired("GET",`/entities${L}`,$),V=(me,ze)=>{var rt,H;if(((rt=me.metadata)===null||rt===void 0?void 0:rt.name)===void 0||me.kind===void 0||((H=ze.metadata)===null||H===void 0?void 0:H.name)===void 0||ze.kind===void 0)return 0;const ot=(0,r.eE)(me),vt=(0,r.eE)(ze);return ot<vt?-1:ot>vt?1:0};return{items:P.sort(V)}}async getEntitiesByRefs(G,$){var R;const O={entityRefs:G.entityRefs};!((R=G.fields)===null||R===void 0)&&R.length&&(O.fields=G.fields);const X=`${await this.discoveryApi.getBaseUrl("catalog")}/entities/by-refs`,te=await this.fetchApi.fetch(X,{headers:{"Content-Type":"application/json",...($==null?void 0:$.token)&&{Authorization:`Bearer ${$==null?void 0:$.token}`}},method:"POST",body:JSON.stringify(O)});if(!te.ok)throw await z.VL.fromResponse(te);const{items:D}=await te.json();return{items:D.map(A=>A!=null?A:void 0)}}async queryEntities(G={},$){const R=[];if(c(G)){var O,re;const{fields:te=[],filter:D,limit:A,orderFields:L,fullTextFilter:P}=G;R.push(...this.getParams(D)),A!==void 0&&R.push(`limit=${A}`),L!==void 0&&(Array.isArray(L)?L:[L]).forEach(({field:me,order:ze})=>R.push(`orderField=${me},${ze}`)),te.length&&R.push(`fields=${te.map(encodeURIComponent).join(",")}`);const V=P==null||(O=P.term)===null||O===void 0?void 0:O.trim();V&&R.push(`fullTextFilterTerm=${V}`),!(P==null||(re=P.fields)===null||re===void 0)&&re.length&&R.push(`fullTextFilterFields=${P.fields.join(",")}`)}else{const{fields:te=[],limit:D,cursor:A}=G;R.push(`cursor=${A}`),D!==void 0&&R.push(`limit=${D}`),te.length&&R.push(`fields=${te.map(encodeURIComponent).join(",")}`)}const X=R.length?`?${R.join("&")}`:"";return this.requestRequired("GET",`/entities/by-query${X}`,$)}async getEntityByRef(G,$){const{kind:R,namespace:O,name:re}=(0,r.of)(G);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(R)}/${encodeURIComponent(O)}/${encodeURIComponent(re)}`,$)}async getEntityByName(G,$){const{kind:R,namespace:O="default",name:re}=G;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(R)}/${encodeURIComponent(O)}/${encodeURIComponent(re)}`,$)}async refreshEntity(G,$){const R=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...($==null?void 0:$.token)&&{Authorization:`Bearer ${$==null?void 0:$.token}`}},method:"POST",body:JSON.stringify({entityRef:G})});if(R.status!==200)throw new Error(await R.text())}async getEntityFacets(G,$){const{filter:R=[],facets:O}=G,re=this.getParams(R);for(const te of O)re.push(`facet=${encodeURIComponent(te)}`);const X=re.length?`?${re.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${X}`,$)}async addLocation(G,$){const{type:R="url",target:O,dryRun:re}=G,X=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${re?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...($==null?void 0:$.token)&&{Authorization:`Bearer ${$==null?void 0:$.token}`}},method:"POST",body:JSON.stringify({type:R,target:O})});if(X.status!==201)throw new Error(await X.text());const{location:te,entities:D,exists:A}=await X.json();if(!te)throw new Error(`Location wasn't added: ${O}`);return{location:te,entities:D,exists:A}}async getLocationByRef(G,$){return(await this.requestRequired("GET","/locations",$)).map(O=>O.data).find(O=>G===(0,r.NZ)(O))}async removeLocationById(G,$){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(G)}`,$)}async removeEntityByUid(G,$){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(G)}`,$)}async validateEntity(G,$,R){const O=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/validate-entity`,{headers:{"Content-Type":"application/json",...(R==null?void 0:R.token)&&{Authorization:`Bearer ${R==null?void 0:R.token}`}},method:"POST",body:JSON.stringify({entity:G,location:$})});if(O.ok)return{valid:!0};if(O.status!==400)throw await z.VL.fromResponse(O);const{errors:re=[]}=await O.json();return{valid:!1,errors:re}}async requestIgnored(G,$,R){const O=`${await this.discoveryApi.getBaseUrl("catalog")}${$}`,re=R!=null&&R.token?{Authorization:`Bearer ${R.token}`}:{},X=await this.fetchApi.fetch(O,{method:G,headers:re});if(!X.ok)throw await z.VL.fromResponse(X)}async requestRequired(G,$,R){const O=`${await this.discoveryApi.getBaseUrl("catalog")}${$}`,re=R!=null&&R.token?{Authorization:`Bearer ${R.token}`}:{},X=await this.fetchApi.fetch(O,{method:G,headers:re});if(!X.ok)throw await z.VL.fromResponse(X);return X.json()}async requestOptional(G,$,R){const O=`${await this.discoveryApi.getBaseUrl("catalog")}${$}`,re=R!=null&&R.token?{Authorization:`Bearer ${R.token}`}:{},X=await this.fetchApi.fetch(O,{method:G,headers:re});if(!X.ok){if(X.status===404)return;throw await z.VL.fromResponse(X)}return await X.json()}getParams(G=[]){const $=[];for(const R of[G].flat()){const O=[];for(const[re,X]of Object.entries(R))for(const te of[X].flat())te===v?O.push(encodeURIComponent(re)):typeof te=="string"&&O.push(`${encodeURIComponent(re)}=${encodeURIComponent(te)}`);O.length&&$.push(`filter=${O.join(",")}`)}return $}constructor(G){(0,d._)(this,"discoveryApi",void 0),(0,d._)(this,"fetchApi",void 0),this.discoveryApi=G.discoveryApi,this.fetchApi=G.fetchApi||{fetch:g()}}}},25271:function(wt,De,n){"use strict";n.d(De,{Tf:function(){return z},P1:function(){return on},q1:function(){return Hn},M6:function(){return we},l2:function(){return r},zG:function(){return d},w$:function(){return On},nP:function(){return hn},aS:function(){return Qt},S4:function(){return Pt},cz:function(){return dt},iB:function(){return bt},CV:function(){return et},of:function(){return Tt},Ou:function(){return $e},eE:function(){return pt},NZ:function(){return Ue}});const d="default",r="backstage.io/view-url",z="backstage.io/edit-url",I="kubernetes.io/api-server",g="kubernetes.io/api-server-certificate-authority",v="kubernetes.io/auth-provider";var c=n(76635),B=n.n(c);class Ie{async enforce(U){return U.metadata.namespace?U:lodash.merge({metadata:{namespace:this.namespace}},U)}constructor(U=DEFAULT_NAMESPACE){_define_property(this,"namespace",void 0),this.namespace=U}}class fe{static isValidPrefixAndOrSuffix(U,ve,Ee,tt){if(typeof U!="string")return!1;const st=U.split(ve);return st.length===1?tt(st[0]):st.length===2?Ee(st[0])&&tt(st[1]):!1}static isJsonSafe(U){try{return B().isEqual(U,JSON.parse(JSON.stringify(U)))}catch{return!1}}static isValidDnsSubdomain(U){return typeof U=="string"&&U.length>=1&&U.length<=253&&U.split(".").every(fe.isValidDnsLabel)}static isValidDnsLabel(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-z0-9]+(?:\-+[a-z0-9]+)*$/.test(U)}static isValidTag(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(U)}static isValidUrl(U){if(typeof U!="string")return!1;try{return new URL(U),!0}catch{return!1}}static isValidString(U){var ve;return typeof U=="string"&&((ve=U==null?void 0:U.trim())===null||ve===void 0?void 0:ve.length)>=1}static isNonEmptyString(U){var ve;return typeof U=="string"&&((ve=U==null?void 0:U.trim())===null||ve===void 0?void 0:ve.length)>=1}}var G=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}}}}}'),$=n(27991),R=n.n($),O=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"}}}`),re=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}}}}}}'),X=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","target"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference"},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const te=new Map,D=[G,O,re,X];function A(q){if(!(q!=null&&q.length))throw new TypeError("Unknown error");const U=q[0];throw new TypeError(`${U.instancePath||"<root>"} ${U.message}${U.params?` - ${Object.entries(U.params).map(([ve,Ee])=>`${ve}: ${Ee}`).join(", ")}`:""}`)}function L(q,U={}){var ve;const Ee=(ve=U==null?void 0:U.disableCache)!==null&&ve!==void 0?ve:!1,tt=Ee?"":JSON.stringify(q);if(!Ee){const pn=te.get(tt);if(pn)return pn}const st=P(q),kt=new(R())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});st.length&&kt.addSchema(st,void 0,void 0,!0);const Gt=kt.compile(q);return Ee||te.set(tt,Gt),Gt}function P(q){if(typeof q!="object")return[];const U=new Set;q.$id&&U.add(q.$id);const ve=new Array,Ee=[q];for(;Ee.length;){const tt=Ee.pop();for(const st of V(tt))if(!U.has(st)){U.add(st);const kt=D.find(Gt=>Gt.$id===st);kt&&(ve.push(kt),Ee.push(kt))}}return ve}function*V(q){const U=[q];for(;U.length;){const ve=U.pop();if(typeof ve=="object"&&ve)for(const[Ee,tt]of Object.entries(ve))Ee==="$ref"&&typeof tt=="string"?yield tt.split("#")[0]:U.push(tt)}}function me(q){const U=compileAjvSchema(q||entityEnvelopeSchema);return ve=>{if(U(ve)===!0)return ve;throw throwAjvError(U.errors)}}function ze(q){const U=L(q);return ve=>{var Ee;if(U(ve)===!0)return ve;const st=(Ee=U.errors)===null||Ee===void 0?void 0:Ee.filter(kt=>["/kind","/apiVersion"].includes(kt.instancePath));if(st!=null&&st.length&&st.every(kt=>kt.keyword==="enum"))return!1;throw A(U.errors)}}function rt(q){const U=compileAjvSchema(q||entitySchema);return ve=>{if(U(ve)===!0)return ve;throw throwAjvError(U.errors)}}class H{static isValidApiVersion(U){return fe.isValidPrefixAndOrSuffix(U,"/",fe.isValidDnsSubdomain,ve=>ve.length>=1&&ve.length<=63&&/^[a-z0-9A-Z]+$/.test(ve))}static isValidKind(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(U)}static isValidObjectName(U){return typeof U=="string"&&U.length>=1&&U.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(U)}static isValidNamespace(U){return fe.isValidDnsLabel(U)}static isValidLabelKey(U){return fe.isValidPrefixAndOrSuffix(U,"/",fe.isValidDnsSubdomain,H.isValidObjectName)}static isValidLabelValue(U){return U===""||H.isValidObjectName(U)}static isValidAnnotationKey(U){return fe.isValidPrefixAndOrSuffix(U,"/",fe.isValidDnsSubdomain,H.isValidObjectName)}static isValidAnnotationValue(U){return typeof U=="string"}}const ot={isValidApiVersion:H.isValidApiVersion,isValidKind:H.isValidKind,isValidEntityName:H.isValidObjectName,isValidNamespace:H.isValidNamespace,isValidLabelKey:H.isValidLabelKey,isValidLabelValue:H.isValidLabelValue,isValidAnnotationKey:H.isValidAnnotationKey,isValidAnnotationValue:H.isValidAnnotationValue,isValidTag:q=>typeof q=="string"&&q.length>=1&&q.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(q)};function vt(q={}){return{...ot,...q}}class Je{async enforce(U){function ve(ie,m,N){if(m==null)throw new Error(`${ie} must have a value`);let _;try{_=N(m)}catch(J){throw new Error(`${ie} could not be validated, ${J}`)}if(!_){let J;switch(N.name){case"isValidLabelValue":case"isValidObjectName":J="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":J="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":J="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":J="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":J="a string";break;case"isValidKind":J="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":J="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":J="a non empty string";break;default:J=void 0;break}const Ce=J?` expected ${J} but found "${m}".`:"";throw new Error(`"${ie}" is not valid;${Ce} 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(ie,m,N){return m===void 0||ve(ie,m,N)}ve("apiVersion",U.apiVersion,this.validators.isValidApiVersion),ve("kind",U.kind,this.validators.isValidKind),ve("metadata.name",U.metadata.name,this.validators.isValidEntityName),Ee("metadata.namespace",U.metadata.namespace,this.validators.isValidNamespace);var tt;for(const[ie,m]of Object.entries((tt=U.metadata.labels)!==null&&tt!==void 0?tt:[]))ve(`labels.${ie}`,ie,this.validators.isValidLabelKey),ve(`labels.${ie}`,m,this.validators.isValidLabelValue);var st;for(const[ie,m]of Object.entries((st=U.metadata.annotations)!==null&&st!==void 0?st:[]))ve(`annotations.${ie}`,ie,this.validators.isValidAnnotationKey),ve(`annotations.${ie}`,m,this.validators.isValidAnnotationValue);var kt;const Gt=(kt=U.metadata.tags)!==null&&kt!==void 0?kt:[];for(let ie=0;ie<Gt.length;++ie)ve(`tags.${ie}`,Gt[ie],this.validators.isValidTag);var pn;const ee=(pn=U.metadata.links)!==null&&pn!==void 0?pn:[];for(let ie=0;ie<ee.length;++ie){var Y,oe,he;ve(`links.${ie}.url`,(Y=ee[ie])===null||Y===void 0?void 0:Y.url,CommonValidatorFunctions.isValidUrl),Ee(`links.${ie}.title`,(oe=ee[ie])===null||oe===void 0?void 0:oe.title,CommonValidatorFunctions.isNonEmptyString),Ee(`links.${ie}.icon`,(he=ee[ie])===null||he===void 0?void 0:he.icon,KubernetesValidatorFunctions.isValidObjectName)}return U}constructor(U=makeValidator()){_define_property(this,"validators",void 0),this.validators=U}}class ht{async enforce(U){if(!this.validate){const tt=new Ajv({allowUnionTypes:!0});this.validate=tt.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(U)===!0)return U;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 Le(q){let U=q.indexOf(":");const ve=q.indexOf("/");ve!==-1&&ve<U&&(U=-1);const Ee=U===-1?void 0:q.slice(0,U),tt=ve===-1?void 0:q.slice(U+1,ve),st=q.slice(Math.max(U+1,ve+1));if(Ee===""||tt===""||st==="")throw new TypeError(`Entity reference "${q}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:Ee,namespace:tt,name:st}}function bt(q){return{kind:q.kind,namespace:q.metadata.namespace||d,name:q.metadata.name}}function Tt(q,U){if(!q)throw new Error("Entity reference must not be empty");const ve=U==null?void 0:U.defaultKind,Ee=(U==null?void 0:U.defaultNamespace)||d;let tt,st,kt;if(typeof q=="string"){const oe=Le(q);var Gt;tt=(Gt=oe.kind)!==null&&Gt!==void 0?Gt:ve;var pn;st=(pn=oe.namespace)!==null&&pn!==void 0?pn:Ee,kt=oe.name}else{var ee;tt=(ee=q.kind)!==null&&ee!==void 0?ee:ve;var Y;st=(Y=q.namespace)!==null&&Y!==void 0?Y:Ee,kt=q.name}if(tt)if(st){if(!kt){const oe=JSON.stringify(q);throw new Error(`Entity reference ${oe} had missing or empty name`)}}else{const oe=JSON.stringify(q);throw new Error(`Entity reference ${oe} had missing or empty namespace`)}else{const oe=JSON.stringify(q);throw new Error(`Entity reference ${oe} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:tt,namespace:st,name:kt}}function pt(q){let U,ve,Ee;if("metadata"in q){U=q.kind;var tt;ve=(tt=q.metadata.namespace)!==null&&tt!==void 0?tt:d,Ee=q.metadata.name}else{U=q.kind;var st;ve=(st=q.namespace)!==null&&st!==void 0?st:d,Ee=q.name}return`${U.toLocaleLowerCase("en-US")}:${ve.toLocaleLowerCase("en-US")}/${Ee.toLocaleLowerCase("en-US")}`}var gt=n(87612);class jt{async enforce(U){let ve=U;for(const Ee of this.policies){const tt=await Ee.enforce(ve);if(!tt)throw new Error(`Policy ${Ee.constructor.name} did not return a result`);ve=tt}return ve}constructor(U){(0,gt._)(this,"policies",void 0),this.policies=U}}class $t{async enforce(U){for(const ve of this.policies){const Ee=await ve.enforce(U);if(Ee)return Ee}throw new Error("The entity did not match any known policy")}constructor(U){(0,gt._)(this,"policies",void 0),this.policies=U}}const He={allOf(q){return new jt(q)},oneOf(q){return new $t(q)}};var Xt=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 ue(q){let U;return{async check(ve){return U||(U=ze(q)),U(ve)===ve}}}const xe=ue(Xt);var Fe=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ComponentV1alpha1","description":"A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \\"unit of software\\", usually with a distinct deployable or linkable artifact.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Component"]},"spec":{"type":"object","required":["type","lifecycle","owner"],"properties":{"type":{"type":"string","description":"The type of component.","examples":["service","website","library"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the component.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the component belongs to.","minLength":1},"subcomponentOf":{"type":"string","description":"An entity reference to another component of which the component is a part.","minLength":1},"providesApis":{"type":"array","description":"An array of entity references to the APIs that are provided by the component.","items":{"type":"string","minLength":1}},"consumesApis":{"type":"array","description":"An array of entity references to the APIs that are consumed by the component.","items":{"type":"string","minLength":1}},"dependsOn":{"type":"array","description":"An array of references to other entities that the component depends on to function.","items":{"type":"string","minLength":1}}}}}}]}');const Qe=ue(Fe);var mt=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"DomainV1alpha1","description":"A Domain groups a collection of systems that share terminology, domain models, business purpose, or documentation, i.e. form a bounded context.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Domain","metadata":{"name":"artists","description":"Everything about artists"},"spec":{"owner":"artist-relations-team"}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Domain"]},"spec":{"type":"object","required":["owner"],"properties":{"owner":{"type":"string","description":"An entity reference to the owner of the component.","examples":["artist-relations-team","user:john.johnson"],"minLength":1}}}}}]}');const Rt=ue(mt);var ct=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 Et=ue(ct);var Lt=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"LocationV1alpha1","description":"A location is a marker that references other places to look for catalog data.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Location","metadata":{"name":"org-data"},"spec":{"type":"url","targets":["http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-consultants.yaml"]}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["Location"]},"spec":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The single location type, that's common to the targets specified in the spec. If it is left out, it is inherited from the location type that originally read the entity data.","examples":["url"],"minLength":1},"target":{"type":"string","description":"A single target as a string. Can be either an absolute path/URL (depending on the type), or a relative path such as ./details/catalog-info.yaml which is resolved relative to the location of this Location entity itself.","examples":["./details/catalog-info.yaml"],"minLength":1},"targets":{"type":"array","description":"A list of targets as strings. They can all be either absolute paths/URLs (depending on the type), or relative paths such as ./details/catalog-info.yaml which are resolved relative to the location of this Location entity itself.","items":{"type":"string","examples":["./details/catalog-info.yaml","http://github.com/myorg/myproject/org-data-dump/catalog-info-staff.yaml"],"minLength":1}},"presence":{"type":"string","description":"Whether the presence of the location target is required and it should be considered an error if it can not be found","default":"required","examples":["required"],"enum":["required","optional"]}}}}}]}`);const Jt=ue(Lt),Pt="ownedBy",an="ownerOf",Wt="consumesApi",sn="apiConsumedBy",zn="providesApi",An="apiProvidedBy",hn="dependsOn",On="dependencyOf",kn="parentOf",Wn="childOf",Bn="memberOf",Qn="hasMember",dt="partOf",Qt="hasPart";var wn=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 Tn=ue(wn);var yn=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 Mt=ue(yn);var ln=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 bn=ue(ln),on="backstage.io/managed-by-location",Hn="backstage.io/managed-by-origin-location",we="backstage.io/source-location",le=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;function $e(q){if(typeof q!="string")throw new TypeError(`Unable to parse location ref '${q}', unexpected argument ${typeof q}`);const U=q.indexOf(":");if(U<0)throw new TypeError(`Unable to parse location ref '${q}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ve=q.substring(0,U).trim(),Ee=q.substring(U+1).trim();if(!ve||!Ee)throw new TypeError(`Unable to parse location ref '${q}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ve==="http"||ve==="https")throw new TypeError(`Invalid location ref '${q}', please prefix it with 'url:', e.g. 'url:${q}'`);if(le.test(Ee))throw new TypeError(`Invalid location ref '${q}', target is a javascript: URL`);return{type:ve,target:Ee}}function Ue(q){const{type:U,target:ve}=q;if(U){if(!ve)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");if(le.test(ve))throw new TypeError(`Invalid location ref '${U}:${ve}', target is a javascript: URL`);return`${U}:${ve}`}function et(q){var U,ve,Ee,tt,st;const kt=(st=(U=q.metadata)===null||U===void 0||(ve=U.annotations)===null||ve===void 0?void 0:ve[we])!==null&&st!==void 0?st:(Ee=q.metadata)===null||Ee===void 0||(tt=Ee.annotations)===null||tt===void 0?void 0:tt[on];if(!kt)throw new Error(`Entity '${pt(q)}' is missing location`);return $e(kt)}},47223:function(wt,De,n){"use strict";n.d(De,{Oi:function(){return xe},VY:function(){return ft},yW:function(){return nl},XF:function(){return mt},mn:function(){return et},NX:function(){return d},ub:function(){return oe},mf:function(){return al},yu:function(){return fn},h4:function(){return ja},M6:function(){return Eo},i9:function(){return yl},aR:function(){return Ft},rJ:function(){return kr},Oh:function(){return jl},hu:function(){return Sl},rU:function(){return ot},Qj:function(){return Je},nU:function(){return Mr},SA:function(){return To},sk:function(){return Xe},Or:function(){return Oo},T3:function(){return Ea},g9:function(){return Tl},Ex:function(){return oo},Gk:function(){return S},tn:function(){return tr},Ph:function(){return qt},YE:function(){return As},v7:function(){return t},R6:function(){return Os},tR:function(){return aa},uw:function(){return Ko},qt:function(){return si},iA:function(){return wa},GB:function(){return Rn},po:function(){return hr},mZ:function(){return vo},Pf:function(){return zo}});var d={};n.r(d),n.d(d,{Nm:function(){return Rt},ht:function(){return Lt},LJ:function(){return Et}});var r=n(52322),z=n(60871),I=n(19928),g=n(2784);function v(e){const[o,l]=useState([]),h=useApi(alertApiRef),{anchorOrigin:f={vertical:"top",horizontal:"center"},transientTimeoutMs:x}=e,C=x!=null?x:5e3;useEffect(()=>{const F=h.alert$().subscribe(pe=>l(de=>de.concat(pe)));return()=>{F.unsubscribe()}},[h]);const[M]=o;if(useEffect(()=>{if(M&&M.display==="transient"){const F=setTimeout(()=>{l(pe=>{const de=pe.filter(je=>je!==M);return de.length===pe.length?pe:de})},C);return()=>clearTimeout(F)}},[M,C]),o.length===0)return null;const K=()=>{l(F=>F.filter(pe=>pe!==M))};return _jsx(Snackbar,{open:!0,anchorOrigin:f,children:_jsx(Alert,{action:_jsx(IconButton,{color:"inherit",size:"small",onClick:K,"data-testid":"error-button-close",children:_jsx(CloseIcon,{})}),severity:M.severity,children:_jsxs(Typography,{component:"span",children:[String(M.message),o.length>1&&_jsx("em",{children:` (${o.length-1} older ${pluralize("message",o.length-1)})`})]})})})}var c=n(79692);const B=(0,c.Z)(e=>({avatar:{width:"4rem",height:"4rem",color:e.palette.common.white},avatarText:{fontWeight:e.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function Ie(e){const{displayName:o,picture:l,customStyles:h}=e,f=B();let x={...h};const C={fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight};return l||(x={backgroundColor:stringToColor(o||""),...h}),_jsx(MaterialAvatar,{alt:o,src:l,className:f.avatar,style:x,children:o&&_jsx(Typography,{variant:"h6",component:"span",className:f.avatarText,style:C,children:extractInitials(o)})})}var fe=n(77277),G=n(86689),$=n(90436),R=n(72779),O=n.n(R),re=n(76635),X=n(73557),te=n(71597);function D(){const[e]=(0,X.is)((0,r.jsx)(X.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!e.index}const A=(0,c.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"}),L=e=>/^([a-z+.-]+):/.test(e),P=/^[\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,V=window.open;if(V&&!V.__backstage){const e=function(...l){const h=String(l[0]);if(P.test(h))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return V.apply(this,l)};e.__backstage=!0,window.open=e}const me=()=>{try{return(0,z.h_)(z.Ds).getOptionalString("app.baseUrl")}catch{return}},ze=()=>{const e="http://sample.dev";var o;const l=(o=me())!==null&&o!==void 0?o:"/",{pathname:h}=new URL(l,e);return(0,re.trimEnd)(h,"/")},rt=e=>{let o=String(e);const l=ze(),h=L(o),f=o.startsWith(l);return!h&&!f&&(o=l.concat(o)),o},H=e=>{if(e instanceof Array)return e.map(H).join(" ").trim();if(typeof e=="object"&&e){var o;return H(e==null||(o=e.props)===null||o===void 0?void 0:o.children)}return["string","number"].includes(typeof e)?String(e):""},ot=g.forwardRef(({onClick:e,noTrack:o,...l},h)=>{const f=A(),x=(0,z.z$)(),C=D()?rt(l.to):l.to,M=H(l.children)||C,K=L(C),F=K&&!!/^https?:/.exec(C);if(P.test(C))throw new Error("Link component rejected javascript: URL as a security precaution");const pe=de=>{e==null||e(de),o||x.captureEvent("click",M,{attributes:{to:C}})};return K?(0,r.jsxs)(G.Z,{...F?{target:"_blank",rel:"noopener"}:{},...l,ref:h,href:C,onClick:pe,className:O()(f.externalLink,l.className),children:[l.children,(0,r.jsx)($.Z,{component:"span",className:f.visuallyHidden,children:", Opens in a new window"})]}):(0,r.jsx)(G.Z,{...l,ref:h,component:te.rU,to:C,onClick:pe})}),vt=g.forwardRef((e,o)=>(0,r.jsx)(ot,{ref:o,...e,color:"initial"})),Je=g.forwardRef((e,o)=>(0,r.jsx)(fe.Z,{ref:o,component:vt,...e})),ht=null;var Le=n(95544),bt=n(60364),Tt=n(83229),pt=n(26639),gt=n(39595),jt=n(61837),$t=n(80030),He=n(19353),Xt=n(95074);function ue(e){const{text:o,tooltipDelay:l=1e3,tooltipText:h="Text copied to clipboard","aria-label":f="Copy text"}=e,x=(0,z.h_)(z.VE),[C,M]=(0,g.useState)(!1),[{error:K},F]=(0,Xt.Z)();(0,g.useEffect)(()=>{K&&x.post(K)},[K,x]);const pe=de=>{de.stopPropagation(),M(!0),F(o)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)($t.ZP,{id:"copy-test-tooltip",title:h,placement:"top",leaveDelay:l,onClose:()=>M(!1),open:C,children:(0,r.jsx)(jt.Z,{onClick:pe,"aria-label":f,children:(0,r.jsx)(He.Z,{})})})})}function xe(e){const{text:o,language:l,showLineNumbers:h=!1,highlightedNumbers:f,customStyle:x,showCopyCodeButton:C=!1}=e,M=(0,bt.Z)(),K=M.palette.type==="dark"?pt.Z:gt.Z,F=M.palette.type==="dark"?"#256bf3":"#e6ffed";return(0,r.jsxs)(Le.Z,{position:"relative",children:[(0,r.jsx)(Tt.Z,{customStyle:x,language:l,style:K,showLineNumbers:h,wrapLines:!0,lineNumberStyle:{color:M.palette.textVerySubtle},lineProps:pe=>f!=null&&f.includes(pe)?{style:{backgroundColor:F}}:{},children:o}),C&&(0,r.jsx)(Le.Z,{position:"absolute",top:0,right:0,children:(0,r.jsx)(ue,{text:o})})]})}var Fe=n(41156),Qe=n(88188);function mt(e){const{title:o,to:l}=e,h=(0,Fe.Z)(f=>f.breakpoints.down("xs"));return l?h?(0,r.jsx)(jt.Z,{component:te.rU,color:"primary",title:o,size:"small",to:l,children:(0,r.jsx)(Qe.Z,{})}):(0,r.jsx)(fe.Z,{component:te.rU,variant:"contained",color:"primary",to:l,children:o}):null}var Rt;(function(e){e.TOP_BOTTOM="TB",e.BOTTOM_TOP="BT",e.LEFT_RIGHT="LR",e.RIGHT_LEFT="RL"})(Rt||(Rt={}));var ct;(function(e){e.UP_LEFT="UL",e.UP_RIGHT="UR",e.DOWN_LEFT="DL",e.DOWN_RIGHT="DR"})(ct||(ct={}));var Et;(function(e){e.NETWORK_SIMPLEX="network-simplex",e.TIGHT_TREE="tight-tree",e.LONGEST_PATH="longest-path"})(Et||(Et={}));var Lt;(function(e){e.LEFT="l",e.RIGHT="r",e.CENTER="c"})(Lt||(Lt={}));var Jt=n(27397),Pt=n(11105),an=n(97963),Wt=n(46506),sn=n.n(Wt),zn=n(54073),An=n.n(zn),hn=n(10368);const On=(0,c.Z)(e=>({node:{fill:e.palette.primary.light,stroke:e.palette.primary.light},text:{fill:e.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function kn({node:{id:e}}){const o=On(),[l,h]=g.useState(0),[f,x]=g.useState(0),C=g.useRef(null);g.useLayoutEffect(()=>{if(C.current){let{height:pe,width:de}=C.current.getBBox();pe=Math.round(pe),de=Math.round(de),(pe!==f||de!==l)&&(h(de),x(pe))}},[l,f]);const M=10,K=l+M*2,F=f+M*2;return(0,r.jsxs)("g",{children:[(0,r.jsx)("rect",{className:o.node,width:K,height:F,rx:10}),(0,r.jsx)("text",{ref:C,className:o.text,y:F/2,x:K/2,textAnchor:"middle",alignmentBaseline:"middle",children:e})]})}const Wn="arrow-marker",Bn="node",Qn="edge",dt="label",Qt=(0,hn.Z)(e=>({node:{transition:`${e.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),wn=e=>(0,r.jsx)(kn,{...e});function Tn({render:e=wn,setNode:o,node:l}){const{width:h,height:f,x=0,y:C=0}=l,M=l,K=Qt(),F=g.useRef(null);return g.useLayoutEffect(()=>{if(F.current){let{height:pe,width:de}=F.current.getBBox();pe=Math.round(pe),de=Math.round(de),(pe!==f||de!==h)&&o(l.id,{...l,height:pe,width:de})}},[l,h,f,o]),(0,r.jsx)("g",{ref:F,"data-testid":Bn,className:K.node,transform:`translate(${x-h/2},${C-f/2})`,children:e({node:M})})}var yn=n(76985),Mt=n(39829),ln=n(19574),bn=n.n(ln);const on=(0,hn.Z)(e=>({text:{fill:e.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function Hn({edge:{label:e}}){const o=on();return(0,r.jsx)("text",{className:o.text,textAnchor:"middle",children:e})}const we=(0,hn.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"}),le=e=>(0,r.jsx)(Hn,{...e});function $e({render:e=le,setEdge:o,id:l,edge:h,curve:f}){const{x=0,y:C=0,width:M,height:K,points:F}=h,pe=h,de=we(),je=g.useRef(null);g.useLayoutEffect(()=>{if(je.current){let{height:_e,width:Dt}=je.current.getBBox();_e=Math.round(_e),Dt=Math.round(Dt),(_e!==K||Dt!==M)&&o(l,{...h,height:_e,width:Dt})}},[h,K,M,o,l]);let Oe="";const Me=g.useMemo(()=>yn.Z().x(_e=>_e.x).y(_e=>_e.y).curve(Mt[f]),[f]);if(F){const _e=F.filter(Dt=>bn()(Dt.x)&&bn()(Dt.y));Oe=Me(_e)||""}return(0,r.jsxs)(r.Fragment,{children:[Oe&&(0,r.jsx)("path",{"data-testid":Qn,className:de.path,d:Oe}),pe.label?(0,r.jsx)("g",{ref:je,"data-testid":dt,className:de.label,transform:`translate(${x},${C})`,children:e({edge:pe})}):null]})}const Ue="workspace";function et(e){var o,l;const{edges:h,nodes:f,renderNode:x,direction:C=Rt.TOP_BOTTOM,align:M,nodeMargin:K=50,edgeMargin:F=10,rankMargin:pe=50,paddingX:de=0,paddingY:je=0,acyclicer:Oe,ranker:Me=Et.NETWORK_SIMPLEX,labelPosition:_e=Lt.RIGHT,labelOffset:Dt=10,edgeRanks:dn=1,edgeWeight:Ln=1,renderLabel:rr,defs:Zt,zoom:un="enabled",curve:gn="curveMonotoneX",fit:jr="grow",...Er}=e,Ar=(0,an.Z)(),[Tr,Oi]=g.useState(100),[Nr,ki]=g.useState(100),nn=g.useRef(new(sn()).graphlib.Graph),[Co,ks]=g.useState(((o=nn.current.graph())===null||o===void 0?void 0:o.width)||0),[Fr,Bi]=g.useState(((l=nn.current.graph())===null||l===void 0?void 0:l.height)||0),[Un,br]=g.useState([]),[Xr,qr]=g.useState([]),mn=Math.max(Co,Tr),Cn=Math.max(Fr,Nr),wo=Math.min(Fr,Nr),_r=jr==="grow"?Cn:wo,Qo=g.useMemo(()=>An()(xn=>{if(!xn)return;const Mn=Pt.Z(xn),vn=Pt.Z(xn.getElementById(Ue));function pr(){Mn.call(Jt.sP().scaleExtent([1,10]).on("zoom",Rr=>{Rr.transform.x=Math.min(0,Math.max(Rr.transform.x,mn-mn*Rr.transform.k)),Rr.transform.y=Math.min(0,Math.max(Rr.transform.y,Cn-Cn*Rr.transform.k)),vn.attr("transform",Rr.transform)}))}un==="enabled"?pr():un==="enable-on-click"&&Mn.on("click",()=>pr());const{width:fr,height:Bs}=xn.getBoundingClientRect();Tr!==fr&&Oi(fr),Nr!==Bs&&ki(Bs)},100),[Nr,Tr,mn,Cn,un]),Oa=g.useCallback(()=>{const xn=nn.current.nodes(),Mn=nn.current.edges();xn.forEach(vn=>{f.some(fr=>fr.id===vn)||nn.current.removeNode(vn)}),Mn.forEach(vn=>{h.some(fr=>fr.from===vn.v&&fr.to===vn.w)||nn.current.removeEdge(vn.v,vn.w)}),f.forEach(vn=>{const pr=nn.current.nodes().find(fr=>vn.id===fr);if(pr&&nn.current.node(pr)){const{width:fr,height:Bs,x:Rr,y:Gl}=nn.current.node(pr);nn.current.setNode(pr,{...vn,width:fr,height:Bs,x:Rr,y:Gl})}else nn.current.setNode(vn.id,{...vn,width:0,height:0})}),h.forEach(vn=>{nn.current.setEdge(vn.from,vn.to,{...vn,label:vn.label,width:0,height:0,labelpos:_e,labeloffset:Dt,weight:Ln,minlen:dn})})},[h,f,_e,Dt,Ln,dn]),Xo=g.useMemo(()=>An()(()=>{sn().layout(nn.current);const{height:xn,width:Mn}=nn.current.graph(),vn=Math.max(0,xn||0),pr=Math.max(0,Mn||0);ks(pr),Bi(vn),br(nn.current.nodes()),qr(nn.current.edges())},250,{leading:!0}),[]);g.useEffect(()=>(nn.current.setGraph({rankdir:C,align:M,nodesep:K,edgesep:F,ranksep:pe,marginx:de,marginy:je,acyclicer:Oe,ranker:Me}),Oa(),Xo(),Xo.cancel),[Oe,M,C,F,de,je,K,pe,Me,Oa,Xo]);function Vl(xn,Mn){return nn.current.setNode(xn,Mn),Xo(),nn.current}function Hl(xn,Mn){return nn.current.setEdge(xn,Mn),Xo(),nn.current}return(0,r.jsxs)("svg",{ref:Qo,...Er,width:"100%",height:_r,viewBox:`0 0 ${mn} ${Cn}`,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:Wn,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{fill:Ar.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),Zt]}),(0,r.jsx)("g",{id:Ue,children:(0,r.jsxs)("svg",{width:Co,height:Fr,y:Cn/2-Fr/2,x:mn/2-Co/2,viewBox:`0 0 ${Co} ${Fr}`,children:[Xr.map(xn=>{const Mn=nn.current.edge(xn);return Mn?(0,r.jsx)($e,{id:xn,setEdge:Hl,render:rr,edge:Mn,curve:gn},`${xn.v}-${xn.w}`):null}),Un.map(xn=>{const Mn=nn.current.node(xn);return Mn?(0,r.jsx)(Tn,{setNode:Vl,render:x,node:Mn},xn):null})]})})]})}var q;const U=(0,c.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"},message:{display:"flex",alignItems:"center",color:e.palette.banner.text,"& a":{color:e.palette.banner.link}},info:{backgroundColor:e.palette.banner.info},error:{backgroundColor:e.palette.banner.error},warning:{backgroundColor:(q=e.palette.banner.warning)!==null&&q!==void 0?q:e.palette.banner.error}}),{name:"BackstageDismissableBanner"}),ve=e=>{const{variant:o,message:l,id:h,fixed:f=!1}=e,x=U(),M=useApi(storageApiRef).forBucket("notifications");var K;const F=(K=M.snapshot("dismissedBanners").value)!==null&&K!==void 0?K:[],[pe,de]=useState(new Set(F)),je=useObservable(M.observe$("dismissedBanners"));useEffect(()=>{if(je!=null&&je.value){var Me;const _e=(Me=je==null?void 0:je.value)!==null&&Me!==void 0?Me:[];de(new Set(_e))}},[je==null?void 0:je.value]);const Oe=()=>{M.set("dismissedBanners",[...pe,h])};return _jsx(Snackbar,{anchorOrigin:f?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!pe.has(h),classes:{root:classNames(x.root,!f&&x.topPosition)},children:_jsx(SnackbarContent,{classes:{root:classNames(x.content,x[o]),message:x.message},message:l,action:[_jsx(IconButton,{title:"Permanently dismiss this message",color:"inherit",onClick:Oe,children:_jsx(Close,{className:x.icon})},"dismiss")]})})};var Ee=n(60905),tt=n.p+"static/missingAnnotation.67f79e98..svg",st=n.p+"static/noInformation.4b426325..svg",kt=n.p+"static/createComponent.975d1e1e..svg",Gt=n.p+"static/noBuild.1715fa71..svg";const pn=(0,c.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),ee=({missing:e})=>{const o=pn();switch(e){case"field":return(0,r.jsx)("img",{src:tt,className:o.generalImg,alt:"annotation is missing"});case"info":return(0,r.jsx)("img",{src:st,alt:"no Information",className:o.generalImg});case"content":return(0,r.jsx)("img",{src:kt,alt:"create Component",className:o.generalImg});case"data":return(0,r.jsx)("img",{src:Gt,alt:"no Build",className:o.generalImg});default:return null}},Y=(0,c.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 oe(e){const{title:o,description:l,missing:h,action:f}=e,x=Y();return(0,r.jsxs)(Ee.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:x.root,spacing:2,children:[(0,r.jsx)(Ee.Z,{item:!0,xs:12,md:6,children:(0,r.jsxs)(Ee.Z,{container:!0,direction:"column",children:[(0,r.jsx)(Ee.Z,{item:!0,xs:!0,children:(0,r.jsx)($.Z,{variant:"h5",children:o})}),(0,r.jsx)(Ee.Z,{item:!0,xs:!0,children:(0,r.jsx)($.Z,{variant:"body1",children:l})}),(0,r.jsx)(Ee.Z,{item:!0,xs:!0,className:x.action,children:f})]})}),(0,r.jsx)(Ee.Z,{item:!0,xs:12,md:6,className:x.imageContainer,children:typeof h=="string"?(0,r.jsx)(ee,{missing:h}):h.customImage})]})}const he=`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`,ie=/^.*ANNOTATION.*$/m,m=he.match(ie)[0],N=he.split(`
|
|
12
|
-
`).findIndex(e=>ie.test(e)),_=(0,c.Z)(e=>({code:{borderRadius:6,margin:`${e.spacing(2)}px 0px`,background:e.palette.type==="dark"?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function J(e){return Array.from(Array(e+1).keys(),o=>o+N)}function Ce(e){const o=e.map(l=>m.replace("ANNOTATION",l)).join(`
|
|
13
|
-
`);return he.replace(m,o)}function Re(e){const o=e.length<=1;return(0,r.jsxs)(r.Fragment,{children:["The ",o?"annotation":"annotations"," ",e.map(l=>(0,r.jsx)("code",{children:l})).reduce((l,h)=>(0,r.jsxs)(r.Fragment,{children:[l,", ",h]}))," ",o?"is":"are"," missing. You need to add the"," ",o?"annotation":"annotations"," to your component if you want to enable this tool."]})}function Xe(e){const{annotation:o,readMoreUrl:l}=e,h=Array.isArray(o)?o:[o],f=l||"https://backstage.io/docs/features/software-catalog/well-known-annotations",x=_();return(0,r.jsx)(oe,{missing:"field",title:"Missing Annotation",description:Re(h),action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($.Z,{variant:"body1",children:"Add the annotation to your component YAML as shown in the highlighted example below:"}),(0,r.jsx)(Le.Z,{className:x.code,children:(0,r.jsx)(xe,{text:Ce(h),language:"yaml",showLineNumbers:!0,highlightedNumbers:J(h.length),customStyle:{background:"inherit",fontSize:"115%"}})}),(0,r.jsx)(fe.Z,{color:"primary",component:ot,to:f,children:"Read more"})]})})}var yt=n(11776),Ge=n(38402),lt=n(49378),We=n(41128),ut=n(27616),it=n(8284),zt=n(70660),Nt=n(91750),Kt=n(38016);const Vt=(e,o)=>(o.palette.type==="light"?We._j:We.$n)(o.palette[e].light,.6),Bt=(e,o)=>(o.palette.type==="light"?We.$n:We._j)(o.palette[e].light,.9),xt=(0,c.Z)(e=>({root:{marginRight:e.spacing(1),fill:({severity:o})=>Vt(o,e)}})),It=({severity:e})=>{const o=xt({severity:e});return(0,r.jsx)(Nt.Z,{classes:o})},Ot=({severity:e})=>{const o=xt({severity:e});return(0,r.jsx)(Kt.Z,{classes:o})},en=(0,c.Z)(e=>({panel:{backgroundColor:({severity:o})=>Bt(o,e),color:({severity:o})=>Vt(o,e),verticalAlign:"middle"},summary:{display:"flex",flexDirection:"row"},summaryText:{color:({severity:o})=>Vt(o,e),fontWeight:e.typography.fontWeightBold},message:{width:"100%",display:"block",color:({severity:o})=>Vt(o,e),backgroundColor:({severity:o})=>Bt(o,e)},details:{width:"100%",display:"block",color:e.palette.textContrast,backgroundColor:e.palette.background.default,border:`1px solid ${e.palette.border}`,padding:e.spacing(2),fontFamily:"sans-serif"}}),{name:"BackstageWarningPanel"}),jn=e=>e.charAt(0).toLocaleUpperCase("en-US")+e.slice(1);function Rn(e){const{severity:o="warning",title:l,message:h,children:f,defaultExpanded:x}=e,C=en({severity:o}),M=jn(o)+(l?`: ${l}`:"");return(0,r.jsxs)(ut.Z,{defaultExpanded:x!=null?x:!1,className:C.panel,role:"alert",children:[(0,r.jsxs)(it.Z,{expandIcon:(0,r.jsx)(Ot,{severity:o}),className:C.summary,children:[(0,r.jsx)(It,{severity:o}),(0,r.jsx)($.Z,{className:C.summaryText,variant:"subtitle1",children:M})]}),(h||f)&&(0,r.jsx)(zt.Z,{children:(0,r.jsxs)(Ee.Z,{container:!0,children:[h&&(0,r.jsx)(Ee.Z,{item:!0,xs:12,children:(0,r.jsx)($.Z,{className:C.message,variant:"body1",children:h})}),f&&(0,r.jsx)(Ee.Z,{item:!0,xs:12,className:C.details,children:f})]})})]})}const Gn=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageErrorPanel"}),or=({error:e,message:o,stack:l,children:h})=>{const f=Gn();return(0,r.jsxs)(yt.Z,{dense:!0,children:[(0,r.jsxs)(Ge.Z,{alignItems:"flex-start",children:[(0,r.jsx)(lt.Z,{classes:{secondary:f.text},primary:"Error",secondary:e}),(0,r.jsx)(ue,{text:e})]}),(0,r.jsxs)(Ge.Z,{alignItems:"flex-start",children:[(0,r.jsx)(lt.Z,{classes:{secondary:f.text},primary:"Message",secondary:o}),(0,r.jsx)(ue,{text:o})]}),l&&(0,r.jsxs)(Ge.Z,{alignItems:"flex-start",children:[(0,r.jsx)(lt.Z,{classes:{secondary:f.text},primary:"Stack Trace",secondary:l}),(0,r.jsx)(ue,{text:l})]}),h]})};function fn(e){const{title:o,error:l,defaultExpanded:h,children:f}=e;return(0,r.jsx)(Rn,{severity:"error",title:o!=null?o:l.message,defaultExpanded:h,children:(0,r.jsx)(or,{error:l.name,message:l.message,stack:l.stack,children:f})})}var Sn=n(85256);const sr=(0,c.Z)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function S(e){var o;const{title:l,error:h,defaultExpanded:f}=e,x=sr();if(h.name!=="ResponseError")return(0,r.jsx)(fn,{title:l!=null?l:h.message,defaultExpanded:f,error:h});const{body:C,cause:M}=h,{request:K,response:F}=C,pe=`${F.statusCode}: ${M.name}`,de=K&&`${K.method} ${K.url}`,je=M.message.replace(/\\n/g,`
|
|
14
|
-
`),Oe=(o=M.stack)===null||o===void 0?void 0:o.replace(/\\n/g,`
|
|
15
|
-
`),Me=JSON.stringify(C,void 0,2);return(0,r.jsxs)(fn,{title:l!=null?l:h.message,defaultExpanded:f,error:{name:pe,message:je,stack:Oe},children:[de&&(0,r.jsxs)(Ge.Z,{alignItems:"flex-start",children:[(0,r.jsx)(lt.Z,{classes:{secondary:x.text},primary:"Request",secondary:K?`${de}`:void 0}),(0,r.jsx)(ue,{text:de})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Sn.Z,{component:"li",className:x.divider}),(0,r.jsx)(Ge.Z,{alignItems:"flex-start",children:(0,r.jsx)(lt.Z,{classes:{secondary:x.text},primary:"Full Error as JSON"})}),(0,r.jsx)(xe,{language:"json",text:Me,showCopyCodeButton:!0})]})]})}var u=n(28316);function y(e){const o=document.createElement("div");return o.setAttribute("id",e),o}function w(e){document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling)}function Q(e){const o=useRef(null);useEffect(function(){const f=document.querySelector(`#${e}`),x=f||y(e);return f||w(x),x.appendChild(o.current),function(){o.current.remove(),x.childNodes.length===-1&&x.remove()}},[e]);function l(){return o.current||(o.current=document.createElement("div")),o.current}return l()}var Se=null;const be="core.calloutSeen";function Ze(){const[e,o]=useState(()=>{const h=localStorage.getItem(be);return h?JSON.parse(h):{}}),l=useCallback((h,f)=>{const x=localStorage.getItem(be),M={...x?JSON.parse(x):{},[h]:f};o(M),localStorage.setItem(be,JSON.stringify(M))},[]);return{states:e,setState:l}}function Ke(e){const{states:o,setState:l}=Ze(),h=useCallback(()=>{l(e,!0)},[l,e]);return{seen:o[e]===!0,markSeen:h}}function Ht(e){const{seen:o,markSeen:l}=Ke(e);return{show:o===!1,hide:l}}const cn=(0,c.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 Kn(e){const{featureId:o,title:l,description:h,children:f}=e,{show:x,hide:C}=useShowCallout(o),M=usePortal("core.callout"),K=useRef(null),[F,pe]=useState(),de=cn(),je=useCallback(()=>{if(K.current){const Oe=K.current.getBoundingClientRect(),Me=Math.max(Oe.width,Oe.height),_e=800,Dt=Oe.x-(Me-Oe.width)/2-_e,dn=Oe.y-(Me-Oe.height)/2-_e,Ln=Me+2*_e,rr=450,Zt=Oe.x+Oe.width/2-rr,un=Oe.y-(Me-Oe.height)/2+Me+20;pe({dotLeft:Dt,dotTop:dn,dotSize:Ln,borderWidth:_e,textTop:un,textLeft:Zt,textWidth:rr})}},[]);return useEffect(()=>(window.addEventListener("resize",je),window.addEventListener("scroll",je),()=>{window.removeEventListener("resize",je),window.removeEventListener("scroll",je)}),[je]),useLayoutEffect(je,[K.current,je]),x?_jsxs(_Fragment,{children:[_jsx(Box,{className:de.featureWrapper,ref:K,children:f}),createPortal(_jsx(Box,{className:de.backdrop,children:_jsx(ClickAwayListener,{onClickAway:C,children:_jsxs(_Fragment,{children:[_jsx(Box,{className:de.dot,"data-testid":"dot",style:{left:F==null?void 0:F.dotLeft,top:F==null?void 0:F.dotTop,width:F==null?void 0:F.dotSize,height:F==null?void 0:F.dotSize,borderWidth:F==null?void 0:F.borderWidth},onClick:C,onKeyDown:C,role:"button",tabIndex:0,children:_jsx(Box,{className:de.pulseCircle})}),_jsxs(Box,{className:de.text,"data-testid":"text",style:{left:F==null?void 0:F.textLeft,top:F==null?void 0:F.textTop,width:F==null?void 0:F.textWidth},children:[_jsx(Typography,{variant:"h2",paragraph:!0,children:l}),_jsx(Typography,{children:h})]})]})})}),M)]}):_jsx(_Fragment,{children:f})}var gr=n(35292);const mr=(0,c.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 eo({color:e="primary",disabled:o=!1,href:l="#",icon:h=(0,r.jsx)(gr.Z,{}),label:f,onClick:x,title:C}){const M=mr();return o?(0,r.jsxs)(Le.Z,{title:C,className:O()(M.link,M.disabled),children:[h,(0,r.jsx)($.Z,{variant:"caption",component:"span",className:M.label,children:f})]}):(0,r.jsxs)(ot,{title:C,className:O()(M.link,M[e]),to:l,onClick:x,children:[h,(0,r.jsx)($.Z,{variant:"caption",component:"span",className:M.label,children:f})]})}const jo=(0,c.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function Eo(e){const{links:o}=e,l=jo();return(0,r.jsx)("nav",{className:l.links,children:o.map((h,f)=>(0,r.jsx)(eo,{...h},f+1))})}const to=e=>{const o=e==="dark"?"16%":"97%";return`
|
|
16
|
-
hsl(0, 0%, ${o}) 0%,
|
|
17
|
-
hsla(0, 0%, ${o}, 0.987) 8.1%,
|
|
18
|
-
hsla(0, 0%, ${o}, 0.951) 15.5%,
|
|
19
|
-
hsla(0, 0%, ${o}, 0.896) 22.5%,
|
|
20
|
-
hsla(0, 0%, ${o}, 0.825) 29%,
|
|
21
|
-
hsla(0, 0%, ${o}, 0.741) 35.3%,
|
|
22
|
-
hsla(0, 0%, ${o}, 0.648) 41.2%,
|
|
23
|
-
hsla(0, 0%, ${o}, 0.55) 47.1%,
|
|
24
|
-
hsla(0, 0%, ${o}, 0.45) 52.9%,
|
|
25
|
-
hsla(0, 0%, ${o}, 0.352) 58.8%,
|
|
26
|
-
hsla(0, 0%, ${o}, 0.259) 64.7%,
|
|
27
|
-
hsla(0, 0%, ${o}, 0.175) 71%,
|
|
28
|
-
hsla(0, 0%, ${o}, 0.104) 77.5%,
|
|
29
|
-
hsla(0, 0%, ${o}, 0.049) 84.5%,
|
|
30
|
-
hsla(0, 0%, ${o}, 0.013) 91.9%,
|
|
31
|
-
hsla(0, 0%, ${o}, 0) 100%
|
|
32
|
-
`},Vn=100,$n=10,vr=(0,c.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:Vn,height:`calc(100% + ${$n}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-$n,background:`linear-gradient(90deg, ${to(e.palette.type)})`},fadeRight:{right:-$n,background:`linear-gradient(270deg, ${to(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function Ir(e){const[[o,l],h]=React.useState([0,0]);return React.useLayoutEffect(()=>{const f=e.current;if(!f){h([0,0]);return}const x=()=>{const C=f.scrollLeft,M=f.scrollWidth-f.offsetWidth-f.scrollLeft;h([C,M])};return x(),f.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{f.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e]),[o,l]}function Sr(e,o,l){const[h,f]=React.useState(0);return React.useLayoutEffect(()=>{if(h===0)return;const x=window.performance.now(),C=requestAnimationFrame(M=>{if(!e.current)return;const K=M-x,F=Math.abs(h)*K/o,de=Math.max(l,F)*Math.sign(h);e.current.scrollBy({left:de});const je=h-de;Math.sign(h)!==Math.sign(je)?f(0):f(je)});return()=>cancelAnimationFrame(C)},[e,h,o,l]),f}function qo(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:h=5,children:f,...x}=e,C=vr(e),M=React.useRef(),[K,F]=Ir(M),pe=Sr(M,l,h),de=je=>{M.current&&pe(je?o:-o)};return _jsxs(Box,{...x,className:C.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:C.container,ref:M,children:f}),_jsx(Box,{className:classNames(C.fade,C.fadeLeft,{[C.fadeHidden]:K===0})}),_jsx(Box,{className:classNames(C.fade,C.fadeRight,{[C.fadeHidden]:F===0})}),K>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>de(!1),className:classNames(C.button,C.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),F>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>de(!0),className:classNames(C.button,C.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const Ur=(0,c.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 _o(e){const o=Ur(e),{shorthand:l,alpha:h}=e;return l?_jsx(Typography,{component:"span",className:o[h?"alpha":"beta"],style:{fontSize:"120%"},children:h?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[h?"alpha":"beta"],children:h?"Alpha":"Beta"})}const Ao=(0,g.lazy)(()=>Promise.all([n.e(6174),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function Mr(e){const{Progress:o}=(0,z.qD)().getComponents();return(0,r.jsx)(g.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(Ao,{...e})})}var Xn=n(28865),Pr=n(60251);const Lr=(0,c.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"}),no=(e,o)=>o?typeof o=="string"?e+o:g.Children.toArray(o.props.children).reduce(no,e):e,qn=({level:e,children:o})=>{const f=g.Children.toArray(o).reduce(no,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return g.createElement(`h${e}`,{id:f},o)},Or={code:({inline:e,className:o,children:l,...h})=>{const f=String(l).replace(/\n+$/,""),x=/language-(\w+)/.exec(o||"");return!e&&x?(0,r.jsx)(xe,{language:x[1],text:f}):(0,r.jsx)("code",{className:o,...h,children:l})},h1:qn,h2:qn,h3:qn,h4:qn,h5:qn,h6:qn};function To(e){const{content:o,dialect:l="gfm",linkTarget:h,transformLinkUri:f,transformImageUri:x,className:C}=e,M=Lr();return(0,r.jsx)(Xn.D,{remarkPlugins:l==="gfm"?[Pr.Z]:[],className:`${M.markdown} ${C}`,children:o,components:Or,linkTarget:h,transformLinkUri:f,transformImageUri:x})}var Ro=n(23054);const zr=(0,c.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),es=({request:e,busy:o,setBusy:l})=>{const h=zr(),[f,x]=useState(),C=async()=>{l(!0);try{await e.trigger()}catch(K){x(isError(K)?K.message:"An unspecified error occurred")}finally{l(!1)}},M=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:h.root},children:[_jsx(ListItemAvatar,{children:_jsx(M,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:f&&_jsx(Typography,{color:"error",children:f})}),_jsx(Button,{color:"primary",variant:"contained",onClick:C,children:"Log in"})]})};var Io=null;const Wr=(0,c.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 ts(e){const o=Wr(),[l,h]=useState(!1),f=useApi(oauthRequestApiRef),x=useApi(configApiRef);var C;const M=(C=x.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&C!==void 0?C:!1,K=useObservable(useMemo(()=>f.authRequest$(),[f]),[]),F=()=>{K.forEach(pe=>pe.reject())};return _jsxs(Dialog,{open:Boolean(K.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",children:"Login Required"}),M?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:K.map(pe=>_jsx(LoginRequestListItem,{request:pe,busy:l,setBusy:h},pe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:F,children:"Reject All"})})]})}var yr=n(15277),Po=n.n(yr),ro=n(29862);const Lo=(0,c.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Oo(e){const[o,l]=(0,g.useState)(!1),h=(0,ro.t)(),f=Lo(),x=M=>{h()&&l(M)};var C;return(0,r.jsx)($t.ZP,{title:(C=e.title)!==null&&C!==void 0?C:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)(Po(),{text:e.text,line:e.line,onToggled:x,containerClassName:f.container})})}var Vr=n(67358);function oo(e){const o=(0,bt.Z)(),[l,h]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{const f=setTimeout(()=>h(!0),o.transitions.duration.short);return()=>clearTimeout(f)},[o.transitions.duration.short]),l?(0,r.jsx)(Vr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(Le.Z,{display:"none"})}var Cr=n(94339),cr=n(14503),ko=n(24579),Hr=n(32552),tn=n(15459),Bo=n(27597);const $o=(0,c.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 ns(e){const{link:o,title:l,onClick:h}=e,f=$o();return(0,r.jsxs)(Le.Z,{children:[(0,r.jsx)(Sn.Z,{}),(0,r.jsx)(ot,{to:o,onClick:h,underline:"none",children:(0,r.jsxs)(Le.Z,{display:"flex",alignItems:"center",className:f.root,children:[(0,r.jsx)(Le.Z,{className:f.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)($.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(Bo.Z,{className:f.arrow})]})})]})}const rs=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)($.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)($.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(Je,{to:o.href,variant:"contained",children:o.name})},os=class extends g.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:h}=this.state;return h?(0,r.jsx)(fn,{title:"Something Went Wrong",error:h,children:(0,r.jsx)(rs,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ss=(0,c.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"}),is=(0,tn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(cr.Z),ir={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function kr(e){const{title:o,subheader:l,divider:h=!0,deepLink:f,slackChannel:x,errorBoundaryProps:C,variant:M,children:K,headerStyle:F,headerProps:pe,icon:de,action:je,actionsClassName:Oe,actions:Me,cardClassName:_e,actionsTopRight:Dt,className:dn,noPadding:Ln,titleTypographyProps:rr}=e,Zt=ss();let un={},gn={};M&&M.split(/[\s]+/g).forEach(Tr=>{un={...un,...ir.card[Tr]},gn={...gn,...ir.cardContent[Tr]}});const jr=()=>!l&&!de?null:(0,r.jsxs)("div",{className:Zt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:Zt.subheader,children:l}),de]}),Er=C||(x?{slackChannel:x}:{});return(0,r.jsx)(Cr.Z,{style:un,className:dn,children:(0,r.jsxs)(os,{...Er,children:[o&&(0,r.jsx)(Hr.Z,{classes:{root:Zt.header,title:Zt.headerTitle,subheader:Zt.headerSubheader,avatar:Zt.headerAvatar,action:Zt.headerAction,content:Zt.headerContent},title:o,subheader:jr(),action:je,style:{...F},titleTypographyProps:rr,...pe}),Dt&&(0,r.jsx)(is,{children:Dt}),h&&(0,r.jsx)(Sn.Z,{}),(0,r.jsx)(ko.Z,{className:O()(_e,{[Zt.noPadding]:Ln}),style:gn,children:K}),Me&&(0,r.jsx)(cr.Z,{className:Oe,children:Me}),f&&(0,r.jsx)(ns,{...f})]})})}var as=n(39307);const Do=(0,c.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"}),so={fractional:!0,inverse:!1,unit:"%",max:100},Br=({palette:e,value:o,inverse:l,max:h})=>{if(isNaN(o))return"#ddd";const f=h||so.max,x=l?f-o:o;return x<f/3?e.status.error:x<f*(2/3)?e.status.warning:e.status.ok};function ls(e){const[o,l]=useState(null),{getColor:h=Br}=e,f=Do(e),{palette:x}=useTheme(),{value:C,fractional:M,inverse:K,unit:F,max:pe,description:de}={...so,...e},je=M?Math.round(C*pe):C,Oe=pe!==100?Math.round(C):je,[Me,_e]=useState(!1);return useEffect(()=>{const Dt=o,dn=()=>_e(!0),Ln=()=>_e(!1);return Dt&&de?(Dt.addEventListener("mouseenter",dn),Dt.addEventListener("mouseleave",Ln),()=>{Dt.removeEventListener("mouseenter",dn),Dt.removeEventListener("mouseleave",Ln)}):()=>{_e(!1)}},[de,o]),_jsxs(Box,{ref:l,className:f.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:je,strokeWidth:12,trailWidth:12,strokeColor:h({palette:x,value:Oe,inverse:K,max:pe}),className:f.circle}),de&&Me?_jsx(Box,{className:f.description,children:de}):_jsx(Box,{className:f.overlay,children:isNaN(C)?"N/A":`${Oe}${F}`})]})}const cs=(0,c.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function b(e){const o=cs(e),{title:l,subheader:h,progress:f,inverse:x,deepLink:C,description:M,icon:K,variant:F,getColor:pe}=e,de={inverse:x,description:M,getColor:pe,value:f};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:h,deepLink:C,variant:F,icon:K,children:_jsx(Gauge,{...de})})})}function j(e){const{value:o,getColor:l=getProgressColor}=e,{palette:h}=useTheme();if(isNaN(o))return null;let f=Math.round(o*100*100)/100;f>100&&(f=100);const x=l({palette:h,value:f,inverse:!1,max:100});return _jsx(Tooltip,{title:`${f}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:f,strokeWidth:4,trailWidth:4,strokeColor:x})})})}var T=n(21324),Z=n(7089),ne=n(1292),ae=n(42494),ce=n(74603),ye=n(56939),Ae=n(12231),ge=n(73698),Pe=n(12420),Ne=n(72379);const nt=(0,c.Z)(e=>(0,Pe.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Ye=()=>{const e=nt();return(0,r.jsx)(Ne.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 ke=(0,c.Z)(e=>(0,Pe.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var St=()=>{const e=ke();return(0,r.jsx)(Ne.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 rn=(0,tn.Z)(e=>(0,Pe.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(ce.Z),Yt=(0,c.Z)(e=>(0,Pe.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function qt(e){const{multiple:o,items:l,label:h,placeholder:f,selected:x,onChange:C,triggerReset:M,native:K=!1,disabled:F=!1,margin:pe}=e,de=Yt(),[je,Oe]=(0,g.useState)(x||(o?[]:"")),[Me,_e]=(0,g.useState)(!1);(0,g.useEffect)(()=>{Oe(o?[]:"")},[M,o]),(0,g.useEffect)(()=>{Oe(x||(o?[]:""))},[x,o]);const Dt=Zt=>{Oe(Zt.target.value),C(Zt.target.value)},dn=Zt=>{if(F){Zt.preventDefault();return}_e(un=>o&&!(Zt.target instanceof HTMLElement)?!0:!un)},Ln=()=>{_e(!1)},rr=Zt=>()=>{const un=je.filter(gn=>gn!==Zt);Oe(un),C(un)};return(0,r.jsx)(Le.Z,{className:de.root,children:(0,r.jsx)(ne.Z,{onClickAway:Ln,children:(0,r.jsxs)(ae.Z,{className:de.formControl,children:[(0,r.jsx)(ye.Z,{className:de.formLabel,children:h}),(0,r.jsxs)(ge.Z,{"aria-label":h,value:je,native:K,disabled:F,"data-testid":"select",displayEmpty:!0,multiple:o,margin:pe,onChange:Dt,onClick:dn,open:Me,input:(0,r.jsx)(rn,{}),label:h,tabIndex:0,renderValue:Zt=>{var un;return o&&je.length!==0?(0,r.jsx)(Le.Z,{className:de.chips,children:Zt.map(gn=>{var jr,Er;return(0,r.jsx)(Z.Z,{label:(jr=l.find(Ar=>Ar.value===gn))===null||jr===void 0?void 0:jr.label,clickable:!0,onDelete:rr(gn),className:de.chip},(Er=l.find(Ar=>Ar.value===gn))===null||Er===void 0?void 0:Er.value)})}):(0,r.jsx)($.Z,{children:je.length===0?f||"":(un=l.find(gn=>gn.value===Zt))===null||un===void 0?void 0:un.label})},IconComponent:()=>Me?(0,r.jsx)(St,{}):(0,r.jsx)(Ye,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[f&&!o&&(0,r.jsx)(Ae.Z,{value:[],children:f}),K?l&&l.map(Zt=>(0,r.jsx)("option",{value:Zt.value,children:Zt.label},Zt.value)):l&&l.map(Zt=>(0,r.jsxs)(Ae.Z,{value:Zt.value,children:[o&&(0,r.jsx)(T.Z,{color:"primary",checked:je.includes(Zt.value)||!1,className:de.checkbox}),Zt.label]},Zt.value))]})]})})})}const _t=()=>{},En=g.createContext({stepperLength:0,stepIndex:0,setStepIndex:_t,stepHistory:[],setStepHistory:_t,onStepChange:_t});function Dn(e){const{children:o,elevated:l,onStepChange:h,activeStep:f=0}=e,[x,C]=useState(f),[M,K]=useState([0]);useEffect(()=>{C(f)},[f]);const F=[];let pe;return Children.forEach(o,de=>{isValidElement(de)&&(de.props.end?pe=de:F.push(de))}),_jsxs(_Fragment,{children:[_jsx(En.Provider,{value:{stepIndex:x,setStepIndex:C,stepHistory:M,setStepHistory:K,onStepChange:h,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:x,orientation:"vertical",elevation:l?2:0,children:F})}),x>=Children.count(o)-1&&pe]})}const xr=(0,c.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),$r=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Gr=({text:e,handleClick:o,disabled:l,last:h,stepIndex:f})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${f}`,onClick:o,children:e||(h?"Finish":"Next")}),In=({text:e,handleClick:o,disabled:l,stepIndex:h})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${h}`,onClick:o,children:e||"Skip"}),Zn=({text:e,handleClick:o,disabled:l,stepIndex:h})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${h}`,disabled:l,children:e||"Back"}),Dr=({actions:e={},children:o})=>{const l=xr(),{stepperLength:h,stepIndex:f,setStepIndex:x,stepHistory:C,setStepHistory:M,onStepChange:K}=useContext(VerticalStepperContext),F=(Oe,Me)=>{Me&&Me(),K&&K(f,Oe),x(Oe)},pe=()=>{const Oe=e.nextStep?e.nextStep(f,h-1):f+1;F(Oe,e.onNext),M([...C,Oe])},de=()=>{C.pop(),F(C[C.length-1],e.onBack),M([...C])},je=()=>{F(0,e.onRestart),M([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&f!==0&&_jsx(Zn,{text:e.backText,handleClick:de,disabled:f===0,stepIndex:f}),e.showSkip&&_jsx(In,{text:e.skipText,handleClick:pe,disabled:!!h&&f>=h||!!e.canSkip&&!e.canSkip(),stepIndex:f}),[void 0,!0].includes(e.showNext)&&_jsx(Gr,{text:e.nextText,handleClick:pe,disabled:!!h&&f>=h||!!e.canNext&&!e.canNext(),stepIndex:f}),e.showRestart&&f!==0&&_jsx($r,{text:e.restartText,handleClick:je,stepIndex:f}),o]})},$s=(0,c.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function $i(e){const{title:o,children:l,end:h,actions:f,...x}=e,C=$s();return h?_jsxs(Box,{className:C.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...f||{},showNext:!1}})]}):_jsxs(MuiStep,{...x,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:f})]})]})}const wr=(0,c.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 Ds(e){const o=wr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function Di(e){const o=wr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function Zi(e){const o=wr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ni(e){const o=wr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Zs(e){const o=wr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function dr(e){const o=wr(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var ur=n(74600),_n=n(15584);const Zo=e=>(0,Pe.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),Ns={root:{border:"0",verticalAlign:"top"}},Fs=e=>(0,Pe.Z)({root:{margin:e.spacing(0,0,-1,0)}}),Us=e=>(0,Pe.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Ms=(0,tn.Z)(Zo,{name:"BackstageMetadataTableTitleCell"})(_n.Z),ds=(0,tn.Z)(Ns,{name:"BackstageMetadataTableCell"})(_n.Z),zs=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Fi=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Ms,{children:e}),_jsx(ds,{colSpan:e?1:2,...l,children:o})]}),us=(0,tn.Z)(Fs,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(yt.Z,{disablePadding:!0,className:e.root,children:o})),Ui=(0,tn.Z)(Us,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(Ge.Z,{className:e.root,children:o})),hs=(0,Pe.Z)({root:{margin:"0 0",listStyleType:"none"}}),ps=e=>(0,Pe.Z)({root:{...hs.root,paddingLeft:e.spacing(1)}}),No=(0,tn.Z)(hs,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(us,{classes:e,children:o})),fs=(0,tn.Z)(ps,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(us,{classes:e,children:o}));function Ws(e,o){const l=e.map((h,f)=>_jsx(MetadataListItem,{children:ao(h)},f));return o?_jsx(fs,{children:l}):_jsx(No,{children:l})}function io(e,o,l){const h=Object.keys(e).map(f=>{const x=ao(e[f],!0),C=l&&l.titleFormat?l.titleFormat(f):startCase(f);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${C}: `}),x]},f)});return o?_jsx(fs,{children:h}):_jsx(No,{children:h})}function ao(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?io(e,o,l):Array.isArray(e)?Ws(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const Vs=({value:e,options:o})=>_jsx(Fragment,{children:ao(e,o)}),Hs=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(Vs,{value:o,options:l})});function Mi(e,o){return Object.keys(e).map(l=>_jsx(Hs,{title:l,value:e[l],options:o},l))}function Kr(e){const{metadata:o,dense:l=!0,options:h}=e,f=Mi(o,h||{});return _jsx(MetadataTable,{dense:l,children:f})}var Gs=n(49429),Nn=n(86136),Ks=n(79784),zi=n(19126),Ys=n.n(zi);function Js(e){return qs.stringify(e,{strictNullHandling:!0})}function Qs(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Xs(e,o){return Qs(e)[o]}function Fo(e,o,l){const h={...Qs(e),[o]:l};return Js(h)}function Wi(e,o=250){const[l,h]=useSearchParams(),f=l.toString(),[x,C]=useState(Xs(f,e));return useEffect(()=>{const M=Xs(f,e);C(K=>isEqual(M,K)?K:M)},[f,C,e]),useDebouncedEffect(()=>{const M=Fo(f,e,x);f!==M&&h(M,{replace:!0})},[h,x,f,e],o),[x,C]}const lo={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 Yr(){const o=(0,z.I_)().get(z.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return lo;var h;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(f=>({title:f.getString("title"),icon:f.getOptionalString("icon"),links:((h=f.getOptionalConfigArray("links"))!==null&&h!==void 0?h:[]).flatMap(x=>({url:x.getString("url"),title:x.getString("title")}))}))}}var co=n(80079);function er(e,o){const h=(0,z.qD)().getSystemIcon(e);return h?(0,r.jsx)(h,{...o}):(0,r.jsx)(co.Z,{...o})}function _s(e){return er("brokenImage",e)}function ei(e){return er("catalog",e)}function Vi(e){return er("chat",e)}function Hi(e){return er("dashboard",e)}function Gi(e){return er("docs",e)}function Ki(e){return er("email",e)}function Yi(e){return er("github",e)}function ka(e){return er("group",e)}function uo(e){return er("help",e)}function Ji(e){return er("user",e)}function gs(e){return er("warning",e)}const ti=(0,c.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ni=({icon:e})=>{const o=(0,z.qD)();var l;const h=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:uo;return(0,r.jsx)(h,{})};var ho;const ri=({link:e})=>(0,r.jsx)(ot,{to:e.url,children:(ho=e.title)!==null&&ho!==void 0?ho:e.url}),oi=({item:e})=>{var o;return(0,r.jsxs)(Ge.Z,{children:[(0,r.jsx)(Nn.Z,{children:(0,r.jsx)(ni,{icon:e.icon})}),(0,r.jsx)(lt.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,h,f)=>[...l,f>0&&(0,r.jsx)("br",{},f),(0,r.jsx)(ri,{link:h},h.url)],[])})]})};function si(e){const{title:o,items:l,children:h}=e,{items:f}=Yr(),[x,C]=(0,g.useState)(!1),[M,K]=(0,g.useState)(null),F=ti(),pe=(0,Fe.Z)(Oe=>Oe.breakpoints.down("sm")),de=Oe=>{K(Oe.currentTarget),C(!0)},je=()=>{C(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Le.Z,{display:"flex",ml:1,children:pe?(0,r.jsx)(jt.Z,{color:"primary",size:"small",onClick:de,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(uo,{})}):(0,r.jsx)(fe.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:de,startIcon:(0,r.jsx)(uo,{}),children:"Support"})}),(0,r.jsxs)(Ks.ZP,{"data-testid":"support-button-popover",open:x,anchorEl:M,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:je,children:[(0,r.jsxs)(yt.Z,{className:F.popoverList,children:[o&&(0,r.jsx)(Ge.Z,{alignItems:"flex-start",children:(0,r.jsx)($.Z,{variant:"subtitle1",children:o})}),g.Children.map(h,(Oe,Me)=>(0,r.jsx)(Ge.Z,{alignItems:"flex-start",children:Oe},`child-${Me}`)),(l!=null?l:f).map((Oe,Me)=>(0,r.jsx)(oi,{item:Oe},`item-${Me}`))]}),(0,r.jsx)(Gs.Z,{children:(0,r.jsx)(fe.Z,{color:"primary",onClick:je,"aria-label":"Close",children:"Close"})})]})]})}var Uo=n(18671),ms=n(84800);const po=72,vs=24,ys=18,hr={drawerWidthClosed:po,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:po,iconSize:po-vs*2,iconPadding:vs,selectedIndicatorWidth:3,userBadgePadding:ys,userBadgeDiameter:po-ys*2,mobileSidebarHeight:56},xs=e=>({...hr,...e,iconContainerWidth:hr.drawerWidthClosed,iconSize:hr.drawerWidthClosed-hr.iconPadding*2,userBadgeDiameter:hr.drawerWidthClosed-hr.userBadgePadding*2}),fo={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:hr.defaultOpenDelayMs+200},ii=e=>({...fo,...e}),Qi="@backstage/core/sidebar-intro-dismissed",ar=(0,g.createContext)({sidebarConfig:hr,submenuConfig:fo}),bs=(0,g.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var Xi=n(50023),go=n(4190),qi=n(87685),_i=n(44882),mo=n(51837);const Ss={isOpen:!1,setOpen:()=>{}},Mo=(0,g.createContext)(Ss),ai=(0,mo.CT)("sidebar-open-state-context");function li(e){const{children:o,value:l}=e;return(0,r.jsx)(Mo.Provider,{value:l,children:(0,r.jsx)(ai.Provider,{value:(0,mo.EI)({1:l}),children:o})})}const vo=()=>{const e=(0,g.useContext)(ai),o=(0,g.useContext)(Mo);if(e===void 0)return o||Ss;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var Cs=n(57998);const ws={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},js=(0,g.createContext)(ws),Jr=(0,mo.CT)("sidebar-pin-state-context");function ea(e){const{children:o,value:l}=e;return(0,r.jsx)(js.Provider,{value:l,children:(0,r.jsx)(Jr.Provider,{value:(0,mo.EI)({1:l}),children:o})})}const zo=()=>{const e=(0,g.useContext)(Jr),o=(0,g.useContext)(js);if(e===void 0)return o||ws;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},ta=(0,c.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),na=e=>{const{to:o,label:l,icon:h,value:f}=e,{sidebarConfig:x}=(0,g.useContext)(ar),C=ta({sidebarConfig:x}),M=(0,X.TH)(),{selectedMenuItemIndex:K,setSelectedMenuItemIndex:F}=(0,g.useContext)(di),pe=(je,Oe)=>{F(Oe===K?-1:Oe)},de=f===K&&K>=0||f!==K&&!(K>=0)&&o===M.pathname;return(0,r.jsx)(Cs.Z,{"aria-label":l,label:l,icon:h,component:ot,to:o||M.pathname,onChange:pe,value:f,selected:de,classes:C})},Es=e=>{const{children:o,to:l,label:h,icon:f,value:x}=e,{isMobile:C}=zo();return C?(0,r.jsx)(na,{to:l,label:h,icon:f,value:x}):(0,r.jsx)(r.Fragment,{children:o})},Pn=(0,c.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838"},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),ra=e=>(0,re.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),ci=g.createElement(Es).type,oa=({children:e,label:o="Menu",open:l,onClose:h})=>{const{sidebarConfig:f}=(0,g.useContext)(ar),x=Pn({sidebarConfig:f});return(0,r.jsxs)(go.ZP,{anchor:"bottom",open:l,onClose:h,ModalProps:{BackdropProps:{classes:{root:x.marginMobileSidebar}}},classes:{root:x.marginMobileSidebar,paperAnchorBottom:x.overlay},children:[(0,r.jsxs)(Le.Z,{className:x.overlayHeader,children:[(0,r.jsx)($.Z,{variant:"h3",children:o}),(0,r.jsx)(jt.Z,{onClick:h,classes:{root:x.overlayHeaderClose},children:(0,r.jsx)(qi.Z,{})})]}),(0,r.jsx)(Le.Z,{component:"nav",children:e})]})},di=(0,g.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),sa=e=>{const{sidebarConfig:o}=(0,g.useContext)(ar),{children:l}=e,h=Pn({sidebarConfig:o}),f=(0,X.TH)(),[x,C]=(0,g.useState)(-1);(0,g.useEffect)(()=>{C(-1)},[f.pathname]);let M=(0,z.vJ)(l,F=>F.getElements().filter(pe=>pe.type===ci));if(l)M.length?M=ra(M):M.push((0,r.jsx)(Es,{icon:(0,r.jsx)(_i.Z,{}),children:l},"default_menu"));else return null;const K=x>=0&&!M[x].props.to;return(0,r.jsx)(li,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(di.Provider,{value:{selectedMenuItemIndex:x,setSelectedMenuItemIndex:C},children:[(0,r.jsx)(oa,{label:M[x]&&M[x].props.label,open:K,onClose:()=>C(-1),children:M[x]&&M[x].props.children}),(0,r.jsx)(Xi.Z,{className:h.root,"data-testid":"mobile-sidebar-root",component:"nav",children:M})]})})};var Wo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Wo||(Wo={}));const ui={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Wo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Wo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ia=(0,c.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),hi=(0,g.createContext)({content:{contentRef:void 0}});function aa(e){const[o,l]=(0,g.useState)(()=>ui.getSidebarPinState()),{sidebarConfig:h}=(0,g.useContext)(ar),f=(0,g.useRef)(null),x=(0,g.useMemo)(()=>({content:{contentRef:f}}),[f]);(0,g.useEffect)(()=>{ui.setSidebarPinState(o)},[o]);const C=(0,Fe.Z)(F=>F.breakpoints.down("xs"),{noSsr:!0}),M=()=>l(!o),K=ia({isPinned:o,sidebarConfig:h});return(0,r.jsx)(ea,{value:{isPinned:o,toggleSidebarPinState:M,isMobile:C},children:(0,r.jsx)(hi.Provider,{value:x,children:(0,r.jsx)(Le.Z,{className:K.root,children:e.children})})})}function pi(){const{content:e}=(0,g.useContext)(hi);return{focusContent:(0,g.useCallback)(()=>{var l,h;e==null||(l=e.contentRef)===null||l===void 0||(h=l.current)===null||h===void 0||h.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const fi=(0,c.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Yn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Yn||(Yn={}));const la=e=>{const{sidebarConfig:o}=(0,g.useContext)(ar),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:h=o.defaultCloseDelayMs,disableExpandOnHover:f,children:x}=e,C=fi({sidebarConfig:o}),M=(0,Fe.Z)(dn=>dn.breakpoints.down("md"),{noSsr:!0}),[K,F]=(0,g.useState)(Yn.Closed),pe=(0,g.useRef)(),{isPinned:de,toggleSidebarPinState:je}=zo(),Oe=()=>{de||f||(pe.current&&(clearTimeout(pe.current),pe.current=void 0),K!==Yn.Open&&!M&&(pe.current=window.setTimeout(()=>{pe.current=void 0,F(Yn.Open)},l),F(Yn.Idle)))},Me=()=>{de||f||(pe.current&&(clearTimeout(pe.current),pe.current=void 0),K===Yn.Idle?F(Yn.Closed):K===Yn.Open&&(pe.current=window.setTimeout(()=>{pe.current=void 0,F(Yn.Closed)},h)))},_e=K===Yn.Open&&!M||de,Dt=dn=>{dn?(F(Yn.Open),je()):(F(Yn.Closed),je())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(gi,{}),(0,r.jsx)(li,{value:{isOpen:_e,setOpen:Dt},children:(0,r.jsx)(Le.Z,{className:C.root,"data-testid":"sidebar-root",onMouseEnter:f?()=>{}:Oe,onFocus:f?()=>{}:Oe,onMouseLeave:f?()=>{}:Me,onBlur:f?()=>{}:Me,children:(0,r.jsx)(Le.Z,{className:O()(C.drawer,C.drawerWidth,{[C.drawerOpen]:_e}),children:x})})})]})},As=e=>{var o;const l=xs((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var h;const f=ii((h=e.submenuOptions)!==null&&h!==void 0?h:{}),{children:x,disableExpandOnHover:C,openDelayMs:M,closeDelayMs:K}=e,{isMobile:F}=zo();return F?(0,r.jsx)(sa,{children:x}):(0,r.jsx)(ar.Provider,{value:{sidebarConfig:l,submenuConfig:f},children:(0,r.jsx)(la,{openDelayMs:M,closeDelayMs:K,disableExpandOnHover:C,children:x})})};function gi(){const{sidebarConfig:e}=(0,g.useContext)(ar),{focusContent:o,contentRef:l}=pi(),h=fi({sidebarConfig:e});return l!=null&&l.current?(0,r.jsx)(fe.Z,{onClick:o,variant:"contained",className:O()(h.visuallyHidden),children:"Skip to content"}):null}function Ts(e,o){const l=new URLSearchParams(o.search).toString(),h=Ys().parse(l),f=new URLSearchParams(e.search).toString(),x=Ys().parse(f);return(0,re.isEqual)(o.pathname,e.pathname)&&(0,re.isMatch)(x,h)}const mi=(0,c.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),ca=e=>{const{title:o,subtitle:l,to:h,icon:f,dropdownItems:x}=e,C=mi(),{setIsHoveredOn:M}=useContext(SidebarItemWithSubmenuContext),K=()=>{M(!1)},F=useResolvedPath(h!=null?h:""),pe=useLocation();let de=isLocationMatch(pe,F);const[je,Oe]=useState(!1),Me=()=>{Oe(!je)};return x!==void 0?(x.some(_e=>{const Dt=resolvePath(_e.to);return de=isLocationMatch(pe,Dt),de}),_jsxs(Box,{className:C.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:Me,onTouchStart:_e=>_e.stopPropagation(),className:classnames(C.item,de?C.selected:void 0),children:[f&&_jsx(f,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:C.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:C.subtitle,children:l})]}),je?_jsx(ArrowDropUpIcon,{className:C.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:C.dropdownArrow})]})}),x&&je&&_jsx(Box,{className:C.dropdown,children:x.map((_e,Dt)=>_jsx(Tooltip,{title:_e.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:_e.to,underline:"none",className:C.dropdownItem,onClick:K,onTouchStart:dn=>dn.stopPropagation(),children:_jsx(Typography,{className:C.textContent,children:_e.title})})},Dt))})]})):_jsx(Box,{className:C.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:h,underline:"none",className:classnames(C.item,de?C.selected:void 0),onClick:K,onTouchStart:_e=>_e.stopPropagation(),children:[f&&_jsx(f,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",className:C.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",className:C.subtitle,children:l})]})]})})})};var Vo;const vi=(0,c.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(Vo=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&Vo!==void 0?Vo:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),yi=e=>{const{isOpen:o}=vo(),{sidebarConfig:l,submenuConfig:h}=(0,g.useContext)(ar),f=o?l.drawerWidthOpen:l.drawerWidthClosed,x=vi({left:f,submenuConfig:h}),{isHoveredOn:C}=(0,g.useContext)(bs),[M,K]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{K(C)},[C]),(0,r.jsxs)(Le.Z,{className:O()(x.drawer,{[x.drawerOpen]:M}),children:[(0,r.jsx)($.Z,{variant:"h5",className:x.title,children:e.title}),e.children]})};var xi=n(26739),yo=n(76600),da=n(83543),bi=n(59797),Rs=n(98989);const ua=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ha=()=>{const e=ua();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 pa=null;const Si=(0,c.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),fa=()=>{const e=Si();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 ga=null,Ho,Go;const lr=e=>(0,c.Z)(o=>{var l,h;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(Ho=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&Ho!==void 0?Ho:"#404040"}},highlighted:{background:(Go=(h=o.palette.navigation.navItem)===null||h===void 0?void 0:h.hoverBackground)!==null&&Go!==void 0?Go:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function xo(e){return(0,g.useMemo)(()=>lr(e),[e])()}const Ci=(e,o)=>(0,z.vJ)(e.props.children,l=>{let h=!1;return l.getElements().forEach(({props:{to:f,dropdownItems:x}})=>{if(!h){if(x!=null&&x.length){x.forEach(({to:C})=>h=h||Ts(o,(0,ms.i3)(C)));return}f&&(h=Ts(o,(0,ms.i3)(f)))}}),h},[o.pathname]);function Is(e){return e.to===void 0}const Ps=g.createElement(yi).type,wi=g.forwardRef(function({to:o,end:l,style:h,className:f,activeStyle:x,caseSensitive:C,activeClassName:M="active","aria-current":K="page",...F},pe){let{pathname:de}=(0,X.TH)(),{pathname:je}=(0,X.WU)(o);C||(de=de.toLocaleLowerCase("en-US"),je=je.toLocaleLowerCase("en-US"));let Oe=de===je;!Oe&&!l&&(Oe=de.startsWith(`${je}/`));const Me=Oe?K:void 0;return(0,r.jsx)(te.rU,{...F,to:o,ref:pe,"aria-current":Me,style:{...h,...Oe?x:void 0},className:O()([f,Oe?M:void 0])})}),Ls=(0,g.forwardRef)((e,o)=>{const{icon:l,text:h,hasNotifications:f=!1,hasSubmenu:x=!1,disableHighlight:C=!1,onClick:M,children:K,className:F,...pe}=e,{sidebarConfig:de}=(0,g.useContext)(ar),je=xo(de),{isOpen:Oe}=vo(),Me=!Oe&&x?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},_e=(0,r.jsxs)(Le.Z,{style:Me,children:[(0,r.jsx)(l,{fontSize:"small"}),!Oe&&x?(0,r.jsx)(Rs.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),Dt=(0,r.jsx)(xi.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!f,className:O()({[je.closedItemIcon]:!Oe}),children:_e}),dn=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Le.Z,{"data-testid":"login-button",className:je.iconContainer,children:Dt}),h&&(0,r.jsx)($.Z,{variant:"subtitle2",className:je.label,children:h}),(0,r.jsx)("div",{className:je.secondaryAction,children:K})]}),Ln=Oe?dn:Dt,rr={onClick:M,className:O()(F,je.root,Oe?je.open:je.closed,Is(e)&&je.buttonItem,{[je.highlightable]:!C})};return Is(e)?(0,r.jsx)(fe.Z,{role:"button","aria-label":h,...rr,ref:o,children:Ln}):(0,r.jsx)(wi,{...rr,activeClassName:je.selected,to:e.to?e.to:"",ref:o,"aria-label":h||e.to,...pe,children:Ln})}),ji=({children:e,...o})=>{const{sidebarConfig:l}=(0,g.useContext)(ar),h=xo(l),[f,x]=(0,g.useState)(!1),C=(0,X.TH)(),M=Ci(e,C),K=(0,Fe.Z)(je=>je.breakpoints.down("sm")),F=()=>{x(!0)},pe=()=>{x(!1)},de=()=>K?f?(0,r.jsx)(bi.Z,{fontSize:"small",className:h.submenuArrow}):(0,r.jsx)(da.Z,{fontSize:"small",className:h.submenuArrow}):!f&&(0,r.jsx)(Rs.Z,{fontSize:"small",className:h.submenuArrow});return(0,r.jsx)(bs.Provider,{value:{isHoveredOn:f,setIsHoveredOn:x},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:pe,onTouchStart:f?pe:F,onMouseEnter:F,className:O()(f&&h.highlighted),children:[(0,r.jsx)(Ls,{hasSubmenu:!0,className:M?h.selected:"",...o,children:de()}),f&&e]})})},Os=(0,g.forwardRef)((e,o)=>{const[l]=(0,z.vJ)(e.children,h=>h.getElements().filter(f=>f.type===Ps));return l?(0,r.jsx)(ji,{...e,children:l}):(0,r.jsx)(Ls,{...e,ref:o})});function Ba(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,h]=useState(""),f=xo(o),x=e.icon?e.icon:SearchIcon,C=()=>{e.onSearch(l),h("")},M=de=>{de.key==="Enter"&&(de.preventDefault(),C())},K=de=>{h(de.target.value)},F=de=>{de.preventDefault(),de.stopPropagation()},pe=de=>{C(),de.preventDefault()};return _jsx(Box,{className:f.searchRoot,children:_jsx(Os,{icon:x,to:e.to,onClick:pe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:F,onChange:K,onKeyDown:M,className:f.searchContainer,InputProps:{disableUnderline:!0,className:f.searchField},inputProps:{className:f.searchFieldHTMLInput}})})})}const ma=(0,yo.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),i=(0,yo.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),t=(0,yo.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),s=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.hint,borderRadius:"5px"}}),a=(0,yo.Z)("div")(({theme:e})=>{const o=s(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),p=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=xo(e),{isOpen:l,setOpen:h}=useSidebarOpenState();if(useMediaQuery(C=>C.breakpoints.down("md"),{noSsr:!0}))return null;const x=()=>{h(!l)};return _jsx(Button,{role:"button",onClick:x,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},E=(0,c.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function k(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=E({sidebarConfig:o}),{text:h,onClose:f}=e,x=()=>f();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:h}),_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 W=e=>{const{text:o,onDismiss:l}=e,[h,f]=useState(!1),x=()=>{f(!0)};return _jsx(Collapse,{in:!h,onExited:l,children:_jsx(k,{text:o,onClose:x})})},se=null,Te="And your recently viewed plugins will pop up here!";function Be(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:h,set:f}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:x,recentlyViewedItemsDismissed:C}=h!=null?h:{},M=()=>{f(F=>({...l,...F,starredItemsDismissed:!0}))},K=()=>{f(F=>({...l,...F,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!x&&_jsxs(_Fragment,{children:[_jsx(W,{text:se,onDismiss:M}),_jsx(SidebarDivider,{})]}),!C&&_jsx(W,{text:Te,onDismiss:K})]}):null}const Ve=(0,c.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 ft(e){const{className:o,stretch:l,noPadding:h,children:f,...x}=e,{contentRef:C}=pi(),M=Ve();return(0,r.jsx)("article",{ref:C,tabIndex:-1,...x,className:O()(M.root,o,{[M.stretch]:l,[M.noPadding]:h}),children:f})}var Ct=n(6487),At=n(99152);const Ut=(0,c.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 Ft(e){const{tabs:o,onChange:l,selectedIndex:h}=e,[f,x]=(0,g.useState)(h!=null?h:0),C=Ut(),M=(0,g.useCallback)((K,F)=>{h===void 0&&x(F),l&&h!==F&&l(F)},[h,l]);return(0,g.useEffect)(()=>{h!==void 0&&x(h)},[h]),(0,r.jsx)(Le.Z,{className:C.tabsWrapper,children:(0,r.jsx)(At.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:M,value:f,children:o.map((K,F)=>(0,g.createElement)(Ct.Z,{...K.tabProps,"data-testid":`header-tab-${F}`,label:K.label,key:K.id,value:F,className:C.defaultTab,classes:{selected:C.selected,root:C.tabRoot}}))})})}function Fn(e){const o=(0,X.UO)(),h=e.map(({path:je,children:Oe})=>({caseSensitive:!1,path:`${je}/*`,element:Oe})).sort((je,Oe)=>Oe.path.replace(/\/\*$/,"").localeCompare(je.path.replace(/\/\*$/,"")));var f;const x=(f=(0,X.V$)(h))!==null&&f!==void 0?f:e[0].children;var C;let M=(C=o["*"])!==null&&C!==void 0?C:"";M.startsWith("/")||(M=`/${M}`);var K;const[F]=(K=(0,ms.fp)(h,M))!==null&&K!==void 0?K:[],pe=F?e.findIndex(je=>`${je.path}/*`===F.route.path):0;var de;return{index:pe===-1?0:pe,element:x,route:(de=e[pe])!==null&&de!==void 0?de:e[0]}}function tr(e){const{routes:o}=e,l=(0,X.s0)(),{index:h,route:f,element:x}=Fn(o),C=(0,g.useMemo)(()=>o.map(K=>({id:K.path,label:K.title,tabProps:K.tabProps})),[o]),M=K=>{let{path:F}=o[K];F=F.replace(/\/\*$/,""),F=F.replace(/^\//,""),l(F)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ft,{tabs:C,selectedIndex:h,onChange:M}),(0,r.jsxs)(ft,{children:[(0,r.jsx)(Uo.q,{title:f.title}),x]})]})}const nr=()=>null;(0,z.R5)(nr,"core.gatherMountPoints",!0);function Qr(e){const o=(0,r.jsx)(nr,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return g.Children.toArray(e).flatMap(l=>{if(!(0,g.isValidElement)(l))return[];if(l.type===g.Fragment)return Qr(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:h,title:f,children:x,tabProps:C}=l.props;return[{path:h,title:f,children:x,tabProps:C}]})}function Ei(e){const o=Qr(e.children);return(0,r.jsx)(tr,{routes:o})}Ei.Route=nr;const Ai=(0,c.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Ko(e){const{value:o,subvalue:l}=e,h=Ai();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Le.Z,{className:h.value,children:o}),(0,r.jsx)(Le.Z,{className:h.subvalue,children:l})]})}var bo=n(67222),Zr=n(21070),$a=n(90324),Da=n(98281),Za=n(48049),va=n(51209),ya=n(33375),Na=n(44233),Fa=n(27604),Ti=n(36444),Ua=n(37971),Ma=n(59709),za=n(17373),Wa=n(3702),Va=n(93111);const Ha=(0,c.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"}),Ga=e=>{var o;const l=Ha(),{onChangeFilters:h}=e,[f,x]=(0,g.useState)({...e.selectedFilters}),[C,M]=(0,g.useState)(!1),K=()=>{x({}),M(F=>!F)};return(0,g.useEffect)(()=>{h(f)},[f,h]),(0,r.jsxs)(Le.Z,{className:l.root,children:[(0,r.jsxs)(Le.Z,{className:l.header,children:[(0,r.jsx)(Le.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(fe.Z,{color:"primary",onClick:K,children:"Clear all"})]}),(0,r.jsx)(Le.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(F=>(0,r.jsx)(qt,{triggerReset:C,...F.element,selected:f[F.element.label],onChange:pe=>x({...f,[F.element.label]:pe})},F.element.label))})]})},xa={Add:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Zr.Z,{...e,ref:o})),Check:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Da.Z,{...e,ref:o})),Clear:(0,g.forwardRef)((e,o)=>(0,r.jsx)(ya.Z,{...e,ref:o})),Delete:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Na.Z,{...e,ref:o})),DetailPanel:(0,g.forwardRef)((e,o)=>(0,r.jsx)(va.Z,{...e,ref:o})),Edit:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Fa.Z,{...e,ref:o})),Export:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Wa.Z,{...e,ref:o})),Filter:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Ti.Z,{...e,ref:o})),FirstPage:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Ua.Z,{...e,ref:o})),LastPage:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Ma.Z,{...e,ref:o})),NextPage:(0,g.forwardRef)((e,o)=>(0,r.jsx)(va.Z,{...e,ref:o})),PreviousPage:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Za.Z,{...e,ref:o})),ResetSearch:(0,g.forwardRef)((e,o)=>(0,r.jsx)(ya.Z,{...e,ref:o})),Search:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Ti.Z,{...e,ref:o})),SortArrow:(0,g.forwardRef)((e,o)=>(0,r.jsx)($a.Z,{...e,ref:o})),ThirdStateCheck:(0,g.forwardRef)((e,o)=>(0,r.jsx)(za.Z,{...e,ref:o})),ViewColumn:(0,g.forwardRef)((e,o)=>(0,r.jsx)(Va.Z,{...e,ref:o}))};function ba(e,o){const l=o.split(".");let h=e[l[0]];for(let f=1;f<l.length;++f){if(h===void 0)return h;const x=l[f];h=h[x]}return h}const Ka=(0,tn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,color:e.palette.textSubtle,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(bo.W$),Sa=(0,tn.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"})(bo.UW),Ya=(0,c.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),Ja=(0,c.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function Qa(e,o){return e.map(l=>{var h;const f=(h=l.headerStyle)!==null&&h!==void 0?h:{};let x=l.cellStyle||{};if(l.highlight)if(f.color=o.palette.textContrast,typeof x=="object")x.fontWeight=o.typography.fontWeightBold;else{const C=x;x=(M,K,F)=>({...C(M,K,F),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:f,cellStyle:x}})}function Xa(e,o){return(0,re.transform)(e,(l,h,f)=>{(0,re.isEqual)(h,o[f])||(l[f]=h)})}const Ca={search:"",filtersOpen:!1,filters:{}};function qa(e){const{toolbarRef:o,setSearch:l,hasFilters:h,selectedFiltersLength:f,toggleFilters:x}=e,C=Ya(),M=(0,g.useCallback)(K=>{e.onSearchChanged(K),l(K)},[e,l]);return h?(0,r.jsxs)(Le.Z,{className:C.root,children:[(0,r.jsxs)(Le.Z,{className:C.root,children:[(0,r.jsx)(jt.Z,{onClick:x,"aria-label":"filter list",children:(0,r.jsx)(Ti.Z,{})}),(0,r.jsxs)($.Z,{className:C.title,children:["Filters (",f,")"]})]}),(0,r.jsx)(Sa,{...e,ref:o,onSearchChanged:M})]}):(0,r.jsx)(Sa,{...e,ref:o,onSearchChanged:M})}function wa(e){const{data:o,columns:l,options:h,title:f,subtitle:x,filters:C,initialState:M,emptyContent:K,onStateChange:F,components:pe,...de}=e,je=Ja(),Oe=(0,bt.Z)(),Me={...Ca,...M},[_e,Dt]=(0,g.useState)(Me.filtersOpen),dn=(0,g.useCallback)(()=>Dt(Un=>!Un),[Dt]),[Ln,rr]=(0,g.useState)(0),[Zt,un]=(0,g.useState)(o),[gn,jr]=(0,g.useState)(Me.filters),Er=Qa(l,Oe),[Ar,Tr]=(0,g.useState)(Me.search);(0,g.useEffect)(()=>{if(F){const Un=Xa({search:Ar,filtersOpen:_e,filters:gn},Ca);F(Un)}},[Ar,_e,gn,F]);const Oi={headerStyle:{textTransform:"uppercase"}},Nr=(0,g.useCallback)(Un=>{var br;return(br=l.find(Xr=>Xr.title===Un))===null||br===void 0?void 0:br.field},[l]);(0,g.useEffect)(()=>{if(typeof o=="function")return;if(!gn){un(o);return}const Un=Object.values(gn);if(o&&Un.flat().length){const br=o.filter(Xr=>!!Object.entries(gn).filter(([,qr])=>!!qr.length).every(([qr,mn])=>{const Cn=ba(Xr,Nr(qr));return Array.isArray(Cn)&&Array.isArray(mn)?Cn.some(wo=>mn.includes(wo)):Array.isArray(Cn)?Cn.includes(mn):Array.isArray(mn)?mn.includes(Cn):Cn===mn}));un(br)}else un(o);rr(Un.flat().length)},[o,gn,Nr]);const ki=(Un,br)=>{const Xr=mn=>{const Cn=new Set,wo=_r=>{_r!=null&&Cn.add(_r)};return br&&br.forEach(_r=>{const Qo=ba(_r,Nr(mn));Array.isArray(Qo)?Qo.forEach(wo):wo(Qo)}),Cn},qr=mn=>({placeholder:"All results",label:mn.column,multiple:mn.type==="multiple-select",items:[...Xr(mn.column)].sort().map(Cn=>({label:Cn,value:Cn}))});return Un.map(mn=>({type:mn.type,element:qr(mn)}))},nn=!!(C!=null&&C.length),Co=(0,g.useCallback)(Un=>(0,r.jsx)(qa,{setSearch:Tr,hasFilters:nn,selectedFiltersLength:Ln,toggleFilters:dn,...Un}),[dn,nn,Ln,Tr]),ks=typeof o!="function"&&o.length===0,Fr=l.length,Bi=(0,g.useCallback)(Un=>K&&ks?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Fr,children:K})})}):(0,r.jsx)(bo.os,{...Un}),[ks,K,Fr]);return(0,r.jsxs)(Le.Z,{className:je.root,children:[_e&&o&&typeof o!="function"&&(C==null?void 0:C.length)&&(0,r.jsx)(Ga,{filters:ki(C,o),selectedFilters:gn,onChangeFilters:jr}),(0,r.jsx)(bo.ZP,{components:{Header:Ka,Toolbar:Co,Body:Bi,...pe},options:{...Oi,...h},columns:Er,icons:xa,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($.Z,{variant:"h5",component:"h2",children:f}),x&&(0,r.jsx)($.Z,{color:"textSecondary",variant:"body1",children:x})]}),data:typeof o=="function"?o:Zt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...de})]})}wa.icons=Object.freeze(xa);var Kl=n(44311);function _a(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function Yl(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:_a(e.data,o)})]})}const el=e=>(0,c.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),tl=({title:e="Unknown page",className:o})=>(0,r.jsx)($.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function nl(e){const{description:o,title:l,titleComponent:h=void 0,children:f,textAlign:x="left"}=e,C=el({textAlign:x})(),M=h||(0,r.jsx)(tl,{title:l,className:C.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Uo.q,{title:l}),(0,r.jsxs)(Le.Z,{className:C.container,children:[(0,r.jsxs)(Le.Z,{className:C.leftItemsBox,children:[M,o&&(0,r.jsx)($.Z,{className:C.description,variant:"body2",children:o})]}),(0,r.jsx)(Le.Z,{className:C.rightItemsBox,children:f})]})]})}var rl=n.p+"static/mic-drop.fe3ef4d0..svg";const ol=(0,c.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),sl=()=>{const e=ol();return(0,r.jsx)("img",{src:rl,className:e.micDrop,alt:"Girl dropping mic from her hands"})},il=(0,c.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 al(e){const{status:o,statusMessage:l,additionalInfo:h,supportUrl:f}=e,x=il(),C=(0,X.s0)(),M=Yr();return(0,r.jsxs)(Ee.Z,{container:!0,spacing:0,className:x.container,children:[(0,r.jsxs)(Ee.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)($.Z,{"data-testid":"error",variant:"body1",className:x.subtitle,children:["ERROR ",o,": ",l]}),(0,r.jsx)($.Z,{variant:"body1",className:x.subtitle,children:h}),(0,r.jsx)($.Z,{variant:"h2",className:x.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)($.Z,{variant:"h6",children:[(0,r.jsx)(ot,{to:"#","data-testid":"go-back-link",onClick:()=>C(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(ot,{to:f||M.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(sl,{})]})}var ll=n(16173);const cl=(0,tn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})($.Z),Ri=(0,tn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(Le.Z);function dl(e){const{children:o,...l}=e,[h,f]=g.useState(null),x=g.Children.toArray(o),[C,M,...K]=x,F=K.length?K.pop():x[x.length-1],pe=x.length>3,de=Me=>{f(Me.currentTarget)},je=()=>{f(null)},Oe=Boolean(h);return(0,r.jsxs)(g.Fragment,{children:[(0,r.jsxs)(ll.Z,{"aria-label":"breadcrumb",...l,children:[x.length>1&&(0,r.jsx)(Ri,{clone:!0,children:C}),x.length>2&&(0,r.jsx)(Ri,{clone:!0,children:M}),pe&&(0,r.jsx)(cl,{onClick:de,children:"..."}),(0,r.jsx)(Le.Z,{style:{fontStyle:"italic"},children:F})]}),(0,r.jsx)(Ks.ZP,{open:Oe,anchorEl:h,onClose:je,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(yt.Z,{children:K.map((Me,_e)=>(0,r.jsx)(Ge.Z,{button:!0,children:(0,r.jsx)(Ri,{clone:!0,children:Me})},_e))})})]})}const ul=(0,c.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"}),hl=({type:e,typeLink:o,classes:l,pageTitle:h})=>e?o?(0,r.jsxs)(dl,{className:l.breadcrumb,children:[(0,r.jsx)(ot,{to:o,children:e}),(0,r.jsx)($.Z,{children:h})]}):(0,r.jsx)($.Z,{className:l.type,children:e}):null,pl=({pageTitle:e,classes:o,tooltip:l})=>{const h=(0,r.jsx)($.Z,{className:o.title,variant:"h1",children:e});return l?(0,r.jsx)($t.ZP,{title:l,placement:"top-start",children:h}):h},fl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)($.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function ja(e){const{children:o,pageTitleOverride:l,style:h,subtitle:f,title:x,tooltip:C,type:M,typeLink:K}=e,F=ul(),de=(0,z.h_)(z.Ds).getOptionalString("app.title")||"Backstage",je=l||x,Oe=x||l,Me=`${je} | %s | ${de}`,_e=`${je} | ${de}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Uo.q,{titleTemplate:Me,defaultTitle:_e}),(0,r.jsxs)("header",{style:h,className:F.header,children:[(0,r.jsxs)(Le.Z,{className:F.leftItemsBox,children:[(0,r.jsx)(hl,{classes:F,type:M,typeLink:K,pageTitle:Oe}),(0,r.jsx)(pl,{classes:F,pageTitle:Oe,tooltip:C}),(0,r.jsx)(fl,{classes:F,subtitle:f})]}),(0,r.jsx)(Ee.Z,{container:!0,className:F.rightItemsBox,spacing:4,children:o})]})]})}const gl=({label:e,secondaryLabel:o,icon:l,disabled:h=!1,onClick:f})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:h,button:!0,onClick:x=>{f&&f(x)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function Jl(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[h,f]=React.useState(!1),x=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>f(!0),"data-testid":"header-action-menu",ref:x,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:h,anchorEl:x.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>f(!1),children:_jsx(List,{children:l.map((C,M)=>_jsx(gl,{...C},`header-action-menu-${M}`))})})]})}const ml=(0,c.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,We.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),vl=({value:e,className:o})=>(0,r.jsx)($.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function yl(e){const{label:o,value:l,url:h}=e,f=ml(),x=(0,r.jsx)(vl,{className:f.value,value:l||"<Unknown>"});return(0,r.jsx)(Ee.Z,{item:!0,children:(0,r.jsxs)($.Z,{component:"span",className:f.root,children:[(0,r.jsx)($.Z,{className:f.label,children:o}),h?(0,r.jsx)(ot,{to:h,children:x}):x]})})}const xl=e=>(0,Pe.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),bl=(0,c.Z)(xl,{name:"BackstageItemCardHeader"});function Sl(e){const{title:o,subtitle:l,children:h}=e,f=bl(e);return(0,r.jsxs)(Le.Z,{className:f.root,children:[l&&(0,r.jsx)($.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,r.jsx)($.Z,{variant:"h6",component:"h4",children:o}),h]})}function Ql(e){const{description:o,tags:l,title:h,type:f,subtitle:x,label:C,onClick:M,href:K}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:h,subtitle:x||f})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((F,pe)=>_jsx(Chip,{size:"small",label:F},pe))}):null,o]}),_jsxs(CardActions,{children:[!K&&_jsx(LinkButton,{to:"#",onClick:M,color:"primary",children:C}),K&&_jsx(LinkButton,{to:K,color:"primary",children:C})]})]})}const Cl=e=>(0,Pe.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),wl=(0,c.Z)(Cl,{name:"BackstageItemCardGrid"});function jl(e){const{children:o,...l}=e,h=wl(l);return(0,r.jsx)(Le.Z,{className:h.root,...l,children:o})}var El=n(41547);const Al=(0,c.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"}}}),{name:"BackstagePage"});function Ea(e){const{themeId:o,children:l}=e,h=Al();return(0,r.jsx)(El.Z,{theme:f=>({...f,page:f.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:h.root,children:l})})}function Tl(e){const{themeId:o,children:l,...h}=e;return(0,r.jsxs)(Ea,{themeId:o,children:[(0,r.jsx)(ja,{...h}),l]})}var Jn=n(30195);const Xl=Jn.z.object({providerInfo:Jn.z.object({}).catchall(Jn.z.unknown()).optional(),profile:Jn.z.object({email:Jn.z.string().optional(),displayName:Jn.z.string().optional(),picture:Jn.z.string().optional()}),backstageIdentity:Jn.z.object({token:Jn.z.string(),identity:Jn.z.object({type:Jn.z.literal("user"),userEntityRef:Jn.z.string(),ownershipEntityRefs:Jn.z.array(Jn.z.string())})})}),Aa={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function Rl(e){const o=new Date(Date.now()+Aa.defaultTokenExpiryMillis);if(!e)return o;const[l,h,f]=e.split("."),x=JSON.parse(window.atob(h));return typeof x.exp!="number"?o:new Date(x.exp*1e3-Aa.tokenExpiryMarginMillis)}class ql{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,h=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!h)throw new TypeError(`Invalid user entity reference "${l}"`);return h[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(h=>(this.state={type:"active",session:h,expiresAt:Rl(h.backstageIdentity.token)},h),h=>{throw this.state={type:"failed",error:h},h});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,h=new Headers(l);h.set("X-Requested-With","XMLHttpRequest");const f=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:h,credentials:"include"});if(!f.ok)throw await ResponseError.fromResponse(f);return proxiedSessionSchema.parse(await f.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const _l=e=>{const o=useApi(discoveryApiRef),[{status:l,error:h},{execute:f}]=useAsync(async()=>{const x=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await x.start(),e.onSignInSuccess(x)});return useMountEffect(f),l==="loading"?_jsx(Progress,{}):h?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:h}):null},Il=(0,c.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),Ii=({children:e})=>{const o=Il();return(0,r.jsx)(Ee.Z,{component:"li",item:!0,classes:o,children:e})};var Yo=n(87612);class Pi{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function Pl(e){const[o,l,h]=e.split(".");return JSON.parse(window.atob(l))}class Li{getUserId(){return this.result.userId}static fromResult(o){return new Li(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const f=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:f,ownershipEntityRefs:[f]}}const{sub:l,ent:h}=Pl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:h!=null?h:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,Yo._)(this,"result",void 0),this.result=o}}class Jo{static createGuest(){return new Pi}static fromLegacy(o){return Li.fromResult(o)}static create(o){return new Jo(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,h){(0,Yo._)(this,"identity",void 0),(0,Yo._)(this,"authApi",void 0),(0,Yo._)(this,"profile",void 0),(0,Yo._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=h}}const Ll={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:h})=>{const{apiRef:f,title:x,message:C}=e,M=(0,z.h_)(f),K=(0,z.h_)(z.VE),F=async()=>{try{o();const pe=await M.getBackstageIdentity({instantPopup:!0});if(!pe)throw h(),new Error(`The ${x} provider is not configured to support sign-in`);const de=await M.getProfile();l(Jo.create({identity:pe.identity,profile:de,authApi:M}))}catch(pe){h(),K.post(new Ro.SP("Login failed",pe))}};return(0,r.jsx)(Ii,{children:(0,r.jsx)(kr,{variant:"fullHeight",title:x,actions:(0,r.jsx)(fe.Z,{color:"primary",variant:"outlined",onClick:F,children:"Sign In"}),children:(0,r.jsx)($.Z,{variant:"body1",children:C})})})},loader:async(e,o)=>{const l=e.get(o),h=await l.getBackstageIdentity({optional:!0});if(!h)return;const f=await l.getProfile();return Jo.create({identity:h.identity,profile:f,authApi:l})}},Ol={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(Ii,{children:(0,r.jsx)(kr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(fe.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new Pi)},children:"Enter"}),children:(0,r.jsxs)($.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 Pi};var kl=n(63955),Ta=n(86619),Ra=n(74828),Bl=n(45455),$l=n.n(Bl);const Dl=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Zl=(0,c.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Ia=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},Nl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=Zl(),{register:h,handleSubmit:f,formState:x}=(0,kl.cI)({mode:"onChange"}),{errors:C}=x,M=({userId:K,idToken:F})=>{e(),o(Jo.fromLegacy({userId:K,getIdToken:F!==void 0?async()=>F:void 0,profile:{email:`${K}@example.com`}}))};return(0,r.jsx)(Ii,{children:(0,r.jsxs)(kr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)($.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:l.form,onSubmit:f(M),children:[(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(Ta.Z,{...Ia(h("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(C.userId)}),C.userId&&(0,r.jsx)(Ra.Z,{error:!0,children:C.userId.message})]}),(0,r.jsxs)(ae.Z,{children:[(0,r.jsx)(Ta.Z,{...Ia(h("idToken",{required:!1,validate:K=>!K||Dl.test(K)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(C.idToken)}),C.idToken&&(0,r.jsx)(Ra.Z,{error:!0,children:C.idToken.message})]}),(0,r.jsx)(fe.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(x!=null&&x.isDirty)||!$l()(C),children:"Continue"})]})]})})},loader:async()=>{}},So="@backstage/core:SignInPage:provider",Pa={guest:Ol,custom:Nl,common:Ll};function La(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function ic(e){return e.reduce((l,h)=>{if(typeof h=="string")return La(h,l),l[h]={components:Pa[h],id:h},l;const{id:f}=h;return La(f,l),l[f]={components:Pa.common,id:f,config:h},l},{})}const ac=(e,o)=>{const l=useApi(errorApiRef),h=useApiHolder(),[f,x]=useState(!0),C=useCallback(K=>{o(IdentityApiSignOutProxy.from({identityApi:K,signOut:async()=>{var F;localStorage.removeItem(So),await((F=K.signOut)===null||F===void 0?void 0:F.call(K))}}))},[o]);useLayoutEffect(()=>{var K;if(!f)return;const F=localStorage.getItem(So);if(F===null){x(!1);return}const pe=e[F];if(!pe){x(!1);return}let de=!1;return pe.components.loader(h,(K=pe.config)===null||K===void 0?void 0:K.apiRef).then(je=>{if(de){localStorage.removeItem(So);return}je?C(je):x(!1)}).catch(je=>{localStorage.removeItem(So),!de&&(l.post(je),x(!1))}),()=>{de=!0}},[f,l,o,h,e,C]);const M=useMemo(()=>Object.keys(e).map(K=>{const F=e[K],{Component:pe}=F.components,de=Me=>{C(Me)},je=()=>{var Me;localStorage.setItem(So,(F==null||(Me=F.config)===null||Me===void 0?void 0:Me.id)||F.id)},Oe=()=>{localStorage.removeItem(So)};return _jsx(pe,{config:F.config,onSignInStarted:je,onSignInSuccess:de,onSignInFailure:Oe},F.id)}),[e,C]);return[f,M]},Fl=({onSignInSuccess:e,providers:o=[],title:l,align:h="left"})=>{const f=useApi(configApiRef),x=useStyles(),C=getSignInProviders(o),[M,K]=useSignInProviders(C,e);return M?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:f.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:h}),_jsx(Grid,{container:!0,justifyContent:h==="center"?h:"flex-start",spacing:2,component:"ul",classes:x,children:K})]})]})},Ul=({provider:e,auto:o,onSignInSuccess:l})=>{const h=useStyles(),f=useApi(e.apiRef),x=useApi(configApiRef),[C,M]=useState(),[K,F]=useState(!1),pe=async({checkExisting:de,showPopup:je})=>{try{let Oe;if(de&&(Oe=await f.getBackstageIdentity({optional:!0})),!Oe&&(je||o)&&(F(!0),Oe=await f.getBackstageIdentity({instantPopup:!0}),!Oe))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Oe){F(!0);return}const Me=await f.getProfile();l(UserIdentity.create({identity:Oe.identity,authApi:f,profile:Me}))}catch(Oe){M(Oe),F(!0)}};return useMountEffect(()=>pe({checkExisting:!0})),K?_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:h,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{pe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),C&&C.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:C.message})]})})})})]}):_jsx(Progress,{})};function lc(e){return"provider"in e?_jsx(Ul,{...e}):_jsx(Fl,{...e})}const Ml=(0,c.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"}),zl=(0,tn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(Hr.Z);function cc(e){const{slackChannel:o,errorBoundaryProps:l,children:h,title:f,deepLink:x,value:C,onChange:M}=e,K=Ml(),[F,pe]=useState(0),de=M||((Me,_e)=>pe(_e));let je;C?React.Children.map(h,Me=>{if(React.isValidElement(Me)&&(Me==null?void 0:Me.props.value)===C){var _e;je=Me==null||(_e=Me.props)===null||_e===void 0?void 0:_e.children}}):React.Children.map(h,(Me,_e)=>{React.isValidElement(Me)&&_e===F&&(je=Me==null?void 0:Me.props.children)});const Oe=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Oe,children:[f&&_jsx(zl,{title:f}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:K,value:C||F,onChange:de,children:h}),_jsx(Divider,{}),_jsx(CardContent,{children:je}),x&&_jsx(BottomLink,{...x})]})})}const Wl=(0,c.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 dc(e){const{children:o,...l}=e,h=Wl();return _jsx(Tab,{disableRipple:!0,classes:h,...l})}},60871:function(wt,De,n){"use strict";n.d(De,{fC:function(){return v},CL:function(){return Le},sM:function(){return re},$v:function(){return rt},v_:function(){return H},hg:function(){return ot},uB:function(){return ze},R5:function(){return Qe},bq:function(){return V},Km:function(){return me},Ds:function(){return vt},ni:function(){return O},T0:function(){return R},CO:function(){return Tn},x8:function(){return kn},rx:function(){return Hn},YO:function(){return yn},P4:function(){return wn},NT:function(){return Jt},NW:function(){return Je},VE:function(){return ht},W0:function(){return bt},gP:function(){return Tt},IY:function(){return mt},F4:function(){return te},ux:function(){return A},Kp:function(){return X},$4:function(){return pt},p_:function(){return L},ZM:function(){return gt},D:function(){return D},gW:function(){return P},E6:function(){return jt},z$:function(){return Xt},h_:function(){return Ie},I_:function(){return B},qD:function(){return ue},vJ:function(){return bn},tg:function(){return Bn},Oi:function(){return Qn}});var d=n(52322),r=n(51837),z=n(2784);const I=(0,r.CT)("analytics-context"),g=()=>{const we=(0,z.useContext)(I);if(we===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const le=we.atVersion(1);if(le===void 0)throw new Error("No context found for version 1.");return le},v=we=>{const{attributes:le,children:$e}=we,et={...g(),...le},q=(0,r.EI)({1:et});return(0,d.jsx)(I.Provider,{value:q,children:$e})};function c(we,le){const $e=Ue=>_jsx(v,{attributes:le,children:_jsx(we,{...Ue})});return $e.displayName=`WithAnalyticsContext(${we.displayName||we.name||"Component"})`,$e}function B(){const we=(0,r.Vt)("api-context");if(!we)throw new Error("API context is not available");const le=we.atVersion(1);if(!le)throw new Error("ApiContext v1 not available");return le}function Ie(we){const $e=B().get(we);if(!$e)throw new Error(`No implementation available for ${we}`);return $e}function fe(we){return function($e){const Ue=q=>{const U=B(),ve={};for(const Ee in we)if(we.hasOwnProperty(Ee)){const tt=we[Ee],st=U.get(tt);if(!st)throw new Error(`No implementation available for ${tt}`);ve[Ee]=st}return _jsx($e,{...q,...ve})},et=$e.displayName||$e.name||"Component";return Ue.displayName=`withApis(${et})`,Ue}}var G=n(87612);class ${get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(le){if((0,G._)(this,"config",void 0),this.config=le,!le.id.split(".").flatMap(Ue=>Ue.split("-")).every(Ue=>Ue.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${le.id}'`)}}function R(we){return new $(we)}function O(we,le){return"id"in we?{api:we,deps:{},factory:()=>le}:we}var re;(function(we){we.SignedIn="SignedIn",we.SignedOut="SignedOut"})(re||(re={}));const X=R({id:"core.auth.google"}),te=R({id:"core.auth.github"}),D=R({id:"core.auth.okta"}),A=R({id:"core.auth.gitlab"}),L=R({id:"core.auth.microsoft"}),P=R({id:"core.auth.onelogin"}),V=R({id:"core.auth.bitbucket"}),me=R({id:"core.auth.bitbucket-server"}),ze=R({id:"core.auth.atlassian"}),rt=R({id:"core.alert"}),H=R({id:"core.analytics"}),ot=R({id:"core.apptheme"}),vt=R({id:"core.config"}),Je=R({id:"core.discovery"}),ht=R({id:"core.error"});var Le;(function(we){we[we.None=0]="None",we[we.Active=1]="Active"})(Le||(Le={}));const bt=R({id:"core.featureflags"}),Tt=R({id:"core.fetch"}),pt=R({id:"core.identity"}),gt=R({id:"core.oauthrequest"}),jt=R({id:"core.storage"});class $t{setContext(le){this.context=le}captureEvent(le,$e,{value:Ue,attributes:et}={}){try{this.analyticsApi.captureEvent({action:le,subject:$e,value:Ue,attributes:et,context:this.context})}catch(q){console.warn("Error during analytics event capture. %o",q)}}constructor(le,$e={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,G._)(this,"analyticsApi",void 0),(0,G._)(this,"context",void 0),this.analyticsApi=le,this.context=$e}}function He(){try{return Ie(H)}catch{return{captureEvent:()=>{}}}}function Xt(){const we=(0,z.useRef)(null),le=g(),$e=He();function Ue(){return we.current===null&&(we.current=new $t($e)),we.current}const et=Ue();return et.setContext(le),et}const ue=()=>{const we=(0,r.Vt)("app-context");if(!we)throw new Error("App context is not available");const le=we.atVersion(1);if(!le)throw new Error("AppContext v1 not available");return le},xe=(0,r.uW)("component-data-store",()=>new WeakMap),Fe="__backstage_data";function Qe(we,le,$e){const Ue=we;var et;let q=(et=Ue[Fe])!==null&&et!==void 0?et:xe.get(we);if(q||(q={map:new Map},Object.defineProperty(Ue,Fe,{enumerable:!1,configurable:!0,writable:!1,value:q}),xe.set(we,q)),q.map.has(le)){const U=we.displayName||we.name;throw new Error(`Attempted to attach duplicate data "${le}" to component "${U}"`)}q.map.set(le,$e)}function mt(we,le){if(!we)return;const $e=we.type;if(!$e)return;var Ue;const et=(Ue=$e[Fe])!==null&&Ue!==void 0?Ue:xe.get($e);if(et)return et.map.get(le)}const Rt=(0,r.uW)("route-ref-type",()=>Symbol("route-ref-type"));let ct=Rt,Et=ct;class Lt{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(le,$e){(0,G._)(this,"id",void 0),(0,G._)(this,"params",void 0),(0,G._)(this,Et,void 0),this.id=le,this.params=$e,this[ct]="absolute"}}function Jt(we){var le;return new Lt(we.id,(le=we.params)!==null&&le!==void 0?le:[])}const Pt=/^\w+$/;let an=null,Wt=null;class sn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(le,$e,Ue,et){_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,Wt,void 0),this.id=le,this.path=$e,this.parent=Ue,this.params=et,this[an]="sub"}}function zn(we){const{id:le,path:$e,parent:Ue}=we,et=$e.split("/").filter(ve=>ve.startsWith(":")).map(ve=>ve.substring(1)),q=[...Ue.params,...et];if(Ue.params.some(ve=>et.includes(ve)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!$e.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${$e}'`);if($e.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${$e}'`);for(const ve of et)if(!Pt.test(ve))throw new Error(`SubRouteRef path has invalid param, got '${ve}'`);return new sn(le,$e,Ue,q)}let An=Rt,hn=An;class On{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(le,$e,Ue){(0,G._)(this,"id",void 0),(0,G._)(this,"params",void 0),(0,G._)(this,"optional",void 0),(0,G._)(this,hn,void 0),this.id=le,this.params=$e,this.optional=Ue,this[An]="external"}}function kn(we){var le;return new On(we.id,(le=we.params)!==null&&le!==void 0?le:[],Boolean(we.optional))}var Wn=n(73557);function Bn(we){const{pathname:le}=(0,Wn.TH)(),$e=(0,r.Vt)("routing-context");if(!$e)throw new Error("Routing context is not available");const Ue=$e.atVersion(1),et=(0,z.useMemo)(()=>Ue&&Ue.resolve(we,{pathname:le}),[Ue,we,le]);if(!$e)throw new Error("useRouteRef used outside of routing context");if(!Ue)throw new Error("RoutingContext v1 not available");const q="optional"in we&&we.optional;if(!et&&!q)throw new Error(`No path for ${we}`);return et}function Qn(we){return(0,Wn.UO)()}class dt extends z.Component{static getDerivedStateFromError(le){return{error:le}}render(){const{error:le}=this.state,{app:$e,plugin:Ue}=this.props,{ErrorBoundaryFallback:et}=$e.getComponents();return le?(0,d.jsx)(et,{error:le,resetError:this.handleErrorReset,plugin:Ue}):this.props.children}constructor(...le){super(...le),(0,G._)(this,"state",{error:void 0}),(0,G._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var Qt=n(64355);function wn(we){const{component:le,mountPoint:$e,name:Ue}=we;return yn({component:{lazy:()=>le().then(et=>{const q=ve=>{try{Bn($e)}catch(Ee){if(typeof Ee=="object"&&Ee!==null){const{message:tt}=Ee;if(typeof tt=="string"&&tt.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${$e} 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 Ee}return(0,d.jsx)(et,{...ve})},U=Ue||et.displayName||et.name||"LazyComponent";return q.displayName=`RoutableExtension(${U})`,q},et=>U=>{const ve=ue(),{BootErrorPage:Ee}=ve.getComponents();return(0,d.jsx)(Ee,{step:"load-chunk",error:et})})},data:{"core.mountPoint":$e},name:Ue})}function Tn(we){const{component:le,name:$e}=we;return yn({component:le,name:$e})}function yn(we){const{data:le={},name:$e}=we;$e||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ue;if("lazy"in we.component){const q=we.component.lazy;Ue=(0,z.lazy)(()=>q().then(U=>({default:U})))}else Ue=we.component.sync;const et=$e||Ue.displayName||Ue.name||"Component";return{expose(q){const U=ve=>{const Ee=ue(),{Progress:tt}=Ee.getComponents(),st=le==null?void 0:le["core.mountPoint"];return(0,d.jsx)(z.Suspense,{fallback:(0,d.jsx)(tt,{}),children:(0,d.jsx)(dt,{app:Ee,plugin:q,children:(0,d.jsx)(v,{attributes:{pluginId:q.getId(),...$e&&{extension:$e},...st&&{routeRef:st.id}},children:(0,d.jsx)(Qt.o,{plugin:q,children:(0,d.jsx)(Ue,{...ve})})})})})};Qe(U,"core.plugin",q);for(const[ve,Ee]of Object.entries(le))Qe(U,ve,Ee);return U.displayName=`Extension(${et})`,U}}}function Mt(we,le,$e,Ue){return z.Children.toArray(we).flatMap(et=>{if(!(0,z.isValidElement)(et))return[];if(et.type===z.Fragment)return Mt(et.props.children,le,$e,Ue);if(mt(et,"core.featureFlagged")){const q=et.props;return("with"in q?le.isActive(q.with):!le.isActive(q.without))?Mt(et.props.children,le,$e,Ue):[]}if($e===void 0||$e(et))return[et];if(Ue)throw new Error(Ue);return Mt(et.props.children,le,$e,Ue)})}class ln{selectByComponentData(le){const $e=Mt(this.node,this.featureFlagsApi,Ue=>mt(Ue,le.key)!==void 0,le.withStrictError);return new ln($e,this.featureFlagsApi)}findComponentData(le){return Mt(this.node,this.featureFlagsApi,Ue=>mt(Ue,le.key)!==void 0).map(Ue=>mt(Ue,le.key)).filter(Ue=>Ue!==void 0)}getElements(){return Mt(this.node,this.featureFlagsApi)}constructor(le,$e){(0,G._)(this,"node",void 0),(0,G._)(this,"featureFlagsApi",void 0),this.node=le,this.featureFlagsApi=$e}}function bn(we,le,$e=[]){const Ue=Ie(bt),et=new ln(we,Ue);return(0,z.useMemo)(()=>le(et),[we,...$e])}class on{getId(){return this.config.id}getApis(){var le;return(le=this.config.apis)!==null&&le!==void 0?le:[]}getFeatureFlags(){var le,$e;return($e=(le=this.config.featureFlags)===null||le===void 0?void 0:le.slice())!==null&&$e!==void 0?$e:[]}get routes(){var le;return(le=this.config.routes)!==null&&le!==void 0?le:{}}get externalRoutes(){var le;return(le=this.config.externalRoutes)!==null&&le!==void 0?le:{}}provide(le){return le.expose(this)}__experimentalReconfigure(le){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(le))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var le;return(le=this.options)!==null&&le!==void 0?le:{}}toString(){return`plugin{${this.config.id}}`}constructor(le){(0,G._)(this,"config",void 0),(0,G._)(this,"options",void 0),this.config=le,this.options=void 0}}function Hn(we){return new on(we)}},64355:function(wt,De,n){"use strict";n.d(De,{o:function(){return g},y:function(){return v}});var d=n(52322),r=n(51837),z=n(2784);const I="plugin-context",g=c=>{const{children:B,plugin:Ie}=c,{Provider:fe}=(0,r.CT)(I);return(0,d.jsx)(fe,{value:(0,r.EI)({1:{plugin:Ie}}),children:B})};function v(){const c=(0,r.Vt)(I);if(!c)throw new Error("Plugin Options context is not available");const B=c.atVersion(1);if(!B)throw new Error("Plugin Options v1 is not available");return B.plugin.getPluginOptions()}},23054:function(wt,De,n){"use strict";n.d(De,{SP:function(){return X},dR:function(){return $},VL:function(){return D},BD:function(){return r}});function d(A){if(typeof A!="object"||A===null||Array.isArray(A))return!1;const L=A;return!(typeof L.name!="string"||L.name===""||typeof L.message!="string")}function r(A){if(typeof A!="object"||A===null||Array.isArray(A))throw new Error(`Encountered invalid error, not an object, got '${A}'`);const L=A;if(typeof L.name!="string"||L.name==="")throw new Error(`Encountered error object without a name, got '${A}'`);if(typeof L.message!="string")throw new Error(`Encountered error object without a message, got '${A}'`)}var z=n(87612),I=n(24852);function g(A,L){const V={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(A)};return L!=null&&L.includeStack||delete V.stack,V}function v(A){const L=(0,I.deserializeError)(A);return A.stack||(L.stack=void 0),L}function c(A){if(d(A)){const L=String(A);return L!=="[object Object]"?L:`${A.name}: ${A.message}`}return`unknown error '${A}'`}class B extends Error{constructor(L,P){var V;let me=L;if(P!==void 0){const ze=c(P);me?me+=`; caused by ${ze}`:me=`caused by ${ze}`}super(me),(0,z._)(this,"cause",void 0),(V=Error.captureStackTrace)===null||V===void 0||V.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=d(P)?P:void 0}}class Ie extends null{}class fe extends null{}class G extends null{}class $ extends B{}class R extends null{}class O extends null{}class re extends null{}class X extends B{constructor(L,P){super(L,P),this.name=d(P)?P.name:"Error"}}async function te(A){try{const P=await A.text();if(P){var L;if(!((L=A.headers.get("content-type"))===null||L===void 0)&&L.startsWith("application/json"))try{const V=JSON.parse(P);if(V.error&&V.response)return V}catch{}return{error:{name:"Error",message:`Request failed with status ${A.status} ${A.statusText}, ${P}`},response:{statusCode:A.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${A.status} ${A.statusText}`},response:{statusCode:A.status}}}class D extends Error{static async fromResponse(L){const P=await te(L),V=P.response.statusCode||L.status,me=P.error.name||L.statusText,ze=`Request failed with ${V} ${me}`,rt=v(P.error);return new D({message:ze,response:L,data:P,cause:rt})}constructor(L){super(L.message),(0,z._)(this,"response",void 0),(0,z._)(this,"body",void 0),(0,z._)(this,"cause",void 0),this.name="ResponseError",this.response=L.response,this.body=L.data,this.cause=L.cause}}},32838:function(wt,De,n){"use strict";n.d(De,{nW:function(){return X},ae:function(){return G},q3:function(){return $}});var d=n(60871);const r=(0,d.T0)({id:"core.scmauth"});var z=new WeakMap;class I{async getCredentials(D){const A=new URL(D.url),L=_class_private_field_get(this,z).find(P=>P.isUrlSupported(A));if(!L)throw new Error(`No auth provider available for '${D.url}', see https://backstage.io/link?scm-auth`);return L.getCredentials(D)}constructor(D){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_set(this,z,D)}}var g=new WeakMap,v=new WeakMap,c=new WeakMap,B=new WeakMap;class Ie{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:D,gitlab:A,azure:L,bitbucket:P})=>Ie.merge(Ie.forGithub(D),Ie.forGitlab(A),Ie.forAzure(L),Ie.forBitbucket(P))})}static forAuthApi(D,A){return new Ie("generic",D,A.host,A.scopeMapping)}static forGithub(D,A){var L;const P=(L=A==null?void 0:A.host)!==null&&L!==void 0?L:"github.com";return new Ie("github",D,P,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(D,A){var L;const P=(L=A==null?void 0:A.host)!==null&&L!==void 0?L:"gitlab.com";return new Ie("gitlab",D,P,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(D,A){var L;const P=(L=A==null?void 0:A.host)!==null&&L!==void 0?L:"dev.azure.com";return new Ie("azure",D,P,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(D,A){var L;const P=(L=A==null?void 0:A.host)!==null&&L!==void 0?L:"bitbucket.org";return new Ie("bitbucket",D,P,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...D){return new I(D)}isUrlSupported(D){return D.host===_class_private_field_get(this,v)}getAdditionalScopesForProvider(D){var A;if(!(D!=null&&D.customScopes)||_class_private_field_get(this,B)==="generic")return[];var L;return(L=(A=D.customScopes)===null||A===void 0?void 0:A[_class_private_field_get(this,B)])!==null&&L!==void 0?L:[]}async getCredentials(D){const{url:A,additionalScope:L,...P}=D,V=_class_private_field_get(this,c).default.slice();L!=null&&L.repoWrite&&V.push(..._class_private_field_get(this,c).repoWrite);const me=this.getAdditionalScopesForProvider(L);me.length&&V.push(...me);const ze=[...new Set(V)],rt=await _class_private_field_get(this,g).getAccessToken(ze,P);return{token:rt,headers:{Authorization:`Bearer ${rt}`}}}constructor(D,A,L,P){_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,v,{writable:!0,value:void 0}),_class_private_field_init(this,c,{writable:!0,value:void 0}),_class_private_field_init(this,B,{writable:!0,value:void 0}),_class_private_field_set(this,g,A),_class_private_field_set(this,v,L),_class_private_field_set(this,c,P),_class_private_field_set(this,B,D)}}var fe=n(79158);class G{static fromConfig(D){return fe.Lx.fromConfig(D)}}const $=(0,d.T0)({id:"integration.scmintegrations"});var R=n(52322),O=n(73250),re=n(2784);const X=te=>{const{type:D}=te,A=(0,d.qD)(),L=O.Z;var P;const V=D&&(P=A.getSystemIcon(D))!==null&&P!==void 0?P:L;return(0,R.jsx)(V,{})}},79158:function(wt,De,n){"use strict";n.d(De,{Lx:function(){return sr},BT:function(){return ut}});var d=n(87612),r=n(82717),z=n.n(r),I=n(76635);function g(S){const u=new URL("http://example.com");return u.host=S,u.host===S}function v(S){try{return new URL(S),!0}catch{return!1}}function c(S,u){return{list(){return S},byUrl(y){try{const w=typeof y=="string"?new URL(y):y;return S.find(Q=>u(Q)===w.host)}catch{return}},byHost(y){return S.find(w=>u(w)===y)}}}function B(S){const{url:u,base:y,lineNumber:w}=S;try{return new URL(u),u}catch{}let Q;if(u.startsWith("/")){const{filepath:Se}=z()(y);Q=new URL(y);const be=(0,I.trimEnd)(Q.pathname.substring(0,Q.pathname.length-Se.length),"/");Q.pathname=`${be}${u}`}else Q=new URL(u,y);return Q.search=new URL(y).search,w&&(Q.hash=`L${w}`),Q.toString()}function Ie(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const fe="amazonaws.com";function G(S){const u=S.getOptionalString("endpoint");var y;const w=(y=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&y!==void 0?y:!1;let Q,Se;if(u){try{const cn=new URL(u);Q=cn.host,Se=cn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${u}' is not a valid URL`)}if(Se!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${u}'`)}else Q=fe;const be=S.getOptionalString("accessKeyId"),Ze=S.getOptionalString("secretAccessKey"),Ke=S.getOptionalString("roleArn"),Ht=S.getOptionalString("externalId");return{host:Q,endpoint:u,s3ForcePathStyle:w,accessKeyId:be,secretAccessKey:Ze,roleArn:Ke,externalId:Ht}}function $(S){const u=S.map(G);return u.some(y=>y.host===fe)||u.push({host:fe}),u}class R{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return B(u)}resolveEditUrl(u){return u}constructor(u){(0,d._)(this,"integrationConfig",void 0),this.integrationConfig=u}}(0,d._)(R,"factory",({config:S})=>{var u;const y=$((u=S.getOptionalConfigArray("integrations.awsS3"))!==null&&u!==void 0?u:[]);return c(y.map(w=>new R(w)),w=>w.config.host)});var O=n(88412),re=n(50629),X=n(80956);const te="GB";var D=new WeakMap,A=new WeakMap,L=new WeakMap,P=new WeakMap,V=new WeakMap,me=new WeakMap,ze=new WeakMap;class rt{static fromRepoUrl(u){const y=new URL(u);let w,Q,Se;const be=y.pathname.split("/").map(Kn=>decodeURIComponent(Kn));if(be[2]==="_git"?(w=be[1],Q=Se=be[3]):be[3]==="_git"?(w=be[1],Q=be[2],Se=be[4]):be[4]==="_git"&&(w=`${be[1]}/${be[2]}`,Q=be[3],Se=be[5]),!w||!Q||!Se)throw new Error("Azure URL must point to a git repository");var Ze;const Ke=(Ze=y.searchParams.get("path"))!==null&&Ze!==void 0?Ze:void 0;let Ht;const cn=y.searchParams.get("version");if(cn){if(cn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Ht=cn.slice(2)}return new rt(y.origin,w,Q,Se,Ke,Ht)}toRepoUrl(){let u;return(0,O._)(this,L)===(0,O._)(this,P)?u=(0,O._)(this,ze).call(this,(0,O._)(this,A),"_git",(0,O._)(this,P)):u=(0,O._)(this,ze).call(this,(0,O._)(this,A),(0,O._)(this,L),"_git",(0,O._)(this,P)),(0,O._)(this,V)&&u.searchParams.set("path",(0,O._)(this,V)),(0,O._)(this,me)&&u.searchParams.set("version",te+(0,O._)(this,me)),u.toString()}toFileUrl(){if(!(0,O._)(this,V))throw new Error("Azure URL must point to a specific path to be able to download a file");const u=(0,O._)(this,ze).call(this,(0,O._)(this,A),(0,O._)(this,L),"_apis","git","repositories",(0,O._)(this,P),"items");return u.searchParams.set("api-version","6.0"),u.searchParams.set("path",(0,O._)(this,V)),(0,O._)(this,me)&&u.searchParams.set("version",(0,O._)(this,me)),u.toString()}toArchiveUrl(){const u=(0,O._)(this,ze).call(this,(0,O._)(this,A),(0,O._)(this,L),"_apis","git","repositories",(0,O._)(this,P),"items");return u.searchParams.set("recursionLevel","full"),u.searchParams.set("download","true"),u.searchParams.set("api-version","6.0"),(0,O._)(this,V)&&u.searchParams.set("scopePath",(0,O._)(this,V)),(0,O._)(this,me)&&u.searchParams.set("version",(0,O._)(this,me)),u.toString()}toCommitsUrl(){const u=(0,O._)(this,ze).call(this,(0,O._)(this,A),(0,O._)(this,L),"_apis","git","repositories",(0,O._)(this,P),"commits");return u.searchParams.set("api-version","6.0"),(0,O._)(this,me)&&u.searchParams.set("searchCriteria.itemVersion.version",(0,O._)(this,me)),u.toString()}getOwner(){return(0,O._)(this,A)}getProject(){return(0,O._)(this,L)}getRepo(){return(0,O._)(this,P)}getPath(){return(0,O._)(this,V)}getRef(){return(0,O._)(this,me)}constructor(u,y,w,Q,Se,be){(0,re._)(this,D,{writable:!0,value:void 0}),(0,re._)(this,A,{writable:!0,value:void 0}),(0,re._)(this,L,{writable:!0,value:void 0}),(0,re._)(this,P,{writable:!0,value:void 0}),(0,re._)(this,V,{writable:!0,value:void 0}),(0,re._)(this,me,{writable:!0,value:void 0}),(0,re._)(this,ze,{writable:!0,value:(...Ze)=>{const Ke=new URL((0,O._)(this,D));return Ke.pathname=Ze.map(Ht=>encodeURIComponent(Ht)).join("/"),Ke}}),(0,X._)(this,D,u),(0,X._)(this,A,y),(0,X._)(this,L,w),(0,X._)(this,P,Q),(0,X._)(this,V,Se),(0,X._)(this,me,be)}}const H="dev.azure.com";function ot(S){var u;const y=(u=S.getOptionalString("host"))!==null&&u!==void 0?u:H,w=S.getOptionalString("token");if(!g(y))throw new Error(`Invalid Azure integration config, '${y}' is not a valid host`);return{host:y,token:w}}function vt(S){const u=S.map(ot);return u.some(y=>y.host===H)||u.push({host:H}),u}class Je{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:y,base:w}=u;if(v(y))return y;try{const Se=rt.fromRepoUrl(w),be=new URL(w);var Q;const Ze=new URL(`https://a.com${(Q=Se.getPath())!==null&&Q!==void 0?Q:""}`),Ke=new URL(y,Ze).pathname;return be.searchParams.set("path",Ke),u.lineNumber&&(be.searchParams.set("line",String(u.lineNumber)),be.searchParams.set("lineEnd",String(u.lineNumber+1)),be.searchParams.set("lineStartColumn","1"),be.searchParams.set("lineEndColumn","1")),be.toString()}catch{return new URL(y,w).toString()}}resolveEditUrl(u){return u}constructor(u){(0,d._)(this,"integrationConfig",void 0),this.integrationConfig=u}}(0,d._)(Je,"factory",({config:S})=>{var u;const y=vt((u=S.getOptionalConfigArray("integrations.azure"))!==null&&u!==void 0?u:[]);return c(y.map(w=>new Je(w)),w=>w.config.host)});var ht=n(48834).lW;function Le(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function bt(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function Tt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}function pt(S,u){const y=u?{...u}:{};if(S.token){const w=ht.from(`:${S.token}`,"utf8");y.Authorization=`Basic ${w.toString("base64")}`}return{headers:y}}const gt="bitbucket.org",jt="https://api.bitbucket.org/2.0";function $t(S){var u;const y=(u=S.getOptionalString("host"))!==null&&u!==void 0?u:gt;let w=S.getOptionalString("apiBaseUrl");const Q=S.getOptionalString("token"),Se=S.getOptionalString("username"),be=S.getOptionalString("appPassword");if(!g(y))throw new Error(`Invalid Bitbucket integration config, '${y}' is not a valid host`);return w?w=(0,I.trimEnd)(w,"/"):y===gt?w=jt:w=`https://${y}/rest/api/1.0`,{host:y,apiBaseUrl:w,token:Q,username:Se,appPassword:be}}function He(S){const u=S.map($t);return u.some(y=>y.host===gt)||u.push({host:gt,apiBaseUrl:jt}),u}class Xt{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=B(u);if(!u.lineNumber)return y;const w=new URL(y);return this.integrationConfig.host==="bitbucket.org"?w.hash=`lines-${u.lineNumber}`:w.hash=`${u.lineNumber}`,w.toString()}resolveEditUrl(u){const y=z()(u),w=new URL(u);return w.searchParams.set("mode","edit"),w.searchParams.set("spa","0"),w.searchParams.set("at",y.ref),w.toString()}constructor(u){(0,d._)(this,"integrationConfig",void 0),this.integrationConfig=u}}(0,d._)(Xt,"factory",({config:S})=>{var u,y,w;const Q=He((w=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&w!==void 0?w:[...(u=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[],...(y=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&y!==void 0?y:[]]);return c(Q.map(Se=>new Xt(Se)),Se=>Se.config.host)});var ue=n(96279),xe=n(48834).lW;async function Fe(S,u){const{name:y,owner:w,resource:Q}=parseGitUrl(S),Se=Q==="bitbucket.org";let be=Se?`${u.apiBaseUrl}/repositories/${w}/${y}`:`${u.apiBaseUrl}/projects/${w}/repos/${y}/default-branch`,Ze=await fetch(be,Rt(u));if(Ze.status===404&&!Se&&(be=`${u.apiBaseUrl}/projects/${w}/repos/${y}/branches/default`,Ze=await fetch(be,Rt(u))),!Ze.ok){const Ht=`Failed to retrieve default branch from ${be}, ${Ze.status} ${Ze.statusText}`;throw new Error(Ht)}let Ke;if(Se)Ke=(await Ze.json()).mainbranch.name;else{const{displayId:Ht}=await Ze.json();Ke=Ht}if(!Ke)throw new Error(`Failed to read default branch from ${be}. Response ${Ze.status} ${Ze.json()}`);return Ke}async function Qe(S,u){const{name:y,owner:w,ref:Q,protocol:Se,resource:be,filepath:Ze}=parseGitUrl(S),Ke=be==="bitbucket.org";let Ht=Q;Ht||(Ht=await Fe(S,u));const cn=Ze?`&path=${encodeURIComponent(decodeURIComponent(Ze))}`:"";return Ke?`${Se}://${be}/${w}/${y}/get/${Ht}.tar.gz`:`${u.apiBaseUrl}/projects/${w}/repos/${y}/archive?format=tgz&at=${Ht}&prefix=${w}-${y}${cn}`}function mt(S,u){try{const{owner:y,name:w,ref:Q,filepathtype:Se,filepath:be}=parseGitUrl(S);if(!y||!w||Se!=="browse"&&Se!=="raw"&&Se!=="src")throw new Error("Invalid Bitbucket URL or file path");const Ze=be.replace(/^\//,"");if(u.host==="bitbucket.org"){if(!Q)throw new Error("Invalid Bitbucket URL or file path");return`${u.apiBaseUrl}/repositories/${y}/${w}/src/${Q}/${Ze}`}return`${u.apiBaseUrl}/projects/${y}/repos/${w}/raw/${Ze}?at=${Q}`}catch(y){throw new Error(`Incorrect URL: ${S}, ${y}`)}}function Rt(S){const u={};if(S.token)u.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const y=xe.from(`${S.username}:${S.appPassword}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}const ct="bitbucket.org",Et="https://api.bitbucket.org/2.0";function Lt(S){const u=ct,y=Et,w=S.getString("username"),Q=S.getString("appPassword");return{host:u,apiBaseUrl:y,username:w,appPassword:Q}}function Jt(S){const u=S.map(Lt);return u.length===0&&u.push({host:ct,apiBaseUrl:Et}),u}class Pt{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=B(u);if(u.lineNumber){const w=new URL(y);return w.hash=`lines-${u.lineNumber}`,w.toString()}return y}resolveEditUrl(u){const y=z()(u),w=new URL(u);return w.searchParams.set("mode","edit"),w.searchParams.set("at",y.ref),w.toString()}constructor(u){(0,d._)(this,"integrationConfig",void 0),this.integrationConfig=u}}(0,d._)(Pt,"factory",({config:S})=>{var u;const y=Jt((u=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&u!==void 0?u:[]);return c(y.map(w=>new Pt(w)),w=>w.config.host)});var an=n(48834).lW;async function Wt(S,u){const{name:y,owner:w}=parseGitUrl(S),Q=`${u.apiBaseUrl}/repositories/${w}/${y}`,Se=await fetch(Q,An(u));if(!Se.ok){const Ke=`Failed to retrieve default branch from ${Q}, ${Se.status} ${Se.statusText}`;throw new Error(Ke)}const Ze=(await Se.json()).mainbranch.name;if(!Ze)throw new Error(`Failed to read default branch from ${Q}. Response ${Se.status} ${Se.json()}`);return Ze}async function sn(S,u){const{name:y,owner:w,ref:Q,protocol:Se,resource:be}=parseGitUrl(S);let Ze=Q;return Ze||(Ze=await Wt(S,u)),`${Se}://${be}/${w}/${y}/get/${Ze}.tar.gz`}function zn(S,u){try{const{owner:y,name:w,ref:Q,filepathtype:Se,filepath:be}=parseGitUrl(S);if(!y||!w||Se!=="src"&&Se!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Ze=be.replace(/^\//,"");if(!Q)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${u.apiBaseUrl}/repositories/${y}/${w}/src/${Q}/${Ze}`}catch(y){throw new Error(`Incorrect URL: ${S}, ${y}`)}}function An(S){const u={};if(S.username&&S.appPassword){const y=an.from(`${S.username}:${S.appPassword}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}function hn(S){const u=S.getString("host");let y=S.getOptionalString("apiBaseUrl");const w=S.getOptionalString("token"),Q=S.getOptionalString("username"),Se=S.getOptionalString("password");if(!g(u))throw new Error(`Invalid Bitbucket Server integration config, '${u}' is not a valid host`);return y?y=(0,I.trimEnd)(y,"/"):y=`https://${u}/rest/api/1.0`,{host:u,apiBaseUrl:y,token:w,username:Q,password:Se}}function On(S){return S.map(hn)}class kn{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const y=B(u);if(u.lineNumber){const w=new URL(y);return w.hash=u.lineNumber.toString(),w.toString()}return y}resolveEditUrl(u){return u.includes("?")?u.substring(0,u.indexOf("?")):u}constructor(u){(0,d._)(this,"integrationConfig",void 0),this.integrationConfig=u}}(0,d._)(kn,"factory",({config:S})=>{var u;const y=On((u=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&u!==void 0?u:[]);return c(y.map(w=>new kn(w)),w=>w.config.host)});var Wn=n(48834).lW;async function Bn(S,u){const{name:y,owner:w}=parseGitUrl(S);let Q=`${u.apiBaseUrl}/projects/${w}/repos/${y}/default-branch`,Se=await fetch(Q,Qt(u));if(Se.status===404&&(Q=`${u.apiBaseUrl}/projects/${w}/repos/${y}/branches/default`,Se=await fetch(Q,Qt(u))),!Se.ok){const Ke=`Failed to retrieve default branch from ${Q}, ${Se.status} ${Se.statusText}`;throw new Error(Ke)}const{displayId:be}=await Se.json(),Ze=be;if(!Ze)throw new Error(`Failed to read default branch from ${Q}. Response ${Se.status} ${Se.json()}`);return Ze}async function Qn(S,u){const{name:y,owner:w,ref:Q,filepath:Se}=parseGitUrl(S);let be=Q;be||(be=await Bn(S,u));const Ze=Se?`&path=${encodeURIComponent(decodeURIComponent(Se))}`:"";return`${u.apiBaseUrl}/projects/${w}/repos/${y}/archive?format=tgz&at=${be}&prefix=${w}-${y}${Ze}`}function dt(S,u){try{const{owner:y,name:w,ref:Q,filepathtype:Se,filepath:be}=parseGitUrl(S);if(!y||!w||Se!=="browse"&&Se!=="raw"&&Se!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Ze=be.replace(/^\//,"");return`${u.apiBaseUrl}/projects/${y}/repos/${w}/raw/${Ze}?at=${Q}`}catch(y){throw new Error(`Incorrect URL: ${S}, ${y}`)}}function Qt(S){const u={};if(S.token)u.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const y=Wn.from(`${S.username}:${S.password}`,"utf8");u.Authorization=`Basic ${y.toString("base64")}`}return{headers:u}}function wn(S){const u=S.getString("host");let y=S.getOptionalString("baseUrl"),w=S.getOptionalString("cloneUrl"),Q=S.getOptionalString("gitilesBaseUrl");const Se=S.getOptionalString("username"),be=S.getOptionalString("password");if(g(u)){if(y&&!v(y))throw new Error(`Invalid Gerrit integration config, '${y}' is not a valid baseUrl`);if(w&&!v(w))throw new Error(`Invalid Gerrit integration config, '${w}' is not a valid cloneUrl`);if(Q&&!v(Q))throw new Error(`Invalid Gerrit integration config, '${Q}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${u}' is not a valid host`);return y?y=(0,I.trimEnd)(y,"/"):y=`https://${u}`,Q?Q=(0,I.trimEnd)(Q,"/"):Q=`https://${u}`,w?w=(0,I.trimEnd)(w,"/"):w=y,{host:u,baseUrl:y,cloneUrl:w,gitilesBaseUrl:Q,username:Se,password:be}}function Tn(S){return S.map(wn)}var yn=n(48834).lW;const Mt=")]}'";function ln(S,u){const w=u.replace(S.gitilesBaseUrl,"").split("/").filter(Ht=>!!Ht),Q=w.indexOf("+");if(Q<=0)throw new Error(`Unable to parse project from url: ${u}`);const Se=(0,I.trimStart)(w.slice(0,Q).join("/"),"/"),be=w.indexOf("heads");if(be<=0)throw new Error(`Unable to parse branch from url: ${u}`);const Ze=w[be+1],Ke=w.slice(be+2).join("/");return{branch:Ze,filePath:Ke===""?"/":Ke,project:Se}}function bn(S,u,y,w){return`${S.gitilesBaseUrl}/${u}/+/refs/heads/${y}/${(0,I.trimStart)(w,"/")}`}function on(S){return S.password?"/a/":"/"}function Hn(S,u){const{branch:y,project:w}=ln(S,u);return`${S.baseUrl}${on(S)}projects/${encodeURIComponent(w)}/branches/${y}`}function we(S,u){const{project:y}=ln(S,u);return`${S.cloneUrl}${on(S)}${y}`}function le(S,u){const{branch:y,filePath:w,project:Q}=ln(S,u);return`${S.baseUrl}${on(S)}projects/${encodeURIComponent(Q)}/branches/${y}/files/${encodeURIComponent(w)}/content`}function $e(S){return`${S.baseUrl}${on(S)}projects/`}function Ue(S){const u={};if(!S.password)return u;const y=yn.from(`${S.username}:${S.password}`,"utf8");return u.Authorization=`Basic ${y.toString("base64")}`,{headers:u}}async function et(S){const u=await S.text();if(u.startsWith(Mt))try{return JSON.parse(u.slice(Mt.length))}catch(y){throw new Error(`Invalid response from Gerrit: ${u.slice(0,10)} - ${y}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${u.slice(0,10)}`)}class q{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){const{url:y,base:w,lineNumber:Q}=u;let Se;if(y.startsWith("/")){const{branch:be,project:Ze}=ln(this.config,w);return bn(this.config,Ze,be,y)}return y?Se=new URL(y,w):Se=new URL(w),Q&&(Se.hash=Q.toString()),Se.toString()}resolveEditUrl(u){return u}constructor(u){(0,d._)(this,"integrationConfig",void 0),this.integrationConfig=u}}(0,d._)(q,"factory",({config:S})=>{var u;const y=Tn((u=S.getOptionalConfigArray("integrations.gerrit"))!==null&&u!==void 0?u:[]);return c(y.map(w=>new q(w)),w=>w.config.host)});function U(S){const u=S.getString("host");let y=S.getOptionalString("baseUrl");const w=S.getOptionalString("username"),Q=S.getOptionalString("password");if(!g(u))throw new Error(`Invalid Gitea integration config, '${u}' is not a valid host`);return y?y=(0,I.trimEnd)(y,"/"):y=`https://${u}`,{host:u,baseUrl:y,username:w,password:Q}}var ve=n(48834).lW;function Ee(S,u){try{var y;const w=(y=S.baseUrl)!==null&&y!==void 0?y:`https://${S.host}`,[Q,Se,be,Ze,Ke,Ht,...cn]=u.replace(w,"").split("/"),Kn=cn.join("/").replace(/^\//,"");return`${w}/${Se}/${be}/_edit/${Ht}/${Kn}`}catch(w){throw new Error(`Incorrect URL: ${u}, ${w}`)}}function tt(S,u){try{var y;const w=(y=S.baseUrl)!==null&&y!==void 0?y:`https://${S.host}`,[Q,Se,be,Ze,Ke,Ht,...cn]=u.replace(w,"").split("/"),Kn=cn.join("/").replace(/^\//,"");return`${w}/api/v1/repos/${Se}/${be}/contents/${Kn}?ref=${Ht}`}catch(w){throw new Error(`Incorrect URL: ${u}, ${w}`)}}function st(S){const u={},{username:y,password:w}=S;return w?(y?u.Authorization=`basic ${ve.from(`${y}:${w}`).toString("base64")}`:u.Authorization=`token ${w}`,{headers:u}):u}class kt{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(u){return B(u)}resolveEditUrl(u){return Ee(this.config,u)}constructor(u){(0,d._)(this,"config",void 0),this.config=u}}(0,d._)(kt,"factory",({config:S})=>{var u;const w=((u=S.getOptionalConfigArray("integrations.gitea"))!==null&&u!==void 0?u:[]).map(Q=>U(Q));return c(w.map(Q=>new kt(Q)),Q=>Q.config.host)});const Gt="github.com",pn="https://api.github.com",ee="https://raw.githubusercontent.com";function Y(S){var u,y;const w=(y=S.getOptionalString("host"))!==null&&y!==void 0?y:Gt;let Q=S.getOptionalString("apiBaseUrl"),Se=S.getOptionalString("rawBaseUrl");const be=S.getOptionalString("token"),Ze=(u=S.getOptionalConfigArray("apps"))===null||u===void 0?void 0:u.map(Ke=>({appId:Ke.getNumber("appId"),clientId:Ke.getString("clientId"),clientSecret:Ke.getString("clientSecret"),webhookSecret:Ke.getString("webhookSecret"),privateKey:Ke.getString("privateKey"),allowedInstallationOwners:Ke.getOptionalStringArray("allowedInstallationOwners")}));if(!g(w))throw new Error(`Invalid GitHub integration config, '${w}' is not a valid host`);return Q?Q=(0,I.trimEnd)(Q,"/"):w===Gt&&(Q=pn),Se?Se=(0,I.trimEnd)(Se,"/"):w===Gt&&(Se=ee),{host:w,apiBaseUrl:Q,rawBaseUrl:Se,token:be,apps:Ze}}function oe(S){const u=S.map(Y);return u.some(y=>y.host===Gt)||u.push({host:Gt,apiBaseUrl:pn,rawBaseUrl:ee}),u}function he(S,u,y){try{const{owner:w,name:Q,ref:Se,filepathtype:be,filepath:Ze}=parseGitUrl(S);if(!w||!Q||!Se||be!=="blob"&&be!=="raw"&&be!=="tree")throw new Error("Invalid GitHub URL or file path");const Ke=Ze.replace(/^\//,"");return m(u,y)==="api"?`${u.apiBaseUrl}/repos/${w}/${Q}/contents/${Ke}?ref=${Se}`:`${u.rawBaseUrl}/${w}/${Q}/${Se}/${Ke}`}catch(w){throw new Error(`Incorrect URL: ${S}, ${w}`)}}function ie(S,u){const y={};return m(S,u)==="api"&&(y.Accept="application/vnd.github.v3.raw"),u.token&&(y.Authorization=`token ${u.token}`),{headers:y}}function m(S,u){return S.apiBaseUrl&&(u.token||!S.rawBaseUrl)?"api":"raw"}var N=n(42822),_=n(89393),J=n(26228);class Ce{async getOrCreateToken(u,y,w){let Q=this.tokenCache.get(u);if((!Q||this.isExpired(Q.expiresAt))&&(Q=await w(),Q.expiresAt=Q.expiresAt.minus({minutes:10}),this.tokenCache.set(u,Q)),!this.appliesToRepo(Q,y))throw new Error(`The Backstage GitHub application used in the ${u} organization does not have access to a repository with the name ${y}`);return{accessToken:Q.token}}appliesToRepo(u,y){return y===void 0?!0:u.repositories!==void 0?u.repositories.includes(y):!0}constructor(){(0,d._)(this,"tokenCache",new Map),(0,d._)(this,"isExpired",u=>J.ou.local()>u)}}const Re={Accept:"application/vnd.github.machine-man-preview+json"};class Xe{async getInstallationCredentials(u,y){if(this.allowedInstallationOwners){var w;if(!(!((w=this.allowedInstallationOwners)===null||w===void 0)&&w.includes(u)))return{accessToken:void 0}}return this.cache.getOrCreateToken(u,y,async()=>{const{installationId:Q,suspended:Se}=await this.getInstallationData(u);if(Se)throw new Error(`The GitHub application for ${u} is suspended`);const be=await this.appClient.apps.createInstallationAccessToken({installation_id:Q,headers:Re});let Ze;if(be.data.repository_selection==="selected"){const Ht=new _.v({baseUrl:this.baseUrl,auth:be.data.token}),cn=await Ht.paginate(Ht.apps.listReposAccessibleToInstallation);var Ke;Ze=((Ke=cn.repositories)!==null&&Ke!==void 0?Ke:cn).map(gr=>gr.name)}return{token:be.data.token,expiresAt:J.ou.fromISO(be.data.expires_at),repositories:Ze}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(u){const w=(await this.getInstallations()).find(Se=>{var be,Ze;return((be=Se.account)===null||be===void 0||(Ze=be.login)===null||Ze===void 0?void 0:Ze.toLocaleLowerCase("en-US"))===u.toLocaleLowerCase("en-US")});if(w)return{installationId:w.id,suspended:Boolean(w.suspended_by)};const Q=new Error(`No app installation found for ${u} in ${this.baseAuthConfig.appId}`);throw Q.name="NotFoundError",Q}constructor(u,y){(0,d._)(this,"appClient",void 0),(0,d._)(this,"baseUrl",void 0),(0,d._)(this,"baseAuthConfig",void 0),(0,d._)(this,"cache",new Ce),(0,d._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=u.allowedInstallationOwners,this.baseUrl=y,this.baseAuthConfig={appId:u.appId,privateKey:u.privateKey.replace(/\\n/gm,`
|
|
33
|
-
`)},this.appClient=new _.v({baseUrl:y,headers:Re,authStrategy:N.i,auth:this.baseAuthConfig})}}class yt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(y=>y.getInstallations()))).flat():[]}async getAppToken(u,y){if(this.apps.length===0)return;const w=await Promise.all(this.apps.map(Ze=>Ze.getInstallationCredentials(u,y).then(Ke=>({credentials:Ke,error:void 0}),Ke=>({credentials:void 0,error:Ke})))),Q=w.find(Ze=>Ze.credentials);if(Q)return Q.credentials.accessToken;const be=w.map(Ze=>Ze.error).find(Ze=>Ze.name!=="NotFoundError");if(be)throw be}constructor(u){var y;(0,d._)(this,"apps",void 0);var w;this.apps=(w=(y=u.apps)===null||y===void 0?void 0:y.map(Q=>new Xe(Q,u.apiBaseUrl)))!==null&&w!==void 0?w:[]}}class Ge{async getCredentials(u){const y=z()(u.url),w=y.owner||y.name,Q=y.owner?y.name:void 0;let Se="app",be=await this.githubAppCredentialsMux.getAppToken(w,Q);return be||(Se="token",be=this.token),{headers:be?{Authorization:`Bearer ${be}`}:void 0,token:be,type:Se}}constructor(u,y){(0,d._)(this,"githubAppCredentialsMux",void 0),(0,d._)(this,"token",void 0),this.githubAppCredentialsMux=u,this.token=y}}(0,d._)(Ge,"create",S=>new Ge(new yt(S),S.token));class lt{static fromIntegrations(u){const y=new Map;return u.github.list().forEach(w=>{const Q=SingleInstanceGithubCredentialsProvider.create(w.config);y.set(w.config.host,Q)}),new lt(y)}async getCredentials(u){const y=new URL(u.url),w=this.providers.get(y.host);if(!w)throw new Error(`There is no GitHub integration that matches ${u.url}. Please add a configuration for an integration.`);return w.getCredentials(u)}constructor(u){_define_property(this,"providers",void 0),this.providers=u}}class We{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return ut(B(u),"tree")}resolveEditUrl(u){return ut(u,"edit")}constructor(u){(0,d._)(this,"integrationConfig",void 0),this.integrationConfig=u}}(0,d._)(We,"factory",({config:S})=>{var u;const y=oe((u=S.getOptionalConfigArray("integrations.github"))!==null&&u!==void 0?u:[]);return c(y.map(w=>new We(w)),w=>w.config.host)});function ut(S,u){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(y,w,Q,Se)=>`//${w}/${Q}/${Se}/${u}/`)}const it=null;class zt extends We{get config(){return super.config}constructor(u){super(u)}}(0,d._)(zt,"factory",We.factory);const Nt=null,Kt=null,Vt=null,Bt="gitlab.com",xt="https://gitlab.com/api/v4";function It(S){const u=S.getString("host");let y=S.getOptionalString("apiBaseUrl");const w=S.getOptionalString("token");let Q=S.getOptionalString("baseUrl");if(y?y=(0,I.trimEnd)(y,"/"):u===Bt&&(y=xt),Q?Q=(0,I.trimEnd)(Q,"/"):Q=`https://${u}`,g(u)){if(!y||!v(y))throw new Error(`Invalid GitLab integration config, '${y}' is not a valid apiBaseUrl`);if(!v(Q))throw new Error(`Invalid GitLab integration config, '${Q}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${u}' is not a valid host`);return{host:u,token:w,apiBaseUrl:y,baseUrl:Q}}function Ot(S){const u=S.map(It);return u.some(y=>y.host===Bt)||u.push({host:Bt,apiBaseUrl:xt,baseUrl:`https://${Bt}`}),u}function en(S){let u="";return S.host!==Bt&&(u=new URL(S.baseUrl).pathname),trimEnd(u,"/")}async function jn(S,u){const y=await or(S,u);return Gn(S,y,u).toString()}function Rn(S){const{token:u=""}=S;return{headers:{"PRIVATE-TOKEN":u}}}function Gn(S,u,y){try{const w=new URL(S),Q=w.pathname.split("/blob/").slice(1).join("/blob/"),[Se,...be]=Q.split("/"),Ze=getGitLabIntegrationRelativePath(y);return w.pathname=[...Ze?[Ze]:[],"api/v4/projects",u,"repository/files",encodeURIComponent(decodeURIComponent(be.join("/"))),"raw"].join("/"),w.search=`?ref=${Se}`,w}catch(w){throw new Error(`Incorrect url: ${S}, ${w}`)}}async function or(S,u){const y=new URL(S);if(!y.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let w=y.pathname.split("/-/blob/")[0].split("/blob/")[0];const Q=getGitLabIntegrationRelativePath(u);Q&&(w=w.replace(Q,""));const Se=new URL(`${y.origin}${Q}/api/v4/projects/${encodeURIComponent(w.replace(/^\//,""))}`),be=await fetch(Se.toString(),Rn(u)),Ze=await be.json();if(!be.ok)throw new Error(`GitLab Error '${Ze.error}', ${Ze.error_description}`);return Number(Ze.id)}catch(w){throw new Error(`Could not get GitLab project ID for: ${S}, ${w}`)}}class fn{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(u){return B(u)}resolveEditUrl(u){return Sn(u,"edit")}constructor(u){(0,d._)(this,"integrationConfig",void 0),this.integrationConfig=u}}(0,d._)(fn,"factory",({config:S})=>{var u;const y=Ot((u=S.getOptionalConfigArray("integrations.gitlab"))!==null&&u!==void 0?u:[]);return c(y.map(w=>new fn(w)),w=>w.config.host)});function Sn(S,u){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${u}/`)}class sr{static fromConfig(u){return new sr({awsS3:R.factory({config:u}),azure:Je.factory({config:u}),bitbucket:Xt.factory({config:u}),bitbucketCloud:Pt.factory({config:u}),bitbucketServer:kn.factory({config:u}),gerrit:q.factory({config:u}),github:We.factory({config:u}),gitlab:fn.factory({config:u}),gitea:kt.factory({config:u})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(u=>u.list())}byUrl(u){let y=Object.values(this.byType).map(w=>w.byUrl(u)).filter(Boolean);if(y.length>1){const w=y.filter(Q=>!(Q instanceof Xt));w.length!==0&&(y=w)}return y[0]}byHost(u){return Object.values(this.byType).map(y=>y.byHost(u)).find(Boolean)}resolveUrl(u){const y=this.byUrl(u.base);return y?y.resolveUrl(u):B(u)}resolveEditUrl(u){const y=this.byUrl(u);return y?y.resolveEditUrl(u):u}constructor(u){(0,d._)(this,"byType",void 0),this.byType=u}}},6290:function(wt,De,n){"use strict";var d={};n.r(d),n.d(d,{TechDocsPlugin:function(){return P.s4}});var r=n(52322),z=n(2784),I=n(28316),g=n(73557),v=n(60871);const c=(0,v.T0)({id:"plugin.techdocs.storageservice"}),B=(0,v.T0)({id:"plugin.techdocs.service"});var Ie=n(92077),fe=n(95481),G=n(7476),$=n(93225),R=n(86317),O=n(65124),re=n(22478),X=n(85478),te=n(68435),D=n(3482),A=n(42081),L=n(48431),P=n(89258),V=n(52943),me=n(61886),ze=n(13980),rt=n.n(ze),H=n(87612);class ot{get(t){for(const s of this.holders){const a=s.get(t);if(a)return a}}constructor(...t){(0,H._)(this,"holders",void 0),this.holders=t}}var vt=n(51837);const Je=(0,vt.CT)("api-context"),ht=i=>{var t;const{apis:s,children:a}=i,p=(t=(0,z.useContext)(Je))===null||t===void 0?void 0:t.atVersion(1),E=p?new ot(s,p):s;return(0,r.jsx)(Je.Provider,{value:(0,vt.EI)({1:E}),children:a})};ht.propTypes={apis:rt().shape({get:rt().func.isRequired}).isRequired,children:rt().node};class Le{static validateFactories(t,s){for(const a of s){const p=[a],E=new Set;for(;p.length;){const k=p.shift(),W=t.get(k);if(W)for(const se of Object.values(W.deps)){if(se.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);E.has(se)||(E.add(se),p.push(se))}}}}get(t){return this.load(t)}load(t,s=[]){const a=this.apis.get(t.id);if(a)return a;const p=this.factories.get(t);if(!p)return;if(s.includes(p.api))throw new Error(`Circular dependency of api factory for ${p.api}`);const E=this.loadDeps(t,p.deps,[...s,p.api]),k=p.factory(E);return this.apis.set(t.id,k),k}loadDeps(t,s,a){const p={};for(const E in s)if(s.hasOwnProperty(E)){const k=s[E],W=this.load(k,a);if(!W)throw new Error(`No API factory available for dependency ${k} of dependent ${t}`);p[E]=W}return p}constructor(t){(0,H._)(this,"factories",void 0),(0,H._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var bt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(bt||(bt={}));class Tt{register(t,s){const a=bt[t],p=this.factories.get(s.api.id);return p&&p.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(t){const s=this.factories.get(t.id);if(s)return s.factory}getAllApis(){const t=new Set;for(const{factory:s}of this.factories.values())t.add(s.api);return t}constructor(){(0,H._)(this,"factories",new Map)}}function pt(i){return new Promise((t,s)=>{const a=i.width||500,p=i.height||700,E=window.screen.width/2-a/2,k=window.screen.height/2-p/2,W=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${p},top=${k},left=${E}`);let se="";if(!W||typeof W.closed=="undefined"||W.closed){const ft=new Error("Failed to open auth popup.");ft.name="PopupRejectedError",s(ft);return}const Te=ft=>{if(ft.source!==W||ft.origin!==i.origin)return;const{data:Ct}=ft;if(Ct.type==="config_info"){se=Ct.targetOrigin;return}if(Ct.type!=="authorization_response")return;const At=Ct;if("error"in At){const Ut=new Error(At.error.message);Ut.name=At.error.name,s(Ut)}else t(At.response);Ve()},Be=setInterval(()=>{if(W.closed){const ft=`Login failed, ${se&&se!==window.location.origin?`Incorrect app origin, expected ${se}`:"popup was closed"}`,Ct=new Error(ft);Ct.name="PopupClosedError",s(Ct),Ve()}},100);function Ve(){window.removeEventListener("message",Te),clearInterval(Be)}window.addEventListener("message",Te)})}let gt=!1;function jt(i){return[...i].join(" ")}class $t{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(p=>{throw new Error(`Auth refresh request failed, ${p}`)});if(!s.ok){const p=new Error(`Auth refresh request failed, ${s.statusText}`);throw p.status=s.status,p}const a=await s.json();if(a.error){const p=new Error(a.error.message);throw a.error.name&&(p.name=a.error.name),p}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!t.ok){const s=new Error(`Logout request failed, ${t.statusText}`);throw s.status=t.status,s}}async showPopup(t){const s=this.joinScopesFunc(t),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),p=await pt({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(p)}async executeRedirect(t){const s=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,s){const a=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${t}${p}`}buildQueryString(t){if(!t)return"";const s=Object.entries(t).map(([a,p])=>{if(typeof p=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(t){(0,H._)(this,"discoveryApi",void 0),(0,H._)(this,"environment",void 0),(0,H._)(this,"provider",void 0),(0,H._)(this,"joinScopesFunc",void 0),(0,H._)(this,"authRequester",void 0),(0,H._)(this,"sessionTransform",void 0),(0,H._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:p,provider:E,joinScopes:k=jt,oauthRequestApi:W,sessionTransform:se=Be=>Be}=t;!gt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),gt=!0);var Te;this.enableExperimentalRedirectFlow=s&&(Te=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&Te!==void 0?Te:!1,this.authRequester=W.createAuthRequester({provider:E,onAuthRequest:async Be=>this.enableExperimentalRedirectFlow?this.executeRedirect(Be):this.showPopup(Be)}),this.discoveryApi=a,this.environment=p,this.provider=E,this.joinScopesFunc=k,this.sessionTransform=se}}function He(i,t){for(const s of t)if(!i.has(s))return!1;return!0}class Xt{sessionExistsAndHasScope(t,s){if(!t)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return He(a,s)}getExtendedScope(t,s){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const p=this.options.sessionScopes(t);for(const E of p)a.add(E)}if(s)for(const p of s)a.add(p);return a}constructor(t){(0,H._)(this,"options",void 0),this.options=t}}var ue=n(82394),xe=n.n(ue);let Fe=Symbol.observable;class Qe{[Fe](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const p=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(p)}constructor(){(0,H._)(this,"isClosed",!1),(0,H._)(this,"terminatingError",void 0),(0,H._)(this,"observable",new(xe())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,H._)(this,"subscribers",new Set)}}let mt=Symbol.observable;class Rt{[mt](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const p=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(p)}constructor(t){(0,H._)(this,"isClosed",void 0),(0,H._)(this,"currentValue",void 0),(0,H._)(this,"terminatingError",void 0),(0,H._)(this,"observable",void 0),(0,H._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(xe())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class ct{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?v.sM.SignedIn:v.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,H._)(this,"subject",new Rt(v.sM.SignedOut)),(0,H._)(this,"signedIn",!1)}}class Et{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),p=this.sessionScopesFunc(this.currentSession),E=this.sessionScopesFunc(a);return He(E,p)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const s=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=s,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(t){(0,H._)(this,"connector",void 0),(0,H._)(this,"helper",void 0),(0,H._)(this,"sessionScopesFunc",void 0),(0,H._)(this,"sessionShouldRefreshFunc",void 0),(0,H._)(this,"stateTracker",new ct),(0,H._)(this,"refreshPromise",void 0),(0,H._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p,sessionShouldRefresh:E}=t;this.connector=s,this.sessionScopesFunc=p,this.sessionShouldRefreshFunc=E,this.helper=new Xt({sessionScopes:p,defaultScopes:a})}}class Lt{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:p}=t;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:p,defaultScopes:a})}}const Jt={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class Pt{static create(t){const{configApi:s,discoveryApi:a,environment:p="development",provider:E=Jt,oauthRequestApi:k,defaultScopes:W=[],scopeTransform:se=Ve=>Ve}=t,Te=new $t({configApi:s,discoveryApi:a,environment:p,provider:E,oauthRequestApi:k,sessionTransform(Ve){return{...Ve,providerInfo:{idToken:Ve.providerInfo.idToken,accessToken:Ve.providerInfo.accessToken,scopes:Pt.normalizeScopes(se,Ve.providerInfo.scope),expiresAt:new Date(Date.now()+Ve.providerInfo.expiresInSeconds*1e3)}}}}),Be=new Et({connector:Te,defaultScopes:new Set(W),sessionScopes:Ve=>Ve.providerInfo.scopes,sessionShouldRefresh:Ve=>(Ve.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new Pt({sessionManager:Be,scopeTransform:se})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,s){const a=Pt.normalizeScopes(this.scopeTransform,t),p=await this.sessionManager.getSession({...s,scopes:a});var E;return(E=p==null?void 0:p.providerInfo.accessToken)!==null&&E!==void 0?E:""}async getIdToken(t={}){const s=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}static normalizeScopes(t,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,H._)(this,"sessionManager",void 0),(0,H._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const an={id:"github",title:"GitHub",icon:()=>null};class Wt{static create(t){const{configApi:s,discoveryApi:a,environment:p="development",provider:E=an,oauthRequestApi:k,defaultScopes:W=["read:user"]}=t;return Pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:E,environment:p,defaultScopes:W})}}const sn={id:"gitlab",title:"GitLab",icon:()=>null};class zn{static create(t){const{configApi:s,discoveryApi:a,environment:p="development",provider:E=sn,oauthRequestApi:k,defaultScopes:W=["read_user"]}=t;return Pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:E,environment:p,defaultScopes:W})}}const An={id:"google",title:"Google",icon:()=>null},hn="https://www.googleapis.com/auth/";class On{static create(t){const{configApi:s,discoveryApi:a,oauthRequestApi:p,environment:E="development",provider:k=An,defaultScopes:W=["openid",`${hn}userinfo.email`,`${hn}userinfo.profile`]}=t;return Pt.create({configApi:s,discoveryApi:a,oauthRequestApi:p,provider:k,environment:E,defaultScopes:W,scopeTransform(se){return se.map(Te=>Te==="openid"?Te:Te==="profile"||Te==="email"?`${hn}userinfo.${Te}`:Te.startsWith(hn)?Te:`${hn}${Te}`)}})}}const kn={id:"okta",title:"Okta",icon:()=>null},Wn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),Bn="okta.";class Qn{static create(t){const{configApi:s,discoveryApi:a,environment:p="development",provider:E=kn,oauthRequestApi:k,defaultScopes:W=["openid","email","profile","offline_access"]}=t;return Pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:E,environment:p,defaultScopes:W,scopeTransform(se){return se.map(Te=>Wn.has(Te)||Te.startsWith(Bn)?Te:`${Bn}${Te}`)}})}}var dt=n(30195);const Qt=dt.z.object({profile:dt.z.object({email:dt.z.string().optional(),displayName:dt.z.string().optional(),picture:dt.z.string().optional()}),backstageIdentity:dt.z.object({token:dt.z.string(),identity:dt.z.object({type:dt.z.literal("user"),userEntityRef:dt.z.string(),ownershipEntityRefs:dt.z.array(dt.z.string())})})}),wn={id:"saml",title:"SAML",icon:()=>null};class Tn{static create(t){const{discoveryApi:s,environment:a="development",provider:p=wn}=t,E=new DirectAuthConnector({discoveryApi:s,environment:a,provider:p}),k=new StaticAuthSessionManager({connector:E}),W=new AuthSessionStore({manager:k,storageKey:`${p.id}Session`,schema:samlSessionSchema});return new Tn(W)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const yn={id:"microsoft",title:"Microsoft",icon:()=>null};class Mt{static create(t){return new Mt(t)}microsoftGraph(){return this.oauth2[Mt.MicrosoftGraphID]}static resourceForScopes(t){const s=t.split(" ").map(Mt.resourceForScope).filter(E=>E!=="openid");if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const p=(a=s[0])!==null&&a!==void 0?a:Mt.MicrosoftGraphID;return Promise.resolve(p)}static resourceForScope(t){var s;const a=(s=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:p}=a;return p.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Mt.MicrosoftGraphID}}async getAccessToken(t,s){const a=t===void 0?Mt.MicrosoftGraphID:await Mt.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=Pt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,s)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,H._)(this,"oauth2",void 0),(0,H._)(this,"configApi",void 0),(0,H._)(this,"environment",void 0),(0,H._)(this,"provider",void 0),(0,H._)(this,"oauthRequestApi",void 0),(0,H._)(this,"discoveryApi",void 0),(0,H._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:p=yn,oauthRequestApi:E,discoveryApi:k,defaultScopes:W=["openid","offline_access","profile","email","User.Read"],scopeTransform:se=Te=>Te.concat("offline_access")}=t;this.configApi=s,this.environment=a,this.provider=p,this.oauthRequestApi=E,this.discoveryApi=k,this.scopeTransform=se,this.oauth2={[Mt.MicrosoftGraphID]:Pt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:W})}}}(0,H._)(Mt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const ln={id:"onelogin",title:"onelogin",icon:()=>null},bn=new Set(["openid","profile","email","phone","address","groups","offline_access"]),on="onelogin.";class Hn{static create(t){const{configApi:s,discoveryApi:a,environment:p="development",provider:E=ln,oauthRequestApi:k}=t;return Pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:E,environment:p,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(W){return W.map(se=>bn.has(se)||se.startsWith(on)?se:`${on}${se}`)}})}}const we={id:"bitbucket",title:"Bitbucket",icon:()=>null};class le{static create(t){const{configApi:s,discoveryApi:a,environment:p="development",provider:E=we,oauthRequestApi:k,defaultScopes:W=["team"]}=t;return Pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:E,environment:p,defaultScopes:W})}}const $e={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Ue{static create(t){const{configApi:s,discoveryApi:a,environment:p="development",provider:E=$e,oauthRequestApi:k,defaultScopes:W=["PROJECT_ADMIN"]}=t;return Pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:E,environment:p,defaultScopes:W})}}const et={id:"atlassian",title:"Atlassian",icon:()=>null};class q{static create(t){const{configApi:s,discoveryApi:a,environment:p="development",provider:E=et,oauthRequestApi:k}=t;return Pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:E,environment:p})}}class U{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,H._)(this,"subject",new Qe)}}class ve{captureEvent(t){}}const Ee="theme";class tt{static createWithStorage(t){const s=new tt(t);if(!window.localStorage)return s;var a;const p=(a=window.localStorage.getItem(Ee))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(p),s.activeThemeId$().subscribe(E=>{E?window.localStorage.setItem(Ee,E):window.localStorage.removeItem(Ee)}),window.addEventListener("storage",E=>{if(E.key===Ee){var k;const W=(k=localStorage.getItem(Ee))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(W)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,H._)(this,"themes",void 0),(0,H._)(this,"activeThemeId",void 0),(0,H._)(this,"subject",void 0),this.themes=t,this.subject=new Rt(void 0)}}var st=n(9850),kt=n.n(st),Gt=n(12782),pn=n.n(Gt);const ee=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function Y(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function oe(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 he={type(i,t,s,a){return`Invalid type in config for key '${i}' in '${t}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,s){return`Unable to convert config value for key '${i}' in '${t}' to a ${s}`}};class ie{static fromConfigs(t){return t.length===0?new ie(void 0):t.reduce((s,{data:a,context:p,filteredKeys:E,deprecatedKeys:k})=>{const W=new ie(a,p,s);if(W.filteredKeys=E,k)for(const{key:se,description:Te}of k)console.warn(`The configuration key '${se}' of ${p} is deprecated and may be removed soon. ${Te||""}`);return W},void 0)}has(t){var s;if(this.readValue(t)!==void 0)return!0;var p;return(p=(s=this.fallback)===null||s===void 0?void 0:s.has(t))!==null&&p!==void 0?p:!1}keys(){var t;const s=this.data?Object.keys(this.data):[];var a;const p=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...p])]}get(t){const s=this.getOptional(t);if(s===void 0)throw new Error(he.missing(this.fullKey(t!=null?t:"")));return s}getOptional(t){var s;const a=kt()(this.readValue(t)),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(t);if(a===void 0){if(!1)var E;return p}else if(p===void 0)return a;return pn()({},{value:p},{value:a},(k,W)=>!Y(W)||!Y(k)?W:void 0).value}getConfig(t){const s=this.getOptionalConfig(t);if(s===void 0)throw new Error(he.missing(this.fullKey(t)));return s}getOptionalConfig(t){var s;const a=this.readValue(t),p=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(t);if(Y(a))return this.copy(a,t,p);if(a!==void 0)throw new TypeError(he.type(this.fullKey(t),this.context,oe(a),"object"));return p}getConfigArray(t){const s=this.getOptionalConfigArray(t);if(s===void 0)throw new Error(he.missing(this.fullKey(t)));return s}getOptionalConfigArray(t){const s=this.readConfigValue(t,p=>{if(!Array.isArray(p))return{expected:"object-array"};for(const[E,k]of p.entries())if(!Y(k))return{expected:"object-array",value:k,key:`${t}[${E}]`};return!0});if(!s){if(!1)var a;return}return s.map((p,E)=>this.copy(p,`${t}[${E}]`))}getNumber(t){const s=this.getOptionalNumber(t);if(s===void 0)throw new Error(he.missing(this.fullKey(t)));return s}getOptionalNumber(t){const s=this.readConfigValue(t,p=>typeof p=="number"||typeof p=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(he.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const s=this.getOptionalBoolean(t);if(s===void 0)throw new Error(he.missing(this.fullKey(t)));return s}getOptionalBoolean(t){const s=this.readConfigValue(t,p=>typeof p=="boolean"||typeof p=="number"||typeof p=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(he.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const s=this.getOptionalString(t);if(s===void 0)throw new Error(he.missing(this.fullKey(t)));return s}getOptionalString(t){return this.readConfigValue(t,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(t){const s=this.getOptionalStringArray(t);if(s===void 0)throw new Error(he.missing(this.fullKey(t)));return s}getOptionalStringArray(t){return this.readConfigValue(t,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,p]of s.entries())if(typeof p!="string"||p==="")return{expected:"string-array",value:p,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,s,a){const p=new ie(t,this.context,a,this.fullKey(s));return p.filteredKeys=this.filteredKeys,p}readConfigValue(t,s){const a=this.readValue(t);if(a===void 0){var p;if(!1)var E;return(p=this.fallback)===null||p===void 0?void 0:p.readConfigValue(t,s)}const k=s(a);if(k!==!0){const{key:W=t,value:se=a,expected:Te}=k;throw new TypeError(he.type(this.fullKey(W),this.context,oe(se),Te))}return a}readValue(t){const s=t?t.split("."):[];for(const p of s)if(!ee.test(p))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[p,E]of s.entries())if(Y(a))a=a[E];else if(a!==void 0){const k=this.fullKey(s.slice(0,p).join("."));throw new TypeError(he.type(k,this.context,oe(a),"object"))}return a}constructor(t,s="mock-config",a,p=""){(0,H._)(this,"data",void 0),(0,H._)(this,"context",void 0),(0,H._)(this,"fallback",void 0),(0,H._)(this,"prefix",void 0),(0,H._)(this,"filteredKeys",void 0),(0,H._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=s,this.fallback=a,this.prefix=p,this.notifiedFilteredKeys=new Set}}const m="Invalid discovery URL pattern,";class N{static compile(t){const s=t.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let p;try{p=new URL(a)}catch{throw new Error(`${m} URL '${a}' is invalid`)}if(p.hash)throw new Error(`${m} URL must not have a hash`);if(p.search)throw new Error(`${m} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${m} URL must not end with a slash`);return new N(s)}async getBaseUrl(t){return this.parts.join(t)}constructor(t){(0,H._)(this,"parts",void 0),this.parts=t}}class _{post(t,s){return s!=null&&s.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,s)}error$(){return this.errorApi.error$()}constructor(t,s){(0,H._)(this,"alertApi",void 0),(0,H._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=s}}class J{post(t,s){this.subject.next({error:t,context:s})}error$(){return this.subject}constructor(){(0,H._)(this,"subject",new Qe)}}class Ce{static forward(t,s){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,s)})}}function Re(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 Xe{registerFlag(t){Re(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===v.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,p]of Object.entries(t.states))this.flags.set(a,p);const s=Array.from(this.flags.entries()).filter(([,a])=>a===v.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const s=JSON.parse(t);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([p,E])=>(Re(p),E===v.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,H._)(this,"registeredFeatureFlags",[]),(0,H._)(this,"flags",void 0)}}function yt(i){let t=i.baseImplementation||n.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const p of a)t=p.apply(t);return{fetch:t}}class Ge{static create(t){var s,a;const p=lt(t),E=((s=t.header)===null||s===void 0?void 0:s.name)||"authorization",k=((a=t.header)===null||a===void 0?void 0:a.value)||(W=>`Bearer ${W}`);return new Ge(t.identityApi,p,E,k)}apply(t){return async(s,a)=>{const p=new Request(s,a),{token:E}=await this.identityApi.getCredentials();return p.headers.get(this.headerName)||typeof E!="string"||!E||!this.allowUrl(p.url)?t(s,a):(p.headers.set(this.headerName,this.headerValue(E)),t(p))}}constructor(t,s,a,p){(0,H._)(this,"identityApi",void 0),(0,H._)(this,"allowUrl",void 0),(0,H._)(this,"headerName",void 0),(0,H._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=s,this.headerName=a,this.headerValue=p}}function lt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?We(i.urlPrefixAllowlist):i.config?We([i.config.getString("backend.baseUrl")]):()=>!1}function We(i){const t=i.map(s=>s.replace(/\/$/,""));return s=>t.some(a=>s===a||s.startsWith(`${a}/`))}function ut(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class it{apply(t){return async(s,a)=>{const p=new Request(s,a),E="plugin://";if(!p.url.startsWith(E))return t(s,a);const{hostname:k,pathname:W,search:se,hash:Te,username:Be,password:Ve}=new URL(`http://${p.url.substring(E.length)}`);let ft=await this.discoveryApi.getBaseUrl(k);if(Be||Ve){const At=new URL(ft),Ut=`${Be}${Ve?`:${Ve}`:""}@`;ft=`${At.protocol}//${Ut}${At.host}${At.pathname}`}const Ct=`${ut(ft,W)}${se}${Te}`;return t(Ct,typeof s=="string"||zt(s)?a:s)}}constructor(t){(0,H._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function zt(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Nt{static resolvePluginProtocol(t){return new it(t.discoveryApi)}static injectIdentityAuth(t){return Ge.create(t)}constructor(){}}function Kt(i,t){for(const s of t)if(!i.has(s))return!1;return!0}function Vt(i,...t){const s=new Set(i);for(const a of t)for(const p of a)s.add(p);return s}class Bt{request(t){return new Promise((s,a)=>{this.requests.push({scopes:t,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,s){this.requests=this.requests.filter(a=>Kt(t,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(s=>s.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>Vt(s,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:s=>{t&&this.resolve(t,s)},reject:s=>{t&&this.reject(s)}}}constructor(){(0,H._)(this,"requests",[]),(0,H._)(this,"subject",new Rt(this.getCurrentPending()))}}class xt{createAuthRequester(t){const s=new Bt,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:p=>{const E=this.currentRequests.slice(),k=this.makeAuthRequest(p,t);k?E[a]=k:delete E[a],this.currentRequests=E,this.subject.next(E.filter(Boolean))}}),p=>s.request(p)}makeAuthRequest(t,s){const{scopes:a}=t;if(a)return{provider:s.provider,trigger:async()=>{const p=await s.onAuthRequest(a);t.resolve(p)},reject:()=>{const p=new Error("Login failed, rejected by user");p.name="RejectedError",t.reject(p)}}}authRequest$(){return this.subject}constructor(){(0,H._)(this,"subject",new Rt([])),(0,H._)(this,"currentRequests",[]),(0,H._)(this,"handlerCount",0)}}const It=new Map;class Ot{static create(t){var s;return new Ot((s=t.namespace)!==null&&s!==void 0?s:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,p]of It.entries()){var s;!((s=t.key)===null||s===void 0)&&s.startsWith(a)&&p.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let s,a="absent";try{const p=localStorage.getItem(this.getKeyName(t));p&&(s=JSON.parse(p,(E,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:s,presence:a}}forBucket(t){const s=`${this.namespace}/${t}`;return It.has(s)||It.set(s,new Ot(s,this.errorApi)),It.get(s)}async set(t,s){localStorage.setItem(this.getKeyName(t),JSON.stringify(s)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return Ot.hasSubscribed||(Ot.addStorageEventListener(),Ot.hasSubscribed=!0),this.observable.filter(({key:s})=>s===t)}handleStorageChange(t){if(!(t!=null&&t.startsWith(this.namespace)))return;const s=t==null?void 0:t.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const s=this.snapshot(t);for(const a of this.subscribers)a.next(s)}constructor(t,s){(0,H._)(this,"namespace",void 0),(0,H._)(this,"errorApi",void 0),(0,H._)(this,"subscribers",void 0),(0,H._)(this,"observable",void 0),this.namespace=t,this.errorApi=s,this.subscribers=new Set,this.observable=new(xe())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,H._)(Ot,"hasSubscribed",!1);const en=(0,z.createContext)(void 0);function jn(){const[i]=(0,g.is)((0,r.jsx)(g.AW,{index:!0,element:(0,r.jsx)("div",{})}));return!i.index}var Rn=n(84800);const Gn=(i,t)=>{try{var s,a;const p=(0,Rn.fp)(t,{pathname:i}),E=(s=p==null?void 0:p.filter(W=>{var se;return((se=W==null?void 0:W.route.routeRefs)===null||se===void 0?void 0:se.size)>0}).pop())===null||s===void 0?void 0:s.route;if(!E)return{};let k;return E.routeRefs.size===1&&(k=E.routeRefs.values().next().value),{extension:"App",pluginId:((a=E.plugin)===null||a===void 0?void 0:a.getId())||"root",...k?{routeRef:k.id}:{}}}catch{return{}}},or=({pathname:i,search:t,hash:s})=>{const a=(0,v.z$)();return(0,z.useEffect)(()=>{a.captureEvent("navigate",`${i}${t}${s}`)},[a,i,t,s]),null},fn=({routeObjects:i})=>{const{pathname:t,search:s,hash:a}=(0,g.TH)();return(0,r.jsx)(v.fC,{attributes:Gn(t,i),children:(0,r.jsx)(or,{pathname:t,search:s,hash:a})})};function Sn(i){return jn()?sr(i):""}function sr(i){var t;let{pathname:s}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function S({component:i,appIdentityProxy:t,children:s}){const[a,p]=(0,z.useState)(),E=(0,v.h_)(v.Ds),k=Sn(E);return a?(t.setTarget(a,{signOutTargetUrl:k||"/"}),(0,r.jsx)(r.Fragment,{children:s})):(0,r.jsx)(i,{onSignInSuccess:p})}function u(i){const{Router:t,SignInPage:s}=(0,v.qD)().getComponents(),a=(0,v.h_)(v.Ds),p=sr(a),E=`${p}/*`,k=(0,z.useContext)(en);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:W,appIdentityProxy:se}=k;return s?jn()?(0,r.jsxs)(t,{children:[(0,r.jsx)(fn,{routeObjects:W}),(0,r.jsx)(S,{component:s,appIdentityProxy:se,children:(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:E,element:(0,r.jsx)(r.Fragment,{children:i.children})})})})]}):(0,r.jsxs)(t,{basename:p,children:[(0,r.jsx)(fn,{routeObjects:W}),(0,r.jsx)(S,{component:s,appIdentityProxy:se,children:i.children})]}):(se.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:p||"/"}),jn()?(0,r.jsxs)(t,{children:[(0,r.jsx)(fn,{routeObjects:W}),(0,r.jsx)(g.Z5,{children:(0,r.jsx)(g.AW,{path:E,element:(0,r.jsx)(r.Fragment,{children:i.children})})})]}):(0,r.jsxs)(t,{basename:p,children:[(0,r.jsx)(fn,{routeObjects:W}),i.children]}))}var y=n(88412),w=n(50629),Q=n(80956),Se=n(64279);function be(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const s=[{node:z.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:p,contexts:E}=s.shift();z.Children.forEach(a,k=>{if(!(0,z.isValidElement)(k))return;const W={};for(const se in t)if(t.hasOwnProperty(se)){const Te=t[se];W[se]=Te.visit(Te.accumulator,k,p,E[se])}for(const se of i.discoverers){const Te=se(k);Te&&s.push({node:Te,parent:k,contexts:W})}})}return Object.fromEntries(Object.entries(t).map(([a,p])=>[a,p.accumulator]))}function Ze(i,t){return()=>({accumulator:i(),visit:t})}function Ke(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function Ht(i){var t,s;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const cn=Ze(()=>new Set,(i,t)=>{const s=(0,v.IY)(t,"core.plugin");s&&i.add(s)}),Kn=i=>{const{children:t}=i,s=(0,v.h_)(v.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,r.jsx)(r.Fragment,{children:a?t:null})};(0,v.R5)(Kn,"core.featureFlagged",!0);const gr={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function mr(i){const t=i;if(t!=null&&t.type){var s,a;return(a=(s=t.type.displayName)!==null&&s!==void 0?s:t.type.name)!==null&&a!==void 0?a:String(t.type)}return String(t)}function eo(i,t=new Array){return z.Children.forEach(i,s=>{if(!(0,z.isValidElement)(s))return;const a=(0,v.IY)(s,"core.mountPoint");if(a){const p=(0,v.IY)(s,"core.plugin");t.push({routeRef:a,plugin:p})}eo(s.props.children,t)}),t}const jo=Ze(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var p,E;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===t)return{...a,isElementAncestor:!0};const k=(p=t.props)===null||p===void 0?void 0:p.path,W=(0,v.IY)(t,"core.mountPoint");if(W&&k)throw new Error(`Path property may not be set directly on a routable extension "${mr(t)}"`);var se;const Te=(se=a==null||(E=a.obj)===null||E===void 0?void 0:E.children)!==null&&se!==void 0?se:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${mr(t)}"`);const Ct=k.startsWith("/")?k.slice(1):k,At=t.props.element;if((0,v.IY)(t,"core.gatherMountPoints")){var Be;if(At)throw new Error(`Mount point gatherers may not have an element prop "${mr(t)}"`);const Ut={path:Ct,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Be=t.props)===null||Be===void 0?void 0:Be.caseSensitive),children:[gr],plugin:void 0};return Te.push(Ut),{obj:Ut,gatherPath:Ct,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(At){var Ve;const[Ut,...Ft]=eo(At);if(Ft.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Ut)return a;const{routeRef:Fn,plugin:tr}=Ut,nr={path:Ct,element:"mounted",routeRefs:new Set([Fn]),caseSensitive:Boolean((Ve=t.props)===null||Ve===void 0?void 0:Ve.caseSensitive),children:[gr],plugin:tr};return Te.push(nr),i.paths.set(Fn,Ct),i.parents.set(Fn,a==null?void 0:a.routeRef),{obj:nr,routeRef:Fn!=null?Fn:a==null?void 0:a.routeRef,gatherPath:Ct,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(W){var ft;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${mr(t)}" with mount point "${W}" must be assigned a path`);return a==null||(ft=a.obj)===null||ft===void 0||ft.routeRefs.add(W),i.paths.set(W,a.gatherPath),i.parents.set(W,a==null?void 0:a.gatherRouteRef),{...a,routeRef:W}}return a}),Eo=Ze(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var p,E,k;if((s==null?void 0:s.props.element)===t)return a;let W=a==null?void 0:a.obj,se=a==null?void 0:a.routeRef,Te=a==null?void 0:a.sticky;const Be=(p=t.props)===null||p===void 0?void 0:p.path;var Ve;const ft=(Ve=W==null?void 0:W.children)!==null&&Ve!==void 0?Ve:i.objects,Ct=Boolean((E=t.props)===null||E===void 0?void 0:E.caseSensitive);let At=a==null?void 0:a.path;if((0,v.IY)(t,"core.gatherMountPoints")){if(!Be)throw new Error("Mount point gatherer must have a path");At=Be}const Ut=(k=t.props)===null||k===void 0?void 0:k.element;let Ft=(0,v.IY)(t,"core.mountPoint");if(!Ft&&(0,z.isValidElement)(Ut)&&(Ft=(0,v.IY)(Ut,"core.mountPoint")),Ft){let nr=Be;if(At&&(nr?At=void 0:nr=At),!nr)throw new Error("Mounted routable extension must have a path");i.paths.set(Ft,nr),se&&Te?(i.parents.set(Ft,se),Be&&(se=Ft,Te=!1)):(i.parents.set(Ft,se),se=Ft),Be?(W={caseSensitive:Ct,path:Be,element:"mounted",routeRefs:new Set([Ft]),children:[gr],plugin:(0,v.IY)(t.props.element,"core.plugin")},ft.push(W)):W==null||W.routeRefs.add(Ft)}if((0,v.IY)(t,"core.gatherMountPoints")&&(Te=!0),(0,v.IY)(t,"core.gatherMountPoints")){if(!Be)throw new Error("Mount point gatherer must have a path");if(!Ft){var tr;W={caseSensitive:Ct,path:Be,element:"gathered",routeRefs:new Set,children:[gr],plugin:a==null||(tr=a.obj)===null||tr===void 0?void 0:tr.plugin},ft.push(W)}}return{obj:W,path:At,routeRef:se,sticky:Te}}),to=Ze(()=>new Set,(i,t)=>{if(t.type===Kn){const s=t.props;i.add("with"in s?s.with:s.without)}}),Vn=(0,vt.uW)("route-ref-type",()=>Symbol("route-ref-type"));function $n(i){return i[Vn]==="absolute"}function vr(i){return i[Vn]==="sub"}function Ir(i){return i[Vn]==="external"}function Sr(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function qo(i,t,s){let a,p="";if($n(i))a=i;else if(vr(i))a=i.parent,p=i.path;else if(Ir(i)){const W=s.get(i);if(!W)return[void 0,""];if($n(W))a=W;else if(vr(W))a=W.parent,p=W.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${W}`)}else throw i[Vn]?new Error(`Unknown or invalid route ref type, ${i[Vn]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const E=t.get(a);if(E===void 0)return[void 0,""];const k=Sr(E,p);return[a,k]}function Ur(i,t,s,a,p){var E;const k=(E=(0,Rn.fp)(p,t))!==null&&E!==void 0?E:[],W=Array();let se=-1;for(let Ve=i;Ve&&(se=k.findIndex(ft=>ft.route.routeRefs.has(Ve)),se===-1);Ve=a.get(Ve))W.unshift(Ve);W.length===0&&(se-=1);const Te=se===-1?"":k[se].pathname,Be=W.slice(0,-1).map(Ve=>{const ft=s.get(Ve);if(ft===void 0)throw new Error(`No path for ${Ve}`);if(ft.includes(":"))throw new Error(`Cannot route to ${i} with parent ${Ve} as it has parameters`);return ft});return`${Sr(Te,...Be)}/`}class _o{resolve(t,s){const[a,p]=qo(t,this.routePaths,this.routeBindings);if(!a)return;let E;typeof s=="string"?E=this.trimPath(s):s.pathname?E={...s,pathname:this.trimPath(s.pathname)}:E=s;const k=this.appBasePath+Ur(a,E,this.routePaths,this.routeParents,this.routeObjects);return(...[se])=>Sr(k,(0,Rn.Gn)(p,se))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,s,a,p,E){(0,H._)(this,"routePaths",void 0),(0,H._)(this,"routeParents",void 0),(0,H._)(this,"routeObjects",void 0),(0,H._)(this,"routeBindings",void 0),(0,H._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=s,this.routeObjects=a,this.routeBindings=p,this.appBasePath=E}}const Ao=(0,vt.CT)("routing-context"),Mr=({routePaths:i,routeParents:t,routeObjects:s,routeBindings:a,basePath:p="",children:E})=>{const k=new _o(i,t,s,a,p),W=(0,vt.EI)({1:k});return(0,r.jsx)(Ao.Provider,{value:W,children:E})};function Xn(i,t){const s=new Set(t.values());s.delete(void 0);for(const a of t.keys()){if(s.has(a))continue;let p=a,E="";for(;p;){const W=i.get(p);if(W===void 0)throw new Error(`No path for ${p}`);E=Sr(W,E),p=t.get(p)}const k=E.match(/:(\w+)/g);if(k){for(let W=0;W<k.length;W++)for(let se=W+1;se<k.length;se++)if(k[se]===k[W])throw new Error(`Parameter ${k[se]} is duplicated in path ${E}`)}}}function Pr(i,t){for(const s of t)if(s.externalRoutes){for(const[a,p]of Object.entries(s.externalRoutes))if(!p.optional&&!i.has(p))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Lr=(0,vt.CT)("app-context"),no=({appContext:i,children:t})=>{const s=(0,vt.EI)({1:i});return(0,r.jsx)(Lr.Provider,{value:s,children:t})};function qn(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function Or(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class To{setTarget(t,s){this.target=t,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw qn("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return Or("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw qn("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return Or("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(s=>s.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return Or("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,H._)(this,"target",void 0),(0,H._)(this,"waitForTarget",void 0),(0,H._)(this,"resolveTarget",()=>{}),(0,H._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Ro=n(72164);function zr(i,t,s){if(i!==void 0){const p=s.find(E=>E.id===i);if(p)return p}if(t){const p=s.find(E=>E.variant==="dark");if(p)return p}const a=s.find(p=>p.variant==="light");return a||s[0]}const es=()=>{const i=(0,z.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,s]=(0,z.useState)(i.matches);return(0,z.useEffect)(()=>{const a=p=>{s(p.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function Io({children:i}){const t=(0,v.h_)(v.hg),s=(0,Ro.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?es():!1,p=zr(s,a,t.getInstalledThemes());if(!p)throw new Error("App has no themes");return(0,r.jsx)(p.Provider,{children:i})}const Wr=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const s=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const p=JSON.parse(i);Array.isArray(p)?s.push(...p):s.push({data:p,context:"env"})}catch(p){throw new Error(`Failed to load runtime configuration, ${p}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class ts{add(t,s){return this.apis.push([t.id,s]),s}build(){return new yr(new Map(this.apis))}constructor(){(0,H._)(this,"apis",[])}}class yr{static builder(){return new ts}static from(t){return new yr(new Map(t.map(([s,a])=>[s.id,a])))}static with(t,s){return new yr(new Map([[t.id,s]]))}with(t,s){return new yr(new Map([...this.apis,[t.id,s]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,H._)(this,"apis",void 0),this.apis=t}}function Po(i){const t=new Map;return i&&i({bind:(a,p)=>{for(const[E,k]of Object.entries(p)){const W=a[E];if(!W)throw new Error(`Key ${E} is not an existing external route`);if(!k&&!W.optional)throw new Error(`External route ${E} is required but was undefined`);k&&t.set(W,k)}}}),t}function ro(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Lo(i,t,s){var a;const p=Boolean(i),E=(0,Se.default)(i||(()=>Promise.resolve([])));let k;if(p&&E.loading){const{Progress:Te}=t;k=(0,r.jsx)(Te,{})}else if(E.error){const{BootErrorPage:Te}=t;k=(0,r.jsx)(Te,{step:"load-config",error:E.error})}const{ThemeProvider:W=Io}=t;if(k)return{node:(0,r.jsx)(ht,{apis:yr.with(v.hg,s),children:(0,r.jsx)(W,{children:k})})};let se;if(!((a=E.value)===null||a===void 0)&&a.length){const Te=ie.fromConfigs(E.value),Be=Te.getOptionalString("app.baseUrl"),Ve=Te.getOptionalString("backend.baseUrl");let ft=E.value;const Ct={data:{},context:"relative-resolver"};if(Be&&Ve){const At=new URL(Be).origin,Ut=new URL(Ve).origin;if(At===Ut){const Ft=ro(Ve);Ve!==Ft&&(Ct.data.backend={baseUrl:Ft})}}if(Be){const At=ro(Be);Be!==At&&(Ct.data.app={baseUrl:At})}Object.keys(Ct.data).length&&(ft=ft.concat([Ct])),se=ie.fromConfigs(ft)}else se=ie.fromConfigs([]);return{api:se}}class Oo{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,H._)(this,"app",void 0),this.app=t}}var Vr=new WeakMap;class oo{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const s=this.getProvider();return()=>(0,r.jsx)(s,{children:t})}getProvider(){if((0,y._)(this,Vr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,Q._)(this,Vr,!0);const t=new Oo(this);let s=!1;return({children:p})=>{const E=(0,z.useRef)(!0),k=(0,z.useMemo)(()=>tt.createWithStorage(this.themes),[]),{routing:W,featureFlags:se,routeBindings:Te}=(0,z.useMemo)(()=>{const Ct=be({root:p,discoverers:[Ke,Ht],collectors:{routing:jn()?Eo:jo,collectedPlugins:cn,featureFlags:to}});return Ct.collectedPlugins.forEach(At=>this.plugins.add(At)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...Ct,routeBindings:Po(this.bindRoutes)}},[p]);s||(s=!0,Xn(W.paths,W.parents),Pr(Te,this.plugins));const Be=Lo(this.configLoader,this.components,k),Ve="api"in Be;if(Ve){const{api:Ct}=Be;this.configApi=Ct}if("node"in Be)return Be.node;if(Ve&&E.current){E.current=!1;const Ct=this.getApiHolder().get(v.W0);if(Ct){for(const Ft of this.featureFlags)Ct.registerFlag({...Ft,pluginId:""});for(const Ft of this.plugins.values())if("getFeatureFlags"in Ft)for(const Fn of Ft.getFeatureFlags())Ct.registerFlag({name:Fn.name,pluginId:Ft.getId()});else for(const Fn of Ft.output())Fn.type==="feature-flag"&&Ct.registerFlag({name:Fn.name,pluginId:Ft.getId()});const At=Ct.getRegisteredFlags(),Ut=new Set(At.map(Ft=>Ft.name));for(const Ft of se)Ut.has(Ft)||Ct.registerFlag({name:Ft,pluginId:""})}}const{ThemeProvider:ft=Io}=this.components;return(0,r.jsx)(ht,{apis:this.getApiHolder(),children:(0,r.jsx)(no,{appContext:t,children:(0,r.jsx)(ft,{children:(0,r.jsx)(Mr,{routePaths:W.paths,routeParents:W.parents,routeObjects:W.objects,routeBindings:Te,basePath:Sn(Be.api),children:(0,r.jsx)(en.Provider,{value:{routeObjects:W.objects,appIdentityProxy:this.appIdentityProxy},children:p})})})})})}}getRouter(){return u}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const s of t.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return Le.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:v.hg,deps:{},factory:()=>tt.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:v.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:v.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:v.W0,deps:{},factory:()=>new Xe});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const s of t.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return Le.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new Le(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const s=new Set;for(const a of t){const p=a.getId();if(s.has(p))throw new Error(`Duplicate plugin found '${p}'`);s.add(p)}}constructor(t){(0,H._)(this,"apiHolder",void 0),(0,H._)(this,"configApi",void 0),(0,H._)(this,"apis",void 0),(0,H._)(this,"icons",void 0),(0,H._)(this,"plugins",void 0),(0,H._)(this,"featureFlags",void 0),(0,H._)(this,"components",void 0),(0,H._)(this,"themes",void 0),(0,H._)(this,"configLoader",void 0),(0,H._)(this,"defaultApis",void 0),(0,H._)(this,"bindRoutes",void 0),(0,H._)(this,"appIdentityProxy",new To),(0,H._)(this,"apiFactoryRegistry",void 0),(0,w._)(this,Vr,{writable:!0,value:!1});var s;this.apis=(s=t.apis)!==null&&s!==void 0?s:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var p;this.featureFlags=(p=t.featureFlags)!==null&&p!==void 0?p:[],this.components=t.components,this.themes=t.themes;var E;this.configLoader=(E=t.configLoader)!==null&&E!==void 0?E:Wr;var k;this.defaultApis=(k=t.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Tt}}function Cr(i){return new oo(i)}let cr=!1;const ko=i=>{const t=(0,v.qD)(),{NotFoundErrorPage:s}=t.getComponents(),a=(0,z.useMemo)(()=>jn(),[]),E=[...(0,v.vJ)(i.children,k=>k.getElements().flatMap(W=>{let se=W.props.path;if(se==="")return[];var Te;se=(Te=se==null?void 0:se.replace(/\/\*$/,""))!==null&&Te!==void 0?Te:"/";let Be=a?W:W.props.element;return!a&&!Be&&(Be=W,cr||(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] />} />."),cr=!0)),[{path:se,element:Be,children:W.props.children?[{path:se==="/"?"/":"*",element:W.props.children}]:void 0}]}).sort((W,se)=>se.path.localeCompare(W.path)).map(W=>({...W,path:W.path==="/"?"/":`${W.path}/*`}))),{path:"*",element:(0,r.jsx)(s,{})}];return(0,g.V$)(E)},Hr=(0,v.T0)({id:"plugin.permission.api"});var tn;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(tn||(tn={}));function Bo(i,t){return i.name===t.name}function $o(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function ns(i){return i.attributes.action==="create"}function rs(i){return i.attributes.action==="read"}function os(i){return i.attributes.action==="update"}function ss(i){return i.attributes.action==="delete"}function is(i){return{authorize:async(t,s)=>await i.authorize(t,s),authorizeConditional(t,s){const a=t;return i.authorize(a,s)}}}function ir({name:i,attributes:t,resourceType:s}){return s?{type:"resource",name:i,attributes:t,resourceType:s}:{type:"basic",name:i,attributes:t}}var kr=n(23054),as=n(96279),Do=n.n(as),so=n(9571);const Br=dt.z.lazy(()=>dt.z.object({rule:dt.z.string(),resourceType:dt.z.string(),params:dt.z.record(dt.z.any()).optional()}).or(dt.z.object({anyOf:dt.z.array(Br).nonempty()})).or(dt.z.object({allOf:dt.z.array(Br).nonempty()})).or(dt.z.object({not:Br}))),ls=dt.z.object({result:dt.z.literal(tn.ALLOW).or(dt.z.literal(tn.DENY))}),cs=dt.z.union([dt.z.object({result:dt.z.literal(tn.ALLOW).or(dt.z.literal(tn.DENY))}),dt.z.object({result:dt.z.literal(tn.CONDITIONAL),pluginId:dt.z.string(),resourceType:dt.z.string(),conditions:Br})]),b=(i,t)=>dt.z.object({items:dt.z.array(dt.z.intersection(dt.z.object({id:dt.z.string()}),i)).refine(s=>s.length===t.size&&s.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class j{async authorize(t,s){return this.makeRequest(t,ls,s)}async authorizeConditional(t,s){return this.makeRequest(t,cs,s)}async makeRequest(t,s,a){if(!this.enabled)return t.map(Be=>({result:tn.ALLOW}));const p={items:t.map(Be=>({id:so.Z(),...Be}))},E=await this.discovery.getBaseUrl("permission"),k=await Do()(`${E}/authorize`,{method:"POST",body:JSON.stringify(p),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!k.ok)throw await kr.VL.fromResponse(k);const W=await k.json(),Te=b(s,new Set(p.items.map(({id:Be})=>Be))).parse(W).items.reduce((Be,Ve)=>(Be[Ve.id]=Ve,Be),{});return p.items.map(Be=>Te[Be.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,H._)(this,"enabled",void 0),(0,H._)(this,"discovery",void 0),this.discovery=t.discovery;var s;this.enabled=(s=t.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class T{static create(t){const{config:s,discovery:a,identity:p}=t,E=new j({discovery:a,config:s});return new T(E,p)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,s){(0,H._)(this,"permissionClient",void 0),(0,H._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=s}}var Z=n(69984);function ne(i){const t=(0,v.h_)(Hr),{data:s,error:a}=(0,Z.ZP)(i,async p=>{if($o(p.permission)&&!p.resourceRef)return tn.DENY;const{result:E}=await t.authorize(p);return E});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===tn.ALLOW}}const ae=i=>{const{permission:t,resourceRef:s,errorComponent:a,...p}=i,E=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),k=useApp(),{NotFoundErrorPage:W}=k.getComponents();let se=a===void 0?_jsx(W,{}):a;return E.loading?se=null:E.allowed&&(se=i.element),_jsx(Route,{...p,element:se})};function ce(i){const{permission:t,resourceRef:s}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),p=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:E}=p.getComponents();return _jsx(E,{})}const ye=[(0,v.ni)({api:v.NW,deps:{configApi:v.Ds},factory:({configApi:i})=>N.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,v.ni)({api:v.$v,deps:{},factory:()=>new U}),(0,v.ni)({api:v.v_,deps:{},factory:()=>new ve}),(0,v.ni)({api:v.VE,deps:{alertApi:v.$v},factory:({alertApi:i})=>{const t=new _(i,new J);return Ce.forward(t,{hidden:!1}),t}}),(0,v.ni)({api:v.E6,deps:{errorApi:v.VE},factory:({errorApi:i})=>Ot.create({errorApi:i})}),(0,v.ni)({api:v.gP,deps:{configApi:v.Ds,identityApi:v.$4,discoveryApi:v.NW},factory:({configApi:i,identityApi:t,discoveryApi:s})=>yt({middleware:[Nt.resolvePluginProtocol({discoveryApi:s}),Nt.injectIdentityAuth({identityApi:t,config:i})]})}),(0,v.ni)({api:v.ZM,deps:{},factory:()=>new xt}),(0,v.ni)({api:v.Kp,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>On.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,v.ni)({api:v.p_,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Mt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,v.ni)({api:v.F4,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Wt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,v.ni)({api:v.D,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Qn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,v.ni)({api:v.ux,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>zn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,v.ni)({api:v.gW,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Hn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,v.ni)({api:v.bq,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>le.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,v.ni)({api:v.Km,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Ue.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,v.ni)({api:v.uB,deps:{discoveryApi:v.NW,oauthRequestApi:v.ZM,configApi:v.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>q.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,v.ni)({api:Hr,deps:{discovery:v.NW,identity:v.$4,config:v.Ds},factory:({config:i,discovery:t,identity:s})=>T.create({config:i,discovery:t,identity:s})})];var Ae=n(77277),ge=n(47223),Pe=n(71597);function Ne({children:i}){return(0,g.GV)()?(0,r.jsx)(r.Fragment,{children:i}):(0,r.jsx)(g.VA,{children:i})}const nt=()=>(0,r.jsx)(ge.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),at=({step:i,error:t})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,r.jsx)(Ne,{children:(0,r.jsx)(ge.mf,{status:"501",statusMessage:s})})},Ye=({error:i,resetError:t,plugin:s})=>(0,r.jsx)(ge.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,r.jsx)(Ae.Z,{variant:"outlined",onClick:t,children:"Retry"})}),ke={Progress:ge.Ex,Router:Pe.VK,NotFoundErrorPage:nt,BootErrorPage:at,ErrorBoundaryFallback:Ye};var qe=n(43642),St=n(80079),rn=n(90941),Yt=n(32915),qt=n(40562),_t=n(21853),En=n(60744),Dn=n(66569),xr=n(30254),$r=n(13384),Gr=n(15933),In=n(58838),Zn=n(86737),Dr=n(4989),$s=n(44407),$i=n(18628),wr=n(84219),Ds=n(98685),Di=n(39781);const Zi={brokenImage:St.Z,catalog:$i.Z,scaffolder:Yt.Z,techdocs:qt.Z,search:_t.Z,chat:En.Z,dashboard:Dn.Z,docs:xr.Z,email:$r.Z,github:In.Z,group:wr.Z,help:Zn.Z,"kind:api":Gr.Z,"kind:component":$s.Z,"kind:domain":qe.Z,"kind:group":wr.Z,"kind:location":Dr.Z,"kind:system":rn.Z,"kind:user":Ds.Z,user:Ds.Z,warning:Di.Z};var Ni=n(73689),Zs=n(48032);const dr={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")`},ur={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 _n(i){const{colors:t,shape:s,options:a}=i,E=`linear-gradient(90deg, ${(t.length===1?[t[0],t[0]]:t).join(", ")})`,k=`${s}, ${E}`;var W;const se=(W=a==null?void 0:a.fontColor)!==null&&W!==void 0?W:"#FFFFFF";return{colors:t,shape:s,backgroundImage:k,fontColor:se}}const Zo={home:_n({colors:ur.teal,shape:dr.wave}),documentation:_n({colors:ur.pinkSea,shape:dr.wave2}),tool:_n({colors:ur.purpleSky,shape:dr.round}),service:_n({colors:ur.marineBlue,shape:dr.wave}),website:_n({colors:ur.veryBlue,shape:dr.wave}),library:_n({colors:ur.rubyRed,shape:dr.wave}),other:_n({colors:ur.darkGrey,shape:dr.wave}),app:_n({colors:ur.toastyOrange,shape:dr.wave}),apis:_n({colors:ur.teal,shape:dr.wave2}),card:_n({colors:ur.greens,shape:dr.wave})},Ns=16,Fs='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';function Us(i){const{palette:t,htmlFontSize:s=Ns,fontFamily:a=Fs,defaultPageTheme:p,pageTheme:E=Zo}=i;if(!E[p])throw new Error(`${p} is not defined in pageTheme.`);var k;return{palette:t,props:{MuiGrid:{spacing:2},MuiSwitch:{color:"primary"}},typography:{htmlFontSize:s,fontFamily:a,h6:{fontWeight:700,fontSize:20,marginBottom:2},h5:{fontWeight:700,fontSize:24,marginBottom:4},h4:{fontWeight:700,fontSize:28,marginBottom:6},h3:{fontSize:32,fontWeight:700,marginBottom:6},h2:{fontSize:40,fontWeight:700,marginBottom:8},h1:{fontSize:54,fontWeight:700,marginBottom:10}},page:E[p],getPageTheme:({themeId:W})=>(k=E[W])!==null&&k!==void 0?k:E[p]}}function Ms(i){return{MuiCssBaseline:{"@global":{html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,"overscroll-behavior-y":"none"},a:{color:"inherit",textDecoration:"none"}}},MuiTableRow:{root:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}},hover:{"&:hover":{cursor:"pointer"}},head:{"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}}},MuiTableCell:{root:{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0},sizeSmall:{padding:i.spacing(1.5,2,1.5,2.5)},head:{wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"}},MuiTabs:{root:{minHeight:24}},MuiTab:{root:{color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Zs.darken)(i.palette.link,.3),background:(0,Zs.lighten)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}},textColorPrimary:{color:i.palette.link}},MuiTableSortLabel:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"}},active:{fontWeight:"bold",color:"inherit"}},MuiListItemText:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},MuiButton:{text:{padding:void 0}},MuiChip:{root:{backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]},outlined:{color:i.palette.text.primary},label:{lineHeight:`${i.spacing(2.5)}px`,fontWeight:i.typography.fontWeightMedium,fontSize:`${i.spacing(1.75)}px`},labelSmall:{fontSize:`${i.spacing(1.5)}px`},deleteIcon:{color:i.palette.grey[500],width:`${i.spacing(3)}px`,height:`${i.spacing(3)}px`,margin:`0 ${i.spacing(.75)}px 0 -${i.spacing(.75)}px`},deleteIconSmall:{width:`${i.spacing(2)}px`,height:`${i.spacing(2)}px`,margin:`0 ${i.spacing(.5)}px 0 -${i.spacing(.5)}px`}},MuiCard:{root:{display:"flex",flexDirection:"column"}},MuiCardHeader:{root:{paddingBottom:0}},MuiCardContent:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}},MuiCardActions:{root:{justifyContent:"flex-end"}}}}function ds(i){const t=Us(i),s=(0,Ni.Z)(t),a=Ms(s);return{...s,overrides:a}}var zs=n(34505);const Fi=ds({palette:{type:"light",background:{default:"#F8F8F8"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#2E77D0",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#2E77D0"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:zs.Z.A700,navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Zo}),us=ds({palette:{type:"dark",background:{default:"#333333"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:zs.Z.A700,navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},defaultPageTheme:"home",pageTheme:Zo});var Ui=n(98192),hs=n(15222),ps=n(41547),No=n(87561);const fs=[{id:"light",title:"Light Theme",variant:"light",icon:(0,r.jsx)(hs.Z,{}),Provider:({children:i})=>(0,r.jsx)(ps.Z,{theme:Fi,children:(0,r.jsx)(No.ZP,{children:i})})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,r.jsx)(Ui.Z,{}),Provider:({children:i})=>(0,r.jsx)(ps.Z,{theme:us,children:(0,r.jsx)(No.ZP,{children:i})})}];function Ws(i){var t,s,a,p;return Cr({...i,apis:(t=i==null?void 0:i.apis)!==null&&t!==void 0?t:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...ke,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:ye,icons:{...Zi,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(p=i==null?void 0:i.themes)!==null&&p!==void 0?p:fs})}var io=n(25271),ao=n(76635);async function Vs({storageApi:i}){const t=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,ao.isArray)(a))return;var p;const E=new Set((p=s.snapshot("entityRefs").value)!==null&&p!==void 0?p:[]);a.filter(ao.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,W,se,Te])=>(0,io.eE)({kind:W,namespace:se,name:Te})).forEach(k=>E.add(k)),await s.set("entityRefs",Array.from(E)),await t.remove("starredEntities")}class Hs{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,H._)(this,"settingsStore",void 0),(0,H._)(this,"starredEntities",void 0),(0,H._)(this,"subscribers",new Set),(0,H._)(this,"observable",new(xe())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),Vs(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var p;this.starredEntities=new Set((p=a.value)!==null&&p!==void 0?p:[]),this.notifyChanges()}})}}var Mi=n(33414),Kr=n(79692),Gs=n(12420),Nn=n(40303),Ks=n(19928);function zi(){const i=useApi(catalogApiRef),{error:t,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(E=>{var k;return((k=E.facets.kind)===null||k===void 0?void 0:k.map(W=>W.value).sort())||[]}),[i]);return{loading:s,error:t,allKinds:a!=null?a:[]}}function Ys(i,t,s){let a=i;return t&&(a=a.filter(E=>t.some(k=>k.toLocaleLowerCase("en-US")===E.toLocaleLowerCase("en-US")))),s&&!i.some(E=>E.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((E,k)=>(E[k.toLocaleLowerCase("en-US")]=k,E),{})}const Js=(0,Kr.Z)(i=>(0,Gs.Z)({root:{...i.typography.h4}}));function Qs(i){var t;const{initialFilter:s="component",allowedKinds:a}=i,p=Js(),{allKinds:E}=useAllKinds(),{filters:k,updateFilters:W,queryParameters:{kind:se}}=useEntityList(),Te=useMemo(()=>[se].flat()[0],[se]);var Be;const[Ve,ft]=useState((Be=Te!=null?Te:(t=k.kind)===null||t===void 0?void 0:t.value)!==null&&Be!==void 0?Be:s);useEffect(()=>{Te&&ft(Te)},[Te]),useEffect(()=>{var At;if(!((At=k.kind)===null||At===void 0)&&At.value){var Ut;ft((Ut=k.kind)===null||Ut===void 0?void 0:Ut.value)}},[k.kind]),useEffect(()=>{W({kind:Ve?new EntityKindFilter(Ve):void 0})},[Ve,W]);const Ct=filterKinds(E,a,Ve);return _jsx(Select,{input:_jsx(InputBase,{}),value:Ve.toLocaleLowerCase("en-US"),onChange:At=>ft(At.target.value),classes:p,children:Object.keys(Ct).map(At=>_jsx(MenuItem,{value:At,children:`${pluralize(Ct[At])}`},At))})}var Xs=n(86359),Fo=n(95544),Wi=n(99688),lo=n(12231),Yr=n(86136),co=n(49378),er=n(85256),_s=n(80030),ei=n(61837),Vi=n(79784),Hi=n(50758),Gi=n(31654),Ki=n(43054),Yi=n(65759),ka=n(49280),uo=n(96641);function Ji(i){const{entity:t,loading:s,error:a}=(0,uo.ce)(),{allowed:p,loading:E,error:k}=ne({permission:i,resourceRef:t?(0,io.eE)(t):void 0});return s||E?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:p,error:k}}const gs="catalog-entity",ti=ir({name:"catalog.entity.read",attributes:{action:"read"},resourceType:gs}),ni=ir({name:"catalog.entity.create",attributes:{action:"create"}}),ho=ir({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:gs}),ri=ir({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:gs}),oi=ir({name:"catalog.location.read",attributes:{action:"read"}}),si=ir({name:"catalog.location.create",attributes:{action:"create"}}),Uo=ir({name:"catalog.location.delete",attributes:{action:"delete"}}),ms=[ti,ni,ho,ri,oi,si,Uo];var po=n(49166);function vs(i){const{unregisterEntityOptions:t,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:p}=i,E=typeof(t==null?void 0:t.disableUnregister)=="boolean";var k;const W=(k=!s||(E?!!(t!=null&&t.disableUnregister):(t==null?void 0:t.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let se=(0,r.jsx)(r.Fragment,{});return(t==null?void 0:t.disableUnregister)!=="hidden"&&(se=(0,r.jsxs)(lo.Z,{onClick:()=>{p(),a()},disabled:W,children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(po.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Unregister entity"})]})),(0,r.jsx)(r.Fragment,{children:se})}const ys=(0,Kr.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function hr(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:p}=i,[E,k]=(0,z.useState)(),W=ys(),Te=Ji(ho).allowed,Be=Ut=>{k(Ut.currentTarget)},Ve=()=>{k(void 0)},ft=(0,v.h_)(v.$v),Ct=(0,z.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>ft.post({message:"Copied!",severity:"info",display:"transient"}))},[ft]),At=t&&[...t.map(Ut=>(0,r.jsxs)(lo.Z,{onClick:()=>{Ve(),Ut.onClick()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Ut.Icon,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:Ut.title})]},Ut.title)),(0,r.jsx)(er.Z,{},"the divider is here!")];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_s.ZP,{title:"More",arrow:!0,children:(0,r.jsx)(ei.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!E,role:"button",onClick:Be,"data-testid":"menu-button",className:W.button,id:"long-menu",children:(0,r.jsx)(Ki.Z,{})})}),(0,r.jsx)(Vi.ZP,{open:Boolean(E),onClose:Ve,anchorEl:E,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,r.jsxs)(Hi.Z,{children:[At,(0,r.jsx)(vs,{unregisterEntityOptions:s,isUnregisterAllowed:Te,onUnregisterEntity:a,onClose:Ve}),(0,r.jsxs)(lo.Z,{onClick:()=>{Ve(),p()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Gi.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Inspect entity"})]}),(0,r.jsxs)(lo.Z,{onClick:()=>{Ve(),Ct()},children:[(0,r.jsx)(Yr.Z,{children:(0,r.jsx)(Yi.Z,{fontSize:"small"})}),(0,r.jsx)(co.Z,{primary:"Copy entity URL"})]})]})})]})}const xs="plugin.catalog.entityLayoutRoute",fo=()=>null;(0,v.R5)(fo,xs,!0),(0,v.R5)(fo,"core.gatherMountPoints",!0);function ii(i){const{entity:t,title:s}=i;return(0,r.jsxs)(Fo.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,r.jsx)(Fo.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),t&&(0,r.jsx)(Nn.LH,{entity:t})]})}function Qi(i,t,s,a){var p;const E=(p=i!=null?i:a==null?void 0:a.kind)!==null&&p!==void 0?p:"";var k;const W=(k=t!=null?t:a==null?void 0:a.metadata.namespace)!==null&&k!==void 0?k:"";var se,Te,Be;return{headerTitle:`${(Be=(Te=(se=a==null?void 0:a.metadata.title)!==null&&se!==void 0?se:s)!==null&&Te!==void 0?Te:a==null?void 0:a.metadata.name)!==null&&Be!==void 0?Be:""}${W&&W!==io.zG?` in ${W}`:""}`,headerType:(()=>{let ft=E.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(ft+=" \u2014 ",ft+=a.spec.type.toLocaleLowerCase("en-US")),ft})()}}function ar(i){var t;const{entity:s}=i,a=(0,Nn.hF)(s,io.S4);return(0,r.jsxs)(r.Fragment,{children:[a.length>0&&(0,r.jsx)(ge.i9,{label:"Owner",value:(0,r.jsx)(Nn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=s.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,r.jsx)(ge.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const bs=i=>{var t,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,children:E,NotFoundComponent:k}=i,{kind:W,namespace:se,name:Te}=(0,v.Oi)(Nn.wi),{entity:Be,loading:Ve,error:ft}=(0,Nn.ce)(),Ct=(0,g.TH)(),At=(0,v.vJ)(E,bo=>bo.selectByComponentData({key:xs,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Zr})=>{if(Be){if(Zr.if&&!Zr.if(Be))return[]}else return[];return[{path:Zr.path,title:Zr.title,children:Zr.children,tabProps:Zr.tabProps}]}),[Be]),{headerTitle:Ut,headerType:Ft}=Qi(W,se,Te,Be),[Fn,tr]=(0,z.useState)(!1),[nr,Qr]=(0,z.useState)(!1),Ei=(0,g.s0)(),Ai=async()=>{tr(!1),Qr(!1),Ei("/")};(0,z.useEffect)(()=>{tr(!1),Qr(!1)},[Ct.pathname]);var Ko;return(0,r.jsxs)(ge.T3,{themeId:(Ko=Be==null||(t=Be.spec)===null||t===void 0||(s=t.type)===null||s===void 0?void 0:s.toString())!==null&&Ko!==void 0?Ko:"home",children:[(0,r.jsx)(ge.h4,{title:(0,r.jsx)(ii,{title:Ut,entity:Be}),pageTitleOverride:Ut,type:Ft,children:Be&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ar,{entity:Be}),(0,r.jsx)(hr,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:p,onUnregisterEntity:()=>tr(!0),onInspectEntity:()=>Qr(!0)})]})}),Ve&&(0,r.jsx)(ge.Ex,{}),Be&&(0,r.jsx)(ge.tn,{routes:At}),ft&&(0,r.jsx)(ge.VY,{children:(0,r.jsx)(Wi.Z,{severity:"error",children:ft.toString()})}),!Ve&&!ft&&!Be&&(0,r.jsx)(ge.VY,{children:k||(0,r.jsxs)(ge.GB,{title:"Entity not found",children:["There is no ",W," with the requested"," ",(0,r.jsx)(ge.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,r.jsx)(Nn.pp,{open:Fn,entity:Be,onConfirm:Ai,onClose:()=>tr(!1)}),(0,r.jsx)(Nn.U_,{open:nr,entity:Be,onClose:()=>Qr(!1)})]})};bs.Route=fo;function Xi(i){const{open:t,onClose:s,onConfirm:a,entity:p}=i,[E,k]=useState(!1),W=useApi(catalogApiRef),se=useApi(alertApiRef),Te=async()=>{k(!0);try{const Be=p.metadata.uid;await W.removeEntityByUid(Be),a()}catch(Be){assertError(Be),se.post({message:Be.message})}finally{k(!1)}};return _jsxs(Dialog,{open:t,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:E,onClick:Te,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var go=n(19625);function qi(i){var t,s;return(i==null||(t=i.metadata)===null||t===void 0||(s=t.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function _i(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:p}=useEntity(),E=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:p,onConfirm:E,onClose:()=>a(!1)})]})}var mo=n(4791);const Ss=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Mo(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(p=>{var E,k;return{errors:((k=(E=p.entity.status)===null||E===void 0?void 0:E.items)!==null&&k!==void 0?k:[]).filter(Ss).map(Te=>Te.error).filter(Te=>Boolean(Te)),entity:p.entity}}).filter(p=>p.errors.length>0)}}async function ai(i,t){const s=t.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Mo(stringifyEntityRef(i),s)).items.length>0}function li(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:p,value:E}=useAsync(async()=>Mo(t,s),[t,s]);return p?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:p})}):a||!E?null:_jsx(_Fragment,{children:E.items.map((k,W)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((se,Te)=>_jsx(ResponseErrorPanel,{error:se},Te))]},W))})}const vo="core.backstage.entitySwitch",Cs=i=>null;(0,v.R5)(Cs,vo,!0);const ws=i=>{var t;const{entity:s,loading:a}=(0,Nn.ce)(),p=(0,v.I_)(),E=(0,v.vJ)(i.children,se=>se.selectByComponentData({key:vo,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(Te=>{if(a)return[];const{if:Be,children:Ve}=Te.props;return s?[{if:Be==null?void 0:Be(s,{apis:p}),children:Ve}]:[{if:Be===void 0,children:Ve}]}),[p,s,a]);if(E.some(se=>typeof se.if=="object"&&"then"in se.if))return(0,r.jsx)(js,{results:E,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const se=E.filter(Te=>Te.if).map(Te=>Te.children);return se.length===0?Jr(E):(0,r.jsx)(r.Fragment,{children:se})}var W;return(W=(t=E.find(se=>se.if))===null||t===void 0?void 0:t.children)!==null&&W!==void 0?W:Jr(E)};function js({results:i,renderMultipleMatches:t}){const{loading:s,value:a}=(0,Se.default)(async()=>{const p=i.map(async({if:k,children:W})=>{try{if(await k)return W}catch{}return null});if(t==="all"){const k=(await Promise.all(p)).filter(Boolean);return k.length===0?Jr(i):(0,r.jsx)(r.Fragment,{children:k})}var E;return(E=(await Promise.all(p)).find(Boolean))!==null&&E!==void 0?E:Jr(i)},[i]);return s||!a?null:a}function Jr(i){var t,s;return(s=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&s!==void 0?s:null}ws.Case=Cs;const ea=null,zo=Nn._i.Filters,ta=Nn._i.Content;var na=n(85877),Es=n(15096);const Pn=(0,v.rx)({id:"catalog",apis:[(0,v.ni)({api:Nn.Ah,deps:{discoveryApi:v.NW,fetchApi:v.gP},factory:({discoveryApi:i,fetchApi:t})=>new mo.MS({discoveryApi:i,fetchApi:t})}),(0,v.ni)({api:Nn.p3,deps:{storageApi:v.E6},factory:({storageApi:i})=>new Hs({storageApi:i})})],routes:{catalogIndex:go._Z,catalogEntity:Nn.wi},externalRoutes:{createComponent:go.yw,viewTechDoc:go.jU},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),ra=Pn.provide((0,v.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:go._Z})),ci=Pn.provide((0,v.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Nn.wi})),oa=Pn.provide((0,v.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,33414)).then(i=>i.AboutCard)}})),di=Pn.provide((0,v.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),sa=Pn.provide((0,v.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),Wo=Pn.provide((0,v.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),ui=Pn.provide((0,v.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),ia=Pn.provide((0,v.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),hi=Pn.provide((0,v.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),aa=Pn.provide((0,v.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),pi=Pn.provide((0,v.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),fi=Pn.provide((0,v.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),Yn=Pn.provide((0,v.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),la=Pn.provide((0,Es.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var As=n(32838);class gi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,s){const p=`${await this.getApiOrigin()}/${s}`,E=await fetch(`${p.endsWith("/")?p:`${p}/`}index.html`);if(E.status===404)throw new Error("Page not found");return E.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,s,a){const p=await this.getApiOrigin();return new URL(t,`${p}/${a}`).toString()}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,H._)(this,"configApi",void 0),(0,H._)(this,"discoveryApi",void 0),(0,H._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}class Ts{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,H._)(this,"configApi",void 0),(0,H._)(this,"discoveryApi",void 0),(0,H._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}const mi=[(0,v.ni)({api:me.Dl,deps:{configApi:v.Ds,discoveryApi:v.NW,identityApi:v.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new gi({configApi:i,discoveryApi:t,identityApi:s})}),(0,v.ni)({api:me.gT,deps:{configApi:v.Ds,discoveryApi:v.NW,identityApi:v.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Ts({configApi:i,discoveryApi:t,identityApi:s})}),(0,v.ni)({api:As.q3,deps:{configApi:v.Ds},factory:({configApi:i})=>As.ae.fromConfig(i)})],ca={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Vo={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function vi(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function yi(){const i=await Wr(),t=await vi();return[...i,{context:"detected",data:t?ca:Vo}]}var xi=n(58845);const yo=(0,Kr.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var bi=()=>{const i=yo();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,r.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 Rs=(0,Kr.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var ha=()=>{const i=Rs();return(0,r.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,r.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 pa=(0,Kr.Z)({root:{width:ge.po.drawerWidthClosed,height:3*ge.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:ge.po.drawerWidthClosed,marginLeft:24}}),Si=()=>{const i=pa(),{isOpen:t}=(0,ge.mZ)();return(0,r.jsx)("div",{className:i.root,children:(0,r.jsx)(ge.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,r.jsx)(bi,{}):(0,r.jsx)(ha,{})})})},fa=({children:i})=>(0,r.jsxs)(ge.tR,{children:[(0,r.jsxs)(ge.YE,{children:[(0,r.jsx)(Si,{}),(0,r.jsx)(ge.v7,{}),(0,r.jsx)(ge.R6,{icon:xi.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var ga=n(32388),Ho=n(4142);const Go=(0,Kr.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 lr;(function(i){i.LIGHT="light",i.DARK="dark"})(lr||(lr={}));const xo=()=>{const i=(0,v.h_)(v.hg),t=Go(),[s,a]=(0,z.useState)(i.getActiveThemeId()===lr.DARK?lr.DARK:lr.LIGHT),p={[lr.LIGHT]:{icon:Ho.Z,title:"Dark theme"},[lr.DARK]:{icon:ga.Z,title:"Light theme"}},{title:E,icon:k}=p[s],W=()=>{a(se=>{const Te=se===lr.LIGHT?lr.DARK:lr.LIGHT;return i.setActiveThemeId(Te),Te})};return(0,r.jsx)(Fo.Z,{display:"flex",alignItems:"center",mr:2,children:(0,r.jsx)(_s.ZP,{title:E,arrow:!0,children:(0,r.jsx)(ei.Z,{size:"small",onClick:W,children:(0,r.jsx)(k,{className:t.headerIcon})})})})},Ci=()=>(0,r.jsxs)(P.I6,{children:[(0,r.jsx)($.S,{}),(0,r.jsx)(R.F,{withSearch:!1})]}),Is=(0,r.jsx)(Ci,{}),Ps=Ws({apis:mi,configLoader:yi,plugins:Object.values(d)}),wi=Ps.getProvider(),Ls=Ps.getRouter(),ji=P.s4.provide((0,me.KY)({name:"ThemeToggleAddon",component:xo,location:me.oZ.Header})),Os=(0,r.jsxs)(ko,{children:[(0,r.jsx)(g.Fg,{to:"/docs/default/component/local/"},"/"),(0,r.jsx)(g.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,r.jsx)(ci,{})}),(0,r.jsx)(g.AW,{path:"/docs",element:(0,r.jsx)(P.Jl,{}),children:(0,r.jsx)(D.u,{})}),(0,r.jsxs)(g.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,r.jsx)(P.I6,{}),children:[Is,(0,r.jsx)(me.DR,{children:(0,r.jsx)(ji,{})})]})]});var ma=()=>(0,r.jsx)(wi,{children:(0,r.jsx)(Ls,{children:(0,r.jsx)(fa,{children:Os})})});I.render((0,r.jsx)(ma,{}),document.getElementById("root"))},51837:function(wt,De,n){"use strict";n.d(De,{CT:function(){return v},EI:function(){return Ie},uW:function(){return I},Vt:function(){return c}});function d(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const r=d(),z=fe=>`__@backstage/${fe}__`;function I(fe,G){const $=z(fe);let R=r[$];return R||(R=G(),r[$]=R,R)}var g=n(2784);function v(fe){return I(fe,()=>(0,g.createContext)(void 0))}function c(fe){return(0,g.useContext)(v(fe))}function B(fe){return{set(G){globalThis[`__@backstage/${fe}__`]=createContext(createVersionedValueMap(G))},reset(){delete globalThis[`__@backstage/${fe}__`]}}}function Ie(fe){Object.freeze(fe);const G={atVersion($){return fe[$]}};return Object.defineProperty(G,"$map",{configurable:!0,enumerable:!0,get(){return fe}}),G}},96641:function(wt,De,n){"use strict";n.d(De,{X2:function(){return Ie},ce:function(){return fe},h$:function(){return c}});var d=n(52322),r=n(25271),z=n(60871),I=n(51837),g=n(2784);const v=(0,I.CT)("entity-context"),c=G=>{const{children:$,entity:R,loading:O,error:re,refresh:X}=G,te={entity:R,loading:O,error:re,refresh:X};return(0,d.jsx)(v.Provider,{value:(0,I.EI)({1:te}),children:(0,d.jsx)(z.fC,{attributes:{...R?{entityRef:(0,r.eE)(R)}:void 0},children:$})})},B=G=>_jsx(c,{entity:G.entity,loading:!Boolean(G.entity),error:void 0,refresh:void 0,children:G.children});function Ie(){const G=(0,I.Vt)("entity-context");if(!G)throw new Error("Entity context is not available");const $=G.atVersion(1);if(!$)throw new Error("EntityContext v1 not available");if(!$.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:$.entity}}function fe(){const G=(0,I.Vt)("entity-context");if(!G)throw new Error("Entity context is not available");const $=G.atVersion(1);if(!$)throw new Error("EntityContext v1 not available");const{entity:R,loading:O,error:re,refresh:X}=$;return{entity:R,loading:O,error:re,refresh:X}}},40303:function(wt,De,n){"use strict";n.d(De,{h$:function(){return Tt.h$},n3:function(){return d.n3},_i:function(){return A},tW:function(){return dt},df:function(){return $e},UO:function(){return Fe},dq:function(){return st},nl:function(){return ls},dx:function(){return Y},rI:function(){return he},u3:function(){return it},xE:function(){return Rn},sL:function(){return Gn},LH:function(){return u},U_:function(){return ko},pp:function(){return rs},EW:function(){return as},Ah:function(){return z},wi:function(){return Gt},hF:function(){return me.hF},CV:function(){return me.CV},$3:function(){return q},p3:function(){return I},ce:function(){return Tt.ce},X2:function(){return Tt.X2},wp:function(){return Qe},ZW:function(){return kn},eK:function(){return an},CR:function(){return zn}});var d=n(4791),r=n(60871);const z=(0,r.T0)({id:"plugin.catalog.service"}),I=(0,r.T0)({id:"catalog-react.starred-entities"});var g=n(82394);class v{async toggleStarred(j){this.starredEntities.delete(j)||this.starredEntities.add(j);for(const T of this.subscribers)T.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 c=n(52322),B=n(2784),Ie=n(41156),fe=n(60364),G=n(77277),$=n(4190),R=n(95544),O=n(90436),re=n(60905),X=n(36444);const te=b=>{const j=(0,Ie.Z)(ae=>ae.breakpoints.down("md")),T=(0,fe.Z)(),[Z,ne]=(0,B.useState)(!1);return j?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(G.Z,{style:{marginTop:T.spacing(1),marginLeft:T.spacing(1)},onClick:()=>ne(!0),startIcon:(0,c.jsx)(X.Z,{}),children:"Filters"}),(0,c.jsx)($.ZP,{open:Z,onClose:()=>ne(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,c.jsxs)(R.Z,{m:2,children:[(0,c.jsx)(O.Z,{variant:"h6",component:"h2",style:{marginBottom:T.spacing(1)},children:"Filters"}),b.children]})})]}):(0,c.jsx)(re.Z,{item:!0,lg:2,children:b.children})},D=b=>(0,c.jsx)(re.Z,{item:!0,xs:12,lg:10,children:b.children}),A=b=>(0,c.jsx)(re.Z,{container:!0,style:{position:"relative"},children:b.children});A.Filters=te,A.Content=D;var L=n(47223),P=n(87612),V=n(25271),me=n(49280);class ze{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(j){(0,P._)(this,"value",void 0),this.value=j}}class rt{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(j){(0,P._)(this,"value",void 0),this.value=j}}class H{filterEntity(j){var T;return this.values.every(Z=>((T=j.metadata.tags)!==null&&T!==void 0?T:[]).includes(Z))}toQueryValue(){return this.values}constructor(j){(0,P._)(this,"values",void 0),this.values=j}}class ot{filterEntity(j){const T=this.toUpperArray(this.value.split(/\s/)),Z=this.toUpperArray([j.metadata.tags]),ne=this.toUpperArray([j.metadata.name,j.metadata.title]);for(const ae of T)if(Z.every(ce=>ce!==ae)&&ne.every(ce=>!ce.includes(ae)))return!1;return!0}toUpperArray(j){return j.flat().filter(T=>Boolean(T)).map(T=>T.toLocaleUpperCase("en-US"))}constructor(j){_define_property(this,"value",void 0),this.value=j}}class vt{filterEntity(j){return this.values.some(T=>(0,me.hF)(j,V.S4).some(Z=>(0,V.eE)(Z)===T))}toQueryValue(){return this.values}constructor(j){(0,P._)(this,"values",void 0),this.values=j.reduce((T,Z)=>{try{return T.push((0,V.eE)((0,V.of)(Z,{defaultKind:"Group"}))),T}catch{return T}},[])}}class Je{filterEntity(j){return this.values.some(T=>{var Z;return((Z=j.spec)===null||Z===void 0?void 0:Z.lifecycle)===T})}toQueryValue(){return this.values}constructor(j){(0,P._)(this,"values",void 0),this.values=j}}class ht{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,T,Z){(0,P._)(this,"value",void 0),(0,P._)(this,"isOwnedEntity",void 0),(0,P._)(this,"isStarredEntity",void 0),this.value=j,this.isOwnedEntity=T,this.isStarredEntity=Z}}class Le{filterEntity(j){var T;const Z=(T=j.metadata.annotations)===null||T===void 0?void 0:T["backstage.io/orphan"];return Z!==void 0&&this.value.toString()===Z}constructor(j){(0,P._)(this,"value",void 0),this.value=j}}class bt{filterEntity(j){var T,Z;const ne=(j==null||(T=j.status)===null||T===void 0||(Z=T.items)===null||Z===void 0?void 0:Z.length)>0;return ne!==void 0&&this.value===ne}constructor(j){(0,P._)(this,"value",void 0),this.value=j}}var Tt=n(96641),pt=n(76635),gt=n(19126),jt=n.n(gt),$t=n(73557),He=n(69294),Xt=n(48760),ue=n(90736);const xe=(0,B.createContext)(void 0),Fe=b=>{const j=(0,ue.default)(),T=(0,r.h_)(z),[Z,ne]=(0,B.useState)({}),ae=(0,$t.TH)();var ce;const ye=(0,B.useMemo)(()=>(ce=jt().parse(ae.search,{ignoreQueryPrefix:!0}).filters)!==null&&ce!==void 0?ce:{},[ae]),[Ae,ge]=(0,B.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:Pe,error:Ne},nt]=(0,He.default)(async()=>{const ke=(0,pt.compact)(Object.values(Z)),qe=(0,me.Gz)(ke),St=(0,me.wq)(ke),rn=(0,me.wq)((0,pt.compact)(Object.values(Ae.appliedFilters))),Yt=Object.keys(Z).reduce((_t,En)=>{const Dn=Z[En];return Dn!=null&&Dn.toQueryValue&&(_t[En]=Dn.toQueryValue()),_t},{});if((0,pt.isEqual)(rn,St))ge({appliedFilters:Z,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(qe)});else{const _t=await T.getEntities({filter:St});ge({appliedFilters:Z,backendEntities:_t.items,entities:_t.items.filter(qe)})}if(j()){var qt;const _t=jt().parse(ae.search,{ignoreQueryPrefix:!0}),En=jt().stringify({..._t,filters:Yt},{addQueryPrefix:!0,arrayFormat:"repeat"}),Dn=`${window.location.pathname}${En}`;(qt=window.history)===null||qt===void 0||qt.replaceState(null,document.title,Dn)}},[T,ye,Z,Ae],{loading:!0});(0,Xt.Z)(nt,10,[Z]);const at=(0,B.useCallback)(ke=>{ne(qe=>{const St=typeof ke=="function"?ke(qe):ke;return{...qe,...St}})},[]),Ye=(0,B.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:at,queryParameters:ye,loading:Pe,error:Ne}),[Ae,at,ye,Pe,Ne]);return(0,c.jsx)(xe.Provider,{value:Ye,children:b.children})};function Qe(){const b=(0,B.useContext)(xe);if(!b)throw new Error("useEntityList must be used within EntityListProvider");return b}var mt=n(64279),Rt=n(18149),ct=n.n(Rt),Et=n(829),Lt=n.n(Et);function Jt(){const b=(0,r.h_)(z),{filters:{kind:j,type:T},queryParameters:{type:Z},updateFilters:ne}=Qe(),ae=(0,B.useMemo)(()=>[Z].flat().filter(Boolean),[Z]);var ce;const[ye,Ae]=(0,B.useState)(ae.length?ae:(ce=T==null?void 0:T.getTypes())!==null&&ce!==void 0?ce:[]);(0,B.useEffect)(()=>{ae.length&&Ae(ae)},[ae]);const[ge,Pe]=(0,B.useState)([]),Ne=(0,B.useMemo)(()=>j==null?void 0:j.value,[j]),{error:nt,loading:at,value:Ye}=(0,mt.default)(async()=>Ne?await b.getEntityFacets({filter:{kind:Ne},facets:["spec.type"]}).then(St=>St.facets["spec.type"]||[]):[],[Ne,b]),ke=(0,B.useRef)(Ye);return(0,B.useEffect)(()=>{const qe=ke.current;if(ke.current=Ye,at||!Ne||qe===Ye||!Ye)return;const St=[...new Set(Lt()(Ye,Yt=>-Yt.count).map(Yt=>Yt.value.toLocaleLowerCase("en-US")))];Pe(St);const rn=ye.filter(Yt=>St.includes(Yt));ct()(ye,rn)||Ae(rn)},[at,Ne,ye,Ae,Ye]),(0,B.useEffect)(()=>{ne({type:ye.length?new rt(ye):void 0})},[ye,ne]),{loading:at,error:nt,availableTypes:ge,selectedTypes:ye,setSelectedTypes:Ae}}const Pt=20;function an(b,j){var T,Z;const ne=j==null||(T=j.type)===null||T===void 0?void 0:T.toLocaleLowerCase("en-US"),ae=j==null||(Z=j.kind)===null||Z===void 0?void 0:Z.toLocaleLowerCase("en-US"),ce=(0,r.h_)(z),{loading:ye,value:Ae,error:ge}=(0,mt.default)(async()=>{var Pe;const Ne=(Pe=b.relations)===null||Pe===void 0?void 0:Pe.map(ke=>({type:ke.type,target:(0,V.of)(ke.targetRef)})).filter(ke=>(!ne||ke.type.toLocaleLowerCase("en-US")===ne)&&(!ae||ke.target.kind===ae));if(!Ne)return[];const nt=Object.values((0,pt.groupBy)(Ne,({target:ke})=>`${ke.kind}:${ke.namespace}`.toLocaleLowerCase("en-US"))),at=[];for(const ke of nt)at.push({kind:ke[0].target.kind,namespace:ke[0].target.namespace,nameBatches:(0,pt.chunk)(ke.map(qe=>qe.target.name),Pt)});return(await Promise.all(at.flatMap(ke=>ke.nameBatches.map(qe=>ce.getEntities({filter:{kind:ke.kind,"metadata.namespace":ke.namespace,"metadata.name":qe}}))))).flatMap(ke=>ke.items)},[b,ne,ae]);return{entities:Ae,loading:ye,error:ge}}var Wt=n(72164);function sn(b){return typeof b=="string"?b:(0,V.eE)(b)}function zn(){const b=(0,r.h_)(I),j=(0,Wt.Z)(b.starredEntitie$(),new Set),T=(0,B.useCallback)(ne=>j.has(sn(ne)),[j]),Z=(0,B.useCallback)(ne=>b.toggleStarred(sn(ne)).then(),[b]);return{starredEntities:j,toggleStarredEntity:Z,isStarredEntity:T}}function An(b){return typeof b=="string"?b:(0,V.eE)(b)}function hn(b){const j=(0,r.h_)(I),[T,Z]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{const ae=j.starredEntitie$().subscribe({next(ce){Z(ce.has(An(b)))}});return()=>{ae.unsubscribe()}},[b,j]),{toggleStarredEntity:(0,B.useCallback)(()=>j.toggleStarred(An(b)).then(),[b,j]),isStarredEntity:T}}var On=n(75435);function kn(){const b=(0,r.h_)(r.$4),{loading:j,value:T}=(0,mt.default)(async()=>{const{ownershipEntityRefs:ne}=await b.getBackstageIdentity();return ne},[]),Z=(0,B.useMemo)(()=>{const ne=new Set(T!=null?T:[]);return ae=>{const ce=(0,On.h)(ae,V.S4).map(V.eE);for(const ye of ce)if(ne.has(ye))return!0;return!1}},[T]);return(0,B.useMemo)(()=>({loading:j,isOwnedEntity:Z}),[j,Z])}function Wn(){const b=(0,r.h_)(z),{error:j,loading:T,value:Z}=(0,mt.default)(async()=>await b.getEntityFacets({facets:["kind"]}).then(ae=>{var ce;return((ce=ae.facets.kind)===null||ce===void 0?void 0:ce.map(ye=>ye.value).sort())||[]}),[b]);return{loading:T,error:j,allKinds:Z!=null?Z:[]}}function Bn(b,j,T){let Z=b;return j&&(Z=Z.filter(ae=>j.some(ce=>ce.toLocaleLowerCase("en-US")===ae.toLocaleLowerCase("en-US")))),T&&!b.some(ae=>ae.toLocaleLowerCase("en-US")===T.toLocaleLowerCase("en-US"))&&(Z=Z.concat([T])),Z.sort().reduce((ae,ce)=>(ae[ce.toLocaleLowerCase("en-US")]=ce,ae),{})}function Qn(b){var j;const{filters:T,queryParameters:{kind:Z},updateFilters:ne}=Qe(),ae=(0,B.useMemo)(()=>[Z].flat()[0],[Z]);var ce;const[ye,Ae]=(0,B.useState)((ce=ae!=null?ae:(j=T.kind)===null||j===void 0?void 0:j.value)!==null&&ce!==void 0?ce:b.initialFilter);(0,B.useEffect)(()=>{ae&&Ae(ae)},[ae]),(0,B.useEffect)(()=>{var nt;if(!((nt=T.kind)===null||nt===void 0)&&nt.value){var at;Ae((at=T.kind)===null||at===void 0?void 0:at.value)}},[T.kind]),(0,B.useEffect)(()=>{ne({kind:ye?new ze(ye):void 0})},[ye,ne]);const{allKinds:ge,loading:Pe,error:Ne}=Wn();return{loading:Pe,error:Ne,allKinds:ge!=null?ge:[],selectedKind:ye,setSelectedKind:Ae}}const dt=b=>{const{allowedKinds:j,hidden:T,initialFilter:Z="component"}=b,ne=(0,r.h_)(r.$v),{error:ae,allKinds:ce,selectedKind:ye,setSelectedKind:Ae}=Qn({initialFilter:Z});if((0,B.useEffect)(()=>{ae&&ne.post({message:"Failed to load entity kinds",severity:"error"})},[ae,ne]),ae)return null;const ge=Bn(ce,j,ye),Pe=Object.keys(ge).map(Ne=>({value:Ne,label:ge[Ne]}));return T?null:(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsx)(L.Ph,{label:"Kind",items:Pe,selected:ye.toLocaleLowerCase("en-US"),onChange:Ne=>Ae(String(Ne))})})};var Qt=n(79692),wn=n(5806),Tn=n(21324),yn=n(86619),Mt=n(19996),ln=n(25505),bn=n(38016),on=n(88013);const Hn=(0,Qt.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),we=(0,c.jsx)(ln.Z,{fontSize:"small"}),le=(0,c.jsx)(Mt.Z,{fontSize:"small"}),$e=b=>{var j;const{initialFilter:T=[]}=b,Z=Hn(),{updateFilters:ne,backendEntities:ae,filters:ce,queryParameters:{lifecycles:ye}}=Qe(),Ae=(0,B.useMemo)(()=>[ye].flat().filter(Boolean),[ye]);var ge;const[Pe,Ne]=(0,B.useState)(Ae.length?Ae:(ge=(j=ce.lifecycles)===null||j===void 0?void 0:j.values)!==null&&ge!==void 0?ge:T);(0,B.useEffect)(()=>{Ae.length&&Ne(Ae)},[Ae]);const nt=(0,B.useMemo)(()=>[...new Set(ae.map(at=>{var Ye;return(Ye=at.spec)===null||Ye===void 0?void 0:Ye.lifecycle}).filter(Boolean))].sort(),[ae]);return(0,B.useEffect)(()=>{ne({lifecycles:Pe.length&&nt.length?new Je(Pe):void 0})},[Pe,ne,nt]),nt.length?(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsxs)(O.Z,{variant:"button",component:"label",children:["Lifecycle",(0,c.jsx)(on.ZP,{multiple:!0,disableCloseOnSelect:!0,options:nt,value:Pe,onChange:(at,Ye)=>Ne(Ye),renderOption:(at,{selected:Ye})=>(0,c.jsx)(wn.Z,{control:(0,c.jsx)(Tn.Z,{icon:we,checkedIcon:le,checked:Ye}),onClick:ke=>ke.preventDefault(),label:at}),size:"small",popupIcon:(0,c.jsx)(bn.Z,{"data-testid":"lifecycle-picker-expand"}),renderInput:at=>(0,c.jsx)(yn.Z,{...at,className:Z.input,variant:"outlined"})})]})}):null};var Ue=n(72579),et=n.n(Ue);function q(b,j){const T=j==null?void 0:j.defaultKind;let Z,ne,ae;return"metadata"in b?(Z=b.kind,ne=b.metadata.namespace,ae=b.metadata.name):(Z=b.kind,ne=b.namespace,ae=b.name),(ne===void 0||ne==="")&&(ne=V.zG),(j==null?void 0:j.defaultNamespace)!==void 0?(j==null?void 0:j.defaultNamespace)===ne&&(ne=void 0):ne===V.zG&&(ne=void 0),Z=Z.toLocaleLowerCase("en-US"),Z=T&&T.toLocaleLowerCase("en-US")===Z?void 0:Z,`${Z?`${Z}:`:""}${ne?`${ne}/`:""}${ae}`}function U(b,j){for(const T of["spec.profile.displayName","metadata.title"]){const Z=et()(b,T);if(Z&&typeof Z=="string")return Z}return q(b,j)}const ve=(0,Qt.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),Ee=(0,c.jsx)(ln.Z,{fontSize:"small"}),tt=(0,c.jsx)(Mt.Z,{fontSize:"small"}),st=()=>{var b;const j=ve(),{updateFilters:T,backendEntities:Z,filters:ne,queryParameters:{owners:ae}}=Qe(),ce=(0,r.h_)(z),ye=(0,r.h_)(r.VE),Ae=(0,B.useMemo)(()=>[ae].flat().filter(Boolean),[ae]);var ge;const[Pe,Ne]=(0,B.useState)(Ae.length?new vt(Ae).values:(ge=(b=ne.owners)===null||b===void 0?void 0:b.values)!==null&&ge!==void 0?ge:[]),{loading:nt,error:at,value:Ye}=(0,mt.default)(async()=>{const qe=[...new Set(Z.flatMap(Yt=>(0,me.hF)(Yt,V.S4).map(qt=>(0,V.eE)(qt))).filter(Boolean))],{items:St}=await ce.getEntitiesByRefs({entityRefs:qe,fields:["kind","metadata.name","metadata.title","metadata.namespace","spec.profile.displayName"]});return St.map((Yt,qt)=>Yt?{label:U(Yt,{defaultKind:"Group"}),entityRef:(0,V.eE)(Yt)}:{label:q((0,V.of)(qe[qt]),{defaultKind:"group"}),entityRef:qe[qt]}).sort((Yt,qt)=>Yt.label.localeCompare(qt.label,"en-US",{ignorePunctuation:!0,caseFirst:"upper"}))},[Z]);if((0,B.useEffect)(()=>{at&&ye.post({...at,message:`EntityOwnerPicker failed to initialize: ${at.message}`},{})},[at,ye]),(0,B.useEffect)(()=>{if(Ae.length){const qe=new vt(Ae);Ne(qe.values)}},[Ae]),(0,B.useEffect)(()=>{!nt&&Ye&&T({owners:Pe.length&&Ye.length?new vt(Pe):void 0})},[Pe,T,Ye,nt]),!nt&&!(Ye!=null&&Ye.length))return null;var ke;return(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsxs)(O.Z,{variant:"button",component:"label",children:["Owner",(0,c.jsx)(on.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:nt,options:Ye||[],value:(ke=Ye==null?void 0:Ye.filter(qe=>Pe.some(St=>St===qe.entityRef)))!==null&&ke!==void 0?ke:[],onChange:(qe,St)=>Ne(St.map(rn=>rn.entityRef)),getOptionLabel:qe=>qe.label,renderOption:(qe,{selected:St})=>(0,c.jsx)(wn.Z,{control:(0,c.jsx)(Tn.Z,{icon:Ee,checkedIcon:tt,checked:St}),onClick:rn=>rn.preventDefault(),label:qe.label}),size:"small",popupIcon:(0,c.jsx)(bn.Z,{"data-testid":"owner-picker-expand"}),renderInput:qe=>(0,c.jsx)(yn.Z,{...qe,className:j.input,variant:"outlined"})})]})})};var kt=n(51837);const Gt=(0,kt.uW)("catalog:entity-route-ref",()=>(0,r.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function pn(b){var j,T;return{kind:b.kind.toLocaleLowerCase("en-US"),namespace:(T=(j=b.metadata.namespace)===null||j===void 0?void 0:j.toLocaleLowerCase("en-US"))!==null&&T!==void 0?T:DEFAULT_NAMESPACE,name:b.metadata.name}}var ee=n(80030);const Y=(0,B.forwardRef)((b,j)=>{const{entityRef:T,defaultKind:Z,title:ne,children:ae,...ce}=b,ye=(0,r.tg)(Gt);let Ae,ge,Pe;if(typeof T=="string"){const ke=(0,V.of)(T);Ae=ke.kind,ge=ke.namespace,Pe=ke.name}else"metadata"in T?(Ae=T.kind,ge=T.metadata.namespace,Pe=T.metadata.name):(Ae=T.kind,ge=T.namespace,Pe=T.name);Ae=Ae.toLocaleLowerCase("en-US");var Ne;ge=(Ne=ge==null?void 0:ge.toLocaleLowerCase("en-US"))!==null&&Ne!==void 0?Ne:V.zG;const nt={kind:Ae,namespace:ge,name:Pe},at=q({kind:Ae,namespace:ge,name:Pe},{defaultKind:Z}),Ye=(0,c.jsxs)(L.rU,{...ce,ref:j,to:ye(nt),children:[ae,!ae&&(ne!=null?ne:at)]});return ne?(0,c.jsx)(ee.ZP,{title:at,children:Ye}):Ye});function oe(b){const{entityRefs:j,defaultKind:T,getTitle:Z,...ne}=b,ae=(0,r.h_)(z),{value:ce=new Array,loading:ye,error:Ae}=(0,mt.default)(async()=>{const ge=j.reduce((Ne,nt)=>typeof nt=="object"&&"metadata"in nt?Ne:[...Ne,(0,V.of)(nt)],new Array),Pe=j.filter(Ne=>typeof Ne=="object"&&"metadata"in Ne);return ge.length>0?[...(await ae.getEntities({filter:ge.map(Ne=>({kind:Ne.kind,"metadata.namespace":Ne.namespace,"metadata.name":Ne.name}))})).items,...Pe]:Pe},[j]);return ye?(0,c.jsx)(L.Ex,{}):Ae?(0,c.jsx)(L.yu,{error:Ae}):(0,c.jsx)(c.Fragment,{children:ce.map((ge,Pe)=>(0,c.jsxs)(B.Fragment,{children:[Pe>0&&", ",(0,c.jsx)(Y,{...ne,defaultKind:T,entityRef:ge,title:Z(ge)})]},Pe))})}function he(b){const{entityRefs:j,defaultKind:T,fetchEntities:Z,getTitle:ne,...ae}=b;return Z?(0,c.jsx)(oe,{...ae,defaultKind:T,entityRefs:j,getTitle:ne}):(0,c.jsx)(c.Fragment,{children:j.map((ce,ye)=>(0,c.jsxs)(B.Fragment,{children:[ye>0&&", ",(0,c.jsx)(Y,{...ae,defaultKind:T,entityRef:ce,title:ne?ne(ce):void 0})]},ye))})}const ie=b=>{const j=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:j(getCompoundEntityRef(b.entity)),children:_jsx(InfoIcon,{})})},m=b=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${b.email}`,to:`mailto:${b.email}`,children:_jsx(EmailIcon,{})}),N=b=>{var j;const T=(j=b.entity.spec.profile)===null||j===void 0?void 0:j.email;return T?_jsx(EmailCardAction,{email:T}):null},_=b=>{var j;const T=(j=b.entity.spec.profile)===null||j===void 0?void 0:j.email;return T?_jsx(EmailCardAction,{email:T}):null},J=(0,Qt.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),Ce=4,Re=b=>{var j,T,Z;const{entityRef:ne,children:ae,delayTime:ce=500}=b,ye=J(),Ae=useApiHolder(),ge=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[Pe,Ne]=useState(!1),nt=useMemo(()=>debounce(()=>Ne(!0),ce),[ce]),[{loading:at,error:Ye,value:ke},qe]=useAsyncFn(async()=>{const rn=Ae.get(catalogApiRef);if(rn){const Yt=await rn.getEntityByRef(ne);if(!Yt)throw new Error(`${ne} not found`);return Yt}},[Ae,ne]),St=()=>{Ne(!1),nt.cancel()};return useEffect(()=>{ge.isOpen&&!ke&&!Ye&&!at&&qe()},[ge.isOpen,qe,ke,Ye,at]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:nt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(ge),children:ae})}),Pe&&_jsx(HoverPopover,{PaperProps:{className:ye.popoverPaper},...bindPopover(ge),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:St,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[Ye&&_jsx(ResponseErrorPanel,{error:Ye}),at&&_jsx(Progress,{}),ke&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:ke.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:ke.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:ke.kind}),ke.metadata.description&&_jsx(Typography,{className:ye.descriptionTypography,paragraph:!0,children:ke.metadata.description}),_jsx(Typography,{children:(j=ke.spec)===null||j===void 0?void 0:j.type}),_jsxs(Box,{marginTop:"0.5em",children:[(ke.metadata.tags||[]).slice(0,Ce).map(rn=>_jsx(Chip,{size:"small",label:rn},rn)),((T=ke.metadata.tags)===null||T===void 0?void 0:T.length)&&((Z=ke.metadata.tags)===null||Z===void 0?void 0:Z.length)>Ce&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!Ye&&ke&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(ke)&&_jsx(UserCardActions,{entity:ke}),isGroupEntity(ke)&&_jsx(GroupCardActions,{entity:ke}),_jsx(EntityCardActions,{entity:ke})]})})]})})]})},Xe=(0,Qt.Z)(b=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),yt=()=>{var b;const j=Xe(),{filters:T,updateFilters:Z}=useEntityList();var ne;const[ae,ce]=useState((ne=(b=T.text)===null||b===void 0?void 0:b.value)!==null&&ne!==void 0?ne:"");return useDebounce(()=>{Z({text:ae.length?new EntityTextFilter(ae):void 0})},250,[ae,Z]),_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:ye=>ce(ye.target.value),value:ae,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>ce(""),edge:"end",disabled:ae.length===0,children:_jsx(Clear,{})})})})})})},Ge=Object.freeze({createEntityRefColumn(b){const{defaultKind:j}=b;function T(Z){var ne;return((ne=Z.metadata)===null||ne===void 0?void 0:ne.title)||q(Z,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(Z,ne){return T(ne).includes(Z)},customSort(Z,ne){return T(Z).localeCompare(T(ne))},render:Z=>{var ne;return(0,c.jsx)(Y,{entityRef:Z,defaultKind:j,title:(ne=Z.metadata)===null||ne===void 0?void 0:ne.title})}}},createEntityRelationColumn(b){const{title:j,relation:T,defaultKind:Z,filter:ne}=b;function ae(ye){return(0,me.hF)(ye,T,ne)}function ce(ye){return ae(ye).map(Ae=>q(Ae,{defaultKind:Z})).join(", ")}return{title:j,customFilterAndSearch(ye,Ae){return ce(Ae).includes(ye)},customSort(ye,Ae){return ce(ye).localeCompare(ce(Ae))},render:ye=>(0,c.jsx)(he,{entityRefs:ae(ye),defaultKind:Z})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:V.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:V.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:V.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:b=>(0,c.jsx)(L.Or,{text:b.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),lt=[Ge.createEntityRefColumn({defaultKind:"system"}),Ge.createDomainColumn(),Ge.createOwnerColumn(),Ge.createMetadataDescriptionColumn()],We=[Ge.createEntityRefColumn({defaultKind:"component"}),Ge.createSystemColumn(),Ge.createOwnerColumn(),Ge.createSpecTypeColumn(),Ge.createSpecLifecycleColumn(),Ge.createMetadataDescriptionColumn()],ut=(0,Qt.Z)(b=>({empty:{padding:b.spacing(2),display:"flex",justifyContent:"center"}})),it=b=>{const{entities:j,title:T,emptyContent:Z,variant:ne="gridItem",columns:ae}=b,ce=ut(),ye={minWidth:"0",width:"100%"};return ne==="gridItem"&&(ye.height="calc(100% - 10px)"),(0,c.jsx)(L.iA,{columns:ae,title:T,style:ye,emptyContent:Z&&(0,c.jsx)("div",{className:ce.empty,children:Z}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:j})};it.columns=Ge,it.systemEntityColumns=lt,it.componentEntityColumns=We;const zt=(0,c.jsx)(ln.Z,{fontSize:"small"}),Nt=(0,c.jsx)(Mt.Z,{fontSize:"small"});function Kt({selected:b}){return(0,c.jsx)(Tn.Z,{icon:zt,checkedIcon:Nt,checked:b})}const Vt=(0,B.memo)(b=>{const{selected:j,value:T,availableOptions:Z,showCounts:ne}=b,ae=ne?`${T} (${Z==null?void 0:Z[T]})`:T;return(0,c.jsx)(wn.Z,{control:(0,c.jsx)(Kt,{selected:j}),label:ae,onClick:ce=>ce.preventDefault()})});var Bt=n(72779),xt=n.n(Bt);const It=(0,Qt.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function Ot(b){const j=It();return(0,c.jsx)(yn.Z,{variant:"outlined",...b,className:xt()(j.input,b.className)})}function en(b){var j;const{label:T,name:Z,path:ne,showCounts:ae,Filter:ce,InputProps:ye}=b,{updateFilters:Ae,filters:ge,queryParameters:{[Z]:Pe}}=Qe(),Ne=(0,r.h_)(z),{value:nt}=(0,mt.default)(async()=>{var qt;const _t=ne,{facets:En}=await Ne.getEntityFacets({facets:[_t],filter:(qt=ge.kind)===null||qt===void 0?void 0:qt.getCatalogFilters()});return Object.fromEntries(En[_t].map(({value:Dn,count:xr})=>[Dn,xr]))},[ge.kind]),at=(0,B.useMemo)(()=>[Pe].flat().filter(Boolean),[Pe]);var Ye;const[ke,qe]=(0,B.useState)(at.length?at:(Ye=(j=ge[Z])===null||j===void 0?void 0:j.values)!==null&&Ye!==void 0?Ye:[]);(0,B.useEffect)(()=>{at.length&&qe(at)},[at]);const St=Object.keys(nt!=null?nt:{}),rn=ke.length&&St.length;(0,B.useEffect)(()=>{Ae({[Z]:rn?new ce(ke):void 0})},[Z,rn,ke,ce,Ae]);const Yt=ge[Z];return Yt&&typeof Yt=="object"&&!("values"in Yt)||!St.length?null:(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsxs)(O.Z,{variant:"button",component:"label",children:[T,(0,c.jsx)(on.ZP,{multiple:!0,disableCloseOnSelect:!0,options:St,value:ke,onChange:(qt,_t)=>qe(_t),renderOption:(qt,{selected:_t})=>(0,c.jsx)(Vt,{selected:_t,value:qt,availableOptions:nt,showCounts:!!ae}),size:"small",popupIcon:(0,c.jsx)(bn.Z,{"data-testid":`${String(Z)}-picker-expand`}),renderInput:qt=>(0,c.jsx)(Ot,{...qt,...ye})})]})})}const jn=(0,Qt.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),Rn=b=>{const j=jn();return(0,c.jsx)(en,{label:"Tags",name:"tags",path:"metadata.tags",Filter:H,showCounts:b.showCounts,InputProps:{className:j.input}})},Gn=b=>{const{hidden:j,initialFilter:T}=b,Z=(0,r.h_)(r.$v),{error:ne,availableTypes:ae,selectedTypes:ce,setSelectedTypes:ye}=Jt();if((0,B.useEffect)(()=>{ne&&Z.post({message:"Failed to load entity types",severity:"error"}),T&&ye([T])},[ne,Z,T,ye]),ae.length===0||ne)return null;const Ae=[{value:"all",label:"all"},...ae.map(Pe=>({value:Pe,label:Pe}))];var ge;return j?null:(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsx)(L.Ph,{label:"Type",items:Ae,selected:(ge=Ae.length>1?ce[0]:void 0)!==null&&ge!==void 0?ge:"all",onChange:Pe=>ye(Pe==="all"?[]:[String(Pe)])})})};var or=n(15459),fn=n(61837),Sn=n(11640),sr=n(28347);const S=(0,or.Z)({root:{color:"#f3ba37"}})(Sn.Z),u=b=>{const{toggleStarredEntity:j,isStarredEntity:T}=hn(b.entity);return(0,c.jsx)(fn.Z,{"aria-label":"favorite",color:"inherit",...b,onClick:()=>j(),children:(0,c.jsx)(ee.ZP,{title:T?"Remove from favorites":"Add to favorites",children:T?(0,c.jsx)(S,{}):(0,c.jsx)(sr.Z,{})})})};var y=n(8629),w=n(79249),Q=n(38724),Se=n(99152),be=n(6487),Ze=n(49429),Ke=n(55999),Ht=n(39412);const cn=Ht.Z;function Kn(b,j){if(b)return b.toLocaleLowerCase("en-US");if(j)try{return(0,V.of)(j).kind.toLocaleLowerCase("en-US")}catch{return}}function gr(b,j){const T=(0,r.qD)(),Z=Kn(b,j);return Z&&T.getSystemIcon(`kind:${Z}`)||cn}function mr(b){const{kind:j,entityRef:T,...Z}=b,ne=gr(j,T);return(0,c.jsx)(ne,{...Z})}const eo=(0,Qt.Z)(b=>({node:{fill:b.palette.grey[300],stroke:b.palette.grey[300],"&.primary":{fill:b.palette.primary.light,stroke:b.palette.primary.light},"&.secondary":{fill:b.palette.secondary.light,stroke:b.palette.secondary.light}},text:{fill:b.palette.getContrastText(b.palette.grey[300]),"&.primary":{fill:b.palette.primary.contrastText},"&.secondary":{fill:b.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function jo(b){const j=(0,r.h_)(z),T=(0,V.eE)(b),{loading:Z,error:ne,value:ae}=(0,mt.default)(async()=>{const ce=await j.getEntityAncestors({entityRef:T}),ye=new Array,Ae=new Array;for(const ge of ce.items){const Pe=(0,V.eE)(ge.entity),Ne=Pe===ce.rootEntityRef;ye.push({id:Pe,root:Ne,...ge.entity});for(const nt of ge.parentEntityRefs)Ae.push({from:Pe,to:nt})}return{nodes:ye,edges:Ae}},[T]);return{loading:Z,error:ne,nodes:(ae==null?void 0:ae.nodes)||[],edges:(ae==null?void 0:ae.edges)||[]}}function Eo({node:b}){const j=eo(),T=(0,$t.s0)(),Z=(0,r.tg)(Gt),[ne,ae]=(0,B.useState)(0),[ce,ye]=(0,B.useState)(0),Ae=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(Ae.current){let{height:qe,width:St}=Ae.current.getBBox();qe=Math.round(qe),St=Math.round(St),(qe!==ce||St!==ne)&&(ae(St),ye(qe))}},[ne,ce]);const ge=10,Pe=ce,Ne=Pe+ge,nt=Ne+ne+ge*2,at=ce+ge*2,Ye=b.metadata.title||(b.kind&&b.metadata.name&&b.metadata.namespace?q({kind:b.kind,name:b.metadata.name,namespace:b.metadata.namespace||""}):b.id),ke=()=>{T(Z({kind:b.kind,namespace:b.metadata.namespace||V.zG,name:b.metadata.name}))};return(0,c.jsxs)("g",{onClick:ke,className:j.clickable,children:[(0,c.jsx)("rect",{className:xt()(j.node,b.root?"secondary":"primary"),width:nt,height:at,rx:10}),(0,c.jsx)(mr,{kind:b.kind,y:ge,x:ge,width:Pe,height:Pe,className:xt()(j.text,b.root?"secondary":"primary")}),(0,c.jsx)("text",{ref:Ae,className:xt()(j.text,b.root?"secondary":"primary"),y:at/2,x:Ne+(ne+ge*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:Ye})]})}function to(b){const{loading:j,error:T,nodes:Z,edges:ne}=jo(b.entity);return j?(0,c.jsx)(L.Ex,{}):T?(0,c.jsx)(L.Gk,{error:T}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ke.Z,{variant:"h2",children:"Ancestry"}),(0,c.jsxs)(Ke.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,c.jsx)(L.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,c.jsx)(R.Z,{mt:4,children:(0,c.jsx)(L.mn,{nodes:Z,edges:ne,renderNode:Eo,direction:L.NX.Nm.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var Vn=n(11776),$n=n(38402),vr=n(86136),Ir=n(99688),Sr=n(49378),qo=n(54506),Ur=n(94339),_o=n(24579),Ao=n(27685);const Mr=(0,Qt.Z)(b=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:b.spacing(2)},helpIcon:{marginLeft:b.spacing(1),color:b.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function Xn(b){const j=Mr();return(0,c.jsx)(Sr.Z,{...b,primaryTypographyProps:{className:j.monospace},secondaryTypographyProps:{className:j.monospace}})}function Pr(b){const j=Mr();return(0,c.jsx)(qo.Z,{className:j.monospace,children:b.children})}function Lr(b){return(0,c.jsx)(R.Z,{mt:2,children:(0,c.jsx)(Ur.Z,{variant:"outlined",children:(0,c.jsxs)(_o.Z,{children:[(0,c.jsxs)(O.Z,{variant:"h6",gutterBottom:!0,children:[b.title,b.helpLink&&(0,c.jsx)(Or,{to:b.helpLink})]}),b.children]})})})}function no(b){if(b.match(/^url:https?:\/\//))return b.slice(4);if(b.match(/^https?:\/\//))return b}function qn(b){const[j,T]=b.entry,Z=no(T);return(0,c.jsxs)($n.Z,{children:[b.indent&&(0,c.jsx)(vr.Z,{}),(0,c.jsx)(Xn,{primary:j,secondary:Z?(0,c.jsx)(L.rU,{to:Z,children:T}):T})]})}function Or(b){const j=Mr();return(0,c.jsx)(L.rU,{to:b.to,className:j.helpIcon,children:(0,c.jsx)(Ao.Z,{fontSize:"inherit"})})}const To=(0,Qt.Z)({root:{display:"flex",flexDirection:"column"}});function Ro(b){var j,T;const Z=(0,r.h_)(z),ne=(0,V.eE)(b),ae=(j=b.metadata.annotations)===null||j===void 0?void 0:j[V.P1],ce=(T=b.metadata.annotations)===null||T===void 0?void 0:T[V.q1],{loading:ye,error:Ae,value:ge}=(0,mt.default)(async()=>!ae&&!ce?[]:(await Z.getEntities({filter:[...ae?[{[`metadata.annotations.${V.P1}`]:ae}]:[],...ce?[{[`metadata.annotations.${V.q1}`]:ce}]:[]]})).items,[ae,ce]);return{loading:ye,error:Ae,location:ae,originLocation:ce,colocatedEntities:ge==null?void 0:ge.filter(Pe=>(0,V.eE)(Pe)!==ne)}}function zr(b){return(0,c.jsxs)(Vn.Z,{dense:!0,children:[b.header&&(0,c.jsx)(qn,{entry:b.header},"header"),b.entities.map(j=>(0,c.jsxs)($n.Z,{children:[(0,c.jsx)(vr.Z,{children:(0,c.jsx)(mr,{kind:j.kind})}),(0,c.jsx)(Xn,{primary:(0,c.jsx)(Y,{entityRef:j})})]},(0,V.eE)(j)))]})}function es(b){const{entity:j}=b,{loading:T,error:Z,location:ne,originLocation:ae,colocatedEntities:ce}=Ro(j);if(T)return(0,c.jsx)(L.Ex,{});if(Z)return(0,c.jsx)(L.Gk,{error:Z});if(!ne&&!ae)return(0,c.jsx)(Ir.Z,{severity:"warning",children:"Entity had no location information."});if(!(ce!=null&&ce.length))return(0,c.jsx)(Ir.Z,{severity:"info",children:"There were no other entities on this location."});if(ne===ae)return(0,c.jsx)(zr,{entities:ce});const ye=ce.filter(ge=>{var Pe;return((Pe=ge.metadata.annotations)===null||Pe===void 0?void 0:Pe[V.P1])===ne}),Ae=ce.filter(ge=>{var Pe;return((Pe=ge.metadata.annotations)===null||Pe===void 0?void 0:Pe[V.q1])===ae});return(0,c.jsxs)(c.Fragment,{children:[ye.length>0&&(0,c.jsx)(zr,{entities:ye,header:["At the same location",ne]}),Ae.length>0&&(0,c.jsx)(zr,{entities:Ae,header:["At the same origin",ae]})]})}function Io(b){const j=To();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ke.Z,{variant:"h2",children:"Colocated"}),(0,c.jsx)(Ke.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,c.jsx)("div",{className:j.root,children:(0,c.jsx)(es,{entity:b.entity})})]})}function Wr(b){return Object.fromEntries([...Object.entries(b)].sort((j,T)=>j[0]<T[0]?-1:1))}function ts(b){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ke.Z,{variant:"h2",children:"Entity as JSON"}),(0,c.jsx)(Ke.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,c.jsx)(Ke.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(L.Oi,{text:JSON.stringify(Wr(b.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var yr=n(3440),Po=n.n(yr);const ro=(0,Qt.Z)({root:{display:"flex",flexDirection:"column"}});function Lo(b){var j,T;const Z=ro(),{apiVersion:ne,kind:ae,metadata:ce,spec:ye,relations:Ae=[],status:ge={}}=b.entity,Pe=Po()(Lt()(Ae,Ne=>Ne.targetRef),"type");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ke.Z,{variant:"h2",children:"Overview"}),(0,c.jsxs)("div",{className:Z.root,children:[(0,c.jsx)(Lr,{title:"Identity",children:(0,c.jsxs)(Vn.Z,{dense:!0,children:[(0,c.jsx)($n.Z,{children:(0,c.jsx)(Xn,{primary:"apiVersion",secondary:ne})}),(0,c.jsx)($n.Z,{children:(0,c.jsx)(Xn,{primary:"kind",secondary:ae})}),(ye==null?void 0:ye.type)&&(0,c.jsx)($n.Z,{children:(0,c.jsx)(Xn,{primary:"spec.type",secondary:ye.type})}),ce.uid&&(0,c.jsx)($n.Z,{children:(0,c.jsx)(Xn,{primary:"uid",secondary:ce.uid})}),ce.etag&&(0,c.jsx)($n.Z,{children:(0,c.jsx)(Xn,{primary:"etag",secondary:ce.etag})})]})}),(0,c.jsxs)(Lr,{title:"Metadata",children:[!!Object.keys(ce.annotations||{}).length&&(0,c.jsx)(Vn.Z,{dense:!0,subheader:(0,c.jsxs)(Pr,{children:["Annotations",(0,c.jsx)(Or,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(ce.annotations).map(Ne=>(0,c.jsx)(qn,{indent:!0,entry:Ne},Ne[0]))}),!!Object.keys(ce.labels||{}).length&&(0,c.jsx)(Vn.Z,{dense:!0,subheader:(0,c.jsx)(Pr,{children:"Labels"}),children:Object.entries(ce.labels).map(Ne=>(0,c.jsx)(qn,{indent:!0,entry:Ne},Ne[0]))}),!!(!((j=ce.tags)===null||j===void 0)&&j.length)&&(0,c.jsx)(Vn.Z,{dense:!0,subheader:(0,c.jsx)(Pr,{children:"Tags"}),children:ce.tags.map((Ne,nt)=>(0,c.jsxs)($n.Z,{children:[(0,c.jsx)(vr.Z,{}),(0,c.jsx)(Xn,{primary:Ne})]},`${Ne}-${nt}`))})]}),!!Ae.length&&(0,c.jsx)(Lr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(Pe).map(([Ne,nt],at)=>(0,c.jsx)("div",{children:(0,c.jsx)(Vn.Z,{dense:!0,subheader:(0,c.jsx)(Pr,{children:Ne}),children:nt.map(Ye=>(0,c.jsxs)($n.Z,{children:[(0,c.jsx)(vr.Z,{children:(0,c.jsx)(mr,{entityRef:Ye.targetRef})}),(0,c.jsx)(Xn,{primary:(0,c.jsx)(Y,{entityRef:Ye.targetRef})})]},Ye.targetRef))})},at))}),!!(!((T=ge.items)===null||T===void 0)&&T.length)&&(0,c.jsx)(Lr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:ge.items.map((Ne,nt)=>(0,c.jsxs)("div",{children:[(0,c.jsxs)(O.Z,{children:[Ne.level,": ",Ne.type]}),(0,c.jsx)(R.Z,{ml:2,children:Ne.message})]},nt))})]})]})}var Oo=n(72847);function Vr(b){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ke.Z,{variant:"h2",children:"Entity as YAML"}),(0,c.jsx)(Ke.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,c.jsx)(Ke.Z,{children:(0,c.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,c.jsx)(L.Oi,{text:Oo.ZP.stringify(Wr(b.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const oo=(0,Qt.Z)(b=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:b.palette.background.paper},tabs:{borderRight:`1px solid ${b.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Cr(b){const{children:j,value:T,index:Z,...ne}=b,ae=oo();return(0,c.jsx)("div",{role:"tabpanel",hidden:T!==Z,id:`vertical-tabpanel-${Z}`,"aria-labelledby":`vertical-tab-${Z}`,className:ae.tabContents,...ne,children:T===Z&&(0,c.jsx)(R.Z,{pl:3,pr:3,children:j})})}function cr(b){return{id:`vertical-tab-${b}`,"aria-controls":`vertical-tabpanel-${b}`}}function ko(b){const j=oo(),[T,Z]=B.useState(0);return(0,B.useEffect)(()=>{Z(0)},[b.open]),b.entity?(0,c.jsxs)(y.Z,{fullWidth:!0,maxWidth:"xl",open:b.open,onClose:b.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:j.fullHeightDialog},children:[(0,c.jsx)(w.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,c.jsx)(Q.Z,{dividers:!0,children:(0,c.jsxs)("div",{className:j.root,children:[(0,c.jsxs)(Se.Z,{orientation:"vertical",variant:"scrollable",value:T,onChange:(ne,ae)=>Z(ae),"aria-label":"Inspector options",className:j.tabs,children:[(0,c.jsx)(be.Z,{label:"Overview",...cr(0)}),(0,c.jsx)(be.Z,{label:"Ancestry",...cr(1)}),(0,c.jsx)(be.Z,{label:"Colocated",...cr(2)}),(0,c.jsx)(be.Z,{label:"Raw JSON",...cr(3)}),(0,c.jsx)(be.Z,{label:"Raw YAML",...cr(4)})]}),(0,c.jsx)(Cr,{value:T,index:0,children:(0,c.jsx)(Lo,{entity:b.entity})}),(0,c.jsx)(Cr,{value:T,index:1,children:(0,c.jsx)(to,{entity:b.entity})}),(0,c.jsx)(Cr,{value:T,index:2,children:(0,c.jsx)(Io,{entity:b.entity})}),(0,c.jsx)(Cr,{value:T,index:3,children:(0,c.jsx)(ts,{entity:b.entity})}),(0,c.jsx)(Cr,{value:T,index:4,children:(0,c.jsx)(Vr,{entity:b.entity})})]})}),(0,c.jsx)(Ze.Z,{children:(0,c.jsx)(G.Z,{onClick:b.onClose,color:"primary",children:"Close"})})]}):null}var Hr=n(85256);function tn(b){var j;const T=(0,r.h_)(z),Z=(j=b.metadata.annotations)===null||j===void 0?void 0:j[V.q1],ne=b.metadata.uid,ae=Z==="bootstrap:bootstrap",ce=(0,mt.default)(async()=>{const Ye=T.getLocationByRef(Z);let ke;if(!Z)ke=Promise.resolve([]);else{const qe=`metadata.annotations.${V.q1}`;ke=T.getEntities({filter:{[qe]:Z},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(St=>St.items)}return Promise.all([Ye,ke]).then(([qe,St])=>({location:qe,colocatedEntities:St}))},[T,b]),ye=(0,B.useCallback)(async function(){const{location:ke}=ce.value;await T.removeLocationById(ke.id)},[T,ce]),Ae=(0,B.useCallback)(async function(){await T.removeEntityByUid(ne)},[T,ne]);if(ae)return{type:"bootstrap",location:Z,deleteEntity:Ae};const{loading:ge,error:Pe,value:Ne}=ce;if(ge)return{type:"loading"};if(Pe)return{type:"error",error:Pe};const{location:nt,colocatedEntities:at}=Ne;return nt?{type:"unregister",location:Z,colocatedEntities:at.map(V.iB),unregisterLocation:ye,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var Bo=n(23054);const $o=(0,Qt.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),ns=({entity:b,onConfirm:j,onClose:T})=>{const Z=(0,r.h_)(r.$v),ne=(0,r.h_)(r.Ds),ae=$o(),ce=tn(b),[ye,Ae]=(0,B.useState)(!1),[ge,Pe]=(0,B.useState)(!1);var Ne;const nt=(Ne=ne.getOptionalString("app.title"))!==null&&Ne!==void 0?Ne:"Backstage",at=(0,B.useCallback)(async function(){if("unregisterLocation"in ce){Pe(!0);try{await ce.unregisterLocation(),j()}catch(St){(0,Bo.BD)(St),Z.post({message:St.message})}finally{Pe(!1)}}},[Z,j,ce]),Ye=(0,B.useCallback)(async function(){if("deleteEntity"in ce){Pe(!0);try{await ce.deleteEntity(),j()}catch(St){(0,Bo.BD)(St),Z.post({message:St.message})}finally{Pe(!1)}}},[Z,j,ce]),ke=()=>(0,c.jsx)(Ze.Z,{className:ae.dialogActions,children:(0,c.jsx)(G.Z,{onClick:T,color:"primary",children:"Cancel"})});return ce.type==="loading"?(0,c.jsx)(L.Ex,{}):ce.type==="error"?(0,c.jsx)(L.Gk,{error:ce.error}):ce.type==="bootstrap"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Ir.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',ce.location,'"). If you believe this is in error, please contact the ',nt," ","integrator."]}),(0,c.jsxs)(R.Z,{marginTop:2,children:[!ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(G.Z,{variant:"text",size:"small",color:"primary",className:ae.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,c.jsx)(ke,{})]}),ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ke.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,c.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:ge,onClick:Ye,children:"Delete Entity"}),(0,c.jsx)(ke,{})]})]})]}):ce.type==="only-delete"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ke.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,c.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:ge,onClick:Ye,children:"Delete Entity"}),(0,c.jsx)(ke,{})]}):ce.type==="unregister"?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ke.Z,{children:"This action will unregister the following entities:"}),(0,c.jsx)(Ke.Z,{component:"ul",children:ce.colocatedEntities.map(qe=>(0,c.jsx)("li",{children:(0,c.jsx)(Y,{entityRef:qe})},`${qe.kind}:${qe.namespace}/${qe.name}`))}),(0,c.jsx)(Ke.Z,{children:"Located at the following location:"}),(0,c.jsx)(Ke.Z,{component:"ul",children:(0,c.jsx)("li",{children:ce.location})}),(0,c.jsxs)(Ke.Z,{children:["To undo, just re-register the entity in ",nt,"."]}),(0,c.jsxs)(R.Z,{marginTop:2,children:[(0,c.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:ge,onClick:at,children:"Unregister Location"}),!ye&&(0,c.jsx)(R.Z,{component:"span",marginLeft:2,children:(0,c.jsx)(G.Z,{variant:"text",size:"small",color:"primary",className:ae.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),ye&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(R.Z,{paddingTop:4,paddingBottom:4,children:(0,c.jsx)(Hr.Z,{})}),(0,c.jsx)(Ke.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,c.jsx)(G.Z,{variant:"contained",color:"secondary",disabled:ge,onClick:Ye,children:"Delete Entity"})]})]}):(0,c.jsx)(Ir.Z,{severity:"error",children:"Internal error: Unknown state"})},rs=b=>{const{open:j,onConfirm:T,onClose:Z,entity:ne}=b;return(0,c.jsxs)(y.Z,{open:j,onClose:Z,children:[(0,c.jsx)(w.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,c.jsx)(Q.Z,{children:(0,c.jsx)(ns,{entity:ne,onConfirm:T,onClose:Z})})]})};var os=n(12231),ss=n(9520),is=n(47603);const ir=(0,Qt.Z)(b=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:b.spacing(1,0,1,0)},title:{margin:b.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:b.palette.text.primary},menuItem:{minHeight:b.spacing(6)},groupWrapper:{margin:b.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function kr(b){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:is.Z},{id:"starred",label:"Starred",icon:Sn.Z}]},{name:b!=null?b:"Company",items:[{id:"all",label:"All"}]}]}const as=b=>{const{initialFilter:j,availableFilters:T}=b,Z=ir(),ne=(0,r.h_)(r.Ds);var ae;const ce=(ae=ne.getOptionalString("organization.name"))!==null&&ae!==void 0?ae:"Company",{filters:ye,updateFilters:Ae,backendEntities:ge,queryParameters:{kind:Pe,user:Ne},loading:nt}=Qe(),at=["starred","all"],Ye=kr(ce).map(In=>({...In,items:In.items.filter(({id:Zn})=>["group","user"].some(Dr=>Dr===Pe)?at.includes(Zn):!T||T.includes(Zn))})).filter(({items:In})=>!!In.length),{isStarredEntity:ke}=zn(),{isOwnedEntity:qe,loading:St}=kn(),rn=nt||St,Yt=(0,B.useMemo)(()=>new ht("owned",qe,ke),[qe,ke]),qt=(0,B.useMemo)(()=>new ht("starred",qe,ke),[qe,ke]),_t=(0,B.useMemo)(()=>[Ne].flat()[0],[Ne]),[En,Dn]=(0,B.useState)(_t!=null?_t:j),xr=(0,B.useMemo)(()=>ge.filter((0,me.Gz)((0,pt.compact)(Object.values({...ye,user:void 0})))),[ye,ge]),$r=(0,B.useMemo)(()=>({all:xr.length,starred:xr.filter(In=>qt.filterEntity(In)).length,owned:xr.filter(In=>Yt.filterEntity(In)).length}),[xr,qt,Yt]);(0,B.useEffect)(()=>{_t&&Dn(_t)},[_t]),(0,B.useEffect)(()=>{!rn&&En&&En!=="all"&&$r[En]===0&&Dn("all")},[rn,$r,En,Dn]),(0,B.useEffect)(()=>{Ae({user:En?new ht(En,qe,ke):void 0})},[En,qe,ke,Ae]);var Gr;return(0,c.jsx)(Ur.Z,{className:Z.root,children:Ye.map(In=>(0,c.jsxs)(B.Fragment,{children:[(0,c.jsx)(O.Z,{variant:"subtitle2",component:"span",className:Z.title,children:In.name}),(0,c.jsx)(Ur.Z,{className:Z.groupWrapper,children:(0,c.jsx)(Vn.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":In.name,children:In.items.map(Zn=>{var Dr;return(0,c.jsxs)(os.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>Dn(Zn.id),selected:Zn.id===((Dr=ye.user)===null||Dr===void 0?void 0:Dr.value),className:Z.menuItem,disabled:$r[Zn.id]===0,"data-testid":`user-picker-${Zn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[Zn.icon&&(0,c.jsx)(vr.Z,{className:Z.listIcon,children:(0,c.jsx)(Zn.icon,{fontSize:"small"})}),(0,c.jsx)(Sr.Z,{children:(0,c.jsxs)(O.Z,{variant:"body1",children:[Zn.label," "]})}),(0,c.jsx)(ss.Z,{children:(Gr=$r[Zn.id])!==null&&Gr!==void 0?Gr:"-"})]},Zn.id)})})})]},In.name))})},Do=(0,Qt.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),so=(0,c.jsx)(ln.Z,{fontSize:"small"}),Br=(0,c.jsx)(Mt.Z,{fontSize:"small"}),ls=()=>{const b=Do(),{updateFilters:j}=Qe(),[T,Z]=(0,B.useState)([]);function ne(ye){j({orphan:ye?new Le(ye):void 0})}function ae(ye){j({error:ye?new bt(ye):void 0})}const ce=["Is Orphan","Has Error"];return(0,c.jsx)(R.Z,{pb:1,pt:1,children:(0,c.jsxs)(O.Z,{variant:"button",component:"label",children:["Processing Status",(0,c.jsx)(on.ZP,{multiple:!0,disableCloseOnSelect:!0,options:ce,value:T,onChange:(ye,Ae)=>{Z(Ae),ne(Ae.includes("Is Orphan")),ae(Ae.includes("Has Error"))},renderOption:(ye,{selected:Ae})=>(0,c.jsx)(wn.Z,{control:(0,c.jsx)(Tn.Z,{icon:so,checkedIcon:Br,checked:Ae}),onClick:ge=>ge.preventDefault(),label:ye}),size:"small",popupIcon:(0,c.jsx)(bn.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ye=>(0,c.jsx)(yn.Z,{...ye,className:b.input,variant:"outlined"})})]})})};function cs(b){const{children:j,value:T}=b;var Z;const[ne,ae]=useState((Z=T==null?void 0:T.filters)!==null&&Z!==void 0?Z:{}),ce=useCallback(Ye=>{ae(ke=>{const qe=typeof Ye=="function"?Ye(ke):Ye;return{...ke,...qe}})},[]),ye=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ae,ge,Pe,Ne,nt;const at=useMemo(()=>({entities:(Ae=T==null?void 0:T.entities)!==null&&Ae!==void 0?Ae:ye.entities,backendEntities:(ge=T==null?void 0:T.backendEntities)!==null&&ge!==void 0?ge:ye.backendEntities,updateFilters:(Pe=T==null?void 0:T.updateFilters)!==null&&Pe!==void 0?Pe:ce,filters:ne,loading:(Ne=T==null?void 0:T.loading)!==null&&Ne!==void 0?Ne:!1,queryParameters:(nt=T==null?void 0:T.queryParameters)!==null&&nt!==void 0?nt:ye.queryParameters,error:T==null?void 0:T.error}),[T,ye,ne,ce]);return _jsx(EntityListContext.Provider,{value:at,children:j})}},75435:function(wt,De,n){"use strict";n.d(De,{h:function(){return r}});var d=n(25271);function r(z,I,g){var v;let c=(z==null||(v=z.relations)===null||v===void 0?void 0:v.filter(B=>B.type===I).map(B=>(0,d.of)(B.targetRef)))||[];return g!=null&&g.kind&&(c=c.filter(B=>B.kind.toLocaleLowerCase("en-US")===g.kind.toLocaleLowerCase("en-US"))),c}},49280:function(wt,De,n){"use strict";n.d(De,{hF:function(){return z.h},CV:function(){return g},wq:function(){return d},Gz:function(){return r}});function d(c){return c.reduce((B,Ie)=>({...B,...Ie.getCatalogFilters?Ie.getCatalogFilters():{}}),{})}function r(c){return B=>c.every(Ie=>!Ie.filterEntity||Ie.filterEntity(B))}var z=n(75435),I=n(25271);function g(c,B){var Ie;const fe=(Ie=c.metadata.annotations)===null||Ie===void 0?void 0:Ie[I.M6];if(fe)try{const G=(0,I.Ou)(fe),$=B.byUrl(G.target);return{locationTargetUrl:G.target,integrationType:$==null?void 0:$.type}}catch{return}}function v(c,B){const Ie=new Set([...getEntityRelations(c,RELATION_MEMBER_OF,{kind:"group"}),...c?[getCompoundEntityRef(c)]:[]].map(stringifyEntityRef)),fe=getEntityRelations(B,RELATION_OWNED_BY).map(stringifyEntityRef);for(const G of fe)if(Ie.has(G))return!0;return!1}},33414:function(wt,De,n){"use strict";n.r(De),n.d(De,{AboutCard:function(){return vt},AboutContent:function(){return H},AboutField:function(){return V}});var d=n(52322),r=n(25271),z=n(47223),I=n(60871),g=n(32838),v=n(40303),c=n(79692),B=n(94339),Ie=n(32552),fe=n(61837),G=n(85256),$=n(24579),R=n(52866),O=n(30254),re=n(27604),X=n(2784),te=n(19625),D=n(60905),A=n(7089),L=n(90436);const P=(0,c.Z)(Je=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:Je.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function V(Je){const{label:ht,value:Le,gridSizes:bt,children:Tt}=Je,pt=P(),gt=(0,I.vJ)(Tt,$t=>$t.getElements()),jt=gt.length>0?gt:(0,d.jsx)(L.Z,{variant:"body2",className:pt.value,children:Le||"unknown"});return(0,d.jsxs)(D.Z,{item:!0,...bt,children:[(0,d.jsx)(L.Z,{variant:"h2",className:pt.label,children:ht}),jt]})}var me=n(24851);const ze=(0,c.Z)({description:{wordBreak:"break-word"}});function rt(Je,ht,Le){if(ht==="url"||Je.includes("://"))return Je;const bt=Le.type==="file"?`file://${Le.target}`:Le.target;return ht==="file"||Le.type==="file"?new URL(Je,bt).href:bt}function H(Je){var ht,Le,bt,Tt,pt,gt,jt,$t;const{entity:He}=Je,Xt=ze(),ue=He.kind.toLocaleLowerCase("en-US")==="system",xe=He.kind.toLocaleLowerCase("en-US")==="resource",Fe=He.kind.toLocaleLowerCase("en-US")==="component",Qe=He.kind.toLocaleLowerCase("en-US")==="api",mt=He.kind.toLocaleLowerCase("en-US")==="template",Rt=He.kind.toLocaleLowerCase("en-US")==="location",ct=He.kind.toLocaleLowerCase("en-US")==="group",Et=(0,v.hF)(He,r.cz,{kind:"system"}),Lt=(0,v.hF)(He,r.cz,{kind:"component"}),Jt=(0,v.hF)(He,r.cz,{kind:"domain"}),Pt=(0,v.hF)(He,r.S4);let an;try{an=(0,r.CV)(He)}catch{an=void 0}return(0,d.jsxs)(D.Z,{container:!0,children:[(0,d.jsx)(V,{label:"Description",gridSizes:{xs:12},children:(0,d.jsx)(z.SA,{className:Xt.description,content:(He==null||(ht=He.metadata)===null||ht===void 0?void 0:ht.description)||"No description"})}),(0,d.jsx)(V,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Pt.length>0&&(0,d.jsx)(v.rI,{entityRefs:Pt,defaultKind:"group"})}),(ue||Jt.length>0)&&(0,d.jsx)(V,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:Jt.length>0&&(0,d.jsx)(v.rI,{entityRefs:Jt,defaultKind:"domain"})}),(Qe||Fe||xe||Et.length>0)&&(0,d.jsx)(V,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:Et.length>0&&(0,d.jsx)(v.rI,{entityRefs:Et,defaultKind:"system"})}),Fe&&Lt.length>0&&(0,d.jsx)(V,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,d.jsx)(v.rI,{entityRefs:Lt,defaultKind:"component"})}),(Qe||Fe||xe||mt||ct||Rt||typeof(He==null||(Le=He.spec)===null||Le===void 0?void 0:Le.type)=="string")&&(0,d.jsx)(V,{label:"Type",value:He==null||(bt=He.spec)===null||bt===void 0?void 0:bt.type,gridSizes:{xs:12,sm:6,lg:4}}),(Qe||Fe||typeof(He==null||(Tt=He.spec)===null||Tt===void 0?void 0:Tt.lifecycle)=="string")&&(0,d.jsx)(V,{label:"Lifecycle",value:He==null||(pt=He.spec)===null||pt===void 0?void 0:pt.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,d.jsx)(V,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((He==null||(gt=He.metadata)===null||gt===void 0?void 0:gt.tags)||[]).map(Wt=>(0,d.jsx)(A.Z,{size:"small",label:Wt},Wt))}),Rt&&((He==null||(jt=He.spec)===null||jt===void 0?void 0:jt.targets)||(He==null||($t=He.spec)===null||$t===void 0?void 0:$t.target))&&(0,d.jsx)(V,{label:"Targets",gridSizes:{xs:12},children:(0,d.jsx)(me.s,{cols:1,items:(He.spec.targets||[He.spec.target]).map(Wt=>Wt).map(Wt=>{var sn;return{text:Wt,href:rt(Wt,(He==null||(sn=He.spec)===null||sn===void 0?void 0:sn.type)||"unknown",an)}})})})]})}const ot=(0,c.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 vt(Je){var ht,Le,bt;const{variant:Tt}=Je,pt=ot(),{entity:gt}=(0,v.X2)(),jt=(0,I.h_)(g.q3),$t=(0,I.h_)(v.Ah),He=(0,I.h_)(I.$v),Xt=(0,I.h_)(I.VE),ue=(0,I.tg)(te.jU),xe=(0,v.CV)(gt,jt),Fe=(ht=gt.metadata.annotations)===null||ht===void 0?void 0:ht[r.Tf],Qe={label:"View Source",disabled:!xe,icon:(0,d.jsx)(g.nW,{type:xe==null?void 0:xe.integrationType}),href:xe==null?void 0:xe.locationTargetUrl},mt={label:"View TechDocs",disabled:!(!((Le=gt.metadata.annotations)===null||Le===void 0)&&Le["backstage.io/techdocs-ref"])||!ue,icon:(0,d.jsx)(O.Z,{}),href:ue&&ue({namespace:gt.metadata.namespace||r.zG,kind:gt.kind,name:gt.metadata.name})};let Rt="";Tt==="gridItem"?Rt=pt.gridItemCard:Tt==="fullHeight"&&(Rt=pt.fullHeightCard);let ct="";Tt==="gridItem"?ct=pt.gridItemCardContent:Tt==="fullHeight"&&(ct=pt.fullHeightCardContent);const Et=(bt=gt.metadata.annotations)===null||bt===void 0?void 0:bt[r.P1],Lt=(Et==null?void 0:Et.startsWith("url:"))||(Et==null?void 0:Et.startsWith("file:")),Jt=(0,X.useCallback)(async()=>{try{await $t.refreshEntity((0,r.eE)(gt)),He.post({message:"Refresh scheduled",severity:"info"})}catch(Pt){Xt.post(Pt)}},[$t,He,Xt,gt]);return(0,d.jsxs)(B.Z,{className:Rt,children:[(0,d.jsx)(Ie.Z,{title:"About",action:(0,d.jsxs)(d.Fragment,{children:[Lt&&(0,d.jsx)(fe.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Jt,children:(0,d.jsx)(R.Z,{})}),(0,d.jsx)(fe.Z,{component:z.rU,"aria-label":"Edit",disabled:!Fe,title:"Edit Metadata",to:Fe!=null?Fe:"#",children:(0,d.jsx)(re.Z,{})})]}),subheader:(0,d.jsx)(z.M6,{links:[Qe,mt]})}),(0,d.jsx)(G.Z,{}),(0,d.jsx)($.Z,{className:ct,children:(0,d.jsx)(H,{entity:gt})})]})}},86359:function(wt,De,n){"use strict";n.d(De,{E:function(){return te}});var d=n(52322),r=n(25271),z=n(47223),I=n(40303),g=n(90436),v=n(15459),c=n(27604),B=n(2997),Ie=n(11640),fe=n(28347),G=n(76635),$=n(2784),R=n(7089);const O=Object.freeze({createNameColumn(D){function A(L){var P;return((P=L.metadata)===null||P===void 0?void 0:P.title)||(0,I.$3)(L,{defaultKind:D==null?void 0:D.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:L},{entity:P}){return A(L).localeCompare(A(P))},render:({entity:L})=>{var P;return(0,d.jsx)(I.dx,{entityRef:L,defaultKind:(D==null?void 0:D.defaultKind)||"Component",title:(P=L.metadata)===null||P===void 0?void 0:P.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:D})=>(0,d.jsx)(I.rI,{entityRefs:D.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:D})=>(0,d.jsx)(I.rI,{entityRefs:D.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:D})=>{var A,L;return(0,d.jsx)(d.Fragment,{children:((D==null||(A=D.spec)===null||A===void 0?void 0:A.targets)||(D==null||(L=D.spec)===null||L===void 0?void 0:L.target))&&(0,d.jsx)(z.Or,{text:(D.spec.targets||[D.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:D})=>(0,d.jsx)(z.Or,{text:D.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:D})=>(0,d.jsx)(d.Fragment,{children:D.metadata.tags&&D.metadata.tags.map(A=>(0,d.jsx)(R.Z,{label:A,size:"small",variant:"outlined",style:{marginBottom:"0px"}},A))}),width:"auto"}},createTitleColumn(D){return{title:"Title",field:"entity.metadata.title",hidden:D==null?void 0:D.hidden,searchable:!0}},createLabelColumn(D,A){return{title:(A==null?void 0:A.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:L})=>{var P;const V=(P=L.metadata)===null||P===void 0?void 0:P.labels,me=V&&V[D]||(A==null?void 0:A.defaultValue);return(0,d.jsx)(d.Fragment,{children:me&&(0,d.jsx)(R.Z,{label:me,size:"small",variant:"outlined"},me)})},width:"auto"}}}),re=(0,v.Z)({root:{color:"#f3ba37"}})(Ie.Z),X=(D,A)=>{const L=P=>P.metadata.title||(0,I.$3)(P,{defaultKind:"Component"});return L(D).localeCompare(L(A))},te=D=>{var A,L;const{columns:P,actions:V,tableOptions:me,subtitle:ze,emptyContent:rt}=D,{isStarredEntity:H,toggleStarredEntity:ot}=(0,I.CR)(),{loading:vt,error:Je,entities:ht,filters:Le}=(0,I.wp)(),bt=(0,$.useMemo)(()=>{var ue;return[O.createTitleColumn({hidden:!0}),O.createNameColumn({defaultKind:(ue=Le.kind)===null||ue===void 0?void 0:ue.value}),...xe(),O.createMetadataDescriptionColumn(),O.createTagsColumn()];function xe(){var Fe;switch((Fe=Le.kind)===null||Fe===void 0?void 0:Fe.value){case"user":return[];case"domain":case"system":return[O.createOwnerColumn()];case"group":case"template":return[O.createSpecTypeColumn()];case"location":return[O.createSpecTypeColumn(),O.createSpecTargetsColumn()];default:return[O.createSystemColumn(),O.createOwnerColumn(),O.createSpecTypeColumn(),O.createSpecLifecycleColumn()]}}},[(A=Le.kind)===null||A===void 0?void 0:A.value]),Tt=Le.type===void 0;var pt;const gt=(0,G.capitalize)((pt=(L=Le.user)===null||L===void 0?void 0:L.value)!==null&&pt!==void 0?pt:"all");if(Je)return(0,d.jsx)("div",{children:(0,d.jsx)(z.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,d.jsx)(z.Oi,{language:"text",text:Je.toString()})})});const jt=[({entity:ue})=>{var xe;const Fe=(xe=ue.metadata.annotations)===null||xe===void 0?void 0:xe[r.l2],Qe="View";return{icon:()=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.Z,{variant:"srOnly",children:Qe}),(0,d.jsx)(B.Z,{fontSize:"small"})]}),tooltip:Qe,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ue})=>{var xe;const Fe=(xe=ue.metadata.annotations)===null||xe===void 0?void 0:xe[r.Tf],Qe="Edit";return{icon:()=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.Z,{variant:"srOnly",children:Qe}),(0,d.jsx)(c.Z,{fontSize:"small"})]}),tooltip:Qe,disabled:!Fe,onClick:()=>{Fe&&window.open(Fe,"_blank")}}},({entity:ue})=>{const xe=H(ue),Fe=xe?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.Z,{variant:"srOnly",children:Fe}),xe?(0,d.jsx)(re,{}):(0,d.jsx)(fe.Z,{})]}),tooltip:Fe,onClick:()=>ot(ue)}}],$t=ht.sort(X).map(ue=>{const xe=(0,I.hF)(ue,r.cz,{kind:"system"}),Fe=(0,I.hF)(ue,r.S4);return{entity:ue,resolved:{name:(0,I.$3)(ue,{defaultKind:"Component"}),ownedByRelationsTitle:Fe.map(Qe=>(0,I.$3)(Qe,{defaultKind:"group"})).join(", "),ownedByRelations:Fe,partOfSystemRelationTitle:xe.map(Qe=>(0,I.$3)(Qe,{defaultKind:"system"})).join(", "),partOfSystemRelations:xe}}}),He=(P||bt).find(ue=>ue.title==="Type");He&&(He.hidden=!Tt);const Xt=$t.length>20;return(0,d.jsx)(z.iA,{isLoading:vt,columns:P||bt,options:{paging:Xt,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!vt,padding:"dense",pageSizeOptions:[20,50,100],...me},title:`${gt} (${ht.length})`,data:$t,actions:V||jt,subtitle:ze,emptyContent:rt})};te.columns=O},85877:function(wt,De,n){"use strict";n.r(De),n.d(De,{EntityLabelsCard:function(){return $},hasLabels:function(){return R}});var d=n(52322),r=n(40303),z=n(2784),I=n(47223),g=n(79692),v=n(90436),c=n(77277);const B=`metadata:
|
|
34
|
-
name: example
|
|
35
|
-
labels:
|
|
36
|
-
javaVersion: 1.2.3`,Ie=(0,g.Z)(O=>({code:{borderRadius:6,margin:`${O.spacing(2)}px 0px`,background:O.palette.type==="dark"?"#444":O.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function fe(){const O=Ie();return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(v.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,d.jsx)("div",{className:O.code,children:(0,d.jsx)(I.Oi,{text:B,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,d.jsx)(c.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:"Read more"})]})}const G=(0,g.Z)(O=>({key:{fontWeight:"bold"}})),$=O=>{var re;const{variant:X,title:te}=O,{entity:D}=(0,r.X2)(),A=G(),L=[{render:V=>(0,d.jsx)(v.Z,{className:A.key,variant:"body2",children:V.key})},{field:"value"}],P=D==null||(re=D.metadata)===null||re===void 0?void 0:re.labels;return(0,d.jsx)(I.rJ,{title:te||"Labels",variant:X,children:!P||Object.keys(P).length===0?(0,d.jsx)(fe,{}):(0,d.jsx)(I.iA,{columns:L,data:Object.keys(P).map(V=>({key:V,value:P[V]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(P).length>5}})})};function R(O){var re,X;return!(O==null||(re=O.metadata)===null||re===void 0)&&re.labels?Object.keys(O==null||(X=O.metadata)===null||X===void 0?void 0:X.labels).some(Boolean):!1}},24851:function(wt,De,n){"use strict";n.d(De,{s:function(){return re}});var d=n(52322),r=n(90348),z=n(11861),I=n(2784),g=n(79692),v=n(95544),c=n(90436),B=n(52160),Ie=n(47223);const fe=(0,g.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function G(X){const{href:te,text:D,Icon:A}=X,L=fe();return(0,d.jsxs)(v.Z,{display:"flex",children:[(0,d.jsx)(v.Z,{mr:1,className:L.svgIcon,children:(0,d.jsx)(c.Z,{component:"div",children:A?(0,d.jsx)(A,{}):(0,d.jsx)(B.Z,{})})}),(0,d.jsx)(v.Z,{flexGrow:"1",children:(0,d.jsx)(Ie.rU,{to:te,target:"_blank",rel:"noopener",children:D||te})})]})}var $=n(41156);const R={xs:1,sm:1,md:1,lg:2,xl:3};function O(X){const te=[(0,$.Z)(P=>P.breakpoints.up("xl"))?"xl":null,(0,$.Z)(P=>P.breakpoints.up("lg"))?"lg":null,(0,$.Z)(P=>P.breakpoints.up("md"))?"md":null,(0,$.Z)(P=>P.breakpoints.up("sm"))?"sm":null,(0,$.Z)(P=>P.breakpoints.up("xs"))?"xs":null];let D=1;if(typeof X=="number")D=X;else{var A;const P=(A=te.find(V=>V!==null))!==null&&A!==void 0?A:"xs";var L;D=(L=X==null?void 0:X[P])!==null&&L!==void 0?L:R[P]}return D}function re(X){const{items:te,cols:D=void 0}=X,A=O(D);return(0,d.jsx)(r.Z,{rowHeight:"auto",cols:A,children:te.map(({text:L,href:P,Icon:V},me)=>(0,d.jsx)(z.Z,{children:(0,d.jsx)(G,{href:P,text:L!=null?L:P,Icon:V})},me))})}},19625:function(wt,De,n){"use strict";n.d(De,{_Z:function(){return I},jU:function(){return z},yw:function(){return r}});var d=n(60871);const r=(0,d.x8)({id:"create-component",optional:!0}),z=(0,d.x8)({id:"view-techdoc",optional:!0,params:["namespace","kind","name"]}),I=(0,d.NT)({id:"catalog"})},15096:function(wt,De,n){"use strict";n.d(De,{FA:function(){return Ie},qO:function(){return pt},Nd:function(){return H},E5:function(){return kt},Rx:function(){return P}});var d=n(60871);const r=(0,d.T0)({id:"plugin.search.queryservice"});class z{query(){return Promise.resolve(this.mockedResults||{results:[]})}constructor(Y){_define_property(this,"mockedResults",void 0),this.mockedResults=Y}}var I=n(52322),g=n(2784),v=n(38402),c=n(79692);const B=(0,c.Z)(()=>({highlight:{}}),{name:"BackstageHighlightedSearchResultText"}),Ie=ee=>{const{text:Y,preTag:oe,postTag:he}=ee,ie=B(),m=(0,g.useMemo)(()=>Y.split(new RegExp(`(${oe}.+?${he})`)),[he,oe,Y]);return(0,I.jsx)(I.Fragment,{children:m.map((N,_)=>N.includes(oe)?(0,I.jsx)("mark",{className:ie.highlight,children:N.replace(new RegExp(`${oe}|${he}`,"g"),"")},_):N)})};var fe=n(48760),G=n(50581),$=n(61837),R=n(74603),O=n(21853),re=n(33375),X=n(76635),te=n(64279),D=n(1849),A=n(51837);const L=(0,A.CT)("search-context"),P=()=>{const ee=(0,g.useContext)(L);if(!ee)throw new Error("useSearch must be used within a SearchContextProvider");const Y=ee.atVersion(1);if(!Y)throw new Error("No SearchContext v1 found");return Y},V=()=>(0,g.useContext)(L)!==void 0,me={term:"",types:[],filters:{},pageLimit:void 0,pageCursor:void 0},ze=(ee=me)=>{var Y,oe,he,ie;const m=(0,d.h_)(r),[N,_]=(0,g.useState)(ee.term),[J,Ce]=(0,g.useState)(ee.types),[Re,Xe]=(0,g.useState)(ee.filters),[yt,Ge]=(0,g.useState)(ee.pageLimit),[lt,We]=(0,g.useState)(ee.pageCursor),ut=(0,D.Z)(N),it=(0,D.Z)(Re),zt=(0,te.default)(()=>m.query({term:N,types:J,filters:Re,pageLimit:yt,pageCursor:lt}),[N,J,Re,yt,lt]),Nt=!zt.loading&&!zt.error&&((Y=zt.value)===null||Y===void 0?void 0:Y.nextPageCursor),Kt=!zt.loading&&!zt.error&&((oe=zt.value)===null||oe===void 0?void 0:oe.previousPageCursor),Vt=(0,g.useCallback)(()=>{var It;We((It=zt.value)===null||It===void 0?void 0:It.nextPageCursor)},[(he=zt.value)===null||he===void 0?void 0:he.nextPageCursor]),Bt=(0,g.useCallback)(()=>{var It;We((It=zt.value)===null||It===void 0?void 0:It.previousPageCursor)},[(ie=zt.value)===null||ie===void 0?void 0:ie.previousPageCursor]);return(0,g.useEffect)(()=>{ut!==void 0&&N!==ut&&We(void 0)},[N,ut,We]),(0,g.useEffect)(()=>{it!==void 0&&!(0,X.isEqual)(Re,it)&&We(void 0)},[Re,it,We]),{result:zt,term:N,setTerm:_,types:J,setTypes:Ce,filters:Re,setFilters:Xe,pageLimit:yt,setPageLimit:Ge,pageCursor:lt,setPageCursor:We,fetchNextPage:Nt?Vt:void 0,fetchPreviousPage:Kt?Bt:void 0}},rt=ee=>{const{initialState:Y,children:oe}=ee,he=ze(Y);return(0,I.jsx)(d.fC,{attributes:{searchTypes:he.types.sort().join(",")},children:(0,I.jsx)(L.Provider,{value:(0,A.EI)({1:he}),children:oe})})},H=ee=>{const{initialState:Y,inheritParentContextIfAvailable:oe,children:he}=ee;return V()&&oe?(0,I.jsx)(I.Fragment,{children:he}):(0,I.jsx)(rt,{initialState:Y,children:he})},ot=({children:ee})=>{var Y;const oe=Re=>(0,D.Z)(Re)!==Re,he=(0,d.z$)(),{term:ie,result:m}=P();var N;const _=(N=(Y=m.value)===null||Y===void 0?void 0:Y.numberOfResults)!==null&&N!==void 0?N:void 0,Ce=oe(m.loading)&&!m.loading;return(0,g.useEffect)(()=>{ie&&Ce&&he.captureEvent("search",ie,{value:_})},[he,ie,_,Ce]),(0,I.jsx)(I.Fragment,{children:ee})};function vt(ee){return(0,g.forwardRef)((Y,oe)=>(0,I.jsx)(H,{inheritParentContextIfAvailable:!0,children:(0,I.jsx)(ee,{...Y,ref:oe})}))}const Je=vt((0,g.forwardRef)((ee,Y)=>{const{onChange:oe,onKeyDown:he=()=>{},onClear:ie=()=>{},onSubmit:m=()=>{},debounceTime:N=200,clearButton:_=!0,fullWidth:J=!0,value:Ce,placeholder:Re,inputProps:Xe={},endAdornment:yt,...Ge}=ee,lt=(0,d.h_)(d.Ds),[We,ut]=(0,g.useState)("");(0,g.useEffect)(()=>{ut(xt=>xt!==Ce?String(Ce):xt)},[Ce]),(0,fe.Z)(()=>oe(We),N,[We]);const it=(0,g.useCallback)(xt=>{ut(xt.target.value)},[ut]),zt=(0,g.useCallback)(xt=>{he&&he(xt),m&&xt.key==="Enter"&&m()},[he,m]),Nt=(0,g.useCallback)(()=>{oe(""),ie&&ie()},[oe,ie]),Kt=Re!=null?Re:`Search in ${lt.getOptionalString("app.title")||"Backstage"}`,Vt=(0,I.jsx)(G.Z,{position:"start",children:(0,I.jsx)($.Z,{"aria-label":"Query",size:"small",disabled:!0,children:(0,I.jsx)(O.Z,{})})}),Bt=(0,I.jsx)(G.Z,{position:"end",children:(0,I.jsx)($.Z,{"aria-label":"Clear",size:"small",onClick:Nt,children:(0,I.jsx)(re.Z,{})})});return(0,I.jsx)(ot,{children:(0,I.jsx)(R.Z,{"data-testid":"search-bar-next",ref:Y,value:We,placeholder:Kt,startAdornment:Vt,endAdornment:_?Bt:yt,inputProps:{"aria-label":"Search",...Xe},fullWidth:J,onChange:it,onKeyDown:zt,...Ge})})})),ht=vt((0,g.forwardRef)((ee,Y)=>{const{value:oe="",onChange:he,...ie}=ee,{term:m,setTerm:N}=P();(0,g.useEffect)(()=>{oe&&N(String(oe))},[oe,N]);const _=(0,g.useCallback)(J=>{he?he(J):N(J)},[he,N]);return(0,I.jsx)(d.fC,{attributes:{pluginId:"search",extension:"SearchBar"},children:(0,I.jsx)(Je,{...ie,ref:Y,value:m,onChange:_})})}));var Le=n(4614),bt=n(88013);const pt=(ee=>Y=>(0,I.jsx)(H,{inheritParentContextIfAvailable:!0,children:(0,I.jsx)(ee,{...Y})}))(function(Y){const{loading:oe,value:he,onChange:ie=()=>{},options:m=[],getOptionLabel:N=Nt=>String(Nt),inputPlaceholder:_,inputDebounceTime:J,freeSolo:Ce=!0,fullWidth:Re=!0,clearOnBlur:Xe=!1,"data-testid":yt="search-autocomplete",...Ge}=Y,{setTerm:lt}=P(),We=(0,g.useCallback)(Nt=>Nt?typeof Nt=="string"?Nt:N(Nt):"",[N]),ut=(0,g.useMemo)(()=>We(he),[he,We]),it=(0,g.useCallback)((Nt,Kt,Vt,Bt)=>{lt(We(Kt)),ie(Nt,Kt,Vt,Bt)},[We,lt,ie]),zt=(0,g.useCallback)(({InputProps:{ref:Nt,endAdornment:Kt},InputLabelProps:Vt,...Bt})=>(0,I.jsx)(ht,{...Bt,ref:Nt,clearButton:!1,value:ut,placeholder:_,debounceTime:J,endAdornment:oe?(0,I.jsx)(Le.Z,{"data-testid":"search-autocomplete-progressbar",color:"inherit",size:20}):Kt}),[oe,ut,_,J]);return(0,I.jsx)(bt.ZP,{...Ge,"data-testid":yt,value:he,onChange:it,options:m,getOptionLabel:N,renderInput:zt,freeSolo:Ce,fullWidth:Re,clearOnBlur:Xe})}),gt=ee=>{const{icon:Y,primaryText:oe,primaryTextTypographyProps:he,secondaryText:ie,secondaryTextTypographyProps:m,disableTextTypography:N}=ee;return _jsxs(_Fragment,{children:[Y?_jsx(ListItemIcon,{children:Y}):null,_jsx(ListItemText,{primary:oe,primaryTypographyProps:he,secondary:ie,secondaryTypographyProps:m,disableTypography:N})]})};var jt=n(42494),$t=n(84899),He=n(5806),Xt=n(21324),ue=n(56939),xe=n(73698),Fe=n(12231),Qe=n(86619),mt=n(7089),Rt=n(69294);const ct=(ee,Y,oe=[],he=250)=>{const ie=(0,g.useRef)({}),m=ee||(()=>Promise.resolve([])),[N,_]=(0,Rt.default)(m,[Y],{loading:!0});if((0,fe.Z)(()=>{ie.current[Y]===void 0&&(ie.current[Y]=_(Y).then(Ce=>(ie.current[Y]=Ce,Ce)))},he,[_,Y]),oe.length)return{loading:!1,value:oe};const J=ie.current[Y];return Array.isArray(J)?{loading:!1,value:J}:N},Et=(ee,Y)=>{const{setFilters:oe}=P();(0,g.useEffect)(()=>{Y&&[Y].flat().length>0&&oe(he=>({...he,[ee]:Y}))},[])},Lt=ee=>{const{className:Y,defaultValue:oe,name:he,values:ie,valuesDebounceMs:m,label:N,filterSelectedOptions:_,limitTags:J,multiple:Ce}=ee,[Re,Xe]=(0,g.useState)("");Et(he,oe);const yt=typeof ie=="function"?ie:void 0,Ge=typeof ie=="function"?void 0:ie,{value:lt,loading:We}=ct(yt,Re,Ge,m),{filters:ut,setFilters:it}=P(),zt=ut[he]||(Ce?[]:null),Nt=(Bt,xt)=>{it(It=>{const{[he]:Ot,...en}=It;return xt?{...en,[he]:xt}:{...en}})},Kt=Bt=>(0,I.jsx)(Qe.Z,{...Bt,name:"search",variant:"outlined",label:N,fullWidth:!0}),Vt=(Bt,xt)=>Bt.map((It,Ot)=>(0,I.jsx)(mt.Z,{label:It,color:"primary",...xt({index:Ot})}));return(0,I.jsx)(bt.ZP,{filterSelectedOptions:_,limitTags:J,multiple:Ce,className:Y,id:`${Ce?"multi-":""}select-filter-${he}--select`,options:lt||[],loading:We,value:zt,onChange:Nt,onInputChange:(Bt,xt)=>Xe(xt),renderInput:Kt,renderTags:Vt})},Jt=(0,c.Z)({label:{textTransform:"capitalize"}}),Pt=ee=>{const{className:Y,defaultValue:oe,label:he,name:ie,values:m=[],valuesDebounceMs:N}=ee,_=Jt(),{filters:J,setFilters:Ce}=P();Et(ie,oe);const Re=typeof m=="function"?m:void 0,Xe=typeof m=="function"?void 0:m,{value:yt=[],loading:Ge}=ct(Re,"",Xe,N),lt=ut=>{const{target:{value:it,checked:zt}}=ut;Ce(Nt=>{const{[ie]:Kt,...Vt}=Nt,Bt=(Kt||[]).filter(It=>It!==it),xt=zt?[...Bt,it]:Bt;return xt.length?{...Vt,[ie]:xt}:Vt})};var We;return(0,I.jsxs)(jt.Z,{className:Y,disabled:Ge,fullWidth:!0,"data-testid":"search-checkboxfilter-next",children:[he?(0,I.jsx)($t.Z,{className:_.label,children:he}):null,yt.map(ut=>(0,I.jsx)(He.Z,{control:(0,I.jsx)(Xt.Z,{color:"primary",tabIndex:-1,inputProps:{"aria-labelledby":ut},value:ut,name:ut,onChange:lt,checked:((We=J[ie])!==null&&We!==void 0?We:[]).includes(ut)}),label:ut},ut))]})},an=ee=>{const{className:Y,defaultValue:oe,label:he,name:ie,values:m,valuesDebounceMs:N}=ee,_=Jt();Et(ie,oe);const J=typeof m=="function"?m:void 0,Ce=typeof m=="function"?void 0:m,{value:Re=[],loading:Xe}=ct(J,"",Ce,N),{filters:yt,setFilters:Ge}=P(),lt=We=>{const{target:{value:ut}}=We;Ge(it=>{const{[ie]:zt,...Nt}=it;return ut?{...Nt,[ie]:ut}:Nt})};return(0,I.jsxs)(jt.Z,{disabled:Xe,className:Y,variant:"filled",fullWidth:!0,"data-testid":"search-selectfilter-next",children:[he?(0,I.jsx)(ue.Z,{className:_.label,margin:"dense",children:he}):null,(0,I.jsxs)(xe.Z,{variant:"outlined",value:yt[ie]||"",onChange:lt,children:[(0,I.jsx)(Fe.Z,{value:"",children:(0,I.jsx)("em",{children:"All"})}),Re.map(We=>(0,I.jsx)(Fe.Z,{value:We,children:We},We))]})]})},Wt=ee=>{const{component:Y,...oe}=ee;return(0,I.jsx)(Y,{...oe})};Wt.Checkbox=ee=>(0,I.jsx)(Wt,{...ee,component:Pt}),Wt.Select=ee=>(0,I.jsx)(Wt,{...ee,component:an}),Wt.Autocomplete=ee=>(0,I.jsx)(Wt,{...ee,component:Lt});var sn=n(48834).lW;const zn=ee=>sn.from(ee.toString(),"utf-8").toString("base64"),An=ee=>ee?Number(sn.from(ee,"base64").toString("utf-8")):0,hn=ee=>{const{total:Y=-1,cursor:oe,hasNextPage:he,onCursorChange:ie,limit:m=25,limitLabel:N="Results per page:",limitText:_=({from:lt,to:We})=>Y>0?`of ${Y}`:`${lt}-${We}`,limitOptions:J,onLimitChange:Ce,...Re}=ee,Xe=useMemo(()=>An(oe),[oe]),yt=useCallback((lt,We)=>{ie==null||ie(zn(We))},[ie]),Ge=useCallback(lt=>{const We=lt.target.value;Ce==null||Ce(parseInt(We,10))},[Ce]);return _jsx(TablePagination,{...Re,component:"div",count:Y,page:Xe,nextIconButtonProps:{...he!==void 0&&{disabled:!he}},onPageChange:yt,rowsPerPage:m,labelRowsPerPage:N,labelDisplayedRows:_,rowsPerPageOptions:J,onRowsPerPageChange:Ge})},On=ee=>{const{pageLimit:Y,setPageLimit:oe,pageCursor:he,setPageCursor:ie,fetchNextPage:m}=useSearch();return _jsx(hn,{...ee,hasNextPage:!!m,limit:Y,onLimitChange:oe,cursor:he,onCursorChange:ie})};var kn=n(47223);const Wn=ee=>{const{children:Y}=ee,oe=useSearch(),{result:he,...ie}=oe;return Y(he,ie)},Bn=ee=>{const{query:Y,children:oe}=ee,he=useApi(searchApiRef),ie=useAsync(()=>{const{term:m="",types:N=[],filters:_={},...J}=Y;return he.query({...J,term:m,types:N,filters:_})},[Y]);return oe(ie,Y)},Qn=ee=>{const{query:Y,children:oe}=ee;return Y?_jsx(Bn,{query:Y,children:oe}):_jsx(Wn,{children:oe})},dt=ee=>{const{query:Y,children:oe,noResultsComponent:he=_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...ie}=ee;return _jsx(Qn,{query:Y,children:({loading:m,error:N,value:_})=>m?_jsx(Progress,{}):N?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:N}):_!=null&&_.results.length?isFunction(oe)?oe(_):_jsx(SearchResultListItemExtensions,{...ie,results:_.results,children:oe}):he})},Qt=ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResult"},children:_jsx(dt,{...ee})}),wn=({result:ee,highlight:Y,icon:oe,secondaryAction:he,lineClamp:ie=5})=>ee?_jsxs(_Fragment,{children:[oe&&_jsx(ListItemIcon,{children:oe}),_jsx(ListItemText,{primaryTypographyProps:{variant:"h6"},primary:_jsx(Link,{noTrack:!0,to:ee.location,children:Y!=null&&Y.fields.title?_jsx(HighlightedSearchResultText,{text:(Y==null?void 0:Y.fields.title)||"",preTag:(Y==null?void 0:Y.preTag)||"",postTag:(Y==null?void 0:Y.postTag)||""}):ee.title}),secondary:_jsx(Typography,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ie,overflow:"hidden"},color:"textSecondary",variant:"body2",children:Y!=null&&Y.fields.text?_jsx(HighlightedSearchResultText,{text:Y.fields.text,preTag:Y.preTag,postTag:Y.postTag}):ee.text})}),he&&_jsx(Box,{alignItems:"flex-end",children:he})]}):null,Tn=ee=>_jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"DefaultResultListItem"},children:_jsx(wn,{...ee})}),yn=ee=>{const{error:Y,loading:oe,resultItems:he,renderResultItem:ie=J=>_jsx(DefaultResultListItem,{result:J.document},J.document.location),disableRenderingWithNoResults:m,noResultsComponent:N=m?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),..._}=ee;return oe?_jsx(Progress,{}):Y?_jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:Y}):he!=null&&he.length?_jsx(List,{..._,children:he.map(ie)}):_jsx(_Fragment,{children:N})},Mt=ee=>{const{query:Y,renderResultItem:oe,children:he,...ie}=ee,m=useSearchResultListItemExtensions(he);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultList"},children:_jsx(SearchResultState,{query:Y,children:({loading:N,error:_,value:J})=>_jsx(yn,{...ie,error:_,loading:N,resultItems:J==null?void 0:J.results,renderResultItem:oe!=null?oe:m})})})};var ln=n(19126);const bn=(0,c.Z)(ee=>({listSubheader:{display:"flex",alignItems:"center"},listSubheaderName:{marginLeft:ee.spacing(1),textTransform:"uppercase"},listSubheaderChip:{color:ee.palette.text.secondary,margin:ee.spacing(0,0,0,1.5)},listSubheaderFilter:{display:"flex",color:ee.palette.text.secondary,margin:ee.spacing(0,0,0,1.5)},listSubheaderLink:{marginLeft:"auto",display:"flex",alignItems:"center"},listSubheaderLinkIcon:{fontSize:"inherit",marginLeft:ee.spacing(.5)}})),on=ee=>{const Y=bn(),{label:oe,children:he,...ie}=ee;return _jsx(Chip,{...ie,className:Y.listSubheaderFilter,variant:"outlined",label:_jsxs(_Fragment,{children:[oe,": ",he]})})},Hn=()=>null,we=(0,c.Z)(ee=>({root:{fontSize:"inherit","&:focus":{outline:"none",background:ee.palette.common.white},"&:not(:focus)":{cursor:"pointer",color:ee.palette.primary.main,"&:hover":{textDecoration:"underline"}}}})),le=ee=>{const Y=we(),{label:oe,value:he="None",onChange:ie,onDelete:m}=ee,N=useCallback(_=>{ie(_.target.value)},[ie]);return _jsx(on,{label:oe,onDelete:m,children:_jsx(Typography,{role:"textbox",component:"span",className:Y.root,onChange:N,contentEditable:!0,suppressContentEditableWarning:!0,children:he})})},$e=(0,c.Z)(ee=>({root:{fontSize:"inherit","&:not(:focus)":{cursor:"pointer",color:ee.palette.primary.main,"&:hover":{textDecoration:"underline"}},"&:focus":{outline:"none"},"&>div:first-child":{padding:0}}})),Ue=ee=>{const Y=$e(),{label:oe,value:he="none",onChange:ie,onDelete:m,children:N}=ee,_=useCallback(J=>{ie(J.target.value)},[ie]);return _jsx(on,{label:oe,onDelete:m,children:_jsxs(Select,{className:Y.root,value:he,onChange:_,input:_jsx(InputBase,{}),IconComponent:Hn,children:[_jsx(MenuItem,{value:"none",children:"None"}),N]})})};function et(ee){const Y=bn(),[oe,he]=useState(null),{error:ie,loading:m,icon:N,title:_,titleProps:J={},link:Ce=_jsxs(_Fragment,{children:["See all",_jsx(ArrowRightIcon,{className:Y.listSubheaderLinkIcon})]}),linkProps:Re={},filterOptions:Xe,renderFilterOption:yt=xt=>_jsx(MenuItem,{value:String(xt),children:xt},String(xt)),filterFields:Ge,renderFilterField:lt,resultItems:We,renderResultItem:ut=xt=>_jsx(DefaultResultListItem,{result:xt.document},xt.document.location),disableRenderingWithNoResults:it,noResultsComponent:zt=it?null:_jsx(EmptyState,{missing:"data",title:"Sorry, no results were found"}),...Nt}=ee,Kt=useCallback(xt=>{he(xt.currentTarget)},[]),Vt=useCallback(()=>{he(null)},[]);if(m)return _jsx(Progress,{});if(ie)return _jsx(ResponseErrorPanel,{title:"Error encountered while fetching search results",error:ie});if(!(We!=null&&We.length))return _jsx(_Fragment,{children:zt});var Bt;return _jsxs(List,{...Nt,children:[_jsxs(ListSubheader,{className:Y.listSubheader,children:[N,_jsx(Typography,{className:Y.listSubheaderName,component:"strong",...J,children:_}),Xe?_jsx(Chip,{className:Y.listSubheaderChip,component:"button",icon:_jsx(AddIcon,{}),variant:"outlined",label:"Add filter","aria-controls":"filters-menu","aria-haspopup":"true",onClick:Kt}):null,Xe?_jsx(Menu,{id:"filters-menu",anchorEl:oe,open:Boolean(oe),onClose:Vt,onClick:Vt,keepMounted:!0,children:Xe.map(yt)}):null,Ge==null?void 0:Ge.map(xt=>(Bt=lt==null?void 0:lt(xt))!==null&&Bt!==void 0?Bt:null),_jsx(Link,{className:Y.listSubheaderLink,to:"/search",...Re,children:Ce})]}),We.map(ut)]})}function q(ee){const{query:Y,children:oe,renderResultItem:he,linkProps:ie={},...m}=ee,N=useSearchResultListItemExtensions(oe);return _jsx(AnalyticsContext,{attributes:{pluginId:"search",extension:"SearchResultGroup"},children:_jsx(SearchResultState,{query:Y,children:({loading:_,error:J,value:Ce},{term:Re,types:Xe,pageCursor:yt,filters:Ge={}})=>{const lt=`/search?${qs.stringify({term:Re,types:Xe,filters:Ge,pageCursor:yt,query:Re},{arrayFormat:"brackets"})}`;return _jsx(et,{...m,error:J,loading:_,linkProps:{to:lt,...ie},filterFields:Object.keys(Ge),resultItems:Ce==null?void 0:Ce.results,renderResultItem:he!=null?he:N})}})})}const U=(0,c.Z)(ee=>({root:{display:"flex",justifyContent:"space-between",gap:ee.spacing(2),margin:ee.spacing(2,0)}})),ve=()=>{const{fetchNextPage:ee,fetchPreviousPage:Y}=useSearch(),oe=U();return!ee&&!Y?_jsx(_Fragment,{}):_jsxs("nav",{"aria-label":"pagination navigation",className:oe.root,children:[_jsx(Button,{"aria-label":"previous page",disabled:!Y,onClick:Y,startIcon:_jsx(ArrowBackIosIcon,{}),children:"Previous"}),_jsx(Button,{"aria-label":"next page",disabled:!ee,onClick:ee,endIcon:_jsx(ArrowForwardIosIcon,{}),children:"Next"})]})},Ee="search.results.list.items.extensions.v1",tt=(ee,Y)=>{for(const oe of ee){if(!isValidElement(oe))continue;const he=getComponentData(oe,Ee);if(he!=null&&he(Y))return cloneElement(oe,{rank:Y.rank,highlight:Y.highlight,result:Y.document,...oe.props})}return null},st=ee=>{const{rank:Y,result:oe,noTrack:he,children:ie,alignItems:m="flex-start",...N}=ee,_=(0,d.z$)(),J=(0,g.useCallback)(()=>{he||oe&&_.captureEvent("discover",oe.title,{attributes:{to:oe.location},value:Y})},[Y,oe,he,_]);return(0,I.jsx)(v.Z,{divider:!0,alignItems:m,onClickCapture:J,...N,children:ie})},kt=ee=>{const{name:Y,component:oe,predicate:he=()=>!0}=ee;return(0,d.YO)({name:Y,component:{lazy:()=>oe().then(ie=>m=>(0,I.jsx)(st,{rank:m.rank,result:m.result,noTrack:m.noTrack,children:(0,g.createElement)(ie,m)}))},data:{[Ee]:he}})},Gt=ee=>{const Y=useElementFilter(ee,oe=>oe.selectByComponentData({key:Ee}).getElements(),[ee]);return useCallback((oe,he)=>{const ie=tt(Y,oe);return _jsx(Fragment,{children:ie!=null?ie:_jsx(st,{rank:oe.rank,result:oe.document,children:_jsx(DefaultResultListItem,{rank:oe.rank,highlight:oe.highlight,result:oe.document})})},he)},[Y])},pn=ee=>{const{results:Y,children:oe,...he}=ee,ie=Gt(oe);return _jsx(List,{...he,children:Y.map(ie)})}},61886:function(wt,De,n){"use strict";n.d(De,{Ox:function(){return Le},jM:function(){return g},Zz:function(){return v},oZ:function(){return H},DR:function(){return c},ZS:function(){return ze},VA:function(){return pt},KY:function(){return Ie},gT:function(){return O},Dl:function(){return re},ux:function(){return Tt},$L:function(){return R},x1:function(){return rt}});var d=n(52322),r=n(2784),z=n(73557),I=n(60871);const g="techdocs.addons.addon.v1",v="techdocs.addons.wrapper.v1",c=()=>null;(0,I.R5)(c,v,!0);const B=ue=>`${g}.${ue.toLocaleLowerCase("en-US")}`;function Ie(ue){const{name:xe,component:Fe}=ue;return(0,I.YO)({name:xe,component:{sync:Qe=>(0,d.jsx)(Fe,{...Qe})},data:{[g]:ue,[B(xe)]:!0}})}const fe=(ue,xe)=>ue.selectByComponentData({key:xe}).getElements()[0],G=ue=>ue.selectByComponentData({key:v}).selectByComponentData({key:g}),$=ue=>ue.selectByComponentData({key:v}).findComponentData({key:g}),R=()=>{const ue=(0,z.pC)(),xe=(0,I.vJ)(ue,G),Fe=(0,I.vJ)(ue,$),Qe=(0,r.useCallback)(ct=>{if(!xe||!ct)return null;const Et=B(ct.name);var Lt;return(Lt=fe(xe,Et))!==null&&Lt!==void 0?Lt:null},[xe]),mt=(0,r.useCallback)(ct=>{const Et=Fe.find(Lt=>Lt.name===ct);return Et?Qe(Et):null},[Fe,Qe]),Rt=(0,r.useCallback)(ct=>{const Et=Fe.filter(Lt=>Lt.location===ct);return Et.length?Et.map(Qe):null},[Fe,Qe]);return{renderComponentByName:mt,renderComponentsByLocation:Rt}},O=(0,I.T0)({id:"plugin.techdocs.service"}),re=(0,I.T0)({id:"plugin.techdocs.storageservice"});var X=n(64279),te=n(77446),D=n(25271),A=n(51837);function L(ue,xe){return xe.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")||(ue.kind=ue.kind.toLocaleLowerCase(),ue.name=ue.name.toLocaleLowerCase(),ue.namespace=ue.namespace.toLocaleLowerCase()),ue}const P=(ue,xe)=>(0,D.eE)(ue)===(0,D.eE)(xe),V={title:"",subtitle:"",setTitle:()=>{},setSubtitle:()=>{},setShadowRoot:()=>{},metadata:{loading:!0},entityMetadata:{loading:!0},entityRef:{kind:"",name:"",namespace:""}},me=(0,A.CT)("techdocs-reader-page-context"),ze=(0,r.memo)(ue=>{const{entityRef:xe,children:Fe}=ue,Qe=(0,I.h_)(O),mt=(0,I.h_)(I.Ds),Rt=(0,X.default)(async()=>Qe.getEntityMetadata(xe),[xe]),ct=(0,te.Z)(async()=>Qe.getTechDocsMetadata(xe),[xe]),[Et,Lt]=(0,r.useState)(V.title),[Jt,Pt]=(0,r.useState)(V.subtitle),[an,Wt]=(0,r.useState)(V.shadowRoot);(0,r.useEffect)(()=>{an&&!ct.value&&!ct.loading&&ct.retry()},[ct.value,ct.loading,an,ct.retry,ct]);const sn={metadata:ct,entityRef:L(xe,mt),entityMetadata:Rt,shadowRoot:an,setShadowRoot:Wt,title:Et,setTitle:Lt,subtitle:Jt,setSubtitle:Pt},zn=(0,A.EI)({1:sn});return(0,d.jsx)(I.fC,{attributes:{entityRef:(0,D.eE)(xe)},children:(0,d.jsx)(me.Provider,{value:zn,children:Fe instanceof Function?Fe(sn):Fe})})},(ue,xe)=>P(ue.entityRef,xe.entityRef)),rt=()=>{const ue=(0,r.useContext)(me);if(ue===void 0)return V;const xe=ue.atVersion(1);if(xe===void 0)throw new Error("No context found for version 1.");return xe},H=Object.freeze({Header:"Header",Subheader:"Subheader",Settings:"Settings",PrimarySidebar:"PrimarySidebar",SecondarySidebar:"SecondarySidebar",Content:"Content"});var ot=n(70882),vt=n(50236),Je=n(19219),ht=n(47223);const Le="TECH_DOCS_SHADOW_DOM_STYLE_LOAD",bt=ue=>{(0,r.useEffect)(()=>{if(!ue)return()=>{};const xe=ue.querySelectorAll('head > link[rel="stylesheet"]');var Fe;let Qe=(Fe=xe==null?void 0:xe.length)!==null&&Fe!==void 0?Fe:0;const mt=new CustomEvent(Le);if(!Qe)return ue.dispatchEvent(mt),()=>{};const Rt=()=>{--Qe===0&&ue.dispatchEvent(mt)};return xe==null||xe.forEach(ct=>{ct.addEventListener("load",Rt)}),()=>{xe==null||xe.forEach(ct=>{ct.removeEventListener("load",Rt)})}},[ue])},Tt=ue=>{const[xe,Fe]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!ue)return()=>{};Fe(!0);const Qe=ue.style;Qe.setProperty("opacity","0");const mt=()=>{Fe(!1),Qe.setProperty("opacity","1")};return ue.addEventListener(Le,mt),()=>{ue.removeEventListener(Le,mt)}},[ue]),xe},pt=ue=>{const{element:xe,onAppend:Fe,children:Qe}=ue,[mt,Rt]=(0,r.useState)((0,ot.Ue)({...(0,vt.Z)(),insertionPoint:void 0}));bt(xe);const ct=Tt(xe),Et=(0,r.useCallback)(Lt=>{if(!xe||!Lt)return;Rt((0,ot.Ue)({...(0,vt.Z)(),insertionPoint:xe.querySelector("head")||void 0}));let Jt=Lt.shadowRoot;Jt||(Jt=Lt.attachShadow({mode:"open"})),Jt.replaceChildren(xe),typeof Fe=="function"&&Fe(Jt)},[xe,Fe]);return(0,d.jsxs)(d.Fragment,{children:[ct&&(0,d.jsx)(ht.Ex,{}),(0,d.jsxs)(Je.ZP,{jss:mt,sheetsManager:new Map,children:[(0,d.jsx)("div",{ref:Et,"data-testid":"techdocs-native-shadowroot"}),Qe]})]})};var gt=n(54073);const jt=()=>{const{shadowRoot:ue}=useTechDocsReaderPage();return ue},$t=ue=>{const xe=jt();return xe?ue.map(Fe=>xe==null?void 0:xe.querySelectorAll(Fe)).filter(Fe=>Fe.length).map(Fe=>Array.from(Fe)).flat():[]},He=ue=>ue.toString()&&ue.rangeCount&&ue.getRangeAt(0).getBoundingClientRect().top,Xt=(ue=0)=>{const xe=jt(),[Fe,Qe]=useState(null),mt=useMemo(()=>debounce(()=>{const Rt=xe,ct=Rt.getSelection?Rt.getSelection():document.getSelection();ct&&He(ct)?Qe(ct):Qe(null)},ue),[xe,Qe,ue]);return useEffect(()=>(window.document.addEventListener("selectionchange",mt),()=>{mt.cancel(),window.document.removeEventListener("selectionchange",mt)}),[mt]),Fe}},52943:function(wt,De,n){"use strict";n.r(De),n.d(De,{EmbeddedDocsRouter:function(){return X},Router:function(){return re},isTechDocsAvailable:function(){return O}});var d=n(52322),r=n(2784),z=n(73557),I=n(40303),g=n(47223),v=n(25271),c=n(89258),B=n(65124),Ie=n(86317);const fe=({entity:te})=>{const D=(0,v.iB)(te);return(0,d.jsxs)(c.I6,{entityRef:D,children:[(0,d.jsx)(B.b,{}),(0,d.jsx)(Ie.F,{withSearch:!1})]})};var G=n(18662),$=n(7476);const R="backstage.io/techdocs-ref",O=te=>{var D,A;return Boolean(te==null||(D=te.metadata)===null||D===void 0||(A=D.annotations)===null||A===void 0?void 0:A[R])},re=()=>(0,d.jsxs)(z.Z5,{children:[(0,d.jsx)(z.AW,{path:"/",element:(0,d.jsx)(G.TechDocsIndexPage,{})}),(0,d.jsx)(z.AW,{path:"/:namespace/:kind/:name/*",element:(0,d.jsx)($.TechDocsReaderPage,{})})]}),X=te=>{var D;const{children:A}=te,{entity:L}=(0,I.X2)(),P=(0,z.V$)([{path:"/*",element:(0,d.jsx)(fe,{entity:L}),children:[{path:"*",element:A}]}]);return((D=L.metadata.annotations)===null||D===void 0?void 0:D[R])?P:(0,d.jsx)(g.sk,{annotation:R})}},92077:function(wt,De,n){"use strict";n.d(De,{k:function(){return v},p:function(){return g}});var d=n(87612),r=n(23054),z=n(76372),I=n.n(z);class g{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getTechDocsMetadata(B){const{kind:Ie,namespace:fe,name:G}=B,R=`${await this.getApiOrigin()}/metadata/techdocs/${fe}/${Ie}/${G}`,O=await this.fetchApi.fetch(`${R}`);if(!O.ok)throw await r.VL.fromResponse(O);return await O.json()}async getEntityMetadata(B){const{kind:Ie,namespace:fe,name:G}=B,R=`${await this.getApiOrigin()}/metadata/entity/${fe}/${Ie}/${G}`,O=await this.fetchApi.fetch(`${R}`);if(!O.ok)throw await r.VL.fromResponse(O);return await O.json()}constructor(B){(0,d._)(this,"configApi",void 0),(0,d._)(this,"discoveryApi",void 0),(0,d._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.fetchApi=B.fetchApi}}class v{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){var B;return(B=this.configApi.getOptionalString("techdocs.storageUrl"))!==null&&B!==void 0?B:`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(B,Ie){const{kind:fe,namespace:G,name:$}=B,O=`${await this.getStorageUrl()}/${G}/${fe}/${$}/${Ie}`,re=await this.fetchApi.fetch(`${O.endsWith("/")?O:`${O}/`}index.html`);let X="";switch(re.status){case 404:throw X="Page not found. ",Ie||(X+="This could be because there is no index.md file in the root of the docs directory of this repository."),new r.dR(X);case 500:throw X="Could not generate documentation or an error in the TechDocs backend. ",new Error(X);default:break}return re.text()}async syncEntityDocs(B,Ie=()=>{}){const{kind:fe,namespace:G,name:$}=B,O=`${await this.getApiOrigin()}/sync/${G}/${fe}/${$}`,{token:re}=await this.identityApi.getCredentials();return new Promise((X,te)=>{const D=new z.EventSourcePolyfill(O,{withCredentials:!0,headers:re?{Authorization:`Bearer ${re}`}:{}});D.addEventListener("log",A=>{A.data&&Ie(JSON.parse(A.data))}),D.addEventListener("finish",A=>{let L=!1;A.data&&({updated:L}=JSON.parse(A.data)),X(L?"updated":"cached")}),D.onerror=A=>{switch(D.close(),A.status){case 404:te(new r.dR(A.message));return;default:te(new Error(A.data));return}}})}async getBaseUrl(B,Ie,fe){const{kind:G,namespace:$,name:R}=Ie,re=`${await this.getApiOrigin()}/static/docs/${$}/${G}/${R}/${fe}`;return new URL(B,re.endsWith("/")?re:`${re}/`).toString()}constructor(B){(0,d._)(this,"configApi",void 0),(0,d._)(this,"discoveryApi",void 0),(0,d._)(this,"identityApi",void 0),(0,d._)(this,"fetchApi",void 0),this.configApi=B.configApi,this.discoveryApi=B.discoveryApi,this.identityApi=B.identityApi,this.fetchApi=B.fetchApi}}},51953:function(wt,De,n){"use strict";n.d(De,{D:function(){return d}});function d(r,z){return z.getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths")?r:r.toLocaleLowerCase("en-US")}},3482:function(wt,De,n){"use strict";n.d(De,{u:function(){return B}});var d=n(52322),r=n(2784),z=n(47223),I=n(40303),g=n(42081),v=n(48431),c=n(68435);const B=Ie=>{const{initialFilter:fe="owned",columns:G,actions:$}=Ie;return(0,d.jsx)(g.j,{children:(0,d.jsxs)(z.VY,{children:[(0,d.jsx)(z.yW,{title:"",children:(0,d.jsx)(z.qt,{children:"Discover documentation in your ecosystem."})}),(0,d.jsx)(I.UO,{children:(0,d.jsxs)(I._i,{children:[(0,d.jsxs)(I._i.Filters,{children:[(0,d.jsx)(v.f,{}),(0,d.jsx)(I.EW,{initialFilter:fe}),(0,d.jsx)(I.dq,{}),(0,d.jsx)(I.xE,{})]}),(0,d.jsx)(I._i.Content,{children:(0,d.jsx)(c.n,{actions:$,columns:G})})]})})]})})}},85478:function(wt,De,n){"use strict";n.d(De,{f:function(){return G}});var d=n(52322),r=n(95573),z=n(51953),I=n(60871),g=n(47223),v=n(94339),c=n(16111),B=n(24579),Ie=n(14503),fe=n(2784);const G=X=>{const{entities:te}=X,D=(0,I.tg)(r.Fw),A=(0,I.h_)(I.Ds);if(!te)return null;var L,P;return(0,d.jsx)(g.Oh,{"data-testid":"docs-explore",children:te!=null&&te.length?te.map((V,me)=>(0,d.jsxs)(v.Z,{children:[(0,d.jsx)(c.Z,{children:(0,d.jsx)(g.hu,{title:(L=V.metadata.title)!==null&&L!==void 0?L:V.metadata.name})}),(0,d.jsx)(B.Z,{children:V.metadata.description}),(0,d.jsx)(Ie.Z,{children:(0,d.jsx)(g.Qj,{to:D({namespace:(0,z.D)((P=V.metadata.namespace)!==null&&P!==void 0?P:"default",A),kind:(0,z.D)(V.kind,A),name:(0,z.D)(V.metadata.name,A)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},me)):null})};var $=n(40303);const R={title:"All Documentation",filterPredicate:()=>!0},O=X=>{const{entities:te,group:D}=X,{loading:A,isOwnedEntity:L}=useEntityOwnership(),P=te.filter(me=>D.filterPredicate==="ownedByUser"?A?!1:L(me):typeof D.filterPredicate=="function"&&D.filterPredicate(me)),V=(()=>typeof D.title=="string"?_jsx(ContentHeader,{title:D.title}):D.title)();return P.length===0?null:_jsxs(Content,{children:[V,_jsx(DocsCardGrid,{entities:P})]})},re=X=>{const{loading:te,error:D,entities:A}=useEntityList();if(D)return _jsx(WarningPanel,{severity:"error",title:"Could not load available documentation.",children:_jsx(CodeSnippet,{language:"text",text:D.toString()})});if(te)return _jsx(Progress,{});if(A.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 L,P;return A.sort((V,me)=>((L=V.metadata.title)!==null&&L!==void 0?L:V.metadata.name).localeCompare((P=me.metadata.title)!==null&&P!==void 0?P:me.metadata.name)),_jsx(Content,{children:(X.groups||[R]).map((V,me)=>_jsx(O,{entities:A,group:V},`${V.title}-${me}`))})}},68435:function(wt,De,n){"use strict";n.d(De,{H:function(){return A},n:function(){return L}});var d=n(52322),r=n(2784),z=n(95074),I=n(76635),g=n(47223),v=n(40303),c=n(60871),B=n(25271),Ie=n(95573),fe=n(39981),G=n(2337),$=n(11640),R=n(28347);const O=(0,G.Z)({root:{color:"#f3ba37"}})($.Z),re={createCopyDocsUrlAction(P){return V=>({icon:()=>(0,d.jsx)(fe.Z,{fontSize:"small"}),tooltip:"Click to copy documentation link to clipboard",onClick:()=>P(`${window.location.origin}${V.resolved.docsUrl}`)})},createStarEntityAction(P,V){return me=>{const ze=me.entity,rt=P(ze);return{cellStyle:{paddingLeft:"1em"},icon:()=>rt?(0,d.jsx)(O,{}):(0,d.jsx)(R.Z,{}),tooltip:rt?"Remove from favorites":"Add to favorites",onClick:()=>V(ze)}}}};function X(P){return P.metadata.title||P.metadata.name}const te={createNameColumn(){return{title:"Document",field:"entity.metadata.name",highlight:!0,render:P=>(0,d.jsx)(g.uw,{value:(0,d.jsx)(g.rU,{to:P.resolved.docsUrl,children:X(P.entity)}),subvalue:P.entity.metadata.description})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:P})=>(0,d.jsx)(v.rI,{entityRefs:P.ownedByRelations,defaultKind:"group"})}},createTypeColumn(){return{title:"Type",field:"entity.spec.type"}}};var D=n(51953);const A=P=>{const{entities:V,title:me,loading:ze,columns:rt,actions:H,options:ot}=P,[,vt]=(0,z.Z)(),Je=(0,c.tg)(Ie.Fw),ht=(0,c.h_)(c.Ds);if(!V)return null;const Le=V.map(pt=>{const gt=(0,v.hF)(pt,B.S4);var jt;return{entity:pt,resolved:{docsUrl:Je({namespace:(0,D.D)((jt=pt.metadata.namespace)!==null&&jt!==void 0?jt:"default",ht),kind:(0,D.D)(pt.kind,ht),name:(0,D.D)(pt.metadata.name,ht)}),ownedByRelations:gt,ownedByRelationsTitle:gt.map($t=>(0,v.$3)($t,{defaultKind:"group"})).join(", ")}}}),bt=[te.createNameColumn(),te.createOwnerColumn(),te.createTypeColumn()],Tt=[re.createCopyDocsUrlAction(vt)];return(0,d.jsx)(d.Fragment,{children:ze||Le&&Le.length>0?(0,d.jsx)(g.iA,{isLoading:ze,options:{paging:!0,pageSize:20,search:!0,actionsColumnIndex:-1,...ot},data:Le,columns:rt||bt,actions:H||Tt,title:me?`${me} (${Le.length})`:`All (${Le.length})`}):(0,d.jsx)(g.ub,{missing:"data",title:"No documents to show",description:"Create your own document. Check out our Getting Started Information",action:(0,d.jsx)(g.Qj,{color:"primary",to:"https://backstage.io/docs/features/techdocs/getting-started",variant:"contained",children:"DOCS"})})})};A.columns=te,A.actions=re;const L=P=>{var V;const{columns:me,actions:ze,options:rt}=P,{loading:H,error:ot,entities:vt,filters:Je}=(0,v.wp)(),{isStarredEntity:ht,toggleStarredEntity:Le}=(0,v.CR)(),[,bt]=(0,z.Z)();var Tt;const pt=(0,I.capitalize)((Tt=(V=Je.user)===null||V===void 0?void 0:V.value)!==null&&Tt!==void 0?Tt:"all"),gt=[re.createCopyDocsUrlAction(bt),re.createStarEntityAction(ht,Le)];return ot?(0,d.jsx)(g.GB,{severity:"error",title:"Could not load available documentation.",children:(0,d.jsx)(g.Oi,{language:"text",text:ot.toString()})}):(0,d.jsx)(A,{title:pt,entities:vt,loading:H,actions:ze||gt,columns:me,options:rt})};L.columns=te,L.actions=re},18662:function(wt,De,n){"use strict";n.r(De),n.d(De,{TechDocsIndexPage:function(){return g}});var d=n(52322),r=n(2784),z=n(73557),I=n(3482);const g=v=>(0,z.pC)()||(0,d.jsx)(I.u,{...v})},42081:function(wt,De,n){"use strict";n.d(De,{j:function(){return g}});var d=n(52322),r=n(2784),z=n(47223),I=n(60871);const g=v=>{const{children:c}=v,B=(0,I.h_)(I.Ds);var Ie;const fe=`Documentation available in ${(Ie=B.getOptionalString("organization.name"))!==null&&Ie!==void 0?Ie:"Backstage"}`;return(0,d.jsx)(z.g9,{title:"Documentation",subtitle:fe,themeId:"documentation",children:c})}},48431:function(wt,De,n){"use strict";n.d(De,{f:function(){return I}});var d=n(2784),r=n(40303);class z{getCatalogFilters(){return{"metadata.annotations.backstage.io/techdocs-ref":r.n3}}}const I=()=>{const{updateFilters:g}=(0,r.wp)();return(0,d.useEffect)(()=>{g({techdocs:new z})},[g]),null}},89258:function(wt,De,n){"use strict";n.d(De,{I6:function(){return G},Jl:function(){return fe},s4:function(){return v}});var d=n(61886),r=n(92077),z=n(95573),I=n(60871),g=n(15096);const v=(0,I.rx)({id:"techdocs",apis:[(0,I.ni)({api:d.Dl,deps:{configApi:I.Ds,discoveryApi:I.NW,identityApi:I.$4,fetchApi:I.gP},factory:({configApi:R,discoveryApi:O,identityApi:re,fetchApi:X})=>new r.k({configApi:R,discoveryApi:O,identityApi:re,fetchApi:X})}),(0,I.ni)({api:d.gT,deps:{configApi:I.Ds,discoveryApi:I.NW,fetchApi:I.gP},factory:({configApi:R,discoveryApi:O,fetchApi:re})=>new r.p({configApi:R,discoveryApi:O,fetchApi:re})})],routes:{root:z._Z,docRoot:z.Fw,entityContent:z.pd}}),c=v.provide((0,I.P4)({name:"TechdocsPage",component:()=>Promise.resolve().then(n.bind(n,52943)).then(R=>R.Router),mountPoint:z._Z})),B=v.provide((0,I.P4)({name:"EntityTechdocsContent",component:()=>Promise.resolve().then(n.bind(n,52943)).then(R=>R.EmbeddedDocsRouter),mountPoint:z.pd})),Ie=v.provide((0,I.P4)({name:"TechDocsCustomHome",component:()=>n.e(7560).then(n.bind(n,27560)).then(R=>R.TechDocsCustomHome),mountPoint:z._Z})),fe=v.provide((0,I.P4)({name:"TechDocsIndexPage",component:()=>Promise.resolve().then(n.bind(n,18662)).then(R=>R.TechDocsIndexPage),mountPoint:z._Z})),G=v.provide((0,I.P4)({name:"TechDocsReaderPage",component:()=>Promise.resolve().then(n.bind(n,7476)).then(R=>R.TechDocsReaderPage),mountPoint:z.Fw})),$=v.provide((0,g.E5)({name:"TechDocsSearchResultListItem",component:()=>Promise.resolve().then(n.bind(n,55511)).then(R=>R.TechDocsSearchResultListItem),predicate:R=>R.type==="techdocs"}))},7476:function(wt,De,n){"use strict";n.r(De),n.d(De,{TechDocsReaderLayout:function(){return G},TechDocsReaderPage:function(){return $}});var d=n(52322),r=n(2784),z=n(73557),I=n(47223),g=n(61886),v=n(86317),c=n(93225),B=n(65124),Ie=n(95573),fe=n(60871);const G=R=>{const{withSearch:O,withHeader:re=!0}=R;return(0,d.jsxs)(I.T3,{themeId:"documentation",children:[re&&(0,d.jsx)(c.S,{}),(0,d.jsx)(B.b,{}),(0,d.jsx)(v.F,{withSearch:O})]})},$=R=>{const{kind:O,name:re,namespace:X}=(0,fe.Oi)(Ie.Fw),{children:te,entityRef:D={kind:O,name:re,namespace:X}}=R,A=(0,z.pC)();if(!te){const P=A?r.Children.toArray(A.props.children):[];var L;const me=P.flatMap(ze=>{var rt;return(L=ze==null||(rt=ze.props)===null||rt===void 0?void 0:rt.children)!==null&&L!==void 0?L:[]}).find(ze=>!(0,fe.IY)(ze,g.Zz)&&!(0,fe.IY)(ze,g.jM));return(0,d.jsx)(g.ZS,{entityRef:D,children:me||(0,d.jsx)(G,{})})}return(0,d.jsx)(g.ZS,{entityRef:D,children:({metadata:P,entityMetadata:V,onReady:me})=>(0,d.jsx)("div",{className:"techdocs-reader-page",children:(0,d.jsx)(I.T3,{themeId:"documentation",children:te instanceof Function?te({entityRef:D,techdocsMetadataValue:P.value,entityMetadataValue:V.value,onReady:me}):te})})})}},86317:function(wt,De,n){"use strict";n.d(De,{F:function(){return he}});var d=n(52322),r=n(2784),z=n(79692),I=n(60905),g=n(61886),v=n(47223),c=n(22478),B=n(4614),Ie=n(77277),fe=n(99688),G=n(12420),$=n(90436),R=n(61837),O=n(4190),re=n(87685);const X=(0,z.Z)(m=>(0,G.Z)({paper:{width:"100%",[m.breakpoints.up("sm")]:{width:"75%"},[m.breakpoints.up("md")]:{width:"50%"},padding:m.spacing(2.5)},root:{height:"100%",overflow:"hidden"},logs:{background:m.palette.background.default}})),te=({buildLog:m,onClose:N})=>{const _=X(),J=m.length===0?"Waiting for logs...":m.join(`
|
|
37
|
-
`);return(0,d.jsxs)(I.Z,{container:!0,direction:"column",className:_.root,spacing:0,wrap:"nowrap",children:[(0,d.jsxs)(I.Z,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",spacing:0,wrap:"nowrap",children:[(0,d.jsx)($.Z,{variant:"h5",children:"Build Details"}),(0,d.jsx)(R.Z,{title:"Close the drawer",onClick:N,color:"inherit",children:(0,d.jsx)(re.Z,{})},"dismiss")]}),(0,d.jsx)(I.Z,{item:!0,xs:!0,children:(0,d.jsx)(v.nU,{text:J,classes:{root:_.logs}})})]})},D=({buildLog:m})=>{const N=X(),[_,J]=(0,r.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ie.Z,{color:"inherit",onClick:()=>J(!0),children:"Show Build Logs"}),(0,d.jsx)(O.ZP,{classes:{paper:N.paper},anchor:"right",open:_,onClose:()=>J(!1),children:(0,d.jsx)(te,{buildLog:m,onClose:()=>J(!1)})})]})};var A=n(60871);const L=({errorMessage:m})=>{const N=(0,A.h_)(A.Ds).getOptionalString("techdocs.builder");let _="";return N!=="local"&&(_="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,d.jsx)(v.mf,{status:"404",statusMessage:m||"Documentation not found",additionalInfo:_})};var P=n(95481);const V=(0,z.Z)(m=>({root:{marginBottom:m.spacing(2)},message:{wordBreak:"break-word",overflowWrap:"anywhere"}})),me=()=>{let m=null;const N=V(),{state:_,contentReload:J,contentErrorMessage:Ce,syncErrorMessage:Re,buildLog:Xe}=(0,P.DK)();return _==="INITIAL_BUILD"&&(m=(0,d.jsx)(fe.Z,{classes:{root:N.root},variant:"outlined",severity:"info",icon:(0,d.jsx)(B.Z,{size:"24px"}),action:(0,d.jsx)(D,{buildLog:Xe}),children:"Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster."})),_==="CONTENT_STALE_REFRESHING"&&(m=(0,d.jsx)(fe.Z,{variant:"outlined",severity:"info",icon:(0,d.jsx)(B.Z,{size:"24px"}),action:(0,d.jsx)(D,{buildLog:Xe}),classes:{root:N.root},children:"A newer version of this documentation is being prepared and will be available shortly."})),_==="CONTENT_STALE_READY"&&(m=(0,d.jsx)(fe.Z,{variant:"outlined",severity:"success",action:(0,d.jsx)(Ie.Z,{color:"inherit",onClick:()=>J(),children:"Refresh"}),classes:{root:N.root},children:"A newer version of this documentation is now available, please refresh to view."})),_==="CONTENT_STALE_ERROR"&&(m=(0,d.jsxs)(fe.Z,{variant:"outlined",severity:"error",action:(0,d.jsx)(D,{buildLog:Xe}),classes:{root:N.root,message:N.message},children:["Building a newer version of this documentation failed."," ",Re]})),_==="CONTENT_NOT_FOUND"&&(m=(0,d.jsxs)(d.Fragment,{children:[Re&&(0,d.jsxs)(fe.Z,{variant:"outlined",severity:"error",action:(0,d.jsx)(D,{buildLog:Xe}),classes:{root:N.root,message:N.message},children:["Building a newer version of this documentation failed."," ",Re]}),(0,d.jsx)(L,{errorMessage:Ce})]})),m};var ze=n(60364),rt=n(41156),H=n(32838),ot=n(35368),vt=n.n(ot);const Je=/main\.[A-Fa-f0-9]{8}\.min\.css$/,ht=/^https:\/\/fonts\.googleapis\.com/,Le=/^https:\/\/fonts\.gstatic\.com/,bt=m=>m.nodeName==="LINK",Tt=m=>{const N=(m==null?void 0:m.getAttribute("href"))||"",_=N.match(Je),J=N.match(ht),Ce=N.match(Le);return _||J||Ce},pt=m=>(bt(m)&&!Tt(m)&&m.remove(),m),gt=m=>m.nodeName==="IFRAME",jt=(m,N)=>{const _=m.getAttribute("src")||"";try{const{host:J}=new URL(_);return N.includes(J)}catch{return!1}},$t=m=>N=>(gt(N)&&!jt(N,m)&&N.remove(),N),He=()=>{const m=(0,A.h_)(A.Ds);return(0,r.useMemo)(()=>m.getOptionalConfig("techdocs.sanitizer"),[m])},Xt=()=>{const m=He();return(0,r.useCallback)(async N=>{const _=m==null?void 0:m.getOptionalStringArray("allowedIframeHosts");vt().addHook("beforeSanitizeElements",pt);const J=["link"];return _&&(J.push("iframe"),vt().addHook("beforeSanitizeElements",$t(_))),vt().sanitize(N.outerHTML,{ADD_TAGS:J,FORBID_TAGS:["style"],WHOLE_DOCUMENT:!0,RETURN_DOM:!0})},[m])};var ue=n(41128),xe=({theme:m})=>`
|
|
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: ${m.palette.text.primary};
|
|
47
|
-
--md-default-fg-color--light: ${m.palette.text.secondary};
|
|
48
|
-
--md-default-fg-color--lighter: ${(0,ue.$n)(m.palette.text.secondary,.7)};
|
|
49
|
-
--md-default-fg-color--lightest: ${(0,ue.$n)(m.palette.text.secondary,.3)};
|
|
50
|
-
|
|
51
|
-
/* BACKGROUND */
|
|
52
|
-
--md-default-bg-color:${m.palette.background.default};
|
|
53
|
-
--md-default-bg-color--light: ${m.palette.background.paper};
|
|
54
|
-
--md-default-bg-color--lighter: ${(0,ue.$n)(m.palette.background.paper,.7)};
|
|
55
|
-
--md-default-bg-color--lightest: ${(0,ue.$n)(m.palette.background.paper,.3)};
|
|
56
|
-
|
|
57
|
-
/* PRIMARY */
|
|
58
|
-
--md-primary-fg-color: ${m.palette.primary.main};
|
|
59
|
-
--md-primary-fg-color--light: ${m.palette.primary.light};
|
|
60
|
-
--md-primary-fg-color--dark: ${m.palette.primary.dark};
|
|
61
|
-
--md-primary-bg-color: ${m.palette.primary.contrastText};
|
|
62
|
-
--md-primary-bg-color--light: ${(0,ue.$n)(m.palette.primary.contrastText,.7)};
|
|
63
|
-
|
|
64
|
-
/* ACCENT */
|
|
65
|
-
--md-accent-fg-color: var(--md-primary-fg-color);
|
|
66
|
-
|
|
67
|
-
/* SHADOW */
|
|
68
|
-
--md-shadow-z1: ${m.shadows[1]};
|
|
69
|
-
--md-shadow-z2: ${m.shadows[2]};
|
|
70
|
-
--md-shadow-z3: ${m.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: ${m.palette.text.primary};
|
|
107
|
-
--md-code-bg-color: ${m.palette.background.paper};
|
|
108
|
-
--md-code-hl-color: ${(0,ue.Fq)(m.palette.warning.main,.5)};
|
|
109
|
-
--md-code-hl-keyword-color: ${m.palette.type==="dark"?m.palette.primary.light:m.palette.primary.dark};
|
|
110
|
-
--md-code-hl-function-color: ${m.palette.type==="dark"?m.palette.secondary.light:m.palette.secondary.dark};
|
|
111
|
-
--md-code-hl-string-color: ${m.palette.type==="dark"?m.palette.success.light:m.palette.success.dark};
|
|
112
|
-
--md-code-hl-number-color: ${m.palette.type==="dark"?m.palette.error.light:m.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: ${m.palette.link};
|
|
126
|
-
--md-typeset-table-color: ${m.palette.text.primary};
|
|
127
|
-
--md-typeset-del-color: ${m.palette.type==="dark"?(0,ue.Fq)(m.palette.error.dark,.5):(0,ue.Fq)(m.palette.error.light,.5)};
|
|
128
|
-
--md-typeset-ins-color: ${m.palette.type==="dark"?(0,ue.Fq)(m.palette.success.dark,.5):(0,ue.Fq)(m.palette.success.light,.5)};
|
|
129
|
-
--md-typeset-mark-color: ${m.palette.type==="dark"?(0,ue.Fq)(m.palette.warning.dark,.5):(0,ue.Fq)(m.palette.warning.light,.5)};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 76.1875em) {
|
|
133
|
-
:host > * {
|
|
134
|
-
/* TYPESET */
|
|
135
|
-
--md-typeset-font-size: .9rem;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media screen and (max-width: 600px) {
|
|
140
|
-
:host > * {
|
|
141
|
-
/* TYPESET */
|
|
142
|
-
--md-typeset-font-size: .7rem;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,Fe=({theme:m})=>`
|
|
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: ${m.typography.fontFamily};
|
|
152
|
-
font-family: var(--md-text-font-family);
|
|
153
|
-
background-color: unset;
|
|
154
|
-
}
|
|
155
|
-
`;const Qe="224px";var mt=({theme:m,sidebar:N})=>`
|
|
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:${m.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: ${m.spacing(3)}px;
|
|
214
|
-
}
|
|
215
|
-
.md-sidebar::-webkit-scrollbar {
|
|
216
|
-
width: 5px;
|
|
217
|
-
}
|
|
218
|
-
.md-sidebar::-webkit-scrollbar-button {
|
|
219
|
-
width: 5px;
|
|
220
|
-
height: 5px;
|
|
221
|
-
}
|
|
222
|
-
.md-sidebar::-webkit-scrollbar-track {
|
|
223
|
-
background: #eee;
|
|
224
|
-
border: 1 px solid rgb(250, 250, 250);
|
|
225
|
-
box-shadow: 0px 0px 3px #dfdfdf inset;
|
|
226
|
-
border-radius: 3px;
|
|
227
|
-
}
|
|
228
|
-
.md-sidebar::-webkit-scrollbar-thumb {
|
|
229
|
-
width: 5px;
|
|
230
|
-
background: rgb(193, 193, 193);
|
|
231
|
-
border: transparent;
|
|
232
|
-
border-radius: 3px;
|
|
233
|
-
}
|
|
234
|
-
.md-sidebar::-webkit-scrollbar-thumb:hover {
|
|
235
|
-
background: rgb(125, 125, 125);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.md-content {
|
|
239
|
-
max-width: calc(100% - 16rem * 2);
|
|
240
|
-
margin-left: 16rem;
|
|
241
|
-
margin-bottom: 50px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.md-footer {
|
|
245
|
-
position: fixed;
|
|
246
|
-
bottom: 0px;
|
|
247
|
-
pointer-events: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.md-footer-nav__link, .md-footer__link {
|
|
251
|
-
pointer-events: all;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.md-footer__title {
|
|
255
|
-
background-color: unset;
|
|
256
|
-
}
|
|
257
|
-
.md-footer-nav__link {
|
|
258
|
-
width: 16rem;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.md-dialog {
|
|
262
|
-
background-color: unset;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@media screen and (min-width: 76.25em) {
|
|
266
|
-
.md-sidebar {
|
|
267
|
-
height: auto;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@media screen and (max-width: 76.1875em) {
|
|
272
|
-
.md-nav {
|
|
273
|
-
transition: none !important;
|
|
274
|
-
background-color: var(--md-default-bg-color)
|
|
275
|
-
}
|
|
276
|
-
.md-nav--primary .md-nav__title {
|
|
277
|
-
cursor: auto;
|
|
278
|
-
color: var(--md-default-fg-color);
|
|
279
|
-
font-weight: 700;
|
|
280
|
-
white-space: normal;
|
|
281
|
-
line-height: 1rem;
|
|
282
|
-
height: auto;
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-flow: column;
|
|
285
|
-
row-gap: 1.6rem;
|
|
286
|
-
padding: 1.2rem .8rem .8rem;
|
|
287
|
-
background-color: var(--md-default-bg-color);
|
|
288
|
-
}
|
|
289
|
-
.md-nav--primary .md-nav__title~.md-nav__list {
|
|
290
|
-
box-shadow: none;
|
|
291
|
-
}
|
|
292
|
-
.md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
|
|
293
|
-
border-top: none;
|
|
294
|
-
}
|
|
295
|
-
.md-nav--primary .md-nav__title .md-nav__button {
|
|
296
|
-
display: none;
|
|
297
|
-
}
|
|
298
|
-
.md-nav--primary .md-nav__title .md-nav__icon {
|
|
299
|
-
color: var(--md-default-fg-color);
|
|
300
|
-
position: static;
|
|
301
|
-
height: auto;
|
|
302
|
-
margin: 0 0 0 -0.2rem;
|
|
303
|
-
}
|
|
304
|
-
.md-nav--primary > .md-nav__title [for="none"] {
|
|
305
|
-
padding-top: 0;
|
|
306
|
-
}
|
|
307
|
-
.md-nav--primary .md-nav__item {
|
|
308
|
-
border-top: none;
|
|
309
|
-
}
|
|
310
|
-
.md-nav--primary :is(.md-nav__title,.md-nav__item) {
|
|
311
|
-
font-size : var(--md-typeset-font-size);
|
|
312
|
-
}
|
|
313
|
-
.md-nav .md-source {
|
|
314
|
-
display: none;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.md-sidebar {
|
|
318
|
-
height: 100%;
|
|
319
|
-
}
|
|
320
|
-
.md-sidebar--primary {
|
|
321
|
-
width: 12.1rem !important;
|
|
322
|
-
z-index: 200;
|
|
323
|
-
left: ${N.isPinned?`calc(-12.1rem + ${Qe})`:"calc(-12.1rem + 72px)"} !important;
|
|
324
|
-
}
|
|
325
|
-
.md-sidebar--secondary:not([hidden]) {
|
|
326
|
-
display: none;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.md-content {
|
|
330
|
-
max-width: 100%;
|
|
331
|
-
margin-left: 0;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.md-header__button {
|
|
335
|
-
margin: 0.4rem 0;
|
|
336
|
-
margin-left: 0.4rem;
|
|
337
|
-
padding: 0;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.md-overlay {
|
|
341
|
-
left: 0;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.md-footer {
|
|
345
|
-
position: static;
|
|
346
|
-
padding-left: 0;
|
|
347
|
-
}
|
|
348
|
-
.md-footer-nav__link {
|
|
349
|
-
/* footer links begin to overlap at small sizes without setting width */
|
|
350
|
-
width: 50%;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@media screen and (max-width: 600px) {
|
|
355
|
-
.md-sidebar--primary {
|
|
356
|
-
left: -12.1rem !important;
|
|
357
|
-
width: 12.1rem;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
`;const Rt=["h1","h2","h3","h4","h5","h6"];var ct=({theme:m})=>`
|
|
361
|
-
/*================== Typeset ==================*/
|
|
362
|
-
|
|
363
|
-
.md-typeset {
|
|
364
|
-
font-size: var(--md-typeset-font-size);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
${Rt.reduce((N,_)=>{var J;const Ce=(J=m.typography.htmlFontSize)!==null&&J!==void 0?J:16,Re=m.typography[_],{lineHeight:Xe,fontFamily:yt,fontWeight:Ge,fontSize:lt}=Re,We=ut=>{let it=1;return typeof ut=="number"&&(it=ut/Ce*.6),typeof ut=="string"&&(it=ut.replace("rem","")),`calc(${it} * var(--md-typeset-font-size))`};return N.concat(`
|
|
368
|
-
.md-typeset ${_} {
|
|
369
|
-
color: var(--md-default-fg-color);
|
|
370
|
-
line-height: ${Xe};
|
|
371
|
-
font-family: ${yt};
|
|
372
|
-
font-weight: ${Ge};
|
|
373
|
-
font-size: ${We(lt)};
|
|
374
|
-
}
|
|
375
|
-
`)},"")}
|
|
376
|
-
|
|
377
|
-
.md-typeset .md-content__button {
|
|
378
|
-
color: var(--md-default-fg-color);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.md-typeset hr {
|
|
382
|
-
border-bottom: 0.05rem dotted ${m.palette.divider};
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
.md-typeset details {
|
|
386
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
387
|
-
}
|
|
388
|
-
.md-typeset details summary {
|
|
389
|
-
padding-left: 2.5rem !important;
|
|
390
|
-
}
|
|
391
|
-
.md-typeset details summary:before,
|
|
392
|
-
.md-typeset details summary:after {
|
|
393
|
-
top: 50% !important;
|
|
394
|
-
width: 20px !important;
|
|
395
|
-
height: 20px !important;
|
|
396
|
-
transform: rotate(0deg) translateY(-50%) !important;
|
|
397
|
-
}
|
|
398
|
-
.md-typeset details[open] > summary:after {
|
|
399
|
-
transform: rotate(90deg) translateX(-50%) !important;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.md-typeset blockquote {
|
|
403
|
-
color: var(--md-default-fg-color--light);
|
|
404
|
-
border-left: 0.2rem solid var(--md-default-fg-color--light);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
.md-typeset table:not([class]) {
|
|
408
|
-
font-size: var(--md-typeset-font-size);
|
|
409
|
-
border: 1px solid var(--md-default-fg-color);
|
|
410
|
-
border-bottom: none;
|
|
411
|
-
border-collapse: collapse;
|
|
412
|
-
}
|
|
413
|
-
.md-typeset table:not([class]) th {
|
|
414
|
-
font-weight: bold;
|
|
415
|
-
}
|
|
416
|
-
.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
|
|
417
|
-
border-bottom: 1px solid var(--md-default-fg-color);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb {
|
|
421
|
-
background-color: hsla(0, 0%, 0%, 0.32);
|
|
422
|
-
}
|
|
423
|
-
.md-typeset pre > code::-webkit-scrollbar-thumb:hover {
|
|
424
|
-
background-color: hsla(0, 0%, 0%, 0.87);
|
|
425
|
-
}
|
|
426
|
-
`,Et=()=>`
|
|
427
|
-
/*================== Animations ==================*/
|
|
428
|
-
/*
|
|
429
|
-
Disable CSS animations on link colors as they lead to issues in dark mode.
|
|
430
|
-
The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
|
|
431
|
-
*/
|
|
432
|
-
.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
|
|
433
|
-
transition: none;
|
|
434
|
-
}
|
|
435
|
-
`,Lt=({theme:m})=>`
|
|
436
|
-
/*================== Extensions ==================*/
|
|
437
|
-
|
|
438
|
-
/* HIGHLIGHT */
|
|
439
|
-
.highlight .md-clipboard:after {
|
|
440
|
-
content: unset;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.highlight .nx {
|
|
444
|
-
color: ${m.palette.type==="dark"?"#ff53a3":"#ec407a"};
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/* CODE HILITE */
|
|
448
|
-
.codehilite .gd {
|
|
449
|
-
background-color: ${m.palette.type==="dark"?"rgba(248,81,73,0.65)":"#fdd"};
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.codehilite .gi {
|
|
453
|
-
background-color: ${m.palette.type==="dark"?"rgba(46,160,67,0.65)":"#dfd"};
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/* TABBED */
|
|
457
|
-
.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
|
|
458
|
-
.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
|
|
459
|
-
.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
|
|
460
|
-
.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
|
|
461
|
-
.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
|
|
462
|
-
.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
|
|
463
|
-
.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
|
|
464
|
-
.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
|
|
465
|
-
.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
|
|
466
|
-
.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
|
|
467
|
-
.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
|
|
468
|
-
.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
|
|
469
|
-
.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
|
|
470
|
-
.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
|
|
471
|
-
.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
|
|
472
|
-
.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
|
|
473
|
-
.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
|
|
474
|
-
.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
|
|
475
|
-
.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
|
|
476
|
-
.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
|
|
477
|
-
color: var(--md-accent-fg-color);
|
|
478
|
-
border-color: var(--md-accent-fg-color);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/* TASK-LIST */
|
|
482
|
-
.task-list-control .task-list-indicator::before {
|
|
483
|
-
background-color: ${m.palette.action.disabledBackground};
|
|
484
|
-
}
|
|
485
|
-
.task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
|
|
486
|
-
background-color: ${m.palette.success.main};
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
/* ADMONITION */
|
|
490
|
-
.admonition {
|
|
491
|
-
font-size: var(--md-typeset-font-size) !important;
|
|
492
|
-
}
|
|
493
|
-
.admonition .admonition-title {
|
|
494
|
-
padding-left: 2.5rem !important;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.admonition .admonition-title:before {
|
|
498
|
-
top: 50% !important;
|
|
499
|
-
width: 20px !important;
|
|
500
|
-
height: 20px !important;
|
|
501
|
-
transform: translateY(-50%) !important;
|
|
502
|
-
}
|
|
503
|
-
`;const Jt=[xe,Fe,mt,ct,Et,Lt],Pt=()=>(0,v.Pf)(),an=()=>{const m=Pt(),N=(0,ze.Z)();return(0,r.useMemo)(()=>{const _={theme:N,sidebar:m};return Jt.reduce((J,Ce)=>J+Ce(_),"")},[N,m])},Wt=()=>{const m=an();return(0,r.useCallback)(N=>(N.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",`<style>${m}</style>`),N),[m])},sn=(m,N,_)=>{const J=m==="src"&&N.endsWith(".svg"),Ce=!N.match(/^([a-z]*:)?\/\//i),Re=N.startsWith(_);return J&&(Ce||Re)},zn=({techdocsStorageApi:m,entityId:N,path:_})=>async J=>{const Ce=await m.getApiOrigin(),Re=async(Xe,yt)=>{for(const Ge of Xe)if(Ge.hasAttribute(yt)){const lt=Ge.getAttribute(yt);if(!lt)return;const We=await m.getBaseUrl(lt,N,_);if(sn(yt,lt,Ce))try{const it=await(await fetch(We,{credentials:"include"})).text();Ge.setAttribute(yt,`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(it)))}`)}catch{Ge.setAttribute("alt",`Error: ${lt}`)}else Ge.setAttribute(yt,We)}};return await Promise.all([Re(J.querySelectorAll("img"),"src"),Re(J.querySelectorAll("script"),"src"),Re(J.querySelectorAll("source"),"src"),Re(J.querySelectorAll("link"),"href"),Re(J.querySelectorAll("a[download]"),"href")]),J};var An=n(79158),hn=n(67097),On=n(28316),kn=n(82717),Wn=n.n(kn);const Bn=m=>N=>{var _;const J=N.querySelector('[title="Edit this page"]');if(!J||!J.href)return N;const Ce=new URL(J.href),Re=m.byUrl(Ce);if((Re==null?void 0:Re.type)!=="github"&&(Re==null?void 0:Re.type)!=="gitlab")return N;const Xe=((_=N.querySelector("article>h1"))===null||_===void 0?void 0:_.childNodes[0].textContent)||"",yt=encodeURIComponent(`Documentation Feedback: ${Xe}`),Ge=encodeURIComponent(`Page source:
|
|
504
|
-
${J.href}
|
|
505
|
-
|
|
506
|
-
Feedback:`),lt=(Re==null?void 0:Re.type)==="github"?(0,An.BT)(Ce.href,"blob"):Ce.href,We=Wn()(lt),ut=`/${We.organization}/${We.name}`,it=J.cloneNode();switch(Re==null?void 0:Re.type){case"gitlab":it.href=`${Ce.origin}${ut}/issues/new?issue[title]=${yt}&issue[description]=${Ge}`;break;case"github":it.href=`${Ce.origin}${ut}/issues/new?title=${yt}&body=${Ge}`;break;default:return N}return On.render(r.createElement(hn.Z),it),it.style.paddingLeft="5px",it.title="Leave feedback for this page",it.id="git-feedback-link",J==null||J.insertAdjacentElement("beforebegin",it),N};var Qn=n(44882);const dt=()=>m=>{const N=m.querySelector('.md-header label[for="__drawer"]'),_=m.querySelector("article");if(!N||!_)return m;const J=N.cloneNode();return On.render(r.createElement(Qn.Z),J),J.id="toggle-sidebar",J.title="Toggle Sidebar",J.classList.add("md-content__button"),J.style.setProperty("padding","0 0 0 5px"),J.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),_==null||_.prepend(J),m},Qt=()=>m=>(((_,J)=>{Array.from(_).filter(Ce=>Ce.hasAttribute(J)).forEach(Ce=>{const Re=Ce.getAttribute(J);if(Re){Re.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Xe=wn(window.location.href);Ce.setAttribute(J,new URL(Re,Xe).toString())}catch{Ce.replaceWith(Ce.textContent||Re)}}})})(Array.from(m.getElementsByTagName("a")),"href"),m);function wn(m){const N=new URL(m);return!N.pathname.endsWith("/")&&!N.pathname.endsWith(".html")&&(N.pathname+="/"),N.toString()}const Tn=({baseUrl:m,onClick:N})=>_=>(Array.from(_.getElementsByTagName("a")).forEach(J=>{J.addEventListener("click",Ce=>{const Xe=J.getAttribute("href");Xe&&Xe.startsWith(m)&&!J.hasAttribute("download")&&(Ce.preventDefault(),N(Ce,Xe))})}),_);var yn=n(15459),Mt=n(80030),ln=n(72379),bn=n(41547),on=n(95074);const Hn=(0,yn.Z)(m=>({tooltip:{fontSize:"inherit",color:m.palette.text.primary,margin:0,padding:m.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Mt.ZP),we=()=>(0,d.jsx)(ln.Z,{children:(0,d.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),le=({text:m})=>{const[N,_]=(0,r.useState)(!1),[,J]=(0,on.Z)(),Ce=(0,r.useCallback)(()=>{J(m),_(!0)},[m,J]),Re=(0,r.useCallback)(()=>{_(!1)},[_]);return(0,d.jsx)(Hn,{title:"Copied to clipboard",placement:"left",open:N,onClose:Re,leaveDelay:1e3,children:(0,d.jsx)(R.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:Ce,children:(0,d.jsx)(we,{})})})},$e=m=>N=>{const _=N.querySelectorAll("pre > code");for(const Ce of _){var J;const Re=Ce.textContent||"",Xe=document.createElement("div");Ce==null||(J=Ce.parentElement)===null||J===void 0||J.prepend(Xe),On.render((0,d.jsx)(bn.Z,{theme:m,children:(0,d.jsx)(le,{text:Re})}),Xe)}return N},Ue=()=>m=>{var N;return(N=m.querySelector(".md-header"))===null||N===void 0||N.remove(),m},et=()=>m=>{var N,_;return(N=m.querySelector(".md-footer .md-copyright"))===null||N===void 0||N.remove(),(_=m.querySelector(".md-footer-copyright"))===null||_===void 0||_.remove(),m},q=({onLoading:m,onLoaded:N})=>_=>(m(),_.addEventListener(g.Ox,function J(){N(),_.removeEventListener(g.Ox,J)}),_),U=()=>m=>(m.addEventListener(g.Ox,function N(){if(window.location.hash){var _;const J=window.location.hash.slice(1);(_=m==null?void 0:m.querySelector(`[id="${J}"]`))===null||_===void 0||_.scrollIntoView()}m.removeEventListener(g.Ox,N)}),m),ve=()=>m=>(setTimeout(()=>{const N=m==null?void 0:m.querySelectorAll("li.md-nav__item--active");N.length!==0&&(N.forEach(J=>{const Ce=J==null?void 0:J.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),N[N.length-1].scrollIntoView())},200),m),Ee=async(m,N)=>{let _;if(typeof m=="string")_=new DOMParser().parseFromString(m,"text/html").documentElement;else if(m instanceof Element)_=m;else throw new Error("dom is not a recognized type");for(const J of N)_=await J(_);return _};var tt=n(73557);function st(m,N){const _=new URL(N),J=`${_.origin}${_.pathname.replace(/\/$/,"")}`,Ce=m.replace(J,"").replace(/\/+$/,"").replace(/^\/+/,""),Re=new URL(`http://localhost/${Ce}`);return`${Re.pathname}${Re.search}${Re.hash}`}function kt(){const m=(0,tt.s0)(),_=(0,A.h_)(A.Ds).getOptionalString("app.baseUrl");return(0,r.useCallback)(Ce=>{let Re=Ce;if(_)try{Re=st(Ce,_)}catch{}m(Re)},[m,_])}const Gt="screen and (max-width: 76.1875em)",pn=m=>{const N=kt(),_=(0,ze.Z)(),J=(0,rt.Z)(Gt),Ce=Xt(),Re=Wt(),Xe=(0,A.z$)(),yt=(0,A.h_)(g.Dl),Ge=(0,A.h_)(H.q3),{state:lt,path:We,content:ut}=(0,P.DK)(),[it,zt]=(0,r.useState)(null),Nt=(0,g.ux)(it),Kt=(0,r.useCallback)(()=>{if(!it)return;it.querySelectorAll(".md-sidebar").forEach(Ot=>{if(J)Ot.style.top="0px";else{const Gn=document==null?void 0:document.querySelector(".techdocs-reader-page");var en;const or=(en=Gn==null?void 0:Gn.getBoundingClientRect().top)!==null&&en!==void 0?en:0;var jn;let fn=(jn=it.getBoundingClientRect().top)!==null&&jn!==void 0?jn:0;const Sn=it.querySelector(".md-container > .md-tabs");var Rn;const sr=(Rn=Sn==null?void 0:Sn.getBoundingClientRect().height)!==null&&Rn!==void 0?Rn:0;fn<or&&(fn=or),Ot.style.top=`${Math.max(fn,0)+sr}px`}Ot.style.setProperty("opacity","1")})},[it,J]);(0,r.useEffect)(()=>(window.addEventListener("resize",Kt),window.addEventListener("scroll",Kt,!0),()=>{window.removeEventListener("resize",Kt),window.removeEventListener("scroll",Kt,!0)}),[it,Kt]);const Vt=(0,r.useCallback)(()=>{if(!it)return;const It=it.querySelector(".md-footer");It&&(It.style.width=`${it.getBoundingClientRect().width}px`)},[it]);(0,r.useEffect)(()=>(window.addEventListener("resize",Vt),()=>{window.removeEventListener("resize",Vt)}),[it,Vt]),(0,r.useEffect)(()=>{Nt||(Vt(),Kt())},[lt,Nt,Vt,Kt]);const Bt=(0,r.useCallback)((It,Ot)=>Ee(It,[Ce,zn({techdocsStorageApi:yt,entityId:m,path:Ot}),Qt(),dt(),Ue(),et(),Bn(Ge),Re]),[m,Ge,yt,Ce,Re]),xt=(0,r.useCallback)(async It=>Ee(It,[U(),ve(),$e(_),Tn({baseUrl:window.location.origin,onClick:(Ot,en)=>{var jn;const Rn=Ot.ctrlKey||Ot.metaKey,Gn=new URL(en),or=((jn=Ot.target)===null||jn===void 0?void 0:jn.innerText)||en,fn=en.replace(window.location.origin,"");if(Xe.captureEvent("click",or,{attributes:{to:fn}}),Gn.hash)if(Rn)window.open(en,"_blank");else{var Sn;N(en),(Sn=It==null?void 0:It.querySelector(`[id="${Gn.hash.slice(1)}"]`))===null||Sn===void 0||Sn.scrollIntoView()}else Rn?window.open(en,"_blank"):N(en)}}),q({onLoading:()=>{},onLoaded:()=>{var Ot;(Ot=It.querySelector(".md-nav__title"))===null||Ot===void 0||Ot.removeAttribute("for")}}),q({onLoading:()=>{Array.from(It.querySelectorAll(".md-sidebar")).forEach(en=>{en.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[_,N,Xe]);return(0,r.useEffect)(()=>{if(!ut)return()=>{};let It=!0;return Bt(ut,We).then(async Ot=>{if(!(Ot!=null&&Ot.innerHTML)||!It)return;window.scroll({top:0});const en=await xt(Ot);zt(en)}),()=>{It=!1}},[ut,We,Bt,xt]),it};var ee=n(8560);const Y=()=>{const m=(0,g.$L)(),{shadowRoot:N}=(0,g.x1)(),_=N==null?void 0:N.querySelector('[data-md-component="content"]'),J=N==null?void 0:N.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=J==null?void 0:J.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),J==null||J.prepend(Ce));const Re=N==null?void 0:N.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Xe=Re==null?void 0:Re.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Xe||(Xe=document.createElement("div"),Xe.setAttribute("data-techdocs-addons-location","secondary sidebar"),Re==null||Re.prepend(Xe)),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ee.Z,{container:Ce,children:m.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,d.jsx)(ee.Z,{container:_,children:m.renderComponentsByLocation(g.oZ.Content)}),(0,d.jsx)(ee.Z,{container:Xe,children:m.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},oe=(0,z.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),he=(0,P.m1)(m=>{var N;const{withSearch:_=!0,onReady:J}=m,Ce=oe(),{entityMetadata:{value:Re,loading:Xe},entityRef:yt,setShadowRoot:Ge}=(0,g.x1)(),lt=pn(yt),We=(0,r.useCallback)(ut=>{Ge(ut),J instanceof Function&&J()},[Ge,J]);return Xe===!1&&!Re?(0,d.jsx)(v.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):lt?(0,d.jsx)(v.VY,{children:(0,d.jsxs)(I.Z,{container:!0,children:[(0,d.jsx)(I.Z,{xs:12,item:!0,children:(0,d.jsx)(me,{})}),_&&(0,d.jsx)(I.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,d.jsx)(c.S,{entityId:yt,entityTitle:Re==null||(N=Re.metadata)===null||N===void 0?void 0:N.title})}),(0,d.jsx)(I.Z,{xs:12,item:!0,children:(0,d.jsx)(g.VA,{element:lt,onAppend:We,children:(0,d.jsx)(Y,{})})})]})}):(0,d.jsx)(v.VY,{children:(0,d.jsx)(I.Z,{container:!0,children:(0,d.jsx)(I.Z,{xs:12,item:!0,children:(0,d.jsx)(me,{})})})})}),ie=null},93225:function(wt,De,n){"use strict";n.d(De,{S:function(){return X}});var d=n(52322),r=n(2784),z=n(18671),I=n(60905),g=n(98069),v=n(60364),c=n(73250),B=n(61886),Ie=n(40303),fe=n(25271),G=n(47223),$=n(60871),R=n(76635),O=n(95573);const re=(0,d.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),X=te=>{const{palette:{common:{white:D}}}=(0,v.Z)(),{children:A}=te,L=(0,B.$L)(),P=(0,$.h_)($.Ds),{title:V,setTitle:me,subtitle:ze,setSubtitle:rt,entityRef:H,metadata:{value:ot,loading:vt},entityMetadata:{value:Je,loading:ht}}=(0,B.x1)();(0,r.useEffect)(()=>{ot&&(me(ot.site_name),rt(()=>{let{site_description:xe}=ot;return(!xe||xe==="None")&&(xe=""),xe}))},[ot,me,rt]);const Le=P.getOptional("app.title")||"Backstage",bt=[V,ze,Le].filter(Boolean).join(" | "),{locationMetadata:Tt,spec:pt}=Je||{},gt=pt==null?void 0:pt.lifecycle,jt=Je?(0,Ie.hF)(Je,fe.S4):[],$t=(0,$.tg)(O._Z)(),He=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(G.i9,{label:(0,R.capitalize)((Je==null?void 0:Je.kind)||"entity"),value:(0,d.jsx)(Ie.dx,{color:"inherit",entityRef:H,title:Je==null?void 0:Je.metadata.title,defaultKind:"Component"})}),jt.length>0&&(0,d.jsx)(G.i9,{label:"Owner",value:(0,d.jsx)(Ie.rI,{color:"inherit",entityRefs:jt,defaultKind:"group"})}),gt?(0,d.jsx)(G.i9,{label:"Lifecycle",value:gt}):null,Tt&&Tt.type!=="dir"&&Tt.type!=="file"?(0,d.jsx)(G.i9,{label:"",value:(0,d.jsxs)(I.Z,{container:!0,direction:"column",alignItems:"center",style:{color:D},children:[(0,d.jsx)(I.Z,{style:{padding:0},item:!0,children:(0,d.jsx)(c.Z,{style:{marginTop:"-25px"}})}),(0,d.jsx)(I.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Tt.target}):null]});return!ht&&Je===void 0||!vt&&ot===void 0?null:(0,d.jsxs)(G.h4,{type:"Documentation",typeLink:$t,title:V||re,subtitle:ze===""?void 0:ze||re,children:[(0,d.jsx)(z.Z,{titleTemplate:"%s",children:(0,d.jsx)("title",{children:bt})}),He,A,L.renderComponentsByLocation(B.oZ.Header)]})}},65124:function(wt,De,n){"use strict";n.d(De,{b:function(){return $}});var d=n(52322),r=n(2784),z=n(79692),I=n(15223),g=n(95544),v=n(80030),c=n(61837),B=n(48348),Ie=n(47603),fe=n(61886);const G=(0,z.Z)(R=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:R.spacing(3,3,0)}})),$=R=>{const O=G(),[re,X]=(0,r.useState)(null),te=(0,r.useCallback)(ze=>{X(ze.currentTarget)},[]),D=(0,r.useCallback)(()=>{X(null)},[]),{entityMetadata:{value:A,loading:L}}=(0,fe.x1)(),P=(0,fe.$L)(),V=P.renderComponentsByLocation(fe.oZ.Subheader),me=P.renderComponentsByLocation(fe.oZ.Settings);return!V&&!me||L===!1&&!A?null:(0,d.jsx)(I.Z,{classes:O,...R.toolbarProps,children:(0,d.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[V,me?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(v.ZP,{title:"Settings",children:(0,d.jsx)(c.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:te,children:(0,d.jsx)(Ie.Z,{})})}),(0,d.jsx)(B.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:re,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(re),onClose:D,keepMounted:!0,children:(0,d.jsx)("div",{children:me})})]}):null]})})}},95481:function(wt,De,n){"use strict";n.d(De,{DK:function(){return $},m1:function(){return O}});var d=n(52322),r=n(2784),z=n(73557),I=n(61886),g=n(60871),v=n(64279),c=n(77446);function B({contentLoading:re,content:X,activeSyncState:te}){return re||te==="BUILD_READY_RELOAD"||!X&&te==="CHECKING"?"CHECKING":!X&&te==="BUILDING"?"INITIAL_BUILD":X?te==="BUILDING"?"CONTENT_STALE_REFRESHING":te==="BUILD_READY"?"CONTENT_STALE_READY":te==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function Ie(re,X){const te={...re};switch(X.type){case"sync":X.state==="CHECKING"&&(te.buildLog=[]),te.activeSyncState=X.state,te.syncError=X.syncError;break;case"contentLoading":te.contentLoading=!0,te.contentError=void 0;break;case"content":typeof X.path=="string"&&(te.path=X.path),te.contentLoading=!1,te.content=X.content,te.contentError=X.contentError;break;case"buildLog":te.buildLog=te.buildLog.concat(X.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(te.activeSyncState)&&["contentLoading","content"].includes(X.type)&&(te.activeSyncState="UP_TO_DATE",te.buildLog=[]),te}function fe(re,X,te,D){var A,L;const[P,V]=(0,r.useReducer)(Ie,{activeSyncState:"CHECKING",path:D,contentLoading:!0,buildLog:[]}),me=(0,g.h_)(I.Dl),{retry:ze}=(0,c.Z)(async()=>{V({type:"contentLoading"});try{const ot=await me.getEntityDocs({kind:re,namespace:X,name:te},D);return V({type:"content",content:ot,path:D}),ot}catch(ot){V({type:"content",contentError:ot,path:D})}},[me,re,X,te,D]),rt=(0,r.useRef)({content:void 0,reload:()=>{}});return rt.current={content:P.content,reload:ze},(0,v.default)(async()=>{V({type:"sync",state:"CHECKING"});const ot=setTimeout(()=>{V({type:"sync",state:"BUILDING"})},1e3);try{switch(await me.syncEntityDocs({kind:re,namespace:X,name:te},Je=>{V({type:"buildLog",log:Je})})){case"updated":rt.current.content?V({type:"sync",state:"BUILD_READY"}):(rt.current.reload(),V({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":V({type:"sync",state:"UP_TO_DATE"});break;default:V({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(vt){V({type:"sync",state:"ERROR",syncError:vt})}finally{clearTimeout(ot)}},[re,te,X,me,V,rt]),{state:(0,r.useMemo)(()=>B({activeSyncState:P.activeSyncState,contentLoading:P.contentLoading,content:P.content}),[P.activeSyncState,P.content,P.contentLoading]),contentReload:ze,path:P.path,content:P.content,contentErrorMessage:(A=P.contentError)===null||A===void 0?void 0:A.toString(),syncErrorMessage:(L=P.syncError)===null||L===void 0?void 0:L.toString(),buildLog:P.buildLog}}const G=(0,r.createContext)({}),$=()=>(0,r.useContext)(G),R=re=>{const{children:X}=re,{"*":te=""}=(0,z.UO)(),{entityRef:D}=(0,I.x1)(),{kind:A,namespace:L,name:P}=D,V=fe(A,L,P,te);return(0,d.jsx)(G.Provider,{value:V,children:X instanceof Function?X(V):X})},O=re=>X=>(0,d.jsx)(R,{children:(0,d.jsx)(re,{...X})})},95573:function(wt,De,n){"use strict";n.d(De,{Fw:function(){return z},_Z:function(){return r},pd:function(){return I}});var d=n(60871);const r=(0,d.NT)({id:"techdocs:index-page"}),z=(0,d.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),I=(0,d.NT)({id:"techdocs:catalog-reader-view"})},55511:function(wt,De,n){"use strict";n.r(De),n.d(De,{TechDocsSearchResultListItem:function(){return fe}});var d=n(52322),r=n(2784),z=n(79692),I=n(49378),g=n(86136),v=n(90436),c=n(47223),B=n(15096);const Ie=(0,z.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),fe=G=>{const{result:$,highlight:R,lineClamp:O=5,asListItem:re=!0,asLink:X=!0,title:te,icon:D}=G,A=Ie(),L=({children:me})=>X?(0,d.jsx)(c.rU,{noTrack:!0,to:$.location,children:me}):(0,d.jsx)(d.Fragment,{children:me}),P=()=>{const me=R!=null&&R.fields.title?(0,d.jsx)(B.FA,{text:R.fields.title,preTag:R.preTag,postTag:R.postTag}):$.title,ze=R!=null&&R.fields.entityTitle?(0,d.jsx)(B.FA,{text:R.fields.entityTitle,preTag:R.preTag,postTag:R.postTag}):$.entityTitle,rt=R!=null&&R.fields.name?(0,d.jsx)(B.FA,{text:R.fields.name,preTag:R.preTag,postTag:R.postTag}):$.name;return $?(0,d.jsx)(I.Z,{className:A.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,d.jsx)(L,{children:te||(0,d.jsxs)(d.Fragment,{children:[me," | ",ze!=null?ze:rt," docs"]})}),secondary:(0,d.jsx)(v.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:O,overflow:"hidden"},color:"textSecondary",variant:"body2",children:R!=null&&R.fields.text?(0,d.jsx)(B.FA,{text:R.fields.text,preTag:R.preTag,postTag:R.postTag}):$.text})}):null},V=({children:me})=>re?(0,d.jsxs)(d.Fragment,{children:[D&&(0,d.jsx)(g.Z,{children:typeof D=="function"?D($):D}),(0,d.jsx)("div",{className:A.flexContainer,children:me})]}):(0,d.jsx)(d.Fragment,{children:me});return(0,d.jsx)(V,{children:(0,d.jsx)(P,{})})}},22478:function(wt,De,n){"use strict";n.d(De,{S:function(){return G}});var d=n(52322),r=n(15096),z=n(79692),I=n(27556),g=n(2784),v=n(73557),c=n(55511);const B=(0,z.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),Ie=$=>$==null?void 0:$.document,fe=$=>{const{entityId:R,entityTitle:O,debounceTime:re=150}=$,[X,te]=(0,g.useState)(!1),D=(0,v.s0)(),{setFilters:A,result:{loading:L,value:P}}=(0,r.Rx)(),V=B(),[me,ze]=(0,g.useState)([]);(0,g.useEffect)(()=>{let Je=!0;if(Je&&P){const ht=P.results.slice(0,10);ze(ht)}return()=>{Je=!1}},[L,P]);const{kind:rt,name:H,namespace:ot}=R;(0,g.useEffect)(()=>{A(Je=>({...Je,kind:rt,namespace:ot,name:H}))},[rt,ot,H,A]);const vt=(Je,ht)=>{if(Ie(ht)){const{location:Le}=ht.document;D(Le)}};return(0,d.jsx)(I.Z,{className:V.bar,variant:"outlined",children:(0,d.jsx)(r.qO,{classes:{root:V.root},"data-testid":"techdocs-search-bar",size:"small",open:X,getOptionLabel:()=>"",filterOptions:Je=>Je,onClose:()=>{te(!1)},onFocus:()=>{te(!0)},onChange:vt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:me,renderOption:({document:Je,highlight:ht})=>(0,d.jsx)(c.TechDocsSearchResultListItem,{result:Je,lineClamp:3,asListItem:!1,asLink:!1,title:Je.title,highlight:ht}),loading:L,inputDebounceTime:re,inputPlaceholder:`Search ${O||R.name} docs`,freeSolo:!1})})},G=$=>{const R={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,d.jsx)(r.Nd,{initialState:R,children:(0,d.jsx)(fe,{...$})})}},53260:function(){}},function(wt){var De=function(d){return wt(wt.s=d)};wt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return De(6290)});var n=wt.O()}]);})();
|
|
507
|
-
|
|
508
|
-
//# sourceMappingURL=main.0f1c16cc.js.map
|