@techdocs/cli 0.0.0-nightly-20220621024649 → 0.0.0-nightly-20220622024934
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -3
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.c4918ca8.js → main.8810284e.js} +2 -2
- package/dist/embedded-app/static/{main.c4918ca8.js.map → main.8810284e.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.c4918ca8.js → runtime.8810284e.js} +1 -1
- package/dist/embedded-app/static/{runtime.c4918ca8.js.map → runtime.8810284e.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.c4918ca8.js → vendor.8810284e.js} +25 -25
- package/dist/embedded-app/static/vendor.8810284e.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/vendor.c4918ca8.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var qi=Object.defineProperty;var _i=(ee,s,e)=>s in ee?qi(ee,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):ee[s]=e;var q=(ee,s,e)=>(_i(ee,typeof s!="symbol"?s+"":s,e),e),po=(ee,s,e)=>{if(!s.has(ee))throw TypeError("Cannot "+e)};var rt=(ee,s,e)=>(po(ee,s,"read from private field"),e?e.call(ee):s.get(ee)),Dn=(ee,s,e)=>{if(s.has(ee))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(ee):s.set(ee,e)},wn=(ee,s,e,r)=>(po(ee,s,"write to private field"),r?r.call(ee,e):s.set(ee,e),e);(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{30001:function(ee,s,e){"use strict";e.d(s,{n3:function(){return A},MS:function(){return m}});var r=e(48023),t=e(10179),l=e(96279),u=e.n(l);const A=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class m{constructor(c){q(this,"discoveryApi");q(this,"fetchApi");this.discoveryApi=c.discoveryApi,this.fetchApi=c.fetchApi||{fetch:u()}}async getEntityAncestors(c,f){const{kind:y,namespace:p,name:E}=(0,r.of)(c.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}/ancestry`,f)}async getLocationById(c,f){return await this.requestOptional("GET",`/locations/${encodeURIComponent(c)}`,f)}async getEntities(c,f){const{filter:y=[],fields:p=[],offset:E,limit:T,after:I}=c!=null?c:{},B=[];for(const L of[y].flat()){const D=[];for(const[U,Y]of Object.entries(L))for(const te of[Y].flat())te===A?D.push(encodeURIComponent(U)):typeof te=="string"&&D.push(`${encodeURIComponent(U)}=${encodeURIComponent(te)}`);D.length&&B.push(`filter=${D.join(",")}`)}p.length&&B.push(`fields=${p.map(encodeURIComponent).join(",")}`),E!==void 0&&B.push(`offset=${E}`),T!==void 0&&B.push(`limit=${T}`),I!==void 0&&B.push(`after=${encodeURIComponent(I)}`);const j=B.length?`?${B.join("&")}`:"",M=await this.requestRequired("GET",`/entities${j}`,f),b=(L,D)=>{var te,ue;if(((te=L.metadata)==null?void 0:te.name)===void 0||L.kind===void 0||((ue=D.metadata)==null?void 0:ue.name)===void 0||D.kind===void 0)return 0;const U=(0,r.eE)(L),Y=(0,r.eE)(D);return U<Y?-1:U>Y?1:0};return{items:M.sort(b)}}async getEntityByRef(c,f){const{kind:y,namespace:p,name:E}=(0,r.of)(c);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}`,f)}async getEntityByName(c,f){const{kind:y,namespace:p="default",name:E}=c;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}`,f)}async refreshEntity(c,f){const y=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(f==null?void 0:f.token)&&{Authorization:`Bearer ${f==null?void 0:f.token}`}},method:"POST",body:JSON.stringify({entityRef:c})});if(y.status!==200)throw new Error(await y.text())}async getEntityFacets(c,f){const{filter:y=[],facets:p}=c,E=[];for(const I of[y].flat()){const B=[];for(const[j,M]of Object.entries(I))for(const b of[M].flat())b===A?B.push(encodeURIComponent(j)):typeof b=="string"&&B.push(`${encodeURIComponent(j)}=${encodeURIComponent(b)}`);B.length&&E.push(`filter=${B.join(",")}`)}for(const I of p)E.push(`facet=${encodeURIComponent(I)}`);const T=E.length?`?${E.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${T}`,f)}async addLocation({type:c="url",target:f,dryRun:y},p){const E=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${y?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(p==null?void 0:p.token)&&{Authorization:`Bearer ${p==null?void 0:p.token}`}},method:"POST",body:JSON.stringify({type:c,target:f})});if(E.status!==201)throw new Error(await E.text());const{location:T,entities:I,exists:B}=await E.json();if(!T)throw new Error(`Location wasn't added: ${f}`);return{location:T,entities:I,exists:B}}async getLocationByRef(c,f){return(await this.requestRequired("GET","/locations",f)).map(p=>p.data).find(p=>c===(0,r.NZ)(p))}async removeLocationById(c,f){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(c)}`,f)}async removeEntityByUid(c,f){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(c)}`,f)}async requestIgnored(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok)throw await t.VL.fromResponse(T)}async requestRequired(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok)throw await t.VL.fromResponse(T);return await T.json()}async requestOptional(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok){if(T.status===404)return;throw await t.VL.fromResponse(T)}return await T.json()}}},48023:function(ee,s,e){"use strict";e.d(s,{Tf:function(){return l},P1:function(){return Rt},q1:function(){return Nt},M6:function(){return Zt},l2:function(){return t},zG:function(){return r},w$:function(){return Q},nP:function(){return Z},aS:function(){return ke},S4:function(){return fe},cz:function(){return Ae},iB:function(){return _e},of:function(){return et},Ou:function(){return vt},eE:function(){return st},NZ:function(){return at}});const r="default",t="backstage.io/view-url",l="backstage.io/edit-url";var u=e(76635),A=e.n(u);class m{constructor(V=DEFAULT_NAMESPACE){q(this,"namespace");this.namespace=V}async enforce(V){return V.metadata.namespace?V:lodash.merge({metadata:{namespace:this.namespace}},V)}}class o{static isValidPrefixAndOrSuffix(V,ye,He,qe){if(typeof V!="string")return!1;const ot=V.split(ye);return ot.length===1?qe(ot[0]):ot.length===2?He(ot[0])&&qe(ot[1]):!1}static isJsonSafe(V){try{return A().isEqual(V,JSON.parse(JSON.stringify(V)))}catch{return!1}}static isValidDnsSubdomain(V){return typeof V=="string"&&V.length>=1&&V.length<=253&&V.split(".").every(o.isValidDnsLabel)}static isValidDnsLabel(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(V)}static isValidTag(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(V)}static isValidUrl(V){if(typeof V!="string")return!1;try{return new URL(V),!0}catch{return!1}}static isValidString(V){var ye;return typeof V=="string"&&((ye=V==null?void 0:V.trim())==null?void 0:ye.length)>=1}static isNonEmptyString(V){var ye;return typeof V=="string"&&((ye=V==null?void 0:V.trim())==null?void 0:ye.length)>=1}}var c=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),f=e(48231),y=e.n(f),p=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"}}}`),E=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}}}}}}'),T=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 I=new Map,B=[c,p,E,T];function j(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const V=ae[0];throw new TypeError(`${V.instancePath||"<root>"} ${V.message}${V.params?` - ${Object.entries(V.params).map(([ye,He])=>`${ye}: ${He}`).join(", ")}`:""}`)}function M(ae,V={}){var Wt;const ye=(Wt=V==null?void 0:V.disableCache)!=null?Wt:!1,He=ye?"":JSON.stringify(ae);if(!ye){const Xt=I.get(He);if(Xt)return Xt}const qe=b(ae),ot=new(y())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});qe.length&&ot.addSchema(qe,void 0,void 0,!0);const bt=ot.compile(ae);return ye||I.set(He,bt),bt}function b(ae){if(typeof ae!="object")return[];const V=new Set;ae.$id&&V.add(ae.$id);const ye=new Array,He=[ae];for(;He.length;){const qe=He.pop();for(const ot of L(qe))if(!V.has(ot)){V.add(ot);const bt=B.find(Wt=>Wt.$id===ot);bt&&(ye.push(bt),He.push(bt))}}return ye}function*L(ae){const V=[ae];for(;V.length;){const ye=V.pop();if(typeof ye=="object"&&ye)for(const[He,qe]of Object.entries(ye))He==="$ref"&&typeof qe=="string"?yield qe.split("#")[0]:V.push(qe)}}function D(ae){const V=compileAjvSchema(ae||entityEnvelopeSchema);return ye=>{if(V(ye)===!0)return ye;throw throwAjvError(V.errors)}}function U(ae){const V=M(ae);return ye=>{var ot;if(V(ye)===!0)return ye;const qe=(ot=V.errors)==null?void 0:ot.filter(bt=>["/kind","/apiVersion"].includes(bt.instancePath));if((qe==null?void 0:qe.length)&&qe.every(bt=>bt.keyword==="enum"))return!1;throw j(V.errors)}}function Y(ae){const V=compileAjvSchema(ae||entitySchema);return ye=>{if(V(ye)===!0)return ye;throw throwAjvError(V.errors)}}class te{static isValidApiVersion(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,ye=>ye.length>=1&&ye.length<=63&&/^[a-z0-9A-Z]+$/.test(ye))}static isValidKind(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(V)}static isValidObjectName(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(V)}static isValidNamespace(V){return o.isValidDnsLabel(V)}static isValidLabelKey(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,te.isValidObjectName)}static isValidLabelValue(V){return V===""||te.isValidObjectName(V)}static isValidAnnotationKey(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,te.isValidObjectName)}static isValidAnnotationValue(V){return typeof V=="string"}}const ue={isValidApiVersion:te.isValidApiVersion,isValidKind:te.isValidKind,isValidEntityName:te.isValidObjectName,isValidNamespace:te.isValidNamespace,isValidLabelKey:te.isValidLabelKey,isValidLabelValue:te.isValidLabelValue,isValidAnnotationKey:te.isValidAnnotationKey,isValidAnnotationValue:te.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function Re(ae={}){return{...ue,...ae}}class we{constructor(V=makeValidator()){q(this,"validators");this.validators=V}async enforce(V){var bt,Wt,Xt,un,dn,xt,qt;function ye(x,re,Ee){if(re==null)throw new Error(`${x} must have a value`);let Te;try{Te=Ee(re)}catch(Le){throw new Error(`${x} could not be validated, ${Le}`)}if(!Te){let Le;switch(Ee.name){case"isValidLabelValue":case"isValidObjectName":Le="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":Le="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Le="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Le="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Le="a string";break;case"isValidKind":Le="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Le="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Le="a non empty string";break;default:Le=void 0;break}const Je=Le?` expected ${Le} but found "${re}".`:"";throw new Error(`"${x}" is not valid;${Je} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function He(x,re,Ee){return re===void 0||ye(x,re,Ee)}ye("apiVersion",V.apiVersion,this.validators.isValidApiVersion),ye("kind",V.kind,this.validators.isValidKind),ye("metadata.name",V.metadata.name,this.validators.isValidEntityName),He("metadata.namespace",V.metadata.namespace,this.validators.isValidNamespace);for(const[x,re]of Object.entries((bt=V.metadata.labels)!=null?bt:[]))ye(`labels.${x}`,x,this.validators.isValidLabelKey),ye(`labels.${x}`,re,this.validators.isValidLabelValue);for(const[x,re]of Object.entries((Wt=V.metadata.annotations)!=null?Wt:[]))ye(`annotations.${x}`,x,this.validators.isValidAnnotationKey),ye(`annotations.${x}`,re,this.validators.isValidAnnotationValue);const qe=(Xt=V.metadata.tags)!=null?Xt:[];for(let x=0;x<qe.length;++x)ye(`tags.${x}`,qe[x],this.validators.isValidTag);const ot=(un=V.metadata.links)!=null?un:[];for(let x=0;x<ot.length;++x)ye(`links.${x}.url`,(dn=ot[x])==null?void 0:dn.url,CommonValidatorFunctions.isValidUrl),He(`links.${x}.title`,(xt=ot[x])==null?void 0:xt.title,CommonValidatorFunctions.isNonEmptyString),He(`links.${x}.icon`,(qt=ot[x])==null?void 0:qt.icon,KubernetesValidatorFunctions.isValidObjectName);return V}}class ge{constructor(){q(this,"validate")}async enforce(V){if(!this.validate){const qe=new Ajv({allowUnionTypes:!0});this.validate=qe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(V)===!0)return V;const[He]=this.validate.errors||[];throw He?new Error(`Malformed envelope, ${He.instancePath||"<root>"} ${He.message}`):new Error("Malformed envelope, Unknown error")}}function ze(ae){let V=ae.indexOf(":");const ye=ae.indexOf("/");ye!==-1&&ye<V&&(V=-1);const He=V===-1?void 0:ae.slice(0,V),qe=ye===-1?void 0:ae.slice(V+1,ye),ot=ae.slice(Math.max(V+1,ye+1));if(He===""||qe===""||ot==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:He,namespace:qe,name:ot}}function _e(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||r,name:ae.metadata.name}}function et(ae,V){var Wt,Xt,un,dn;if(!ae)throw new Error("Entity reference must not be empty");const ye=V==null?void 0:V.defaultKind,He=(V==null?void 0:V.defaultNamespace)||r;let qe,ot,bt;if(typeof ae=="string"){const xt=ze(ae);qe=(Wt=xt.kind)!=null?Wt:ye,ot=(Xt=xt.namespace)!=null?Xt:He,bt=xt.name}else qe=(un=ae.kind)!=null?un:ye,ot=(dn=ae.namespace)!=null?dn:He,bt=ae.name;if(qe)if(ot){if(!bt){const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty name`)}}else{const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty namespace`)}else{const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:qe,namespace:ot,name:bt}}function st(ae){var qe,ot;let V,ye,He;return"metadata"in ae?(V=ae.kind,ye=(qe=ae.metadata.namespace)!=null?qe:r,He=ae.metadata.name):(V=ae.kind,ye=(ot=ae.namespace)!=null?ot:r,He=ae.name),`${V.toLocaleLowerCase("en-US")}:${ye.toLocaleLowerCase("en-US")}/${He.toLocaleLowerCase("en-US")}`}class Ct{constructor(V){this.policies=V}async enforce(V){let ye=V;for(const He of this.policies){const qe=await He.enforce(ye);if(!qe)throw new Error(`Policy ${He.constructor.name} did not return a result`);ye=qe}return ye}}class yt{constructor(V){this.policies=V}async enforce(V){for(const ye of this.policies){const He=await ye.enforce(V);if(He)return He}throw new Error("The entity did not match any known policy")}}const Pe={allOf(ae){return new Ct(ae)},oneOf(ae){return new yt(ae)}};var ht=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function Ve(ae){const V=U(ae);return{async check(ye){return V(ye)===ye}}}const ie=Ve(ht);var de=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 Ue=Ve(de);var Be=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 Xe=Ve(Be);var mt=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 Ye=Ve(mt);var Et=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 oe=Ve(Et),fe="ownedBy",tt="ownerOf",Ke="consumesApi",Ne="apiConsumedBy",ct="providesApi",X="apiProvidedBy",Z="dependsOn",Q="dependencyOf",se="parentOf",le="childOf",be="memberOf",Oe="hasMember",Ae="partOf",ke="hasPart";var We=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 gt=Ve(We);var It=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 lt=Ve(It);var Tt=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 Lt=Ve(Tt),Rt="backstage.io/managed-by-location",Nt="backstage.io/managed-by-origin-location",Zt="backstage.io/source-location";function vt(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const V=ae.indexOf(":");if(V<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ye=ae.substring(0,V).trim(),He=ae.substring(V+1).trim();if(!ye||!He)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ye==="http"||ye==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:ye,target:He}}function at(ae){const{type:V,target:ye}=ae;if(V){if(!ye)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${V}:${ye}`}function zt(ae){var ye,He,qe,ot,bt;const V=(bt=(He=(ye=ae.metadata)==null?void 0:ye.annotations)==null?void 0:He[ANNOTATION_SOURCE_LOCATION])!=null?bt:(ot=(qe=ae.metadata)==null?void 0:qe.annotations)==null?void 0:ot[ANNOTATION_LOCATION];if(!V)throw new Error(`Entity '${stringifyEntityRef(ae)}' is missing location`);return vt(V)}},23235:function(ee,s,e){"use strict";e.d(s,{C:function(){return t}});var r=e(98005);class t{constructor(){q(this,"subject",new r.J)}post(u){this.subject.next(u)}alert$(){return this.subject}}},47150:function(ee,s,e){"use strict";e.d(s,{g:function(){return r}});class r{captureEvent(l){}}},58652:function(ee,s,e){"use strict";e.d(s,{C:function(){return l}});var r=e(98005);const t="theme";class l{constructor(A){q(this,"activeThemeId");q(this,"subject",new r.X(void 0));this.themes=A}static createWithStorage(A){var c;const m=new l(A);if(!window.localStorage)return m;const o=(c=window.localStorage.getItem(t))!=null?c:void 0;return m.setActiveThemeId(o),m.activeThemeId$().subscribe(f=>{f?window.localStorage.setItem(t,f):window.localStorage.removeItem(t)}),window.addEventListener("storage",f=>{var y;if(f.key===t){const p=(y=localStorage.getItem(t))!=null?y:void 0;m.setActiveThemeId(p)}}),m}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(A){this.activeThemeId=A,this.subject.next(A)}}},14721:function(ee,s,e){"use strict";e.d(s,{m:function(){return f}});var r=e(9850),t=e.n(r),l=e(12782),u=e.n(l);const A=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function m(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function o(y){if(y===null)return"null";if(Array.isArray(y))return"array";const p=typeof y;return p==="number"&&isNaN(y)?"nan":p==="string"&&y===""?"empty-string":p}const c={type(y,p,E,T){return`Invalid type in config for key '${y}' in '${p}', got ${E}, wanted ${T}`},missing(y){return`Missing required config value at '${y}'`},convert(y,p,E){return`Unable to convert config value for key '${y}' in '${p}' to a ${E}`}};class f{constructor(p,E="mock-config",T,I=""){q(this,"filteredKeys");q(this,"notifiedFilteredKeys",new Set);this.data=p,this.context=E,this.fallback=T,this.prefix=I}static fromConfigs(p){return p.length===0?new f(void 0):p.reduce((E,{data:T,context:I,filteredKeys:B,deprecatedKeys:j})=>{const M=new f(T,I,E);if(M.filteredKeys=B,j)for(const{key:b,description:L}of j)console.warn(`The configuration key '${b}' of ${I} is deprecated and may be removed soon. ${L||""}`);return M},void 0)}has(p){var T,I;return this.readValue(p)!==void 0?!0:(I=(T=this.fallback)==null?void 0:T.has(p))!=null?I:!1}keys(){var T,I;const p=this.data?Object.keys(this.data):[],E=(I=(T=this.fallback)==null?void 0:T.keys())!=null?I:[];return[...new Set([...p,...E])]}get(p){const E=this.getOptional(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p!=null?p:"")));return E}getOptional(p){var I;const E=t()(this.readValue(p)),T=(I=this.fallback)==null?void 0:I.getOptional(p);return E===void 0?T:T===void 0?E:u()({},{value:T},{value:E},(B,j)=>!m(j)||!m(B)?j:void 0).value}getConfig(p){const E=this.getOptionalConfig(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalConfig(p){var I;const E=this.readValue(p),T=(I=this.fallback)==null?void 0:I.getOptionalConfig(p);if(m(E))return this.copy(E,p,T);if(E!==void 0)throw new TypeError(c.type(this.fullKey(p),this.context,o(E),"object"));return T}getConfigArray(p){const E=this.getOptionalConfigArray(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalConfigArray(p){const E=this.readConfigValue(p,T=>{if(!Array.isArray(T))return{expected:"object-array"};for(const[I,B]of T.entries())if(!m(B))return{expected:"object-array",value:B,key:`${p}[${I}]`};return!0});if(!!E)return E.map((T,I)=>this.copy(T,`${p}[${I}]`))}getNumber(p){const E=this.getOptionalNumber(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalNumber(p){const E=this.readConfigValue(p,I=>typeof I=="number"||typeof I=="string"||{expected:"number"});if(typeof E=="number"||E===void 0)return E;const T=Number(E);if(!Number.isFinite(T))throw new Error(c.convert(this.fullKey(p),this.context,"number"));return T}getBoolean(p){const E=this.getOptionalBoolean(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalBoolean(p){return this.readConfigValue(p,E=>typeof E=="boolean"||{expected:"boolean"})}getString(p){const E=this.getOptionalString(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalString(p){return this.readConfigValue(p,E=>typeof E=="string"&&E!==""||{expected:"string"})}getStringArray(p){const E=this.getOptionalStringArray(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalStringArray(p){return this.readConfigValue(p,E=>{if(!Array.isArray(E))return{expected:"string-array"};for(const[T,I]of E.entries())if(typeof I!="string"||I==="")return{expected:"string-array",value:I,key:`${p}[${T}]`};return!0})}fullKey(p){return`${this.prefix}${this.prefix?".":""}${p}`}copy(p,E,T){const I=new f(p,this.context,T,this.fullKey(E));return I.filteredKeys=this.filteredKeys,I}readConfigValue(p,E){var B;const T=this.readValue(p);if(T===void 0)return(B=this.fallback)==null?void 0:B.readConfigValue(p,E);const I=E(T);if(I!==!0){const{key:j=p,value:M=T,expected:b}=I;throw new TypeError(c.type(this.fullKey(j),this.context,o(M),b))}return T}readValue(p){const E=p?p.split("."):[];for(const I of E)if(!A.test(I))throw new TypeError(`Invalid config key '${p}'`);if(this.data===void 0)return;let T=this.data;for(const[I,B]of E.entries())if(m(T))T=T[B];else if(T!==void 0){const j=this.fullKey(E.slice(0,I).join("."));throw new TypeError(c.type(j,this.context,o(T),"object"))}return T}}},4333:function(ee,s,e){"use strict";e.d(s,{p:function(){return t}});const r="Invalid discovery URL pattern,";class t{static compile(u){const A=u.split(/\{\{\s*pluginId\s*\}\}/),m=A.join("pluginId");let o;try{o=new URL(m)}catch{throw new Error(`${r} URL '${m}' is invalid`)}if(o.hash)throw new Error(`${r} URL must not have a hash`);if(o.search)throw new Error(`${r} URL must not have a query`);if(m.endsWith("/"))throw new Error(`${r} URL must not end with a slash`);return new t(A)}constructor(u){this.parts=u}async getBaseUrl(u){return this.parts.join(u)}}},89536:function(ee,s,e){"use strict";e.d(s,{KN:function(){return r},gr:function(){return l},Jv:function(){return u}});class r{constructor(m,o){this.alertApi=m,this.errorApi=o}post(m,o){return o!=null&&o.hidden||this.alertApi.post({message:m.message,severity:"error"}),this.errorApi.post(m,o)}error$(){return this.errorApi.error$()}}var t=e(98005);class l{constructor(){q(this,"subject",new t.J)}post(m,o){this.subject.next({error:m,context:o})}error$(){return this.subject}}class u{static forward(m,o){window.addEventListener("unhandledrejection",c=>{m.post(c.reason,o)})}}},14884:function(ee,s,e){"use strict";e.d(s,{b:function(){return l}});var r=e(36964);function t(u){if(u.length<3)throw new Error(`The '${u}' feature flag must have a minimum length of three characters.`);if(u.length>150)throw new Error(`The '${u}' feature flag must not exceed 150 characters.`);if(!u.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${u}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class l{constructor(){q(this,"registeredFeatureFlags",[]);q(this,"flags")}registerFlag(A){t(A.name),this.registeredFeatureFlags.push(A)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(A){return this.flags||(this.flags=this.load()),this.flags.get(A)===r.FeatureFlagState.Active}save(A){this.flags||(this.flags=this.load()),A.merge||this.flags.clear();for(const[o,c]of Object.entries(A.states))this.flags.set(o,c);const m=Array.from(this.flags.entries()).filter(([,o])=>o===r.FeatureFlagState.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(m)))}load(){try{const A=window.localStorage.getItem("featureFlags");if(!A)return new Map;const m=JSON.parse(A);if(typeof m!="object"||m===null||Array.isArray(m))return new Map;const o=Object.entries(m).filter(([c,f])=>(t(c),f===r.FeatureFlagState.Active));return new Map(o)}catch{return new Map}}}},50160:function(ee,s,e){"use strict";e.d(s,{I:function(){return c},j:function(){return r}});function r(f){var E;let y=f.baseImplementation||e.g.fetch;const p=[(E=f.middleware)!=null?E:[]].flat().reverse();for(const T of p)y=T.apply(y);return{fetch:y}}class t{static create(y){var I,B;const p=l(y),E=((I=y.header)==null?void 0:I.name)||"authorization",T=((B=y.header)==null?void 0:B.value)||(j=>`Bearer ${j}`);return new t(y.identityApi,p,E,T)}constructor(y,p,E,T){this.identityApi=y,this.allowUrl=p,this.headerName=E,this.headerValue=T}apply(y){return async(p,E)=>{const T=new Request(p,E),{token:I}=await this.identityApi.getCredentials();return T.headers.get(this.headerName)||typeof I!="string"||!I||!this.allowUrl(T.url)?y(p,E):(T.headers.set(this.headerName,this.headerValue(I)),y(T))}}}function l(f){return f.allowUrl?f.allowUrl:f.urlPrefixAllowlist?u(f.urlPrefixAllowlist):f.config?u([f.config.getString("backend.baseUrl")]):()=>!1}function u(f){const y=f.map(p=>p.replace(/\/$/,""));return p=>y.some(E=>p===E||p.startsWith(`${E}/`))}function A(f,y){return!y||y==="/"?f:`${f.replace(/\/$/,"")}/${y.replace(/^\//,"")}`}class m{constructor(y){this.discoveryApi=y}apply(y){return async(p,E)=>{const T=new Request(p,E),I="plugin://";if(!T.url.startsWith(I))return y(p,E);const{hostname:B,pathname:j,search:M,hash:b,username:L,password:D}=new URL(`http://${T.url.substring(I.length)}`);let U=await this.discoveryApi.getBaseUrl(B);if(L||D){const te=new URL(U),ue=`${L}${D?`:${D}`:""}@`;U=`${te.protocol}//${ue}${te.host}${te.pathname}`}const Y=`${A(U,j)}${M}${b}`;return y(Y,typeof p=="string"||o(p)?E:p)}}}function o(f){return typeof f=="object"&&(f==null?void 0:f.constructor)===URL}class c{static resolvePluginProtocol(y){return new m(y.discoveryApi)}static injectIdentityAuth(y){return t.create(y)}constructor(){}}},11358:function(ee,s,e){"use strict";e.d(s,{Y:function(){return A}});var r=e(98005);function t(m,o){for(const c of o)if(!m.has(c))return!1;return!0}function l(m,...o){const c=new Set(m);for(const f of o)for(const y of f)c.add(y);return c}class u{constructor(){q(this,"requests",[]);q(this,"subject",new r.X(this.getCurrentPending()))}request(o){return new Promise((c,f)=>{this.requests.push({scopes:o,resolve:c,reject:f}),this.subject.next(this.getCurrentPending())})}resolve(o,c){this.requests=this.requests.filter(f=>t(o,f.scopes)?(f.resolve(c),!1):!0),this.subject.next(this.getCurrentPending())}reject(o){this.requests.forEach(c=>c.reject(o)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const o=this.requests.length===0?void 0:this.requests.slice(1).reduce((c,f)=>l(c,f.scopes),this.requests[0].scopes);return{scopes:o,resolve:c=>{o&&this.resolve(o,c)},reject:c=>{o&&this.reject(c)}}}}class A{constructor(){q(this,"subject",new r.X([]));q(this,"currentRequests",[]);q(this,"handlerCount",0)}createAuthRequester(o){const c=new u,f=this.handlerCount;return this.handlerCount++,c.pending().subscribe({next:y=>{const p=this.currentRequests.slice(),E=this.makeAuthRequest(y,o);E?p[f]=E:delete p[f],this.currentRequests=p,this.subject.next(p.filter(Boolean))}}),y=>c.request(y)}makeAuthRequest(o,c){const{scopes:f}=o;if(!!f)return{provider:c.provider,trigger:async()=>{const y=await c.onAuthRequest(f);o.resolve(y)},reject:()=>{const y=new Error("Login failed, rejected by user");y.name="RejectedError",o.reject(y)}}}authRequest$(){return this.subject}}},56054:function(ee,s,e){"use strict";e.d(s,{C:function(){return u}});var r=e(82394),t=e.n(r);const l=new Map;class u{constructor(m,o){q(this,"subscribers",new Set);q(this,"observable",new(t())(m=>(this.subscribers.add(m),()=>{this.subscribers.delete(m)})));this.namespace=m,this.errorApi=o}static create(m){var o;return new u((o=m.namespace)!=null?o:"",m.errorApi)}get(m){return this.snapshot(m).value}snapshot(m){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(m));f&&(o=JSON.parse(f,(y,p)=>(typeof p=="object"&&p!==null&&Object.freeze(p),p)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${m}`))}return{key:m,value:o,presence:c}}forBucket(m){const o=`${this.namespace}/${m}`;return l.has(o)||l.set(o,new u(o,this.errorApi)),l.get(o)}async set(m,o){localStorage.setItem(this.getKeyName(m),JSON.stringify(o)),this.notifyChanges(m)}async remove(m){localStorage.removeItem(this.getKeyName(m)),this.notifyChanges(m)}observe$(m){return this.observable.filter(({key:o})=>o===m)}getKeyName(m){return`${this.namespace}/${encodeURIComponent(m)}`}notifyChanges(m){const o=this.snapshot(m);for(const c of this.subscribers)c.next(o)}}},59589:function(ee,s,e){"use strict";e.d(s,{u:function(){return l}});var r=e(91205);const t={id:"atlassian",title:"Atlassian",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o})}}},6098:function(ee,s,e){"use strict";e.d(s,{Z:function(){return l}});var r=e(91205);const t={id:"bitbucket",title:"Bitbucket",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["team"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},44431:function(ee,s,e){"use strict";e.d(s,{BitbucketAuth:function(){return l.Z}});var r=e(19347),t=e.n(r);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var l=e(6098)},19347:function(){},44474:function(ee,s,e){"use strict";e.d(s,{T:function(){return l}});var r=e(91205);const t={id:"github",title:"GitHub",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["read:user"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},2922:function(ee,s,e){"use strict";e.d(s,{a:function(){return l}});var r=e(91205);const t={id:"gitlab",title:"GitLab",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["read_user"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},59938:function(ee,s,e){"use strict";e.d(s,{e:function(){return u}});var r=e(91205);const t={id:"google",title:"Google",icon:()=>null},l="https://www.googleapis.com/auth/";class u{static create(m){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:y=t,defaultScopes:p=["openid",`${l}userinfo.email`,`${l}userinfo.profile`]}=m;return r.OAuth2.create({discoveryApi:o,oauthRequestApi:c,provider:y,environment:f,defaultScopes:p,scopeTransform(E){return E.map(T=>T==="openid"?T:T==="profile"||T==="email"?`${l}userinfo.${T}`:T.startsWith(l)?T:`${l}${T}`)}})}}},91668:function(ee,s,e){"use strict";e.d(s,{AtlassianAuth:function(){return y.u},BitbucketAuth:function(){return f.BitbucketAuth},GithubAuth:function(){return r.T},GitlabAuth:function(){return t.a},GoogleAuth:function(){return l.e},MicrosoftAuth:function(){return o._},OktaAuth:function(){return A.s},OneLoginAuth:function(){return c.$}});var r=e(44474),t=e(2922),l=e(59938),u=e(91205);e.o(u,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return u.AlertApiForwarder}}),e.o(u,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return u.AppThemeSelector}}),e.o(u,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return u.AtlassianAuth}}),e.o(u,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return u.BitbucketAuth}}),e.o(u,"ConfigReader")&&e.d(s,{ConfigReader:function(){return u.ConfigReader}}),e.o(u,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return u.ErrorAlerter}}),e.o(u,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return u.ErrorApiForwarder}}),e.o(u,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return u.FetchMiddlewares}}),e.o(u,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return u.FlatRoutes}}),e.o(u,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return u.LocalStorageFeatureFlags}}),e.o(u,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return u.MicrosoftAuth}}),e.o(u,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return u.NoOpAnalyticsApi}}),e.o(u,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return u.OAuthRequestManager}}),e.o(u,"OktaAuth")&&e.d(s,{OktaAuth:function(){return u.OktaAuth}}),e.o(u,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return u.OneLoginAuth}}),e.o(u,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return u.UnhandledErrorForwarder}}),e.o(u,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return u.UrlPatternDiscovery}}),e.o(u,"WebStorage")&&e.d(s,{WebStorage:function(){return u.WebStorage}}),e.o(u,"createFetchApi")&&e.d(s,{createFetchApi:function(){return u.createFetchApi}}),e.o(u,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return u.createSpecializedApp}}),e.o(u,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return u.defaultConfigLoader}});var A=e(26079),m=e(67604),o=e(38482),c=e(58381),f=e(44431);e.o(f,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return f.AlertApiForwarder}}),e.o(f,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return f.AppThemeSelector}}),e.o(f,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return f.AtlassianAuth}}),e.o(f,"ConfigReader")&&e.d(s,{ConfigReader:function(){return f.ConfigReader}}),e.o(f,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return f.ErrorAlerter}}),e.o(f,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return f.ErrorApiForwarder}}),e.o(f,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return f.FetchMiddlewares}}),e.o(f,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return f.FlatRoutes}}),e.o(f,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return f.LocalStorageFeatureFlags}}),e.o(f,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return f.NoOpAnalyticsApi}}),e.o(f,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return f.OAuthRequestManager}}),e.o(f,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return f.UnhandledErrorForwarder}}),e.o(f,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return f.UrlPatternDiscovery}}),e.o(f,"WebStorage")&&e.d(s,{WebStorage:function(){return f.WebStorage}}),e.o(f,"createFetchApi")&&e.d(s,{createFetchApi:function(){return f.createFetchApi}}),e.o(f,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return f.createSpecializedApp}}),e.o(f,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return f.defaultConfigLoader}});var y=e(59589)},38482:function(ee,s,e){"use strict";e.d(s,{_:function(){return l}});var r=e(91205);const t={id:"microsoft",title:"Microsoft",icon:()=>null};class l{static create(A){const{environment:m="development",provider:o=t,oauthRequestApi:c,discoveryApi:f,defaultScopes:y=["openid","offline_access","profile","email","User.Read"]}=A;return r.OAuth2.create({discoveryApi:f,oauthRequestApi:c,provider:o,environment:m,defaultScopes:y})}}},73124:function(ee,s,e){"use strict";e.d(s,{Z:function(){return m}});function r(o){return new Promise((c,f)=>{const y=o.width||500,p=o.height||700,E=window.screen.width/2-y/2,T=window.screen.height/2-p/2,I=window.open(o.url,o.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${y},height=${p},top=${T},left=${E}`);let B="";if(!I||typeof I.closed=="undefined"||I.closed){const L=new Error("Failed to open auth popup.");L.name="PopupRejectedError",f(L);return}const j=L=>{if(L.source!==I||L.origin!==o.origin)return;const{data:D}=L;if(D.type==="config_info"){B=D.targetOrigin;return}if(D.type!=="authorization_response")return;const U=D;if("error"in U){const Y=new Error(U.error.message);Y.name=U.error.name,f(Y)}else c(U.response);b()},M=setInterval(()=>{if(I.closed){const L=`Login failed, ${B&&B!==window.location.origin?`Incorrect app origin, expected ${B}`:"popup was closed"}`,D=new Error(L);D.name="PopupClosedError",f(D),b()}},100);function b(){window.removeEventListener("message",j),clearInterval(M)}window.addEventListener("message",j)})}function t(o){return[...o].join(" ")}class l{constructor(c){q(this,"discoveryApi");q(this,"environment");q(this,"provider");q(this,"joinScopesFunc");q(this,"authRequester");q(this,"sessionTransform");const{discoveryApi:f,environment:y,provider:p,joinScopes:E=t,oauthRequestApi:T,sessionTransform:I=B=>B}=c;this.authRequester=T.createAuthRequester({provider:p,onAuthRequest:B=>this.showPopup(B)}),this.discoveryApi=f,this.environment=y,this.provider=p,this.joinScopesFunc=E,this.sessionTransform=I}async createSession(c){return c.instantPopup?this.showPopup(c.scopes):this.authRequester(c.scopes)}async refreshSession(){const c=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(y=>{throw new Error(`Auth refresh request failed, ${y}`)});if(!c.ok){const y=new Error(`Auth refresh request failed, ${c.statusText}`);throw y.status=c.status,y}const f=await c.json();if(f.error){const y=new Error(f.error.message);throw f.error.name&&(y.name=f.error.name),y}return await this.sessionTransform(f)}async removeSession(){const c=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(f=>{throw new Error(`Logout request failed, ${f}`)});if(!c.ok){const f=new Error(`Logout request failed, ${c.statusText}`);throw f.status=c.status,f}}async showPopup(c){const f=this.joinScopesFunc(c),y=await this.buildUrl("/start",{scope:f,origin:location.origin}),p=await r({url:y,name:`${this.provider.title} Login`,origin:new URL(y).origin,width:450,height:730});return await this.sessionTransform(p)}async buildUrl(c,f){const y=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...f,env:this.environment});return`${y}/${this.provider.id}${c}${p}`}buildQueryString(c){if(!c)return"";const f=Object.entries(c).map(([y,p])=>{if(typeof p=="string")return`${encodeURIComponent(y)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(y)}).filter(Boolean).join("&");return f?`?${f}`:""}}var u=e(57018);const A={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class m{constructor(c){q(this,"sessionManager");q(this,"scopeTransform");this.sessionManager=c.sessionManager,this.scopeTransform=c.scopeTransform}static create(c){const{discoveryApi:f,environment:y="development",provider:p=A,oauthRequestApi:E,defaultScopes:T=[],scopeTransform:I=M=>M}=c,B=new l({discoveryApi:f,environment:y,provider:p,oauthRequestApi:E,sessionTransform(M){return{...M,providerInfo:{idToken:M.providerInfo.idToken,accessToken:M.providerInfo.accessToken,scopes:m.normalizeScopes(I,M.providerInfo.scope),expiresAt:new Date(Date.now()+M.providerInfo.expiresInSeconds*1e3)}}}}),j=new u.RefreshingAuthSessionManager({connector:B,defaultScopes:new Set(T),sessionScopes:M=>M.providerInfo.scopes,sessionShouldRefresh:M=>(M.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new m({sessionManager:j,scopeTransform:I})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(c,f){var E;const y=m.normalizeScopes(this.scopeTransform,c),p=await this.sessionManager.getSession({...f,scopes:y});return(E=p==null?void 0:p.providerInfo.accessToken)!=null?E:""}async getIdToken(c={}){var y;const f=await this.sessionManager.getSession(c);return(y=f==null?void 0:f.providerInfo.idToken)!=null?y:""}async getBackstageIdentity(c={}){const f=await this.sessionManager.getSession(c);return f==null?void 0:f.backstageIdentity}async getProfile(c={}){const f=await this.sessionManager.getSession(c);return f==null?void 0:f.profile}static normalizeScopes(c,f){if(!f)return new Set;const y=Array.isArray(f)?f:f.split(/[\s|,]/).filter(Boolean);return new Set(c(y))}}},91205:function(ee,s,e){"use strict";e.d(s,{OAuth2:function(){return r.Z}});var r=e(73124),t=e(5973),l=e.n(t);e.o(t,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return t.AlertApiForwarder}}),e.o(t,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return t.AppThemeSelector}}),e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"ConfigReader")&&e.d(s,{ConfigReader:function(){return t.ConfigReader}}),e.o(t,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return t.ErrorAlerter}}),e.o(t,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return t.ErrorApiForwarder}}),e.o(t,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return t.FetchMiddlewares}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return t.LocalStorageFeatureFlags}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return t.NoOpAnalyticsApi}}),e.o(t,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return t.OAuthRequestManager}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}}),e.o(t,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return t.UnhandledErrorForwarder}}),e.o(t,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return t.UrlPatternDiscovery}}),e.o(t,"WebStorage")&&e.d(s,{WebStorage:function(){return t.WebStorage}}),e.o(t,"createFetchApi")&&e.d(s,{createFetchApi:function(){return t.createFetchApi}}),e.o(t,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return t.createSpecializedApp}}),e.o(t,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return t.defaultConfigLoader}})},5973:function(){},26079:function(ee,s,e){"use strict";e.d(s,{s:function(){return A}});var r=e(91205);const t={id:"okta",title:"Okta",icon:()=>null},l=new Set(["openid","profile","email","phone","address","groups","offline_access"]),u="okta.";class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=t,oauthRequestApi:p,defaultScopes:E=["openid","email","profile","offline_access"]}=o;return r.OAuth2.create({discoveryApi:c,oauthRequestApi:p,provider:y,environment:f,defaultScopes:E,scopeTransform(T){return T.map(I=>l.has(I)||I.startsWith(u)?I:`${u}${I}`)}})}}},58381:function(ee,s,e){"use strict";e.d(s,{$:function(){return A}});var r=e(91205);const t={id:"onelogin",title:"onelogin",icon:()=>null},l=new Set(["openid","profile","email","phone","address","groups","offline_access"]),u="onelogin.";class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=t,oauthRequestApi:p}=o;return r.OAuth2.create({discoveryApi:c,oauthRequestApi:p,provider:y,environment:f,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(E){return E.map(T=>l.has(T)||T.startsWith(u)?T:`${u}${T}`)}})}}},67604:function(ee,s,e){"use strict";var r=e(57018),t=e(30195);const l=t.z.object({profile:t.z.object({email:t.z.string().optional(),displayName:t.z.string().optional(),picture:t.z.string().optional()}),backstageIdentity:t.z.object({token:t.z.string(),identity:t.z.object({type:t.z.literal("user"),userEntityRef:t.z.string(),ownershipEntityRefs:t.z.array(t.z.string())})})}),u={id:"saml",title:"SAML",icon:()=>null};class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=u}=o,p=new DirectAuthConnector({discoveryApi:c,environment:f,provider:y}),E=new StaticAuthSessionManager({connector:p}),T=new AuthSessionStore({manager:E,storageKey:`${y.id}Session`,schema:samlSessionSchema});return new A(T)}sessionState$(){return this.sessionManager.sessionState$()}constructor(o){this.sessionManager=o}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(o={}){const c=await this.sessionManager.getSession(o);return c==null?void 0:c.backstageIdentity}async getProfile(o={}){const c=await this.sessionManager.getSession(o);return c==null?void 0:c.profile}}},91631:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return t.C},AppThemeSelector:function(){return u.C},AtlassianAuth:function(){return r.AtlassianAuth},ConfigReader:function(){return A.m},ErrorAlerter:function(){return o.KN},ErrorApiForwarder:function(){return o.gr},FetchMiddlewares:function(){return f.I},GithubAuth:function(){return r.GithubAuth},GitlabAuth:function(){return r.GitlabAuth},GoogleAuth:function(){return r.GoogleAuth},LocalStorageFeatureFlags:function(){return c.b},MicrosoftAuth:function(){return r.MicrosoftAuth},NoOpAnalyticsApi:function(){return l.g},OAuthRequestManager:function(){return y.Y},OktaAuth:function(){return r.OktaAuth},OneLoginAuth:function(){return r.OneLoginAuth},UnhandledErrorForwarder:function(){return o.Jv},UrlPatternDiscovery:function(){return m.p},WebStorage:function(){return p.C},createFetchApi:function(){return f.j}});var r=e(91668);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(23235),l=e(47150),u=e(58652),A=e(14721),m=e(4333),o=e(89536),c=e(14884),f=e(50160),y=e(11358),p=e(56054)},56494:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return t.AlertApiForwarder},ApiProvider:function(){return r.ApiProvider},AppThemeSelector:function(){return t.AppThemeSelector},ConfigReader:function(){return t.ConfigReader},ErrorAlerter:function(){return t.ErrorAlerter},ErrorApiForwarder:function(){return t.ErrorApiForwarder},FetchMiddlewares:function(){return t.FetchMiddlewares},LocalStorageFeatureFlags:function(){return t.LocalStorageFeatureFlags},NoOpAnalyticsApi:function(){return t.NoOpAnalyticsApi},OAuthRequestManager:function(){return t.OAuthRequestManager},UnhandledErrorForwarder:function(){return t.UnhandledErrorForwarder},UrlPatternDiscovery:function(){return t.UrlPatternDiscovery},WebStorage:function(){return t.WebStorage},createFetchApi:function(){return t.createFetchApi}});var r=e(76105);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"GithubAuth")&&e.d(s,{GithubAuth:function(){return r.GithubAuth}}),e.o(r,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return r.GitlabAuth}}),e.o(r,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return r.GoogleAuth}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return r.MicrosoftAuth}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"OktaAuth")&&e.d(s,{OktaAuth:function(){return r.OktaAuth}}),e.o(r,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return r.OneLoginAuth}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(91631);e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"GithubAuth")&&e.d(s,{GithubAuth:function(){return t.GithubAuth}}),e.o(t,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return t.GitlabAuth}}),e.o(t,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return t.GoogleAuth}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}}),e.o(t,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return t.createSpecializedApp}}),e.o(t,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return t.defaultConfigLoader}})},80396:function(ee,s,e){"use strict";e.d(s,{p:function(){return t}});var r;(function(l){l[l.default=10]="default";const u=50;l[l.app=u]="app",l[l.static=100]="static"})(r||(r={}));class t{constructor(){q(this,"factories",new Map)}register(u,A){const m=r[u],o=this.factories.get(A.api.id);return o&&o.priority>=m?!1:(this.factories.set(A.api.id,{priority:m,factory:A}),!0)}get(u){const A=this.factories.get(u.id);if(!!A)return A.factory}getAllApis(){const u=new Set;for(const{factory:A}of this.factories.values())u.add(A.api);return u}}},14406:function(ee,s,e){"use strict";e.d(s,{g:function(){return o}});var r=e(2784),t=e(13980),l=e.n(t);class u{constructor(...f){q(this,"holders");this.holders=f}get(f){for(const y of this.holders){const p=y.get(f);if(p)return p}}}var A=e(76241);const m=(0,A.CT)("api-context"),o=c=>{var T;const{apis:f,children:y}=c,p=(T=(0,r.useContext)(m))==null?void 0:T.atVersion(1),E=p?new u(f,p):f;return r.createElement(m.Provider,{value:(0,A.EI)({1:E}),children:y})};o.propTypes={apis:l().shape({get:l().func.isRequired}).isRequired,children:l().node}},12132:function(ee,s,e){"use strict";e.d(s,{M:function(){return r}});class r{constructor(l){q(this,"apis",new Map);this.factories=l}static validateFactories(l,u){for(const A of u){const m=[A],o=new Set;for(;m.length;){const c=m.shift(),f=l.get(c);if(!!f)for(const y of Object.values(f.deps)){if(y.id===A.id)throw new Error(`Circular dependency of api factory for ${A}`);o.has(y)||(o.add(y),m.push(y))}}}}get(l){return this.load(l)}load(l,u=[]){const A=this.apis.get(l.id);if(A)return A;const m=this.factories.get(l);if(!m)return;if(u.includes(m.api))throw new Error(`Circular dependency of api factory for ${m.api}`);const o=this.loadDeps(l,m.deps,[...u,m.api]),c=m.factory(o);return this.apis.set(l.id,c),c}loadDeps(l,u,A){const m={};for(const o in u)if(u.hasOwnProperty(o)){const c=u[o],f=this.load(c,A);if(!f)throw new Error(`No API factory available for dependency ${c} of dependent ${l}`);m[o]=f}return m}}},76105:function(ee,s,e){"use strict";e.d(s,{ApiFactoryRegistry:function(){return l.p},ApiProvider:function(){return r.g},ApiResolver:function(){return t.M}});var r=e(14406),t=e(12132),l=e(80396),u=e(82488),A=e.n(u);e.o(u,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return u.AlertApiForwarder}}),e.o(u,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return u.AppThemeSelector}}),e.o(u,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return u.AtlassianAuth}}),e.o(u,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return u.BitbucketAuth}}),e.o(u,"ConfigReader")&&e.d(s,{ConfigReader:function(){return u.ConfigReader}}),e.o(u,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return u.ErrorAlerter}}),e.o(u,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return u.ErrorApiForwarder}}),e.o(u,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return u.FetchMiddlewares}}),e.o(u,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return u.FlatRoutes}}),e.o(u,"GithubAuth")&&e.d(s,{GithubAuth:function(){return u.GithubAuth}}),e.o(u,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return u.GitlabAuth}}),e.o(u,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return u.GoogleAuth}}),e.o(u,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return u.LocalStorageFeatureFlags}}),e.o(u,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return u.MicrosoftAuth}}),e.o(u,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return u.NoOpAnalyticsApi}}),e.o(u,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return u.OAuthRequestManager}}),e.o(u,"OktaAuth")&&e.d(s,{OktaAuth:function(){return u.OktaAuth}}),e.o(u,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return u.OneLoginAuth}}),e.o(u,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return u.UnhandledErrorForwarder}}),e.o(u,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return u.UrlPatternDiscovery}}),e.o(u,"WebStorage")&&e.d(s,{WebStorage:function(){return u.WebStorage}}),e.o(u,"createFetchApi")&&e.d(s,{createFetchApi:function(){return u.createFetchApi}}),e.o(u,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return u.createSpecializedApp}}),e.o(u,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return u.defaultConfigLoader}})},82488:function(){},82370:function(ee,s,e){"use strict";e.d(s,{b:function(){return ct}});var r=e(2784),t=e(10289),l=e(64279),u=e(56494),A=e(36964),m=e(76105);function o(X){const Z={};for(const se in X.collectors)X.collectors.hasOwnProperty(se)&&(Z[se]=X.collectors[se]());const Q=[{node:r.Children.toArray(X.root),parent:void 0,contexts:{}}];for(;Q.length!==0;){const{node:se,parent:le,contexts:be}=Q.shift();r.Children.forEach(se,Oe=>{if(!(0,r.isValidElement)(Oe))return;const Ae={};for(const ke in Z)if(Z.hasOwnProperty(ke)){const We=Z[ke];Ae[ke]=We.visit(We.accumulator,Oe,le,be[ke])}for(const ke of X.discoverers){const We=ke(Oe);We&&Q.push({node:We,parent:Oe,contexts:Ae})}})}return Object.fromEntries(Object.entries(Z).map(([se,le])=>[se,le.accumulator]))}function c(X,Z){return()=>({accumulator:X(),visit:Z})}function f(X){var Z;return(Z=X.props)==null?void 0:Z.children}function y(X){var Z,Q,se;if(((Z=X.props)==null?void 0:Z.path)&&((Q=X.props)==null?void 0:Q.element))return(se=X.props)==null?void 0:se.element}const p=c(()=>new Set,(X,Z)=>{const Q=(0,A.getComponentData)(Z,"core.plugin");Q&&X.add(Q)});var E=e(88934);const T={caseSensitive:!1,path:"/*",element:"match-all",routeRefs:new Set},I=c(()=>({paths:new Map,parents:new Map,objects:new Array}),(X,Z,Q,se)=>{var Lt,Rt,Nt,Zt,vt;if((Q==null?void 0:Q.props.element)===Z)return se;let le=se==null?void 0:se.obj,be=se==null?void 0:se.routeRef,Oe=se==null?void 0:se.sticky;const Ae=(Lt=Z.props)==null?void 0:Lt.path,ke=(Rt=le==null?void 0:le.children)!=null?Rt:X.objects,We=Boolean((Nt=Z.props)==null?void 0:Nt.caseSensitive);let gt=se==null?void 0:se.path;if((0,A.getComponentData)(Z,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");gt=Ae}const It=(Zt=Z.props)==null?void 0:Zt.element;let lt=(0,A.getComponentData)(Z,"core.mountPoint");if(!lt&&(0,r.isValidElement)(It)&&(lt=(0,A.getComponentData)(It,"core.mountPoint")),lt){let at=Ae;if(gt&&(at?gt=void 0:at=gt),!at)throw new Error("Mounted routable extension must have a path");X.paths.set(lt,at),be&&Oe?(X.parents.set(lt,be),Ae&&(be=lt,Oe=!1)):(X.parents.set(lt,be),be=lt),Ae?(le={caseSensitive:We,path:Ae,element:"mounted",routeRefs:new Set([lt]),children:[T],plugin:(0,A.getComponentData)(Z.props.element,"core.plugin")},ke.push(le)):le==null||le.routeRefs.add(lt)}if((0,A.getComponentData)(Z,"core.gatherMountPoints")&&(Oe=!0),(0,A.getComponentData)(Z,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");lt||(le={caseSensitive:We,path:Ae,element:"gathered",routeRefs:new Set,children:[T],plugin:(vt=se==null?void 0:se.obj)==null?void 0:vt.plugin},ke.push(le))}return{obj:le,path:gt,routeRef:be,sticky:Oe}}),B=c(()=>new Set,(X,Z)=>{if(Z.type===E.L){const Q=Z.props;X.add("with"in Q?Q.with:Q.without)}});var j=e(76241);const M=(0,j.uW)("route-ref-type",()=>Symbol("route-ref-type"));function b(X){return X[M]==="absolute"}function L(X){return X[M]==="sub"}function D(X){return X[M]==="external"}function U(...X){const Z=X.join("/").replace(/\/\/+/g,"/");return Z!=="/"&&Z.endsWith("/")?Z.slice(0,-1):Z}function Y(X,Z,Q){let se,le="";if(b(X))se=X;else if(L(X))se=X.parent,le=X.path;else if(D(X)){const Ae=Q.get(X);if(!Ae)return[void 0,""];if(b(Ae))se=Ae;else if(L(Ae))se=Ae.parent,le=Ae.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${Ae}`)}else throw X[M]?new Error(`Unknown or invalid route ref type, ${X[M]}`):new Error(`Unknown object passed to useRouteRef, got ${X}`);if(!se)return[void 0,""];const be=Z.get(se);if(!be)return[void 0,""];const Oe=U(be,le);return[se,Oe]}function te(X,Z,Q,se,le){var gt;const be=(gt=(0,t.fp)(le,Z))!=null?gt:[],Oe=Array();let Ae=-1;for(let It=X;It&&(Ae=be.findIndex(lt=>lt.route.routeRefs.has(It)),Ae===-1);It=se.get(It))Oe.unshift(It);Oe.length===0&&(Ae-=1);const ke=Ae===-1?"":be[Ae].pathname,We=U(...Oe.slice(0,-1).map(It=>{const lt=Q.get(It);if(!lt)throw new Error(`No path for ${It}`);if(lt.includes(":"))throw new Error(`Cannot route to ${X} with parent ${It} as it has parameters`);return lt}));return ke+We}class ue{constructor(Z,Q,se,le,be){this.routePaths=Z,this.routeParents=Q,this.routeObjects=se,this.routeBindings=le,this.appBasePath=be}resolve(Z,Q){const[se,le]=Y(Z,this.routePaths,this.routeBindings);if(!se)return;let be;typeof Q=="string"?be=this.trimPath(Q):Q.pathname?be={...Q,pathname:this.trimPath(Q.pathname)}:be=Q;const Oe=this.appBasePath+te(se,be,this.routePaths,this.routeParents,this.routeObjects);return(...[ke])=>Oe+(0,t.Gn)(le,ke)}trimPath(Z){return Z&&(Z.startsWith(this.appBasePath)?Z.slice(this.appBasePath.length):Z)}}const Re=(0,j.CT)("routing-context"),we=({routePaths:X,routeParents:Z,routeObjects:Q,routeBindings:se,basePath:le="",children:be})=>{const Oe=new ue(X,Z,Q,se,le),Ae=(0,j.EI)({1:Oe});return r.createElement(Re.Provider,{value:Ae},be)},ge=(X,Z)=>{var Q,se;try{const le=(0,t.fp)(Z,{pathname:X}),be=(Q=le==null?void 0:le.filter(Ae=>{var ke;return((ke=Ae==null?void 0:Ae.route.routeRefs)==null?void 0:ke.size)>0}).pop())==null?void 0:Q.route;if(!be)return{};let Oe;return be.routeRefs.size===1&&(Oe=be.routeRefs.values().next().value),{extension:"App",pluginId:((se=be.plugin)==null?void 0:se.getId())||"root",...Oe?{routeRef:Oe.id}:{}}}catch{return{}}},ze=({pathname:X,search:Z,hash:Q})=>{const se=(0,A.useAnalytics)();return(0,r.useEffect)(()=>{se.captureEvent("navigate",`${X}${Z}${Q}`)},[se,X,Z,Q]),null},_e=({routeObjects:X})=>{const{pathname:Z,search:Q,hash:se}=(0,t.TH)();return r.createElement(A.AnalyticsContext,{attributes:ge(Z,X)},r.createElement(ze,{pathname:Z,search:Q,hash:se}))};function et(X,Z){const Q=new Set(Z.values());Q.delete(void 0);for(const se of Z.keys()){if(Q.has(se))continue;let le=se,be="";for(;le;){const Ae=X.get(le);if(!Ae)throw new Error(`No path for ${le}`);be=`${Ae}${be}`,le=Z.get(le)}const Oe=be.match(/:(\w+)/g);if(Oe){for(let Ae=0;Ae<Oe.length;Ae++)for(let ke=Ae+1;ke<Oe.length;ke++)if(Oe[ke]===Oe[Ae])throw new Error(`Parameter ${Oe[ke]} is duplicated in path ${be}`)}}}function st(X,Z){for(const Q of Z)if(!!Q.externalRoutes){for(const[se,le]of Object.entries(Q.externalRoutes))if(!le.optional&&!X.has(le))throw new Error(`External route '${se}' of the '${Q.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Ct=(0,j.CT)("app-context"),yt=({appContext:X,children:Z})=>{const Q=(0,j.EI)({1:X});return r.createElement(Ct.Provider,{value:Q,children:Z})};function Pe(X){return new Error(`Tried to access IdentityApi ${X} before app was loaded`)}function ht(X){console.warn(`WARNING: Call to ${X} is deprecated and will break in the future`)}class Ve{constructor(){q(this,"target");q(this,"waitForTarget");q(this,"resolveTarget",()=>{});q(this,"signOutTargetUrl","/");this.waitForTarget=new Promise(Z=>{this.resolveTarget=Z})}setTarget(Z,Q){this.target=Z,this.signOutTargetUrl=Q.signOutTargetUrl,this.resolveTarget(Z)}getUserId(){if(!this.target)throw Pe("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return ht("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Pe("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return ht("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(Z=>Z.getProfileInfo())}async getBackstageIdentity(){const Z=await this.waitForTarget.then(Q=>Q.getBackstageIdentity());return Z.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${Z.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),Z}async getCredentials(){return this.waitForTarget.then(Z=>Z.getCredentials())}async getIdToken(){return this.waitForTarget.then(Z=>{if(!Z.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return ht("getIdToken"),Z.getIdToken()})}async signOut(){await this.waitForTarget.then(Z=>Z.signOut()),location.href=this.signOutTargetUrl}}var ie=e(72164);function de(X,Z,Q){if(X!==void 0){const le=Q.find(be=>be.id===X);if(le)return le}if(Z){const le=Q.find(be=>be.variant==="dark");if(le)return le}const se=Q.find(le=>le.variant==="light");return se||Q[0]}const Ue=()=>{const X=(0,r.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[Z,Q]=(0,r.useState)(X.matches);return(0,r.useEffect)(()=>{const se=le=>{Q(le.matches)};return X.addListener(se),()=>{X.removeListener(se)}},[X]),Z};function Be({children:X}){const Z=(0,A.useApi)(A.appThemeApiRef),Q=(0,ie.Z)(Z.activeThemeId$(),Z.getActiveThemeId()),se=Boolean(window.matchMedia)?Ue():!1,le=de(Q,se,Z.getInstalledThemes());if(!le)throw new Error("App has no themes");return r.createElement(le.Provider,{children:X})}var Xe=e(46611);class mt{constructor(){q(this,"apis",[])}add(Z,Q){return this.apis.push([Z.id,Q]),Q}build(){return new Ye(new Map(this.apis))}}class Ye{static builder(){return new mt}static from(Z){return new Ye(new Map(Z.map(([Q,se])=>[Q.id,se])))}static with(Z,Q){return new Ye(new Map([[Z.id,Q]]))}constructor(Z){this.apis=Z}with(Z,Q){return new Ye(new Map([...this.apis,[Z.id,Q]]))}get(Z){return this.apis.get(Z.id)}}function Et(X){const Z=new Map;return X&&X({bind:(se,le)=>{for(const[be,Oe]of Object.entries(le)){const Ae=se[be];if(!Ae)throw new Error(`Key ${be} is not an existing external route`);if(!Oe&&!Ae.optional)throw new Error(`External route ${be} is required but was undefined`);Oe&&Z.set(Ae,Oe)}}}),Z}const oe=(0,r.createContext)({routeObjects:[]});function fe(X){var Q;let{pathname:Z}=new URL((Q=X.getOptionalString("app.baseUrl"))!=null?Q:"/","http://dummy.dev");return Z=Z.replace(/\/*$/,""),Z}function tt(X,Z,Q){var ke;const se=Boolean(X),le=(0,l.default)(X||(()=>Promise.resolve([])));let be;if(se&&le.loading){const{Progress:We}=Z;be=r.createElement(We,null)}else if(le.error){const{BootErrorPage:We}=Z;be=r.createElement(We,{step:"load-config",error:le.error})}const{ThemeProvider:Oe=Be}=Z;return be?{node:r.createElement(u.ApiProvider,{apis:Ye.with(A.appThemeApiRef,Q)},r.createElement(Oe,null,be))}:{api:u.ConfigReader.fromConfigs((ke=le.value)!=null?ke:[])}}class Ke{constructor(Z){this.app=Z}getPlugins(){return this.app.getPlugins()}getSystemIcon(Z){return this.app.getSystemIcon(Z)}getComponents(){return this.app.getComponents()}}class Ne{constructor(Z){q(this,"apiHolder");q(this,"configApi");q(this,"apis");q(this,"icons");q(this,"plugins");q(this,"components");q(this,"themes");q(this,"configLoader");q(this,"defaultApis");q(this,"bindRoutes");q(this,"appIdentityProxy",new Ve);q(this,"apiFactoryRegistry");var Q,se,le,be;this.apis=(Q=Z.apis)!=null?Q:[],this.icons=Z.icons,this.plugins=new Set((se=Z.plugins)!=null?se:[]),this.components=Z.components,this.themes=Z.themes,this.configLoader=(le=Z.configLoader)!=null?le:Xe.t,this.defaultApis=(be=Z.defaultApis)!=null?be:[],this.bindRoutes=Z.bindRoutes,this.apiFactoryRegistry=new m.ApiFactoryRegistry}getPlugins(){return Array.from(this.plugins)}getSystemIcon(Z){return this.icons[Z]}getComponents(){return this.components}getProvider(){const Z=new Ke(this);let Q=!1;return({children:le})=>{const be=(0,r.useMemo)(()=>u.AppThemeSelector.createWithStorage(this.themes),[]),{routing:Oe,featureFlags:Ae,routeBindings:ke}=(0,r.useMemo)(()=>{const lt=o({root:le,discoverers:[f,y],collectors:{routing:I,collectedPlugins:p,featureFlags:B}});return lt.collectedPlugins.forEach(Tt=>this.plugins.add(Tt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...lt,routeBindings:Et(this.bindRoutes)}},[le]);Q||(Q=!0,et(Oe.paths,Oe.parents),st(ke,this.plugins));const We=tt(this.configLoader,this.components,be),gt="api"in We;if(gt){const{api:lt}=We;this.configApi=lt}if((0,r.useEffect)(()=>{if(gt){const lt=this.getApiHolder().get(A.featureFlagsApiRef);for(const Tt of this.plugins.values())if("getFeatureFlags"in Tt)for(const Lt of Tt.getFeatureFlags())lt.registerFlag({name:Lt.name,pluginId:Tt.getId()});else for(const Lt of Tt.output())Lt.type==="feature-flag"&<.registerFlag({name:Lt.name,pluginId:Tt.getId()});for(const Tt of Ae)lt.registerFlag({name:Tt,pluginId:""})}},[gt,We,Ae]),"node"in We)return We.node;const{ThemeProvider:It=Be}=this.components;return r.createElement(u.ApiProvider,{apis:this.getApiHolder()},r.createElement(yt,{appContext:Z},r.createElement(It,null,r.createElement(we,{routePaths:Oe.paths,routeParents:Oe.parents,routeObjects:Oe.objects,routeBindings:ke,basePath:fe(We.api)},r.createElement(oe.Provider,{value:{routeObjects:Oe.objects}},le)))))}}getRouter(){const{Router:Z,SignInPage:Q}=this.components,se=({component:be,children:Oe})=>{const[Ae,ke]=(0,r.useState)(),We=(0,A.useApi)(A.configApiRef),gt=fe(We);return Ae?(this.appIdentityProxy.setTarget(Ae,{signOutTargetUrl:gt||"/"}),Oe):r.createElement(be,{onSignInSuccess:ke})};return({children:be})=>{const Oe=(0,A.useApi)(A.configApiRef),Ae=fe(Oe),ke=`${Ae}/*`,{routeObjects:We}=(0,r.useContext)(oe);return Q?r.createElement(Z,null,r.createElement(_e,{routeObjects:We}),r.createElement(se,{component:Q},r.createElement(t.Z5,null,r.createElement(t.AW,{path:ke,element:r.createElement(r.Fragment,null,be)})))):(this.appIdentityProxy.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:Ae||"/"}),r.createElement(Z,null,r.createElement(_e,{routeObjects:We}),r.createElement(t.Z5,null,r.createElement(t.AW,{path:ke,element:r.createElement(r.Fragment,null,be)}))))}}getApiHolder(){if(this.apiHolder){for(const Z of this.plugins)for(const Q of Z.getApis())this.apiFactoryRegistry.get(Q.api)||this.apiFactoryRegistry.register("default",Q);return m.ApiResolver.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:A.appThemeApiRef,deps:{},factory:()=>u.AppThemeSelector.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:A.configApiRef,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:A.identityApiRef,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:A.featureFlagsApiRef,deps:{},factory:()=>new u.LocalStorageFeatureFlags});for(const Z of this.defaultApis)this.apiFactoryRegistry.register("default",Z);for(const Z of this.plugins)for(const Q of Z.getApis())if(!this.apiFactoryRegistry.register("default",Q))throw new Error(`Plugin ${Z.getId()} tried to register duplicate or forbidden API factory for ${Q.api}`);for(const Z of this.apis)if(!this.apiFactoryRegistry.register("app",Z))throw new Error(`Duplicate or forbidden API factory for ${Z.api} in app`);return m.ApiResolver.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new m.ApiResolver(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(Z){const Q=new Set;for(const se of Z){const le=se.getId();if(Q.has(le))throw new Error(`Duplicate plugin found '${le}'`);Q.add(le)}}}function ct(X){return new Ne(X)}},46611:function(ee,s,e){"use strict";e.d(s,{t:function(){return r}});const r=async(t="__APP_INJECTED_RUNTIME_CONFIG__")=>{const l=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!l)throw new Error("No static configuration provided");if(!Array.isArray(l))throw new Error("Static configuration has invalid format");const u=l.slice();if(t!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const m=JSON.parse(t);Array.isArray(m)?u.push(...m):u.push({data:m,context:"env"})}catch(m){throw new Error(`Failed to load runtime configuration, ${m}`)}const A=window.__APP_CONFIG__;return A&&u.push({context:"window",data:A}),u}},44056:function(ee,s,e){"use strict";e.d(s,{createSpecializedApp:function(){return r.b},defaultConfigLoader:function(){return t.t}});var r=e(82370),t=e(46611),l=e(73495),u=e.n(l);e.o(l,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return l.AtlassianAuth}}),e.o(l,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return l.BitbucketAuth}}),e.o(l,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return l.FlatRoutes}}),e.o(l,"GithubAuth")&&e.d(s,{GithubAuth:function(){return l.GithubAuth}}),e.o(l,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return l.GitlabAuth}}),e.o(l,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return l.GoogleAuth}}),e.o(l,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return l.MicrosoftAuth}}),e.o(l,"OktaAuth")&&e.d(s,{OktaAuth:function(){return l.OktaAuth}}),e.o(l,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return l.OneLoginAuth}})},73495:function(){},49208:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder},ErrorAlerter:function(){return r.ErrorAlerter},ErrorApiForwarder:function(){return r.ErrorApiForwarder},FetchMiddlewares:function(){return r.FetchMiddlewares},FlatRoutes:function(){return l.w},NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi},OAuthRequestManager:function(){return r.OAuthRequestManager},UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder},UrlPatternDiscovery:function(){return r.UrlPatternDiscovery},WebStorage:function(){return r.WebStorage},createFetchApi:function(){return r.createFetchApi},createSpecializedApp:function(){return t.createSpecializedApp},defaultConfigLoader:function(){return t.defaultConfigLoader}});var r=e(56494);e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"GithubAuth")&&e.d(s,{GithubAuth:function(){return r.GithubAuth}}),e.o(r,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return r.GitlabAuth}}),e.o(r,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return r.GoogleAuth}}),e.o(r,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return r.MicrosoftAuth}}),e.o(r,"OktaAuth")&&e.d(s,{OktaAuth:function(){return r.OktaAuth}}),e.o(r,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return r.OneLoginAuth}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(44056);e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"GithubAuth")&&e.d(s,{GithubAuth:function(){return t.GithubAuth}}),e.o(t,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return t.GitlabAuth}}),e.o(t,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return t.GoogleAuth}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}});var l=e(63938)},57018:function(ee,s,e){"use strict";e.d(s,{RefreshingAuthSessionManager:function(){return m}});function r(c,f){for(const y of f)if(!c.has(y))return!1;return!0}class t{constructor(f){this.options=f}sessionExistsAndHasScope(f,y){if(!f)return!1;if(!y||this.options.sessionScopes===void 0)return!0;const p=this.options.sessionScopes(f);return r(p,y)}getExtendedScope(f,y){const p=new Set(this.options.defaultScopes);if(f&&this.options.sessionScopes!==void 0){const E=this.options.sessionScopes(f);for(const T of E)p.add(T)}if(y)for(const E of y)p.add(E);return p}}var l=e(98005),u=e(36964);class A{constructor(){q(this,"subject",new l.X(u.SessionState.SignedOut));q(this,"signedIn",!1)}setIsSignedIn(f){this.signedIn!==f&&(this.signedIn=f,this.subject.next(this.signedIn?u.SessionState.SignedIn:u.SessionState.SignedOut))}sessionState$(){return this.subject}}class m{constructor(f){q(this,"connector");q(this,"helper");q(this,"sessionScopesFunc");q(this,"sessionShouldRefreshFunc");q(this,"stateTracker",new A);q(this,"refreshPromise");q(this,"currentSession");const{connector:y,defaultScopes:p=new Set,sessionScopes:E,sessionShouldRefresh:T}=f;this.connector=y,this.sessionScopesFunc=E,this.sessionShouldRefreshFunc=T,this.helper=new t({sessionScopes:E,defaultScopes:p})}async getSession(f){if(this.helper.sessionExistsAndHasScope(this.currentSession,f.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const p=await this.collapsedSessionRefresh(),E=this.sessionScopesFunc(this.currentSession),T=this.sessionScopesFunc(p);return r(T,E)&&(this.currentSession=p),p}catch(p){if(f.optional)return;throw p}}if(!this.currentSession&&!f.instantPopup)try{const y=await this.collapsedSessionRefresh();return this.currentSession=y,this.getSession(f)}catch{}if(!f.optional)return this.currentSession=await this.connector.createSession({...f,scopes:this.helper.getExtendedScope(this.currentSession,f.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const f=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),f}finally{delete this.refreshPromise}}}class o{constructor(f){q(this,"connector");q(this,"helper");q(this,"stateTracker",new SessionStateTracker);q(this,"currentSession");const{connector:y,defaultScopes:p=new Set,sessionScopes:E}=f;this.connector=y,this.helper=new SessionScopeHelper({sessionScopes:E,defaultScopes:p})}setSession(f){this.currentSession=f,this.stateTracker.setIsSignedIn(Boolean(f))}async getSession(f){if(this.helper.sessionExistsAndHasScope(this.currentSession,f.scopes))return this.currentSession;if(!f.optional)return this.currentSession=await this.connector.createSession({...f,scopes:this.helper.getExtendedScope(this.currentSession,f.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}}},98005:function(ee,s,e){"use strict";e.d(s,{J:function(){return l},X:function(){return u}});var r=e(82394),t=e.n(r);class l{constructor(){q(this,"isClosed",!1);q(this,"terminatingError");q(this,"observable",new(t())(m=>this.isClosed?(this.terminatingError?m.error(this.terminatingError):m.complete(),()=>{}):(this.subscribers.add(m),()=>{this.subscribers.delete(m)})));q(this,"subscribers",new Set)}[Symbol.observable](){return this}get closed(){return this.isClosed}next(m){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(m))}error(m){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=m,this.subscribers.forEach(o=>o.error(m))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(m=>m.complete())}subscribe(m,o,c){const f=typeof m=="function"?{next:m,error:o,complete:c}:m;return this.observable.subscribe(f)}}class u{constructor(m){q(this,"isClosed");q(this,"currentValue");q(this,"terminatingError");q(this,"observable");q(this,"subscribers",new Set);this.isClosed=!1,this.currentValue=m,this.terminatingError=void 0,this.observable=new(t())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}[Symbol.observable](){return this}get closed(){return this.isClosed}next(m){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=m,this.subscribers.forEach(o=>o.next(m))}error(m){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=m,this.subscribers.forEach(o=>o.error(m))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(m=>m.complete())}subscribe(m,o,c){const f=typeof m=="function"?{next:m,error:o,complete:c}:m;return this.observable.subscribe(f)}}},88934:function(ee,s,e){"use strict";e.d(s,{L:function(){return l}});var r=e(36964),t=e(2784);const l=u=>{const{children:A}=u,m=(0,r.useApi)(r.featureFlagsApiRef),o="with"in u?m.isActive(u.with):!m.isActive(u.without);return t.createElement(t.Fragment,null,o?A:null)};(0,r.attachComponentData)(l,"core.featureFlagged",!0)},63938:function(ee,s,e){"use strict";e.d(s,{w:function(){return u}});var r=e(2784),t=e(10289),l=e(36964);const u=m=>{const o=(0,l.useApp)(),{NotFoundErrorPage:c}=o.getComponents(),f=(0,l.useElementFilter)(m.children,y=>y.getElements().flatMap(p=>{var T;let E=p.props.path;return E===""?[]:(E=(T=E==null?void 0:E.replace(/\/\*$/,""))!=null?T:"/",[{path:E,element:p,children:p.props.children?[{path:E==="/"?"/":"/*",element:p.props.children}]:void 0}])}).sort((p,E)=>E.path.localeCompare(p.path)).map(p=>(p.path=p.path==="/"?"/":`${p.path}/*`,p)));return f.push({element:r.createElement(c,null),path:"/*"}),(0,t.V$)(f)};var A=e(88934)},82339:function(ee,s,e){"use strict";e.d(s,{Button:function(){return D},CodeSnippet:function(){return et},Content:function(){return Xa},ContentHeader:function(){return ci},CreateButton:function(){return yt},DependencyGraph:function(){return Rt},DependencyGraphTypes:function(){return r},EmptyState:function(){return bt},ErrorPage:function(){return hi},ErrorPanel:function(){return cn},Header:function(){return so},HeaderIconLinkRow:function(){return bn},HeaderLabel:function(){return Ti},HeaderTabs:function(){return qa},InfoCard:function(){return Kn},ItemCardGrid:function(){return Di},ItemCardHeader:function(){return Li},Link:function(){return b},LogViewer:function(){return zr},MissingAnnotationEmptyState:function(){return un},OverflowTooltip:function(){return br},Page:function(){return lo},PageWithHeader:function(){return Mi},Progress:function(){return cr},ResponseErrorPanel:function(){return $t},RoutedTabs:function(){return _a},Select:function(){return je},Sidebar:function(){return as},SidebarDivider:function(){return vs},SidebarItem:function(){return Ja},SidebarPage:function(){return Go},SubvalueCell:function(){return Fs},SupportButton:function(){return zo},Table:function(){return ei},WarningPanel:function(){return tn},sidebarConfig:function(){return kn},useSidebarOpenState:function(){return la},useSidebarPinState:function(){return Br}});var r={};e.r(r),e.d(r,{Nm:function(){return Pe},ht:function(){return ie},LJ:function(){return Ve}});var t=e(2784),l=e(36964),u=e(19928);function A(n){const[a,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"}}=n;if(useEffect(()=>{const N=d.alert$().subscribe(G=>i(H=>H.concat(G)));return()=>{N.unsubscribe()}},[d]),a.length===0)return null;const[v]=a,O=()=>{i(N=>N.filter(G=>G!==v))};return React.createElement(Snackbar,{open:!0,anchorOrigin:g},React.createElement(Alert,{action:React.createElement(IconButton,{color:"inherit",size:"small",onClick:O,"data-testid":"error-button-close"},React.createElement(CloseIcon,null)),severity:v.severity},React.createElement("span",null,v.message.toString(),a.length>1&&React.createElement("em",null,` (${a.length-1} older ${pluralize("message",a.length-1)})`))))}var m=e(79692),o=e(12420);const c=(0,m.Z)(n=>(0,o.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:n.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function f(n){const{displayName:a,picture:i,customStyles:d}=n,g=c();let v={...d};return i||(v={backgroundColor:stringToColor(a||""),...d}),React.createElement(MaterialAvatar,{alt:a,src:i,className:g.avatar,style:v},a&&extractInitials(a))}var y=e(77277),p=e(72779),E=e.n(p),T=e(86689),I=e(62833);const B=(0,m.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"}),j=n=>/^([a-z+.-]+):/.test(n),M=n=>{var a;return n instanceof Array?n.map(M).join(" ").trim():typeof n=="object"&&n?M((a=n==null?void 0:n.props)==null?void 0:a.children):["string","number"].includes(typeof n)?String(n):""},b=t.forwardRef(({onClick:n,noTrack:a,...i},d)=>{const g=B(),v=(0,l.useAnalytics)(),O=String(i.to),N=M(i.children)||O,G=j(O),H=G&&!!/^https?:/.exec(O),ne=_=>{n==null||n(_),a||v.captureEvent("click",N,{attributes:{to:O}})};return G?t.createElement(T.Z,{ref:d,href:O,onClick:ne,...H?{target:"_blank",rel:"noopener"}:{},...i,className:E()(g.externalLink,i.className)},i.children,t.createElement("span",{className:g.visuallyHidden},", Opens in a new window")):t.createElement(T.Z,{ref:d,component:I.rU,onClick:ne,...i})}),L=t.forwardRef((n,a)=>t.createElement(b,{ref:a,...n,color:"initial"})),D=t.forwardRef((n,a)=>t.createElement(y.Z,{ref:a,component:L,...n}));var U=e(60364),Y=e(61837),te=e(80030),ue=e(19353),Re=e(95074);function we(n){const{text:a,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard"}=n,g=(0,l.useApi)(l.errorApiRef),[v,O]=(0,t.useState)(!1),[{error:N},G]=(0,Re.Z)();(0,t.useEffect)(()=>{N&&g.post(N)},[N,g]);const H=ne=>{ne.stopPropagation(),O(!0),G(a)};return t.createElement(t.Fragment,null,t.createElement(te.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>O(!1),open:v},t.createElement(Y.Z,{onClick:H},t.createElement(ue.Z,null))))}var ge=e(83229),ze=e(26639),_e=e(39595);function et(n){const{text:a,language:i,showLineNumbers:d=!1,highlightedNumbers:g,customStyle:v,showCopyCodeButton:O=!1}=n,N=(0,U.Z)(),G=N.palette.type==="dark"?ze.Z:_e.Z,H=N.palette.type==="dark"?"#256bf3":"#e6ffed";return t.createElement("div",{style:{position:"relative"}},t.createElement(ge.Z,{customStyle:v,language:i,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:N.palette.textVerySubtle},lineProps:ne=>g!=null&&g.includes(ne)?{style:{backgroundColor:H}}:{}},a),O&&t.createElement("div",{style:{position:"absolute",top:0,right:0}},t.createElement(we,{text:a})))}var st=e(41156),Ct=e(88188);function yt(n){const{title:a,to:i}=n,d=(0,st.Z)(g=>g.breakpoints.down("xs"));return i?d?t.createElement(Y.Z,{component:I.rU,color:"primary",title:a,size:"small",to:i},t.createElement(Ct.Z,null)):t.createElement(y.Z,{component:I.rU,variant:"contained",color:"primary",to:i},a):null}var Pe;(function(n){const a="TB";n.TOP_BOTTOM=a;const i="BT";n.BOTTOM_TOP=i;const d="LR";n.LEFT_RIGHT=d;const g="RL";n.RIGHT_LEFT=g})(Pe||(Pe={}));var ht;(function(n){const a="UL";n.UP_LEFT=a;const i="UR";n.UP_RIGHT=i;const d="DL";n.DOWN_LEFT=d;const g="DR";n.DOWN_RIGHT=g})(ht||(ht={}));var Ve;(function(n){const a="network-simplex";n.NETWORK_SIMPLEX=a;const i="tight-tree";n.TIGHT_TREE=i;const d="longest-path";n.LONGEST_PATH=d})(Ve||(Ve={}));var ie;(function(n){const a="l";n.LEFT=a;const i="r";n.RIGHT=i;const d="c";n.CENTER=d})(ie||(ie={}));var de=e(84945),Ue=e(11105),Be=e(97963),Xe=e(46506),mt=e.n(Xe),Ye=e(54073),Et=e.n(Ye),oe=e(10368);const fe=(0,m.Z)(n=>({node:{fill:n.palette.primary.light,stroke:n.palette.primary.light},text:{fill:n.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function tt({node:{id:n}}){const a=fe(),[i,d]=t.useState(0),[g,v]=t.useState(0),O=t.useRef(null);t.useLayoutEffect(()=>{if(O.current){let{height:ne,width:_}=O.current.getBBox();ne=Math.round(ne),_=Math.round(_),(ne!==g||_!==i)&&(d(_),v(ne))}},[i,g]);const N=10,G=i+N*2,H=g+N*2;return t.createElement("g",null,t.createElement("rect",{className:a.node,width:G,height:H,rx:10}),t.createElement("text",{ref:O,className:a.text,y:H/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle"},n))}const Ke="arrow-marker",Ne="node",ct="edge",X="label",Z=(0,oe.Z)(n=>({node:{transition:`${n.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Q=n=>t.createElement(tt,{...n});function se({render:n=Q,setNode:a,node:i}){const{width:d,height:g,x:v=0,y:O=0}=i,N=i,G=Z(),H=t.useRef(null);return t.useLayoutEffect(()=>{if(H.current){let{height:ne,width:_}=H.current.getBBox();ne=Math.round(ne),_=Math.round(_),(ne!==g||_!==d)&&a(i.id,{...i,height:ne,width:_})}},[i,d,g,a]),t.createElement("g",{ref:H,"data-testid":Ne,className:G.node,transform:`translate(${v-d/2},${O-g/2})`},n({node:N}))}var le=e(40408),be=e(49810),Oe=e(19574),Ae=e.n(Oe);const ke=(0,oe.Z)(n=>({text:{fill:n.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function We({edge:{label:n}}){const a=ke();return t.createElement("text",{className:a.text,textAnchor:"middle"},n)}const gt=(0,oe.Z)(n=>({path:{strokeWidth:2,stroke:n.palette.textSubtle,fill:"none",transition:`${n.transitions.duration.shortest}ms`},label:{transition:`${n.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),It=n=>t.createElement(We,{...n}),lt=le.Z().x(n=>n.x).y(n=>n.y).curve(be.Z);function Tt({render:n=It,setEdge:a,id:i,edge:d}){const{x:g=0,y:v=0,width:O,height:N,points:G}=d,H=d,ne=gt(),_=t.useRef(null);t.useLayoutEffect(()=>{if(_.current){let{height:Ce,width:Ie}=_.current.getBBox();Ce=Math.round(Ce),Ie=Math.round(Ie),(Ce!==N||Ie!==O)&&a(i,{...d,height:Ce,width:Ie})}},[d,N,O,a,i]);let ve="";if(G){const Ce=G.filter(Ie=>Ae()(Ie.x)&&Ae()(Ie.y));ve=lt(Ce)||""}return t.createElement(t.Fragment,null,ve&&t.createElement("path",{"data-testid":ct,className:ne.path,markerEnd:`url(#${Ke})`,d:ve}),H.label?t.createElement("g",{ref:_,"data-testid":X,className:ne.label,transform:`translate(${g},${v})`},n({edge:H})):null)}const Lt="workspace";function Rt(n){var _n,Ar;const{edges:a,nodes:i,renderNode:d,direction:g=Pe.TOP_BOTTOM,align:v,nodeMargin:O=50,edgeMargin:N=10,rankMargin:G=50,paddingX:H=0,paddingY:ne=0,acyclicer:_,ranker:ve=Ve.NETWORK_SIMPLEX,labelPosition:Ce=ie.RIGHT,labelOffset:Ie=10,edgeRanks:pt=1,edgeWeight:Ut=1,renderLabel:Yt,defs:Jt,zoom:dt="enabled",...Gt}=n,en=(0,Be.Z)(),[Qt,Xn]=t.useState(100),[Nn,wr]=t.useState(100),Mt=t.useRef(new(mt()).graphlib.Graph),[yr,$r]=t.useState(((_n=Mt.current.graph())==null?void 0:_n.width)||0),[Er,ea]=t.useState(((Ar=Mt.current.graph())==null?void 0:Ar.height)||0),[ga,ta]=t.useState([]),[na,pa]=t.useState([]),sn=Math.max(yr,Qt),Sn=Math.max(Er,Nn),ar=t.useMemo(()=>Et()(ln=>{if(!ln)return;const pn=Ue.Z(ln),rn=Ue.Z(ln.getElementById(Lt));function Zn(){pn.call(de.sP().scaleExtent([1,10]).on("zoom",Yn=>{Yn.transform.x=Math.min(0,Math.max(Yn.transform.x,sn-sn*Yn.transform.k)),Yn.transform.y=Math.min(0,Math.max(Yn.transform.y,Sn-Sn*Yn.transform.k)),rn.attr("transform",Yn.transform)}))}dt==="enabled"?Zn():dt==="enable-on-click"&&pn.on("click",()=>Zn());const{width:zn,height:ra}=ln.getBoundingClientRect();Qt!==zn&&Xn(zn),Nn!==ra&&wr(ra)},100),[Nn,Qt,sn,Sn,dt]),qn=t.useCallback(()=>{const ln=Mt.current.nodes(),pn=Mt.current.edges();ln.forEach(rn=>{i.some(zn=>zn.id===rn)||Mt.current.removeNode(rn)}),pn.forEach(rn=>{a.some(zn=>zn.from===rn.v&&zn.to===rn.w)||Mt.current.removeEdge(rn.v,rn.w)}),i.forEach(rn=>{const Zn=Mt.current.nodes().find(zn=>rn.id===zn);if(Zn&&Mt.current.node(Zn)){const{width:zn,height:ra,x:Yn,y:Xi}=Mt.current.node(Zn);Mt.current.setNode(Zn,{...rn,width:zn,height:ra,x:Yn,y:Xi})}else Mt.current.setNode(rn.id,{...rn,width:0,height:0})}),a.forEach(rn=>{Mt.current.setEdge(rn.from,rn.to,{...rn,label:rn.label,width:0,height:0,labelpos:Ce,labeloffset:Ie,weight:Ut,minlen:pt})})},[a,i,Ce,Ie,Ut,pt]),nn=t.useMemo(()=>Et()(()=>{mt().layout(Mt.current);const{height:ln,width:pn}=Mt.current.graph(),rn=Math.max(0,ln||0),Zn=Math.max(0,pn||0);$r(Zn),ea(rn),ta(Mt.current.nodes()),pa(Mt.current.edges())},250,{leading:!0}),[]);t.useEffect(()=>(Mt.current.setGraph({rankdir:g,align:v,nodesep:O,edgesep:N,ranksep:G,marginx:H,marginy:ne,acyclicer:_,ranker:ve}),qn(),nn(),nn.cancel),[_,v,g,N,H,ne,O,G,ve,qn,nn]);function Cn(ln,pn){return Mt.current.setNode(ln,pn),nn(),Mt.current}function vr(ln,pn){return Mt.current.setEdge(ln,pn),nn(),Mt.current}return t.createElement("svg",{ref:ar,...Gt,width:"100%",height:Sn,viewBox:`0 0 ${sn} ${Sn}`},t.createElement("defs",null,t.createElement("marker",{id:Ke,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth"},t.createElement("path",{fill:en.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),Jt),t.createElement("g",{id:Lt},t.createElement("svg",{width:yr,height:Er,y:Sn/2-Er/2,x:sn/2-yr/2,viewBox:`0 0 ${yr} ${Er}`},na.map(ln=>{const pn=Mt.current.edge(ln);return pn?t.createElement(Tt,{key:`${ln.v}-${ln.w}`,id:ln,setEdge:vr,render:Yt,edge:pn}):null}),ga.map(ln=>{const pn=Mt.current.node(ln);return pn?t.createElement(se,{key:ln,setNode:Cn,render:d,node:pn}):null}))))}const Nt=(0,m.Z)(n=>{var a;return{root:{padding:n.spacing(0),marginBottom:n.spacing(0),marginTop:n.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:n.spacing(6),marginTop:-n.spacing(3),zIndex:"unset"},icon:{fontSize:20},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:n.palette.banner.text,"& a":{color:n.palette.banner.link}},info:{backgroundColor:n.palette.banner.info},error:{backgroundColor:n.palette.banner.error},warning:{backgroundColor:(a=n.palette.banner.warning)!=null?a:n.palette.banner.error}}},{name:"BackstageDismissableBanner"}),Zt=n=>{var Ce;const{variant:a,message:i,id:d,fixed:g=!1}=n,v=Nt(),N=useApi(storageApiRef).forBucket("notifications"),G=(Ce=N.snapshot("dismissedBanners").value)!=null?Ce:[],[H,ne]=useState(new Set(G)),_=useObservable(N.observe$("dismissedBanners"));useEffect(()=>{var Ie;if(_!=null&&_.value){const pt=(Ie=_==null?void 0:_.value)!=null?Ie:[];ne(new Set(pt))}},[_==null?void 0:_.value]);const ve=()=>{N.set("dismissedBanners",[...H,d])};return React.createElement(Snackbar,{anchorOrigin:g?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!H.has(d),classes:{root:classNames(v.root,!g&&v.topPosition)}},React.createElement(SnackbarContent,{classes:{root:classNames(v.content,v[a]),message:v.message},message:i,action:[React.createElement(IconButton,{key:"dismiss",title:"Permanently dismiss this message",color:"inherit",onClick:ve},React.createElement(Close,{className:v.icon}))]}))};var vt=e(60905),at=e(90436),zt=e.p+"static/missingAnnotation.67f79e98..svg",ae=e.p+"static/noInformation.4b426325..svg",V=e.p+"static/createComponent.975d1e1e..svg",ye=e.p+"static/noBuild.1715fa71..svg";const He=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),qe=({missing:n})=>{const a=He();switch(n){case"field":return t.createElement("img",{src:zt,className:a.generalImg,alt:"annotation is missing"});case"info":return t.createElement("img",{src:ae,alt:"no Information",className:a.generalImg});case"content":return t.createElement("img",{src:V,alt:"create Component",className:a.generalImg});case"data":return t.createElement("img",{src:ye,alt:"no Build",className:a.generalImg});default:return null}},ot=(0,m.Z)(n=>({root:{backgroundColor:n.palette.background.default,padding:n.spacing(2,0,0,0)},action:{marginTop:n.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function bt(n){const{title:a,description:i,missing:d,action:g}=n,v=ot();return t.createElement(vt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2},t.createElement(vt.Z,{item:!0,xs:12,md:6},t.createElement(vt.Z,{container:!0,direction:"column"},t.createElement(vt.Z,{item:!0,xs:!0},t.createElement(at.Z,{variant:"h5"},a)),t.createElement(vt.Z,{item:!0,xs:!0},t.createElement(at.Z,{variant:"body1"},i)),t.createElement(vt.Z,{item:!0,xs:!0,className:v.action},g))),t.createElement(vt.Z,{item:!0,xs:12,md:6,className:v.imageContainer},t.createElement(qe,{missing:d})))}const Wt=`apiVersion: backstage.io/v1alpha1
|
|
1
|
+
(()=>{var qi=Object.defineProperty;var _i=(ee,s,e)=>s in ee?qi(ee,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):ee[s]=e;var q=(ee,s,e)=>(_i(ee,typeof s!="symbol"?s+"":s,e),e),po=(ee,s,e)=>{if(!s.has(ee))throw TypeError("Cannot "+e)};var rt=(ee,s,e)=>(po(ee,s,"read from private field"),e?e.call(ee):s.get(ee)),Dn=(ee,s,e)=>{if(s.has(ee))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(ee):s.set(ee,e)},wn=(ee,s,e,r)=>(po(ee,s,"write to private field"),r?r.call(ee,e):s.set(ee,e),e);(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[179],{30001:function(ee,s,e){"use strict";e.d(s,{n3:function(){return A},MS:function(){return m}});var r=e(48023),t=e(10179),l=e(96279),u=e.n(l);const A=Symbol.for("CATALOG_FILTER_EXISTS_0e15b590c0b343a2bae3e787e84c2111");class m{constructor(c){q(this,"discoveryApi");q(this,"fetchApi");this.discoveryApi=c.discoveryApi,this.fetchApi=c.fetchApi||{fetch:u()}}async getEntityAncestors(c,f){const{kind:y,namespace:p,name:E}=(0,r.of)(c.entityRef);return await this.requestRequired("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}/ancestry`,f)}async getLocationById(c,f){return await this.requestOptional("GET",`/locations/${encodeURIComponent(c)}`,f)}async getEntities(c,f){const{filter:y=[],fields:p=[],offset:E,limit:T,after:I}=c!=null?c:{},B=[];for(const L of[y].flat()){const D=[];for(const[U,Y]of Object.entries(L))for(const te of[Y].flat())te===A?D.push(encodeURIComponent(U)):typeof te=="string"&&D.push(`${encodeURIComponent(U)}=${encodeURIComponent(te)}`);D.length&&B.push(`filter=${D.join(",")}`)}p.length&&B.push(`fields=${p.map(encodeURIComponent).join(",")}`),E!==void 0&&B.push(`offset=${E}`),T!==void 0&&B.push(`limit=${T}`),I!==void 0&&B.push(`after=${encodeURIComponent(I)}`);const j=B.length?`?${B.join("&")}`:"",M=await this.requestRequired("GET",`/entities${j}`,f),b=(L,D)=>{var te,ue;if(((te=L.metadata)==null?void 0:te.name)===void 0||L.kind===void 0||((ue=D.metadata)==null?void 0:ue.name)===void 0||D.kind===void 0)return 0;const U=(0,r.eE)(L),Y=(0,r.eE)(D);return U<Y?-1:U>Y?1:0};return{items:M.sort(b)}}async getEntityByRef(c,f){const{kind:y,namespace:p,name:E}=(0,r.of)(c);return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}`,f)}async getEntityByName(c,f){const{kind:y,namespace:p="default",name:E}=c;return this.requestOptional("GET",`/entities/by-name/${encodeURIComponent(y)}/${encodeURIComponent(p)}/${encodeURIComponent(E)}`,f)}async refreshEntity(c,f){const y=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/refresh`,{headers:{"Content-Type":"application/json",...(f==null?void 0:f.token)&&{Authorization:`Bearer ${f==null?void 0:f.token}`}},method:"POST",body:JSON.stringify({entityRef:c})});if(y.status!==200)throw new Error(await y.text())}async getEntityFacets(c,f){const{filter:y=[],facets:p}=c,E=[];for(const I of[y].flat()){const B=[];for(const[j,M]of Object.entries(I))for(const b of[M].flat())b===A?B.push(encodeURIComponent(j)):typeof b=="string"&&B.push(`${encodeURIComponent(j)}=${encodeURIComponent(b)}`);B.length&&E.push(`filter=${B.join(",")}`)}for(const I of p)E.push(`facet=${encodeURIComponent(I)}`);const T=E.length?`?${E.join("&")}`:"";return await this.requestOptional("GET",`/entity-facets${T}`,f)}async addLocation({type:c="url",target:f,dryRun:y},p){const E=await this.fetchApi.fetch(`${await this.discoveryApi.getBaseUrl("catalog")}/locations${y?"?dryRun=true":""}`,{headers:{"Content-Type":"application/json",...(p==null?void 0:p.token)&&{Authorization:`Bearer ${p==null?void 0:p.token}`}},method:"POST",body:JSON.stringify({type:c,target:f})});if(E.status!==201)throw new Error(await E.text());const{location:T,entities:I,exists:B}=await E.json();if(!T)throw new Error(`Location wasn't added: ${f}`);return{location:T,entities:I,exists:B}}async getLocationByRef(c,f){return(await this.requestRequired("GET","/locations",f)).map(p=>p.data).find(p=>c===(0,r.NZ)(p))}async removeLocationById(c,f){await this.requestIgnored("DELETE",`/locations/${encodeURIComponent(c)}`,f)}async removeEntityByUid(c,f){await this.requestIgnored("DELETE",`/entities/by-uid/${encodeURIComponent(c)}`,f)}async requestIgnored(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok)throw await t.VL.fromResponse(T)}async requestRequired(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok)throw await t.VL.fromResponse(T);return await T.json()}async requestOptional(c,f,y){const p=`${await this.discoveryApi.getBaseUrl("catalog")}${f}`,E=y!=null&&y.token?{Authorization:`Bearer ${y.token}`}:{},T=await this.fetchApi.fetch(p,{method:c,headers:E});if(!T.ok){if(T.status===404)return;throw await t.VL.fromResponse(T)}return await T.json()}}},48023:function(ee,s,e){"use strict";e.d(s,{Tf:function(){return l},P1:function(){return Rt},q1:function(){return Nt},M6:function(){return Zt},l2:function(){return t},zG:function(){return r},w$:function(){return Q},nP:function(){return Z},aS:function(){return ke},S4:function(){return fe},cz:function(){return Ae},iB:function(){return _e},of:function(){return et},Ou:function(){return vt},eE:function(){return st},NZ:function(){return at}});const r="default",t="backstage.io/view-url",l="backstage.io/edit-url";var u=e(76635),A=e.n(u);class m{constructor(V=DEFAULT_NAMESPACE){q(this,"namespace");this.namespace=V}async enforce(V){return V.metadata.namespace?V:lodash.merge({metadata:{namespace:this.namespace}},V)}}class o{static isValidPrefixAndOrSuffix(V,ye,He,qe){if(typeof V!="string")return!1;const ot=V.split(ye);return ot.length===1?qe(ot[0]):ot.length===2?He(ot[0])&&qe(ot[1]):!1}static isJsonSafe(V){try{return A().isEqual(V,JSON.parse(JSON.stringify(V)))}catch{return!1}}static isValidDnsSubdomain(V){return typeof V=="string"&&V.length>=1&&V.length<=253&&V.split(".").every(o.isValidDnsLabel)}static isValidDnsLabel(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9]+(\-[a-z0-9]+)*$/.test(V)}static isValidTag(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-z0-9+#]+(\-[a-z0-9+#]+)*$/.test(V)}static isValidUrl(V){if(typeof V!="string")return!1;try{return new URL(V),!0}catch{return!1}}static isValidString(V){var ye;return typeof V=="string"&&((ye=V==null?void 0:V.trim())==null?void 0:ye.length)>=1}static isNonEmptyString(V){var ye;return typeof V=="string"&&((ye=V==null?void 0:V.trim())==null?void 0:ye.length)>=1}}var c=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),f=e(48231),y=e.n(f),p=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"}}}`),E=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}}}}}}'),T=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 I=new Map,B=[c,p,E,T];function j(ae){if(!(ae!=null&&ae.length))throw new TypeError("Unknown error");const V=ae[0];throw new TypeError(`${V.instancePath||"<root>"} ${V.message}${V.params?` - ${Object.entries(V.params).map(([ye,He])=>`${ye}: ${He}`).join(", ")}`:""}`)}function M(ae,V={}){var Wt;const ye=(Wt=V==null?void 0:V.disableCache)!=null?Wt:!1,He=ye?"":JSON.stringify(ae);if(!ye){const Xt=I.get(He);if(Xt)return Xt}const qe=b(ae),ot=new(y())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});qe.length&&ot.addSchema(qe,void 0,void 0,!0);const bt=ot.compile(ae);return ye||I.set(He,bt),bt}function b(ae){if(typeof ae!="object")return[];const V=new Set;ae.$id&&V.add(ae.$id);const ye=new Array,He=[ae];for(;He.length;){const qe=He.pop();for(const ot of L(qe))if(!V.has(ot)){V.add(ot);const bt=B.find(Wt=>Wt.$id===ot);bt&&(ye.push(bt),He.push(bt))}}return ye}function*L(ae){const V=[ae];for(;V.length;){const ye=V.pop();if(typeof ye=="object"&&ye)for(const[He,qe]of Object.entries(ye))He==="$ref"&&typeof qe=="string"?yield qe.split("#")[0]:V.push(qe)}}function D(ae){const V=compileAjvSchema(ae||entityEnvelopeSchema);return ye=>{if(V(ye)===!0)return ye;throw throwAjvError(V.errors)}}function U(ae){const V=M(ae);return ye=>{var ot;if(V(ye)===!0)return ye;const qe=(ot=V.errors)==null?void 0:ot.filter(bt=>["/kind","/apiVersion"].includes(bt.instancePath));if((qe==null?void 0:qe.length)&&qe.every(bt=>bt.keyword==="enum"))return!1;throw j(V.errors)}}function Y(ae){const V=compileAjvSchema(ae||entitySchema);return ye=>{if(V(ye)===!0)return ye;throw throwAjvError(V.errors)}}class te{static isValidApiVersion(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,ye=>ye.length>=1&&ye.length<=63&&/^[a-z0-9A-Z]+$/.test(ye))}static isValidKind(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^[a-zA-Z][a-z0-9A-Z]*$/.test(V)}static isValidObjectName(V){return typeof V=="string"&&V.length>=1&&V.length<=63&&/^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$/.test(V)}static isValidNamespace(V){return o.isValidDnsLabel(V)}static isValidLabelKey(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,te.isValidObjectName)}static isValidLabelValue(V){return V===""||te.isValidObjectName(V)}static isValidAnnotationKey(V){return o.isValidPrefixAndOrSuffix(V,"/",o.isValidDnsSubdomain,te.isValidObjectName)}static isValidAnnotationValue(V){return typeof V=="string"}}const ue={isValidApiVersion:te.isValidApiVersion,isValidKind:te.isValidKind,isValidEntityName:te.isValidObjectName,isValidNamespace:te.isValidNamespace,isValidLabelKey:te.isValidLabelKey,isValidLabelValue:te.isValidLabelValue,isValidAnnotationKey:te.isValidAnnotationKey,isValidAnnotationValue:te.isValidAnnotationValue,isValidTag:ae=>typeof ae=="string"&&ae.length>=1&&ae.length<=63&&/^[a-z0-9:+#]+(\-[a-z0-9:+#]+)*$/.test(ae)};function Re(ae={}){return{...ue,...ae}}class we{constructor(V=makeValidator()){q(this,"validators");this.validators=V}async enforce(V){var bt,Wt,Xt,un,dn,xt,qt;function ye(x,re,Ee){if(re==null)throw new Error(`${x} must have a value`);let Te;try{Te=Ee(re)}catch(Le){throw new Error(`${x} could not be validated, ${Le}`)}if(!Te){let Le;switch(Ee.name){case"isValidLabelValue":case"isValidObjectName":Le="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":Le="a valid prefix and/or suffix";break;case"isValidNamespace":case"isValidDnsLabel":Le="a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total";break;case"isValidTag":Le="a string that is sequences of [a-z0-9+#] separated by [-], at most 63 characters in total";break;case"isValidAnnotationValue":Le="a string";break;case"isValidKind":Le="a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total";break;case"isValidUrl":Le="a string that is a valid url";break;case"isValidString":case"isNonEmptyString":Le="a non empty string";break;default:Le=void 0;break}const Je=Le?` expected ${Le} but found "${re}".`:"";throw new Error(`"${x}" is not valid;${Je} To learn more about catalog file format, visit: https://github.com/backstage/backstage/blob/master/docs/architecture-decisions/adr002-default-catalog-file-format.md`)}}function He(x,re,Ee){return re===void 0||ye(x,re,Ee)}ye("apiVersion",V.apiVersion,this.validators.isValidApiVersion),ye("kind",V.kind,this.validators.isValidKind),ye("metadata.name",V.metadata.name,this.validators.isValidEntityName),He("metadata.namespace",V.metadata.namespace,this.validators.isValidNamespace);for(const[x,re]of Object.entries((bt=V.metadata.labels)!=null?bt:[]))ye(`labels.${x}`,x,this.validators.isValidLabelKey),ye(`labels.${x}`,re,this.validators.isValidLabelValue);for(const[x,re]of Object.entries((Wt=V.metadata.annotations)!=null?Wt:[]))ye(`annotations.${x}`,x,this.validators.isValidAnnotationKey),ye(`annotations.${x}`,re,this.validators.isValidAnnotationValue);const qe=(Xt=V.metadata.tags)!=null?Xt:[];for(let x=0;x<qe.length;++x)ye(`tags.${x}`,qe[x],this.validators.isValidTag);const ot=(un=V.metadata.links)!=null?un:[];for(let x=0;x<ot.length;++x)ye(`links.${x}.url`,(dn=ot[x])==null?void 0:dn.url,CommonValidatorFunctions.isValidUrl),He(`links.${x}.title`,(xt=ot[x])==null?void 0:xt.title,CommonValidatorFunctions.isNonEmptyString),He(`links.${x}.icon`,(qt=ot[x])==null?void 0:qt.icon,KubernetesValidatorFunctions.isValidObjectName);return V}}class ge{constructor(){q(this,"validate")}async enforce(V){if(!this.validate){const qe=new Ajv({allowUnionTypes:!0});this.validate=qe.addSchema([commonSchema,entityMetaSchema],void 0,void 0,!0).compile(entitySchema)}if(this.validate(V)===!0)return V;const[He]=this.validate.errors||[];throw He?new Error(`Malformed envelope, ${He.instancePath||"<root>"} ${He.message}`):new Error("Malformed envelope, Unknown error")}}function ze(ae){let V=ae.indexOf(":");const ye=ae.indexOf("/");ye!==-1&&ye<V&&(V=-1);const He=V===-1?void 0:ae.slice(0,V),qe=ye===-1?void 0:ae.slice(V+1,ye),ot=ae.slice(Math.max(V+1,ye+1));if(He===""||qe===""||ot==="")throw new TypeError(`Entity reference "${ae}" was not on the form [<kind>:][<namespace>/]<name>`);return{kind:He,namespace:qe,name:ot}}function _e(ae){return{kind:ae.kind,namespace:ae.metadata.namespace||r,name:ae.metadata.name}}function et(ae,V){var Wt,Xt,un,dn;if(!ae)throw new Error("Entity reference must not be empty");const ye=V==null?void 0:V.defaultKind,He=(V==null?void 0:V.defaultNamespace)||r;let qe,ot,bt;if(typeof ae=="string"){const xt=ze(ae);qe=(Wt=xt.kind)!=null?Wt:ye,ot=(Xt=xt.namespace)!=null?Xt:He,bt=xt.name}else qe=(un=ae.kind)!=null?un:ye,ot=(dn=ae.namespace)!=null?dn:He,bt=ae.name;if(qe)if(ot){if(!bt){const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty name`)}}else{const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty namespace`)}else{const xt=JSON.stringify(ae);throw new Error(`Entity reference ${xt} had missing or empty kind (e.g. did not start with "component:" or similar)`)}return{kind:qe,namespace:ot,name:bt}}function st(ae){var qe,ot;let V,ye,He;return"metadata"in ae?(V=ae.kind,ye=(qe=ae.metadata.namespace)!=null?qe:r,He=ae.metadata.name):(V=ae.kind,ye=(ot=ae.namespace)!=null?ot:r,He=ae.name),`${V.toLocaleLowerCase("en-US")}:${ye.toLocaleLowerCase("en-US")}/${He.toLocaleLowerCase("en-US")}`}class Ct{constructor(V){this.policies=V}async enforce(V){let ye=V;for(const He of this.policies){const qe=await He.enforce(ye);if(!qe)throw new Error(`Policy ${He.constructor.name} did not return a result`);ye=qe}return ye}}class yt{constructor(V){this.policies=V}async enforce(V){for(const ye of this.policies){const He=await ye.enforce(V);if(He)return He}throw new Error("The entity did not match any known policy")}}const Pe={allOf(ae){return new Ct(ae)},oneOf(ae){return new yt(ae)}};var ht=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"ApiV1alpha1","description":"An API describes an interface that can be exposed by a component. The API can be defined in different formats, like OpenAPI, AsyncAPI, GraphQL, gRPC, or other formats.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"API","metadata":{"name":"artist-api","description":"Retrieve artist details","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"openapi","lifecycle":"production","owner":"artist-relations-team","system":"artist-engagement-portal","definition":"openapi: \\"3.0.0\\"\\ninfo:..."}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["backstage.io/v1alpha1","backstage.io/v1beta1"]},"kind":{"enum":["API"]},"spec":{"type":"object","required":["type","lifecycle","owner","definition"],"properties":{"type":{"type":"string","description":"The type of the API definition.","examples":["openapi","asyncapi","graphql","grpc"],"minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the API.","examples":["experimental","production","deprecated"],"minLength":1},"owner":{"type":"string","description":"An entity reference to the owner of the API.","examples":["artist-relations-team","user:john.johnson"],"minLength":1},"system":{"type":"string","description":"An entity reference to the system that the API belongs to.","minLength":1},"definition":{"type":"string","description":"The definition of the API, based on the format defined by the type.","minLength":1}}}}}]}');function Ve(ae){const V=U(ae);return{async check(ye){return V(ye)===ye}}}const ie=Ve(ht);var de=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 Ue=Ve(de);var Be=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 Xe=Ve(Be);var mt=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 Ye=Ve(mt);var Et=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 oe=Ve(Et),fe="ownedBy",tt="ownerOf",Ke="consumesApi",Ne="apiConsumedBy",ct="providesApi",X="apiProvidedBy",Z="dependsOn",Q="dependencyOf",se="parentOf",le="childOf",be="memberOf",Oe="hasMember",Ae="partOf",ke="hasPart";var We=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 gt=Ve(We);var It=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 lt=Ve(It);var Tt=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 Lt=Ve(Tt),Rt="backstage.io/managed-by-location",Nt="backstage.io/managed-by-origin-location",Zt="backstage.io/source-location";function vt(ae){if(typeof ae!="string")throw new TypeError(`Unable to parse location ref '${ae}', unexpected argument ${typeof ae}`);const V=ae.indexOf(":");if(V<0)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);const ye=ae.substring(0,V).trim(),He=ae.substring(V+1).trim();if(!ye||!He)throw new TypeError(`Unable to parse location ref '${ae}', expected '<type>:<target>', e.g. 'url:https://host/path'`);if(ye==="http"||ye==="https")throw new TypeError(`Invalid location ref '${ae}', please prefix it with 'url:', e.g. 'url:${ae}'`);return{type:ye,target:He}}function at(ae){const{type:V,target:ye}=ae;if(V){if(!ye)throw new TypeError("Unable to stringify location ref, empty target")}else throw new TypeError("Unable to stringify location ref, empty type");return`${V}:${ye}`}function zt(ae){var ye,He,qe,ot,bt;const V=(bt=(He=(ye=ae.metadata)==null?void 0:ye.annotations)==null?void 0:He[ANNOTATION_SOURCE_LOCATION])!=null?bt:(ot=(qe=ae.metadata)==null?void 0:qe.annotations)==null?void 0:ot[ANNOTATION_LOCATION];if(!V)throw new Error(`Entity '${stringifyEntityRef(ae)}' is missing location`);return vt(V)}},23235:function(ee,s,e){"use strict";e.d(s,{C:function(){return t}});var r=e(98005);class t{constructor(){q(this,"subject",new r.J)}post(u){this.subject.next(u)}alert$(){return this.subject}}},47150:function(ee,s,e){"use strict";e.d(s,{g:function(){return r}});class r{captureEvent(l){}}},58652:function(ee,s,e){"use strict";e.d(s,{C:function(){return l}});var r=e(98005);const t="theme";class l{constructor(A){q(this,"activeThemeId");q(this,"subject",new r.X(void 0));this.themes=A}static createWithStorage(A){var c;const m=new l(A);if(!window.localStorage)return m;const o=(c=window.localStorage.getItem(t))!=null?c:void 0;return m.setActiveThemeId(o),m.activeThemeId$().subscribe(f=>{f?window.localStorage.setItem(t,f):window.localStorage.removeItem(t)}),window.addEventListener("storage",f=>{var y;if(f.key===t){const p=(y=localStorage.getItem(t))!=null?y:void 0;m.setActiveThemeId(p)}}),m}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(A){this.activeThemeId=A,this.subject.next(A)}}},14721:function(ee,s,e){"use strict";e.d(s,{m:function(){return f}});var r=e(9850),t=e.n(r),l=e(12782),u=e.n(l);const A=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function m(y){return typeof y=="object"&&y!==null&&!Array.isArray(y)}function o(y){if(y===null)return"null";if(Array.isArray(y))return"array";const p=typeof y;return p==="number"&&isNaN(y)?"nan":p==="string"&&y===""?"empty-string":p}const c={type(y,p,E,T){return`Invalid type in config for key '${y}' in '${p}', got ${E}, wanted ${T}`},missing(y){return`Missing required config value at '${y}'`},convert(y,p,E){return`Unable to convert config value for key '${y}' in '${p}' to a ${E}`}};class f{constructor(p,E="mock-config",T,I=""){q(this,"filteredKeys");q(this,"notifiedFilteredKeys",new Set);this.data=p,this.context=E,this.fallback=T,this.prefix=I}static fromConfigs(p){return p.length===0?new f(void 0):p.reduce((E,{data:T,context:I,filteredKeys:B,deprecatedKeys:j})=>{const M=new f(T,I,E);if(M.filteredKeys=B,j)for(const{key:b,description:L}of j)console.warn(`The configuration key '${b}' of ${I} is deprecated and may be removed soon. ${L||""}`);return M},void 0)}has(p){var T,I;return this.readValue(p)!==void 0?!0:(I=(T=this.fallback)==null?void 0:T.has(p))!=null?I:!1}keys(){var T,I;const p=this.data?Object.keys(this.data):[],E=(I=(T=this.fallback)==null?void 0:T.keys())!=null?I:[];return[...new Set([...p,...E])]}get(p){const E=this.getOptional(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p!=null?p:"")));return E}getOptional(p){var I;const E=t()(this.readValue(p)),T=(I=this.fallback)==null?void 0:I.getOptional(p);return E===void 0?T:T===void 0?E:u()({},{value:T},{value:E},(B,j)=>!m(j)||!m(B)?j:void 0).value}getConfig(p){const E=this.getOptionalConfig(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalConfig(p){var I;const E=this.readValue(p),T=(I=this.fallback)==null?void 0:I.getOptionalConfig(p);if(m(E))return this.copy(E,p,T);if(E!==void 0)throw new TypeError(c.type(this.fullKey(p),this.context,o(E),"object"));return T}getConfigArray(p){const E=this.getOptionalConfigArray(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalConfigArray(p){const E=this.readConfigValue(p,T=>{if(!Array.isArray(T))return{expected:"object-array"};for(const[I,B]of T.entries())if(!m(B))return{expected:"object-array",value:B,key:`${p}[${I}]`};return!0});if(!!E)return E.map((T,I)=>this.copy(T,`${p}[${I}]`))}getNumber(p){const E=this.getOptionalNumber(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalNumber(p){const E=this.readConfigValue(p,I=>typeof I=="number"||typeof I=="string"||{expected:"number"});if(typeof E=="number"||E===void 0)return E;const T=Number(E);if(!Number.isFinite(T))throw new Error(c.convert(this.fullKey(p),this.context,"number"));return T}getBoolean(p){const E=this.getOptionalBoolean(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalBoolean(p){return this.readConfigValue(p,E=>typeof E=="boolean"||{expected:"boolean"})}getString(p){const E=this.getOptionalString(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalString(p){return this.readConfigValue(p,E=>typeof E=="string"&&E!==""||{expected:"string"})}getStringArray(p){const E=this.getOptionalStringArray(p);if(E===void 0)throw new Error(c.missing(this.fullKey(p)));return E}getOptionalStringArray(p){return this.readConfigValue(p,E=>{if(!Array.isArray(E))return{expected:"string-array"};for(const[T,I]of E.entries())if(typeof I!="string"||I==="")return{expected:"string-array",value:I,key:`${p}[${T}]`};return!0})}fullKey(p){return`${this.prefix}${this.prefix?".":""}${p}`}copy(p,E,T){const I=new f(p,this.context,T,this.fullKey(E));return I.filteredKeys=this.filteredKeys,I}readConfigValue(p,E){var B;const T=this.readValue(p);if(T===void 0)return(B=this.fallback)==null?void 0:B.readConfigValue(p,E);const I=E(T);if(I!==!0){const{key:j=p,value:M=T,expected:b}=I;throw new TypeError(c.type(this.fullKey(j),this.context,o(M),b))}return T}readValue(p){const E=p?p.split("."):[];for(const I of E)if(!A.test(I))throw new TypeError(`Invalid config key '${p}'`);if(this.data===void 0)return;let T=this.data;for(const[I,B]of E.entries())if(m(T))T=T[B];else if(T!==void 0){const j=this.fullKey(E.slice(0,I).join("."));throw new TypeError(c.type(j,this.context,o(T),"object"))}return T}}},4333:function(ee,s,e){"use strict";e.d(s,{p:function(){return t}});const r="Invalid discovery URL pattern,";class t{static compile(u){const A=u.split(/\{\{\s*pluginId\s*\}\}/),m=A.join("pluginId");let o;try{o=new URL(m)}catch{throw new Error(`${r} URL '${m}' is invalid`)}if(o.hash)throw new Error(`${r} URL must not have a hash`);if(o.search)throw new Error(`${r} URL must not have a query`);if(m.endsWith("/"))throw new Error(`${r} URL must not end with a slash`);return new t(A)}constructor(u){this.parts=u}async getBaseUrl(u){return this.parts.join(u)}}},89536:function(ee,s,e){"use strict";e.d(s,{KN:function(){return r},gr:function(){return l},Jv:function(){return u}});class r{constructor(m,o){this.alertApi=m,this.errorApi=o}post(m,o){return o!=null&&o.hidden||this.alertApi.post({message:m.message,severity:"error"}),this.errorApi.post(m,o)}error$(){return this.errorApi.error$()}}var t=e(98005);class l{constructor(){q(this,"subject",new t.J)}post(m,o){this.subject.next({error:m,context:o})}error$(){return this.subject}}class u{static forward(m,o){window.addEventListener("unhandledrejection",c=>{m.post(c.reason,o)})}}},14884:function(ee,s,e){"use strict";e.d(s,{b:function(){return l}});var r=e(36964);function t(u){if(u.length<3)throw new Error(`The '${u}' feature flag must have a minimum length of three characters.`);if(u.length>150)throw new Error(`The '${u}' feature flag must not exceed 150 characters.`);if(!u.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${u}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class l{constructor(){q(this,"registeredFeatureFlags",[]);q(this,"flags")}registerFlag(A){t(A.name),this.registeredFeatureFlags.push(A)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(A){return this.flags||(this.flags=this.load()),this.flags.get(A)===r.FeatureFlagState.Active}save(A){this.flags||(this.flags=this.load()),A.merge||this.flags.clear();for(const[o,c]of Object.entries(A.states))this.flags.set(o,c);const m=Array.from(this.flags.entries()).filter(([,o])=>o===r.FeatureFlagState.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(m)))}load(){try{const A=window.localStorage.getItem("featureFlags");if(!A)return new Map;const m=JSON.parse(A);if(typeof m!="object"||m===null||Array.isArray(m))return new Map;const o=Object.entries(m).filter(([c,f])=>(t(c),f===r.FeatureFlagState.Active));return new Map(o)}catch{return new Map}}}},50160:function(ee,s,e){"use strict";e.d(s,{I:function(){return c},j:function(){return r}});function r(f){var E;let y=f.baseImplementation||e.g.fetch;const p=[(E=f.middleware)!=null?E:[]].flat().reverse();for(const T of p)y=T.apply(y);return{fetch:y}}class t{static create(y){var I,B;const p=l(y),E=((I=y.header)==null?void 0:I.name)||"authorization",T=((B=y.header)==null?void 0:B.value)||(j=>`Bearer ${j}`);return new t(y.identityApi,p,E,T)}constructor(y,p,E,T){this.identityApi=y,this.allowUrl=p,this.headerName=E,this.headerValue=T}apply(y){return async(p,E)=>{const T=new Request(p,E),{token:I}=await this.identityApi.getCredentials();return T.headers.get(this.headerName)||typeof I!="string"||!I||!this.allowUrl(T.url)?y(p,E):(T.headers.set(this.headerName,this.headerValue(I)),y(T))}}}function l(f){return f.allowUrl?f.allowUrl:f.urlPrefixAllowlist?u(f.urlPrefixAllowlist):f.config?u([f.config.getString("backend.baseUrl")]):()=>!1}function u(f){const y=f.map(p=>p.replace(/\/$/,""));return p=>y.some(E=>p===E||p.startsWith(`${E}/`))}function A(f,y){return!y||y==="/"?f:`${f.replace(/\/$/,"")}/${y.replace(/^\//,"")}`}class m{constructor(y){this.discoveryApi=y}apply(y){return async(p,E)=>{const T=new Request(p,E),I="plugin://";if(!T.url.startsWith(I))return y(p,E);const{hostname:B,pathname:j,search:M,hash:b,username:L,password:D}=new URL(`http://${T.url.substring(I.length)}`);let U=await this.discoveryApi.getBaseUrl(B);if(L||D){const te=new URL(U),ue=`${L}${D?`:${D}`:""}@`;U=`${te.protocol}//${ue}${te.host}${te.pathname}`}const Y=`${A(U,j)}${M}${b}`;return y(Y,typeof p=="string"||o(p)?E:p)}}}function o(f){return typeof f=="object"&&(f==null?void 0:f.constructor)===URL}class c{static resolvePluginProtocol(y){return new m(y.discoveryApi)}static injectIdentityAuth(y){return t.create(y)}constructor(){}}},11358:function(ee,s,e){"use strict";e.d(s,{Y:function(){return A}});var r=e(98005);function t(m,o){for(const c of o)if(!m.has(c))return!1;return!0}function l(m,...o){const c=new Set(m);for(const f of o)for(const y of f)c.add(y);return c}class u{constructor(){q(this,"requests",[]);q(this,"subject",new r.X(this.getCurrentPending()))}request(o){return new Promise((c,f)=>{this.requests.push({scopes:o,resolve:c,reject:f}),this.subject.next(this.getCurrentPending())})}resolve(o,c){this.requests=this.requests.filter(f=>t(o,f.scopes)?(f.resolve(c),!1):!0),this.subject.next(this.getCurrentPending())}reject(o){this.requests.forEach(c=>c.reject(o)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const o=this.requests.length===0?void 0:this.requests.slice(1).reduce((c,f)=>l(c,f.scopes),this.requests[0].scopes);return{scopes:o,resolve:c=>{o&&this.resolve(o,c)},reject:c=>{o&&this.reject(c)}}}}class A{constructor(){q(this,"subject",new r.X([]));q(this,"currentRequests",[]);q(this,"handlerCount",0)}createAuthRequester(o){const c=new u,f=this.handlerCount;return this.handlerCount++,c.pending().subscribe({next:y=>{const p=this.currentRequests.slice(),E=this.makeAuthRequest(y,o);E?p[f]=E:delete p[f],this.currentRequests=p,this.subject.next(p.filter(Boolean))}}),y=>c.request(y)}makeAuthRequest(o,c){const{scopes:f}=o;if(!!f)return{provider:c.provider,trigger:async()=>{const y=await c.onAuthRequest(f);o.resolve(y)},reject:()=>{const y=new Error("Login failed, rejected by user");y.name="RejectedError",o.reject(y)}}}authRequest$(){return this.subject}}},56054:function(ee,s,e){"use strict";e.d(s,{C:function(){return u}});var r=e(82394),t=e.n(r);const l=new Map;class u{constructor(m,o){q(this,"subscribers",new Set);q(this,"observable",new(t())(m=>(this.subscribers.add(m),()=>{this.subscribers.delete(m)})));this.namespace=m,this.errorApi=o}static create(m){var o;return new u((o=m.namespace)!=null?o:"",m.errorApi)}get(m){return this.snapshot(m).value}snapshot(m){let o,c="absent";try{const f=localStorage.getItem(this.getKeyName(m));f&&(o=JSON.parse(f,(y,p)=>(typeof p=="object"&&p!==null&&Object.freeze(p),p)),c="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${m}`))}return{key:m,value:o,presence:c}}forBucket(m){const o=`${this.namespace}/${m}`;return l.has(o)||l.set(o,new u(o,this.errorApi)),l.get(o)}async set(m,o){localStorage.setItem(this.getKeyName(m),JSON.stringify(o)),this.notifyChanges(m)}async remove(m){localStorage.removeItem(this.getKeyName(m)),this.notifyChanges(m)}observe$(m){return this.observable.filter(({key:o})=>o===m)}getKeyName(m){return`${this.namespace}/${encodeURIComponent(m)}`}notifyChanges(m){const o=this.snapshot(m);for(const c of this.subscribers)c.next(o)}}},59589:function(ee,s,e){"use strict";e.d(s,{u:function(){return l}});var r=e(91205);const t={id:"atlassian",title:"Atlassian",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o})}}},6098:function(ee,s,e){"use strict";e.d(s,{Z:function(){return l}});var r=e(91205);const t={id:"bitbucket",title:"Bitbucket",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["team"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},44431:function(ee,s,e){"use strict";e.d(s,{BitbucketAuth:function(){return l.Z}});var r=e(19347),t=e.n(r);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var l=e(6098)},19347:function(){},44474:function(ee,s,e){"use strict";e.d(s,{T:function(){return l}});var r=e(91205);const t={id:"github",title:"GitHub",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["read:user"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},2922:function(ee,s,e){"use strict";e.d(s,{a:function(){return l}});var r=e(91205);const t={id:"gitlab",title:"GitLab",icon:()=>null};class l{static create(A){const{discoveryApi:m,environment:o="development",provider:c=t,oauthRequestApi:f,defaultScopes:y=["read_user"]}=A;return r.OAuth2.create({discoveryApi:m,oauthRequestApi:f,provider:c,environment:o,defaultScopes:y})}}},59938:function(ee,s,e){"use strict";e.d(s,{e:function(){return u}});var r=e(91205);const t={id:"google",title:"Google",icon:()=>null},l="https://www.googleapis.com/auth/";class u{static create(m){const{discoveryApi:o,oauthRequestApi:c,environment:f="development",provider:y=t,defaultScopes:p=["openid",`${l}userinfo.email`,`${l}userinfo.profile`]}=m;return r.OAuth2.create({discoveryApi:o,oauthRequestApi:c,provider:y,environment:f,defaultScopes:p,scopeTransform(E){return E.map(T=>T==="openid"?T:T==="profile"||T==="email"?`${l}userinfo.${T}`:T.startsWith(l)?T:`${l}${T}`)}})}}},91668:function(ee,s,e){"use strict";e.d(s,{AtlassianAuth:function(){return y.u},BitbucketAuth:function(){return f.BitbucketAuth},GithubAuth:function(){return r.T},GitlabAuth:function(){return t.a},GoogleAuth:function(){return l.e},MicrosoftAuth:function(){return o._},OktaAuth:function(){return A.s},OneLoginAuth:function(){return c.$}});var r=e(44474),t=e(2922),l=e(59938),u=e(91205);e.o(u,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return u.AlertApiForwarder}}),e.o(u,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return u.AppThemeSelector}}),e.o(u,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return u.AtlassianAuth}}),e.o(u,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return u.BitbucketAuth}}),e.o(u,"ConfigReader")&&e.d(s,{ConfigReader:function(){return u.ConfigReader}}),e.o(u,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return u.ErrorAlerter}}),e.o(u,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return u.ErrorApiForwarder}}),e.o(u,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return u.FetchMiddlewares}}),e.o(u,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return u.FlatRoutes}}),e.o(u,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return u.LocalStorageFeatureFlags}}),e.o(u,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return u.MicrosoftAuth}}),e.o(u,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return u.NoOpAnalyticsApi}}),e.o(u,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return u.OAuthRequestManager}}),e.o(u,"OktaAuth")&&e.d(s,{OktaAuth:function(){return u.OktaAuth}}),e.o(u,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return u.OneLoginAuth}}),e.o(u,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return u.UnhandledErrorForwarder}}),e.o(u,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return u.UrlPatternDiscovery}}),e.o(u,"WebStorage")&&e.d(s,{WebStorage:function(){return u.WebStorage}}),e.o(u,"createFetchApi")&&e.d(s,{createFetchApi:function(){return u.createFetchApi}}),e.o(u,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return u.createSpecializedApp}}),e.o(u,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return u.defaultConfigLoader}});var A=e(26079),m=e(67604),o=e(38482),c=e(58381),f=e(44431);e.o(f,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return f.AlertApiForwarder}}),e.o(f,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return f.AppThemeSelector}}),e.o(f,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return f.AtlassianAuth}}),e.o(f,"ConfigReader")&&e.d(s,{ConfigReader:function(){return f.ConfigReader}}),e.o(f,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return f.ErrorAlerter}}),e.o(f,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return f.ErrorApiForwarder}}),e.o(f,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return f.FetchMiddlewares}}),e.o(f,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return f.FlatRoutes}}),e.o(f,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return f.LocalStorageFeatureFlags}}),e.o(f,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return f.NoOpAnalyticsApi}}),e.o(f,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return f.OAuthRequestManager}}),e.o(f,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return f.UnhandledErrorForwarder}}),e.o(f,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return f.UrlPatternDiscovery}}),e.o(f,"WebStorage")&&e.d(s,{WebStorage:function(){return f.WebStorage}}),e.o(f,"createFetchApi")&&e.d(s,{createFetchApi:function(){return f.createFetchApi}}),e.o(f,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return f.createSpecializedApp}}),e.o(f,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return f.defaultConfigLoader}});var y=e(59589)},38482:function(ee,s,e){"use strict";e.d(s,{_:function(){return l}});var r=e(91205);const t={id:"microsoft",title:"Microsoft",icon:()=>null};class l{static create(A){const{environment:m="development",provider:o=t,oauthRequestApi:c,discoveryApi:f,defaultScopes:y=["openid","offline_access","profile","email","User.Read"]}=A;return r.OAuth2.create({discoveryApi:f,oauthRequestApi:c,provider:o,environment:m,defaultScopes:y})}}},73124:function(ee,s,e){"use strict";e.d(s,{Z:function(){return m}});function r(o){return new Promise((c,f)=>{const y=o.width||500,p=o.height||700,E=window.screen.width/2-y/2,T=window.screen.height/2-p/2,I=window.open(o.url,o.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${y},height=${p},top=${T},left=${E}`);let B="";if(!I||typeof I.closed=="undefined"||I.closed){const L=new Error("Failed to open auth popup.");L.name="PopupRejectedError",f(L);return}const j=L=>{if(L.source!==I||L.origin!==o.origin)return;const{data:D}=L;if(D.type==="config_info"){B=D.targetOrigin;return}if(D.type!=="authorization_response")return;const U=D;if("error"in U){const Y=new Error(U.error.message);Y.name=U.error.name,f(Y)}else c(U.response);b()},M=setInterval(()=>{if(I.closed){const L=`Login failed, ${B&&B!==window.location.origin?`Incorrect app origin, expected ${B}`:"popup was closed"}`,D=new Error(L);D.name="PopupClosedError",f(D),b()}},100);function b(){window.removeEventListener("message",j),clearInterval(M)}window.addEventListener("message",j)})}function t(o){return[...o].join(" ")}class l{constructor(c){q(this,"discoveryApi");q(this,"environment");q(this,"provider");q(this,"joinScopesFunc");q(this,"authRequester");q(this,"sessionTransform");const{discoveryApi:f,environment:y,provider:p,joinScopes:E=t,oauthRequestApi:T,sessionTransform:I=B=>B}=c;this.authRequester=T.createAuthRequester({provider:p,onAuthRequest:B=>this.showPopup(B)}),this.discoveryApi=f,this.environment=y,this.provider=p,this.joinScopesFunc=E,this.sessionTransform=I}async createSession(c){return c.instantPopup?this.showPopup(c.scopes):this.authRequester(c.scopes)}async refreshSession(){const c=await fetch(await this.buildUrl("/refresh",{optional:!0}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(y=>{throw new Error(`Auth refresh request failed, ${y}`)});if(!c.ok){const y=new Error(`Auth refresh request failed, ${c.statusText}`);throw y.status=c.status,y}const f=await c.json();if(f.error){const y=new Error(f.error.message);throw f.error.name&&(y.name=f.error.name),y}return await this.sessionTransform(f)}async removeSession(){const c=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(f=>{throw new Error(`Logout request failed, ${f}`)});if(!c.ok){const f=new Error(`Logout request failed, ${c.statusText}`);throw f.status=c.status,f}}async showPopup(c){const f=this.joinScopesFunc(c),y=await this.buildUrl("/start",{scope:f,origin:location.origin}),p=await r({url:y,name:`${this.provider.title} Login`,origin:new URL(y).origin,width:450,height:730});return await this.sessionTransform(p)}async buildUrl(c,f){const y=await this.discoveryApi.getBaseUrl("auth"),p=this.buildQueryString({...f,env:this.environment});return`${y}/${this.provider.id}${c}${p}`}buildQueryString(c){if(!c)return"";const f=Object.entries(c).map(([y,p])=>{if(typeof p=="string")return`${encodeURIComponent(y)}=${encodeURIComponent(p)}`;if(p)return encodeURIComponent(y)}).filter(Boolean).join("&");return f?`?${f}`:""}}var u=e(57018);const A={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class m{constructor(c){q(this,"sessionManager");q(this,"scopeTransform");this.sessionManager=c.sessionManager,this.scopeTransform=c.scopeTransform}static create(c){const{discoveryApi:f,environment:y="development",provider:p=A,oauthRequestApi:E,defaultScopes:T=[],scopeTransform:I=M=>M}=c,B=new l({discoveryApi:f,environment:y,provider:p,oauthRequestApi:E,sessionTransform(M){return{...M,providerInfo:{idToken:M.providerInfo.idToken,accessToken:M.providerInfo.accessToken,scopes:m.normalizeScopes(I,M.providerInfo.scope),expiresAt:new Date(Date.now()+M.providerInfo.expiresInSeconds*1e3)}}}}),j=new u.RefreshingAuthSessionManager({connector:B,defaultScopes:new Set(T),sessionScopes:M=>M.providerInfo.scopes,sessionShouldRefresh:M=>(M.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new m({sessionManager:j,scopeTransform:I})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(c,f){var E;const y=m.normalizeScopes(this.scopeTransform,c),p=await this.sessionManager.getSession({...f,scopes:y});return(E=p==null?void 0:p.providerInfo.accessToken)!=null?E:""}async getIdToken(c={}){var y;const f=await this.sessionManager.getSession(c);return(y=f==null?void 0:f.providerInfo.idToken)!=null?y:""}async getBackstageIdentity(c={}){const f=await this.sessionManager.getSession(c);return f==null?void 0:f.backstageIdentity}async getProfile(c={}){const f=await this.sessionManager.getSession(c);return f==null?void 0:f.profile}static normalizeScopes(c,f){if(!f)return new Set;const y=Array.isArray(f)?f:f.split(/[\s|,]/).filter(Boolean);return new Set(c(y))}}},91205:function(ee,s,e){"use strict";e.d(s,{OAuth2:function(){return r.Z}});var r=e(73124),t=e(5973),l=e.n(t);e.o(t,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return t.AlertApiForwarder}}),e.o(t,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return t.AppThemeSelector}}),e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"ConfigReader")&&e.d(s,{ConfigReader:function(){return t.ConfigReader}}),e.o(t,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return t.ErrorAlerter}}),e.o(t,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return t.ErrorApiForwarder}}),e.o(t,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return t.FetchMiddlewares}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return t.LocalStorageFeatureFlags}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return t.NoOpAnalyticsApi}}),e.o(t,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return t.OAuthRequestManager}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}}),e.o(t,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return t.UnhandledErrorForwarder}}),e.o(t,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return t.UrlPatternDiscovery}}),e.o(t,"WebStorage")&&e.d(s,{WebStorage:function(){return t.WebStorage}}),e.o(t,"createFetchApi")&&e.d(s,{createFetchApi:function(){return t.createFetchApi}}),e.o(t,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return t.createSpecializedApp}}),e.o(t,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return t.defaultConfigLoader}})},5973:function(){},26079:function(ee,s,e){"use strict";e.d(s,{s:function(){return A}});var r=e(91205);const t={id:"okta",title:"Okta",icon:()=>null},l=new Set(["openid","profile","email","phone","address","groups","offline_access"]),u="okta.";class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=t,oauthRequestApi:p,defaultScopes:E=["openid","email","profile","offline_access"]}=o;return r.OAuth2.create({discoveryApi:c,oauthRequestApi:p,provider:y,environment:f,defaultScopes:E,scopeTransform(T){return T.map(I=>l.has(I)||I.startsWith(u)?I:`${u}${I}`)}})}}},58381:function(ee,s,e){"use strict";e.d(s,{$:function(){return A}});var r=e(91205);const t={id:"onelogin",title:"onelogin",icon:()=>null},l=new Set(["openid","profile","email","phone","address","groups","offline_access"]),u="onelogin.";class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=t,oauthRequestApi:p}=o;return r.OAuth2.create({discoveryApi:c,oauthRequestApi:p,provider:y,environment:f,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(E){return E.map(T=>l.has(T)||T.startsWith(u)?T:`${u}${T}`)}})}}},67604:function(ee,s,e){"use strict";var r=e(57018),t=e(30195);const l=t.z.object({profile:t.z.object({email:t.z.string().optional(),displayName:t.z.string().optional(),picture:t.z.string().optional()}),backstageIdentity:t.z.object({token:t.z.string(),identity:t.z.object({type:t.z.literal("user"),userEntityRef:t.z.string(),ownershipEntityRefs:t.z.array(t.z.string())})})}),u={id:"saml",title:"SAML",icon:()=>null};class A{static create(o){const{discoveryApi:c,environment:f="development",provider:y=u}=o,p=new DirectAuthConnector({discoveryApi:c,environment:f,provider:y}),E=new StaticAuthSessionManager({connector:p}),T=new AuthSessionStore({manager:E,storageKey:`${y.id}Session`,schema:samlSessionSchema});return new A(T)}sessionState$(){return this.sessionManager.sessionState$()}constructor(o){this.sessionManager=o}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(o={}){const c=await this.sessionManager.getSession(o);return c==null?void 0:c.backstageIdentity}async getProfile(o={}){const c=await this.sessionManager.getSession(o);return c==null?void 0:c.profile}}},91631:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return t.C},AppThemeSelector:function(){return u.C},AtlassianAuth:function(){return r.AtlassianAuth},ConfigReader:function(){return A.m},ErrorAlerter:function(){return o.KN},ErrorApiForwarder:function(){return o.gr},FetchMiddlewares:function(){return f.I},GithubAuth:function(){return r.GithubAuth},GitlabAuth:function(){return r.GitlabAuth},GoogleAuth:function(){return r.GoogleAuth},LocalStorageFeatureFlags:function(){return c.b},MicrosoftAuth:function(){return r.MicrosoftAuth},NoOpAnalyticsApi:function(){return l.g},OAuthRequestManager:function(){return y.Y},OktaAuth:function(){return r.OktaAuth},OneLoginAuth:function(){return r.OneLoginAuth},UnhandledErrorForwarder:function(){return o.Jv},UrlPatternDiscovery:function(){return m.p},WebStorage:function(){return p.C},createFetchApi:function(){return f.j}});var r=e(91668);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(23235),l=e(47150),u=e(58652),A=e(14721),m=e(4333),o=e(89536),c=e(14884),f=e(50160),y=e(11358),p=e(56054)},56494:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return t.AlertApiForwarder},ApiProvider:function(){return r.ApiProvider},AppThemeSelector:function(){return t.AppThemeSelector},ConfigReader:function(){return t.ConfigReader},ErrorAlerter:function(){return t.ErrorAlerter},ErrorApiForwarder:function(){return t.ErrorApiForwarder},FetchMiddlewares:function(){return t.FetchMiddlewares},LocalStorageFeatureFlags:function(){return t.LocalStorageFeatureFlags},NoOpAnalyticsApi:function(){return t.NoOpAnalyticsApi},OAuthRequestManager:function(){return t.OAuthRequestManager},UnhandledErrorForwarder:function(){return t.UnhandledErrorForwarder},UrlPatternDiscovery:function(){return t.UrlPatternDiscovery},WebStorage:function(){return t.WebStorage},createFetchApi:function(){return t.createFetchApi}});var r=e(76105);e.o(r,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder}}),e.o(r,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return r.AppThemeSelector}}),e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"ConfigReader")&&e.d(s,{ConfigReader:function(){return r.ConfigReader}}),e.o(r,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return r.ErrorAlerter}}),e.o(r,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return r.ErrorApiForwarder}}),e.o(r,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return r.FetchMiddlewares}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"GithubAuth")&&e.d(s,{GithubAuth:function(){return r.GithubAuth}}),e.o(r,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return r.GitlabAuth}}),e.o(r,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return r.GoogleAuth}}),e.o(r,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return r.LocalStorageFeatureFlags}}),e.o(r,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return r.MicrosoftAuth}}),e.o(r,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi}}),e.o(r,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return r.OAuthRequestManager}}),e.o(r,"OktaAuth")&&e.d(s,{OktaAuth:function(){return r.OktaAuth}}),e.o(r,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return r.OneLoginAuth}}),e.o(r,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder}}),e.o(r,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return r.UrlPatternDiscovery}}),e.o(r,"WebStorage")&&e.d(s,{WebStorage:function(){return r.WebStorage}}),e.o(r,"createFetchApi")&&e.d(s,{createFetchApi:function(){return r.createFetchApi}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(91631);e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"GithubAuth")&&e.d(s,{GithubAuth:function(){return t.GithubAuth}}),e.o(t,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return t.GitlabAuth}}),e.o(t,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return t.GoogleAuth}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}}),e.o(t,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return t.createSpecializedApp}}),e.o(t,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return t.defaultConfigLoader}})},80396:function(ee,s,e){"use strict";e.d(s,{p:function(){return t}});var r;(function(l){l[l.default=10]="default";const u=50;l[l.app=u]="app",l[l.static=100]="static"})(r||(r={}));class t{constructor(){q(this,"factories",new Map)}register(u,A){const m=r[u],o=this.factories.get(A.api.id);return o&&o.priority>=m?!1:(this.factories.set(A.api.id,{priority:m,factory:A}),!0)}get(u){const A=this.factories.get(u.id);if(!!A)return A.factory}getAllApis(){const u=new Set;for(const{factory:A}of this.factories.values())u.add(A.api);return u}}},14406:function(ee,s,e){"use strict";e.d(s,{g:function(){return o}});var r=e(2784),t=e(13980),l=e.n(t);class u{constructor(...f){q(this,"holders");this.holders=f}get(f){for(const y of this.holders){const p=y.get(f);if(p)return p}}}var A=e(76241);const m=(0,A.CT)("api-context"),o=c=>{var T;const{apis:f,children:y}=c,p=(T=(0,r.useContext)(m))==null?void 0:T.atVersion(1),E=p?new u(f,p):f;return r.createElement(m.Provider,{value:(0,A.EI)({1:E}),children:y})};o.propTypes={apis:l().shape({get:l().func.isRequired}).isRequired,children:l().node}},12132:function(ee,s,e){"use strict";e.d(s,{M:function(){return r}});class r{constructor(l){q(this,"apis",new Map);this.factories=l}static validateFactories(l,u){for(const A of u){const m=[A],o=new Set;for(;m.length;){const c=m.shift(),f=l.get(c);if(!!f)for(const y of Object.values(f.deps)){if(y.id===A.id)throw new Error(`Circular dependency of api factory for ${A}`);o.has(y)||(o.add(y),m.push(y))}}}}get(l){return this.load(l)}load(l,u=[]){const A=this.apis.get(l.id);if(A)return A;const m=this.factories.get(l);if(!m)return;if(u.includes(m.api))throw new Error(`Circular dependency of api factory for ${m.api}`);const o=this.loadDeps(l,m.deps,[...u,m.api]),c=m.factory(o);return this.apis.set(l.id,c),c}loadDeps(l,u,A){const m={};for(const o in u)if(u.hasOwnProperty(o)){const c=u[o],f=this.load(c,A);if(!f)throw new Error(`No API factory available for dependency ${c} of dependent ${l}`);m[o]=f}return m}}},76105:function(ee,s,e){"use strict";e.d(s,{ApiFactoryRegistry:function(){return l.p},ApiProvider:function(){return r.g},ApiResolver:function(){return t.M}});var r=e(14406),t=e(12132),l=e(80396),u=e(82488),A=e.n(u);e.o(u,"AlertApiForwarder")&&e.d(s,{AlertApiForwarder:function(){return u.AlertApiForwarder}}),e.o(u,"AppThemeSelector")&&e.d(s,{AppThemeSelector:function(){return u.AppThemeSelector}}),e.o(u,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return u.AtlassianAuth}}),e.o(u,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return u.BitbucketAuth}}),e.o(u,"ConfigReader")&&e.d(s,{ConfigReader:function(){return u.ConfigReader}}),e.o(u,"ErrorAlerter")&&e.d(s,{ErrorAlerter:function(){return u.ErrorAlerter}}),e.o(u,"ErrorApiForwarder")&&e.d(s,{ErrorApiForwarder:function(){return u.ErrorApiForwarder}}),e.o(u,"FetchMiddlewares")&&e.d(s,{FetchMiddlewares:function(){return u.FetchMiddlewares}}),e.o(u,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return u.FlatRoutes}}),e.o(u,"GithubAuth")&&e.d(s,{GithubAuth:function(){return u.GithubAuth}}),e.o(u,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return u.GitlabAuth}}),e.o(u,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return u.GoogleAuth}}),e.o(u,"LocalStorageFeatureFlags")&&e.d(s,{LocalStorageFeatureFlags:function(){return u.LocalStorageFeatureFlags}}),e.o(u,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return u.MicrosoftAuth}}),e.o(u,"NoOpAnalyticsApi")&&e.d(s,{NoOpAnalyticsApi:function(){return u.NoOpAnalyticsApi}}),e.o(u,"OAuthRequestManager")&&e.d(s,{OAuthRequestManager:function(){return u.OAuthRequestManager}}),e.o(u,"OktaAuth")&&e.d(s,{OktaAuth:function(){return u.OktaAuth}}),e.o(u,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return u.OneLoginAuth}}),e.o(u,"UnhandledErrorForwarder")&&e.d(s,{UnhandledErrorForwarder:function(){return u.UnhandledErrorForwarder}}),e.o(u,"UrlPatternDiscovery")&&e.d(s,{UrlPatternDiscovery:function(){return u.UrlPatternDiscovery}}),e.o(u,"WebStorage")&&e.d(s,{WebStorage:function(){return u.WebStorage}}),e.o(u,"createFetchApi")&&e.d(s,{createFetchApi:function(){return u.createFetchApi}}),e.o(u,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return u.createSpecializedApp}}),e.o(u,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return u.defaultConfigLoader}})},82488:function(){},82370:function(ee,s,e){"use strict";e.d(s,{b:function(){return ct}});var r=e(2784),t=e(10289),l=e(64279),u=e(56494),A=e(36964),m=e(76105);function o(X){const Z={};for(const se in X.collectors)X.collectors.hasOwnProperty(se)&&(Z[se]=X.collectors[se]());const Q=[{node:r.Children.toArray(X.root),parent:void 0,contexts:{}}];for(;Q.length!==0;){const{node:se,parent:le,contexts:be}=Q.shift();r.Children.forEach(se,Oe=>{if(!(0,r.isValidElement)(Oe))return;const Ae={};for(const ke in Z)if(Z.hasOwnProperty(ke)){const We=Z[ke];Ae[ke]=We.visit(We.accumulator,Oe,le,be[ke])}for(const ke of X.discoverers){const We=ke(Oe);We&&Q.push({node:We,parent:Oe,contexts:Ae})}})}return Object.fromEntries(Object.entries(Z).map(([se,le])=>[se,le.accumulator]))}function c(X,Z){return()=>({accumulator:X(),visit:Z})}function f(X){var Z;return(Z=X.props)==null?void 0:Z.children}function y(X){var Z,Q,se;if(((Z=X.props)==null?void 0:Z.path)&&((Q=X.props)==null?void 0:Q.element))return(se=X.props)==null?void 0:se.element}const p=c(()=>new Set,(X,Z)=>{const Q=(0,A.getComponentData)(Z,"core.plugin");Q&&X.add(Q)});var E=e(88934);const T={caseSensitive:!1,path:"/*",element:"match-all",routeRefs:new Set},I=c(()=>({paths:new Map,parents:new Map,objects:new Array}),(X,Z,Q,se)=>{var Lt,Rt,Nt,Zt,vt;if((Q==null?void 0:Q.props.element)===Z)return se;let le=se==null?void 0:se.obj,be=se==null?void 0:se.routeRef,Oe=se==null?void 0:se.sticky;const Ae=(Lt=Z.props)==null?void 0:Lt.path,ke=(Rt=le==null?void 0:le.children)!=null?Rt:X.objects,We=Boolean((Nt=Z.props)==null?void 0:Nt.caseSensitive);let gt=se==null?void 0:se.path;if((0,A.getComponentData)(Z,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");gt=Ae}const It=(Zt=Z.props)==null?void 0:Zt.element;let lt=(0,A.getComponentData)(Z,"core.mountPoint");if(!lt&&(0,r.isValidElement)(It)&&(lt=(0,A.getComponentData)(It,"core.mountPoint")),lt){let at=Ae;if(gt&&(at?gt=void 0:at=gt),!at)throw new Error("Mounted routable extension must have a path");X.paths.set(lt,at),be&&Oe?(X.parents.set(lt,be),Ae&&(be=lt,Oe=!1)):(X.parents.set(lt,be),be=lt),Ae?(le={caseSensitive:We,path:Ae,element:"mounted",routeRefs:new Set([lt]),children:[T],plugin:(0,A.getComponentData)(Z.props.element,"core.plugin")},ke.push(le)):le==null||le.routeRefs.add(lt)}if((0,A.getComponentData)(Z,"core.gatherMountPoints")&&(Oe=!0),(0,A.getComponentData)(Z,"core.gatherMountPoints")){if(!Ae)throw new Error("Mount point gatherer must have a path");lt||(le={caseSensitive:We,path:Ae,element:"gathered",routeRefs:new Set,children:[T],plugin:(vt=se==null?void 0:se.obj)==null?void 0:vt.plugin},ke.push(le))}return{obj:le,path:gt,routeRef:be,sticky:Oe}}),B=c(()=>new Set,(X,Z)=>{if(Z.type===E.L){const Q=Z.props;X.add("with"in Q?Q.with:Q.without)}});var j=e(76241);const M=(0,j.uW)("route-ref-type",()=>Symbol("route-ref-type"));function b(X){return X[M]==="absolute"}function L(X){return X[M]==="sub"}function D(X){return X[M]==="external"}function U(...X){const Z=X.join("/").replace(/\/\/+/g,"/");return Z!=="/"&&Z.endsWith("/")?Z.slice(0,-1):Z}function Y(X,Z,Q){let se,le="";if(b(X))se=X;else if(L(X))se=X.parent,le=X.path;else if(D(X)){const Ae=Q.get(X);if(!Ae)return[void 0,""];if(b(Ae))se=Ae;else if(L(Ae))se=Ae.parent,le=Ae.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${Ae}`)}else throw X[M]?new Error(`Unknown or invalid route ref type, ${X[M]}`):new Error(`Unknown object passed to useRouteRef, got ${X}`);if(!se)return[void 0,""];const be=Z.get(se);if(!be)return[void 0,""];const Oe=U(be,le);return[se,Oe]}function te(X,Z,Q,se,le){var gt;const be=(gt=(0,t.fp)(le,Z))!=null?gt:[],Oe=Array();let Ae=-1;for(let It=X;It&&(Ae=be.findIndex(lt=>lt.route.routeRefs.has(It)),Ae===-1);It=se.get(It))Oe.unshift(It);Oe.length===0&&(Ae-=1);const ke=Ae===-1?"":be[Ae].pathname,We=U(...Oe.slice(0,-1).map(It=>{const lt=Q.get(It);if(!lt)throw new Error(`No path for ${It}`);if(lt.includes(":"))throw new Error(`Cannot route to ${X} with parent ${It} as it has parameters`);return lt}));return ke+We}class ue{constructor(Z,Q,se,le,be){this.routePaths=Z,this.routeParents=Q,this.routeObjects=se,this.routeBindings=le,this.appBasePath=be}resolve(Z,Q){const[se,le]=Y(Z,this.routePaths,this.routeBindings);if(!se)return;let be;typeof Q=="string"?be=this.trimPath(Q):Q.pathname?be={...Q,pathname:this.trimPath(Q.pathname)}:be=Q;const Oe=this.appBasePath+te(se,be,this.routePaths,this.routeParents,this.routeObjects);return(...[ke])=>Oe+(0,t.Gn)(le,ke)}trimPath(Z){return Z&&(Z.startsWith(this.appBasePath)?Z.slice(this.appBasePath.length):Z)}}const Re=(0,j.CT)("routing-context"),we=({routePaths:X,routeParents:Z,routeObjects:Q,routeBindings:se,basePath:le="",children:be})=>{const Oe=new ue(X,Z,Q,se,le),Ae=(0,j.EI)({1:Oe});return r.createElement(Re.Provider,{value:Ae},be)},ge=(X,Z)=>{var Q,se;try{const le=(0,t.fp)(Z,{pathname:X}),be=(Q=le==null?void 0:le.filter(Ae=>{var ke;return((ke=Ae==null?void 0:Ae.route.routeRefs)==null?void 0:ke.size)>0}).pop())==null?void 0:Q.route;if(!be)return{};let Oe;return be.routeRefs.size===1&&(Oe=be.routeRefs.values().next().value),{extension:"App",pluginId:((se=be.plugin)==null?void 0:se.getId())||"root",...Oe?{routeRef:Oe.id}:{}}}catch{return{}}},ze=({pathname:X,search:Z,hash:Q})=>{const se=(0,A.useAnalytics)();return(0,r.useEffect)(()=>{se.captureEvent("navigate",`${X}${Z}${Q}`)},[se,X,Z,Q]),null},_e=({routeObjects:X})=>{const{pathname:Z,search:Q,hash:se}=(0,t.TH)();return r.createElement(A.AnalyticsContext,{attributes:ge(Z,X)},r.createElement(ze,{pathname:Z,search:Q,hash:se}))};function et(X,Z){const Q=new Set(Z.values());Q.delete(void 0);for(const se of Z.keys()){if(Q.has(se))continue;let le=se,be="";for(;le;){const Ae=X.get(le);if(!Ae)throw new Error(`No path for ${le}`);be=`${Ae}${be}`,le=Z.get(le)}const Oe=be.match(/:(\w+)/g);if(Oe){for(let Ae=0;Ae<Oe.length;Ae++)for(let ke=Ae+1;ke<Oe.length;ke++)if(Oe[ke]===Oe[Ae])throw new Error(`Parameter ${Oe[ke]} is duplicated in path ${be}`)}}}function st(X,Z){for(const Q of Z)if(!!Q.externalRoutes){for(const[se,le]of Object.entries(Q.externalRoutes))if(!le.optional&&!X.has(le))throw new Error(`External route '${se}' of the '${Q.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Ct=(0,j.CT)("app-context"),yt=({appContext:X,children:Z})=>{const Q=(0,j.EI)({1:X});return r.createElement(Ct.Provider,{value:Q,children:Z})};function Pe(X){return new Error(`Tried to access IdentityApi ${X} before app was loaded`)}function ht(X){console.warn(`WARNING: Call to ${X} is deprecated and will break in the future`)}class Ve{constructor(){q(this,"target");q(this,"waitForTarget");q(this,"resolveTarget",()=>{});q(this,"signOutTargetUrl","/");this.waitForTarget=new Promise(Z=>{this.resolveTarget=Z})}setTarget(Z,Q){this.target=Z,this.signOutTargetUrl=Q.signOutTargetUrl,this.resolveTarget(Z)}getUserId(){if(!this.target)throw Pe("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return ht("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw Pe("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return ht("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(Z=>Z.getProfileInfo())}async getBackstageIdentity(){const Z=await this.waitForTarget.then(Q=>Q.getBackstageIdentity());return Z.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${Z.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),Z}async getCredentials(){return this.waitForTarget.then(Z=>Z.getCredentials())}async getIdToken(){return this.waitForTarget.then(Z=>{if(!Z.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return ht("getIdToken"),Z.getIdToken()})}async signOut(){await this.waitForTarget.then(Z=>Z.signOut()),location.href=this.signOutTargetUrl}}var ie=e(72164);function de(X,Z,Q){if(X!==void 0){const le=Q.find(be=>be.id===X);if(le)return le}if(Z){const le=Q.find(be=>be.variant==="dark");if(le)return le}const se=Q.find(le=>le.variant==="light");return se||Q[0]}const Ue=()=>{const X=(0,r.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[Z,Q]=(0,r.useState)(X.matches);return(0,r.useEffect)(()=>{const se=le=>{Q(le.matches)};return X.addListener(se),()=>{X.removeListener(se)}},[X]),Z};function Be({children:X}){const Z=(0,A.useApi)(A.appThemeApiRef),Q=(0,ie.Z)(Z.activeThemeId$(),Z.getActiveThemeId()),se=Boolean(window.matchMedia)?Ue():!1,le=de(Q,se,Z.getInstalledThemes());if(!le)throw new Error("App has no themes");return r.createElement(le.Provider,{children:X})}var Xe=e(46611);class mt{constructor(){q(this,"apis",[])}add(Z,Q){return this.apis.push([Z.id,Q]),Q}build(){return new Ye(new Map(this.apis))}}class Ye{static builder(){return new mt}static from(Z){return new Ye(new Map(Z.map(([Q,se])=>[Q.id,se])))}static with(Z,Q){return new Ye(new Map([[Z.id,Q]]))}constructor(Z){this.apis=Z}with(Z,Q){return new Ye(new Map([...this.apis,[Z.id,Q]]))}get(Z){return this.apis.get(Z.id)}}function Et(X){const Z=new Map;return X&&X({bind:(se,le)=>{for(const[be,Oe]of Object.entries(le)){const Ae=se[be];if(!Ae)throw new Error(`Key ${be} is not an existing external route`);if(!Oe&&!Ae.optional)throw new Error(`External route ${be} is required but was undefined`);Oe&&Z.set(Ae,Oe)}}}),Z}const oe=(0,r.createContext)({routeObjects:[]});function fe(X){var Q;let{pathname:Z}=new URL((Q=X.getOptionalString("app.baseUrl"))!=null?Q:"/","http://dummy.dev");return Z=Z.replace(/\/*$/,""),Z}function tt(X,Z,Q){var ke;const se=Boolean(X),le=(0,l.default)(X||(()=>Promise.resolve([])));let be;if(se&&le.loading){const{Progress:We}=Z;be=r.createElement(We,null)}else if(le.error){const{BootErrorPage:We}=Z;be=r.createElement(We,{step:"load-config",error:le.error})}const{ThemeProvider:Oe=Be}=Z;return be?{node:r.createElement(u.ApiProvider,{apis:Ye.with(A.appThemeApiRef,Q)},r.createElement(Oe,null,be))}:{api:u.ConfigReader.fromConfigs((ke=le.value)!=null?ke:[])}}class Ke{constructor(Z){this.app=Z}getPlugins(){return this.app.getPlugins()}getSystemIcon(Z){return this.app.getSystemIcon(Z)}getComponents(){return this.app.getComponents()}}class Ne{constructor(Z){q(this,"apiHolder");q(this,"configApi");q(this,"apis");q(this,"icons");q(this,"plugins");q(this,"components");q(this,"themes");q(this,"configLoader");q(this,"defaultApis");q(this,"bindRoutes");q(this,"appIdentityProxy",new Ve);q(this,"apiFactoryRegistry");var Q,se,le,be;this.apis=(Q=Z.apis)!=null?Q:[],this.icons=Z.icons,this.plugins=new Set((se=Z.plugins)!=null?se:[]),this.components=Z.components,this.themes=Z.themes,this.configLoader=(le=Z.configLoader)!=null?le:Xe.t,this.defaultApis=(be=Z.defaultApis)!=null?be:[],this.bindRoutes=Z.bindRoutes,this.apiFactoryRegistry=new m.ApiFactoryRegistry}getPlugins(){return Array.from(this.plugins)}getSystemIcon(Z){return this.icons[Z]}getComponents(){return this.components}getProvider(){const Z=new Ke(this);let Q=!1;return({children:le})=>{const be=(0,r.useMemo)(()=>u.AppThemeSelector.createWithStorage(this.themes),[]),{routing:Oe,featureFlags:Ae,routeBindings:ke}=(0,r.useMemo)(()=>{const lt=o({root:le,discoverers:[f,y],collectors:{routing:I,collectedPlugins:p,featureFlags:B}});return lt.collectedPlugins.forEach(Tt=>this.plugins.add(Tt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...lt,routeBindings:Et(this.bindRoutes)}},[le]);Q||(Q=!0,et(Oe.paths,Oe.parents),st(ke,this.plugins));const We=tt(this.configLoader,this.components,be),gt="api"in We;if(gt){const{api:lt}=We;this.configApi=lt}if((0,r.useEffect)(()=>{if(gt){const lt=this.getApiHolder().get(A.featureFlagsApiRef);for(const Tt of this.plugins.values())if("getFeatureFlags"in Tt)for(const Lt of Tt.getFeatureFlags())lt.registerFlag({name:Lt.name,pluginId:Tt.getId()});else for(const Lt of Tt.output())Lt.type==="feature-flag"&<.registerFlag({name:Lt.name,pluginId:Tt.getId()});for(const Tt of Ae)lt.registerFlag({name:Tt,pluginId:""})}},[gt,We,Ae]),"node"in We)return We.node;const{ThemeProvider:It=Be}=this.components;return r.createElement(u.ApiProvider,{apis:this.getApiHolder()},r.createElement(yt,{appContext:Z},r.createElement(It,null,r.createElement(we,{routePaths:Oe.paths,routeParents:Oe.parents,routeObjects:Oe.objects,routeBindings:ke,basePath:fe(We.api)},r.createElement(oe.Provider,{value:{routeObjects:Oe.objects}},le)))))}}getRouter(){const{Router:Z,SignInPage:Q}=this.components,se=({component:be,children:Oe})=>{const[Ae,ke]=(0,r.useState)(),We=(0,A.useApi)(A.configApiRef),gt=fe(We);return Ae?(this.appIdentityProxy.setTarget(Ae,{signOutTargetUrl:gt||"/"}),Oe):r.createElement(be,{onSignInSuccess:ke})};return({children:be})=>{const Oe=(0,A.useApi)(A.configApiRef),Ae=fe(Oe),ke=`${Ae}/*`,{routeObjects:We}=(0,r.useContext)(oe);return Q?r.createElement(Z,null,r.createElement(_e,{routeObjects:We}),r.createElement(se,{component:Q},r.createElement(t.Z5,null,r.createElement(t.AW,{path:ke,element:r.createElement(r.Fragment,null,be)})))):(this.appIdentityProxy.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:Ae||"/"}),r.createElement(Z,null,r.createElement(_e,{routeObjects:We}),r.createElement(t.Z5,null,r.createElement(t.AW,{path:ke,element:r.createElement(r.Fragment,null,be)}))))}}getApiHolder(){if(this.apiHolder){for(const Z of this.plugins)for(const Q of Z.getApis())this.apiFactoryRegistry.get(Q.api)||this.apiFactoryRegistry.register("default",Q);return m.ApiResolver.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:A.appThemeApiRef,deps:{},factory:()=>u.AppThemeSelector.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:A.configApiRef,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:A.identityApiRef,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:A.featureFlagsApiRef,deps:{},factory:()=>new u.LocalStorageFeatureFlags});for(const Z of this.defaultApis)this.apiFactoryRegistry.register("default",Z);for(const Z of this.plugins)for(const Q of Z.getApis())if(!this.apiFactoryRegistry.register("default",Q))throw new Error(`Plugin ${Z.getId()} tried to register duplicate or forbidden API factory for ${Q.api}`);for(const Z of this.apis)if(!this.apiFactoryRegistry.register("app",Z))throw new Error(`Duplicate or forbidden API factory for ${Z.api} in app`);return m.ApiResolver.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new m.ApiResolver(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(Z){const Q=new Set;for(const se of Z){const le=se.getId();if(Q.has(le))throw new Error(`Duplicate plugin found '${le}'`);Q.add(le)}}}function ct(X){return new Ne(X)}},46611:function(ee,s,e){"use strict";e.d(s,{t:function(){return r}});const r=async(t="__APP_INJECTED_RUNTIME_CONFIG__")=>{const l=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!l)throw new Error("No static configuration provided");if(!Array.isArray(l))throw new Error("Static configuration has invalid format");const u=l.slice();if(t!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const m=JSON.parse(t);Array.isArray(m)?u.push(...m):u.push({data:m,context:"env"})}catch(m){throw new Error(`Failed to load runtime configuration, ${m}`)}const A=window.__APP_CONFIG__;return A&&u.push({context:"window",data:A}),u}},44056:function(ee,s,e){"use strict";e.d(s,{createSpecializedApp:function(){return r.b},defaultConfigLoader:function(){return t.t}});var r=e(82370),t=e(46611),l=e(73495),u=e.n(l);e.o(l,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return l.AtlassianAuth}}),e.o(l,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return l.BitbucketAuth}}),e.o(l,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return l.FlatRoutes}}),e.o(l,"GithubAuth")&&e.d(s,{GithubAuth:function(){return l.GithubAuth}}),e.o(l,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return l.GitlabAuth}}),e.o(l,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return l.GoogleAuth}}),e.o(l,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return l.MicrosoftAuth}}),e.o(l,"OktaAuth")&&e.d(s,{OktaAuth:function(){return l.OktaAuth}}),e.o(l,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return l.OneLoginAuth}})},73495:function(){},49208:function(ee,s,e){"use strict";e.d(s,{AlertApiForwarder:function(){return r.AlertApiForwarder},ErrorAlerter:function(){return r.ErrorAlerter},ErrorApiForwarder:function(){return r.ErrorApiForwarder},FetchMiddlewares:function(){return r.FetchMiddlewares},FlatRoutes:function(){return l.w},NoOpAnalyticsApi:function(){return r.NoOpAnalyticsApi},OAuthRequestManager:function(){return r.OAuthRequestManager},UnhandledErrorForwarder:function(){return r.UnhandledErrorForwarder},UrlPatternDiscovery:function(){return r.UrlPatternDiscovery},WebStorage:function(){return r.WebStorage},createFetchApi:function(){return r.createFetchApi},createSpecializedApp:function(){return t.createSpecializedApp},defaultConfigLoader:function(){return t.defaultConfigLoader}});var r=e(56494);e.o(r,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return r.AtlassianAuth}}),e.o(r,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return r.BitbucketAuth}}),e.o(r,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return r.FlatRoutes}}),e.o(r,"GithubAuth")&&e.d(s,{GithubAuth:function(){return r.GithubAuth}}),e.o(r,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return r.GitlabAuth}}),e.o(r,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return r.GoogleAuth}}),e.o(r,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return r.MicrosoftAuth}}),e.o(r,"OktaAuth")&&e.d(s,{OktaAuth:function(){return r.OktaAuth}}),e.o(r,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return r.OneLoginAuth}}),e.o(r,"createSpecializedApp")&&e.d(s,{createSpecializedApp:function(){return r.createSpecializedApp}}),e.o(r,"defaultConfigLoader")&&e.d(s,{defaultConfigLoader:function(){return r.defaultConfigLoader}});var t=e(44056);e.o(t,"AtlassianAuth")&&e.d(s,{AtlassianAuth:function(){return t.AtlassianAuth}}),e.o(t,"BitbucketAuth")&&e.d(s,{BitbucketAuth:function(){return t.BitbucketAuth}}),e.o(t,"FlatRoutes")&&e.d(s,{FlatRoutes:function(){return t.FlatRoutes}}),e.o(t,"GithubAuth")&&e.d(s,{GithubAuth:function(){return t.GithubAuth}}),e.o(t,"GitlabAuth")&&e.d(s,{GitlabAuth:function(){return t.GitlabAuth}}),e.o(t,"GoogleAuth")&&e.d(s,{GoogleAuth:function(){return t.GoogleAuth}}),e.o(t,"MicrosoftAuth")&&e.d(s,{MicrosoftAuth:function(){return t.MicrosoftAuth}}),e.o(t,"OktaAuth")&&e.d(s,{OktaAuth:function(){return t.OktaAuth}}),e.o(t,"OneLoginAuth")&&e.d(s,{OneLoginAuth:function(){return t.OneLoginAuth}});var l=e(63938)},57018:function(ee,s,e){"use strict";e.d(s,{RefreshingAuthSessionManager:function(){return m}});function r(c,f){for(const y of f)if(!c.has(y))return!1;return!0}class t{constructor(f){this.options=f}sessionExistsAndHasScope(f,y){if(!f)return!1;if(!y||this.options.sessionScopes===void 0)return!0;const p=this.options.sessionScopes(f);return r(p,y)}getExtendedScope(f,y){const p=new Set(this.options.defaultScopes);if(f&&this.options.sessionScopes!==void 0){const E=this.options.sessionScopes(f);for(const T of E)p.add(T)}if(y)for(const E of y)p.add(E);return p}}var l=e(98005),u=e(36964);class A{constructor(){q(this,"subject",new l.X(u.SessionState.SignedOut));q(this,"signedIn",!1)}setIsSignedIn(f){this.signedIn!==f&&(this.signedIn=f,this.subject.next(this.signedIn?u.SessionState.SignedIn:u.SessionState.SignedOut))}sessionState$(){return this.subject}}class m{constructor(f){q(this,"connector");q(this,"helper");q(this,"sessionScopesFunc");q(this,"sessionShouldRefreshFunc");q(this,"stateTracker",new A);q(this,"refreshPromise");q(this,"currentSession");const{connector:y,defaultScopes:p=new Set,sessionScopes:E,sessionShouldRefresh:T}=f;this.connector=y,this.sessionScopesFunc=E,this.sessionShouldRefreshFunc=T,this.helper=new t({sessionScopes:E,defaultScopes:p})}async getSession(f){if(this.helper.sessionExistsAndHasScope(this.currentSession,f.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const p=await this.collapsedSessionRefresh(),E=this.sessionScopesFunc(this.currentSession),T=this.sessionScopesFunc(p);return r(T,E)&&(this.currentSession=p),p}catch(p){if(f.optional)return;throw p}}if(!this.currentSession&&!f.instantPopup)try{const y=await this.collapsedSessionRefresh();return this.currentSession=y,this.getSession(f)}catch{}if(!f.optional)return this.currentSession=await this.connector.createSession({...f,scopes:this.helper.getExtendedScope(this.currentSession,f.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession();try{const f=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),f}finally{delete this.refreshPromise}}}class o{constructor(f){q(this,"connector");q(this,"helper");q(this,"stateTracker",new SessionStateTracker);q(this,"currentSession");const{connector:y,defaultScopes:p=new Set,sessionScopes:E}=f;this.connector=y,this.helper=new SessionScopeHelper({sessionScopes:E,defaultScopes:p})}setSession(f){this.currentSession=f,this.stateTracker.setIsSignedIn(Boolean(f))}async getSession(f){if(this.helper.sessionExistsAndHasScope(this.currentSession,f.scopes))return this.currentSession;if(!f.optional)return this.currentSession=await this.connector.createSession({...f,scopes:this.helper.getExtendedScope(this.currentSession,f.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}}},98005:function(ee,s,e){"use strict";e.d(s,{J:function(){return l},X:function(){return u}});var r=e(82394),t=e.n(r);class l{constructor(){q(this,"isClosed",!1);q(this,"terminatingError");q(this,"observable",new(t())(m=>this.isClosed?(this.terminatingError?m.error(this.terminatingError):m.complete(),()=>{}):(this.subscribers.add(m),()=>{this.subscribers.delete(m)})));q(this,"subscribers",new Set)}[Symbol.observable](){return this}get closed(){return this.isClosed}next(m){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(o=>o.next(m))}error(m){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=m,this.subscribers.forEach(o=>o.error(m))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(m=>m.complete())}subscribe(m,o,c){const f=typeof m=="function"?{next:m,error:o,complete:c}:m;return this.observable.subscribe(f)}}class u{constructor(m){q(this,"isClosed");q(this,"currentValue");q(this,"terminatingError");q(this,"observable");q(this,"subscribers",new Set);this.isClosed=!1,this.currentValue=m,this.terminatingError=void 0,this.observable=new(t())(o=>this.isClosed?(this.terminatingError?o.error(this.terminatingError):o.complete(),()=>{}):(o.next(this.currentValue),this.subscribers.add(o),()=>{this.subscribers.delete(o)}))}[Symbol.observable](){return this}get closed(){return this.isClosed}next(m){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=m,this.subscribers.forEach(o=>o.next(m))}error(m){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=m,this.subscribers.forEach(o=>o.error(m))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(m=>m.complete())}subscribe(m,o,c){const f=typeof m=="function"?{next:m,error:o,complete:c}:m;return this.observable.subscribe(f)}}},88934:function(ee,s,e){"use strict";e.d(s,{L:function(){return l}});var r=e(36964),t=e(2784);const l=u=>{const{children:A}=u,m=(0,r.useApi)(r.featureFlagsApiRef),o="with"in u?m.isActive(u.with):!m.isActive(u.without);return t.createElement(t.Fragment,null,o?A:null)};(0,r.attachComponentData)(l,"core.featureFlagged",!0)},63938:function(ee,s,e){"use strict";e.d(s,{w:function(){return u}});var r=e(2784),t=e(10289),l=e(36964);const u=m=>{const o=(0,l.useApp)(),{NotFoundErrorPage:c}=o.getComponents(),f=(0,l.useElementFilter)(m.children,y=>y.getElements().flatMap(p=>{var T;let E=p.props.path;return E===""?[]:(E=(T=E==null?void 0:E.replace(/\/\*$/,""))!=null?T:"/",[{path:E,element:p,children:p.props.children?[{path:E==="/"?"/":"/*",element:p.props.children}]:void 0}])}).sort((p,E)=>E.path.localeCompare(p.path)).map(p=>(p.path=p.path==="/"?"/":`${p.path}/*`,p)));return f.push({element:r.createElement(c,null),path:"/*"}),(0,t.V$)(f)};var A=e(88934)},82339:function(ee,s,e){"use strict";e.d(s,{Button:function(){return D},CodeSnippet:function(){return et},Content:function(){return Xa},ContentHeader:function(){return ci},CreateButton:function(){return yt},DependencyGraph:function(){return Rt},DependencyGraphTypes:function(){return r},EmptyState:function(){return bt},ErrorPage:function(){return hi},ErrorPanel:function(){return cn},Header:function(){return so},HeaderIconLinkRow:function(){return bn},HeaderLabel:function(){return Ti},HeaderTabs:function(){return qa},InfoCard:function(){return Kn},ItemCardGrid:function(){return Di},ItemCardHeader:function(){return Li},Link:function(){return b},LogViewer:function(){return zr},MissingAnnotationEmptyState:function(){return un},OverflowTooltip:function(){return br},Page:function(){return lo},PageWithHeader:function(){return Mi},Progress:function(){return cr},ResponseErrorPanel:function(){return $t},RoutedTabs:function(){return _a},Select:function(){return je},Sidebar:function(){return as},SidebarDivider:function(){return vs},SidebarItem:function(){return Ja},SidebarPage:function(){return Go},SubvalueCell:function(){return Fs},SupportButton:function(){return zo},Table:function(){return ei},WarningPanel:function(){return tn},sidebarConfig:function(){return kn},useSidebarOpenState:function(){return la},useSidebarPinState:function(){return Br}});var r={};e.r(r),e.d(r,{Nm:function(){return Pe},ht:function(){return ie},LJ:function(){return Ve}});var t=e(2784),l=e(36964),u=e(19928);function A(n){const[a,i]=useState([]),d=useApi(alertApiRef),{anchorOrigin:g={vertical:"top",horizontal:"center"}}=n;if(useEffect(()=>{const N=d.alert$().subscribe(G=>i(H=>H.concat(G)));return()=>{N.unsubscribe()}},[d]),a.length===0)return null;const[v]=a,O=()=>{i(N=>N.filter(G=>G!==v))};return React.createElement(Snackbar,{open:!0,anchorOrigin:g},React.createElement(Alert,{action:React.createElement(IconButton,{color:"inherit",size:"small",onClick:O,"data-testid":"error-button-close"},React.createElement(CloseIcon,null)),severity:v.severity},React.createElement("span",null,v.message.toString(),a.length>1&&React.createElement("em",null,` (${a.length-1} older ${pluralize("message",a.length-1)})`))))}var m=e(79692),o=e(12420);const c=(0,m.Z)(n=>(0,o.Z)({avatar:{width:"4rem",height:"4rem",color:"#fff",fontWeight:n.typography.fontWeightBold,letterSpacing:"1px",textTransform:"uppercase"}}),{name:"BackstageAvatar"});function f(n){const{displayName:a,picture:i,customStyles:d}=n,g=c();let v={...d};return i||(v={backgroundColor:stringToColor(a||""),...d}),React.createElement(MaterialAvatar,{alt:a,src:i,className:g.avatar,style:v},a&&extractInitials(a))}var y=e(77277),p=e(72779),E=e.n(p),T=e(86689),I=e(62833);const B=(0,m.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"}),j=n=>/^([a-z+.-]+):/.test(n),M=n=>{var a;return n instanceof Array?n.map(M).join(" ").trim():typeof n=="object"&&n?M((a=n==null?void 0:n.props)==null?void 0:a.children):["string","number"].includes(typeof n)?String(n):""},b=t.forwardRef(({onClick:n,noTrack:a,...i},d)=>{const g=B(),v=(0,l.useAnalytics)(),O=String(i.to),N=M(i.children)||O,G=j(O),H=G&&!!/^https?:/.exec(O),ne=_=>{n==null||n(_),a||v.captureEvent("click",N,{attributes:{to:O}})};return G?t.createElement(T.Z,{ref:d,href:O,onClick:ne,...H?{target:"_blank",rel:"noopener"}:{},...i,className:E()(g.externalLink,i.className)},i.children,t.createElement("span",{className:g.visuallyHidden},", Opens in a new window")):t.createElement(T.Z,{ref:d,component:I.rU,onClick:ne,...i})}),L=t.forwardRef((n,a)=>t.createElement(b,{ref:a,...n,color:"initial"})),D=t.forwardRef((n,a)=>t.createElement(y.Z,{ref:a,component:L,...n}));var U=e(60364),Y=e(61837),te=e(80030),ue=e(19353),Re=e(95074);function we(n){const{text:a,tooltipDelay:i=1e3,tooltipText:d="Text copied to clipboard"}=n,g=(0,l.useApi)(l.errorApiRef),[v,O]=(0,t.useState)(!1),[{error:N},G]=(0,Re.Z)();(0,t.useEffect)(()=>{N&&g.post(N)},[N,g]);const H=ne=>{ne.stopPropagation(),O(!0),G(a)};return t.createElement(t.Fragment,null,t.createElement(te.ZP,{id:"copy-test-tooltip",title:d,placement:"top",leaveDelay:i,onClose:()=>O(!1),open:v},t.createElement(Y.Z,{onClick:H},t.createElement(ue.Z,null))))}var ge=e(83229),ze=e(26639),_e=e(39595);function et(n){const{text:a,language:i,showLineNumbers:d=!1,highlightedNumbers:g,customStyle:v,showCopyCodeButton:O=!1}=n,N=(0,U.Z)(),G=N.palette.type==="dark"?ze.Z:_e.Z,H=N.palette.type==="dark"?"#256bf3":"#e6ffed";return t.createElement("div",{style:{position:"relative"}},t.createElement(ge.Z,{customStyle:v,language:i,style:G,showLineNumbers:d,wrapLines:!0,lineNumberStyle:{color:N.palette.textVerySubtle},lineProps:ne=>g!=null&&g.includes(ne)?{style:{backgroundColor:H}}:{}},a),O&&t.createElement("div",{style:{position:"absolute",top:0,right:0}},t.createElement(we,{text:a})))}var st=e(41156),Ct=e(88188);function yt(n){const{title:a,to:i}=n,d=(0,st.Z)(g=>g.breakpoints.down("xs"));return i?d?t.createElement(Y.Z,{component:I.rU,color:"primary",title:a,size:"small",to:i},t.createElement(Ct.Z,null)):t.createElement(y.Z,{component:I.rU,variant:"contained",color:"primary",to:i},a):null}var Pe;(function(n){const a="TB";n.TOP_BOTTOM=a;const i="BT";n.BOTTOM_TOP=i;const d="LR";n.LEFT_RIGHT=d;const g="RL";n.RIGHT_LEFT=g})(Pe||(Pe={}));var ht;(function(n){const a="UL";n.UP_LEFT=a;const i="UR";n.UP_RIGHT=i;const d="DL";n.DOWN_LEFT=d;const g="DR";n.DOWN_RIGHT=g})(ht||(ht={}));var Ve;(function(n){const a="network-simplex";n.NETWORK_SIMPLEX=a;const i="tight-tree";n.TIGHT_TREE=i;const d="longest-path";n.LONGEST_PATH=d})(Ve||(Ve={}));var ie;(function(n){const a="l";n.LEFT=a;const i="r";n.RIGHT=i;const d="c";n.CENTER=d})(ie||(ie={}));var de=e(84945),Ue=e(11105),Be=e(97963),Xe=e(46506),mt=e.n(Xe),Ye=e(54073),Et=e.n(Ye),oe=e(10368);const fe=(0,m.Z)(n=>({node:{fill:n.palette.primary.light,stroke:n.palette.primary.light},text:{fill:n.palette.primary.contrastText}}),{name:"BackstageDependencyGraphDefaultNode"});function tt({node:{id:n}}){const a=fe(),[i,d]=t.useState(0),[g,v]=t.useState(0),O=t.useRef(null);t.useLayoutEffect(()=>{if(O.current){let{height:ne,width:_}=O.current.getBBox();ne=Math.round(ne),_=Math.round(_),(ne!==g||_!==i)&&(d(_),v(ne))}},[i,g]);const N=10,G=i+N*2,H=g+N*2;return t.createElement("g",null,t.createElement("rect",{className:a.node,width:G,height:H,rx:10}),t.createElement("text",{ref:O,className:a.text,y:H/2,x:G/2,textAnchor:"middle",alignmentBaseline:"middle"},n))}const Ke="arrow-marker",Ne="node",ct="edge",X="label",Z=(0,oe.Z)(n=>({node:{transition:`${n.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphNode"}),Q=n=>t.createElement(tt,{...n});function se({render:n=Q,setNode:a,node:i}){const{width:d,height:g,x:v=0,y:O=0}=i,N=i,G=Z(),H=t.useRef(null);return t.useLayoutEffect(()=>{if(H.current){let{height:ne,width:_}=H.current.getBBox();ne=Math.round(ne),_=Math.round(_),(ne!==g||_!==d)&&a(i.id,{...i,height:ne,width:_})}},[i,d,g,a]),t.createElement("g",{ref:H,"data-testid":Ne,className:G.node,transform:`translate(${v-d/2},${O-g/2})`},n({node:N}))}var le=e(55876),be=e(66481),Oe=e(19574),Ae=e.n(Oe);const ke=(0,oe.Z)(n=>({text:{fill:n.palette.textContrast}}),{name:"BackstageDependencyGraphDefaultLabel"});function We({edge:{label:n}}){const a=ke();return t.createElement("text",{className:a.text,textAnchor:"middle"},n)}const gt=(0,oe.Z)(n=>({path:{strokeWidth:2,stroke:n.palette.textSubtle,fill:"none",transition:`${n.transitions.duration.shortest}ms`},label:{transition:`${n.transitions.duration.shortest}ms`}}),{name:"BackstageDependencyGraphEdge"}),It=n=>t.createElement(We,{...n}),lt=le.Z().x(n=>n.x).y(n=>n.y).curve(be.Z);function Tt({render:n=It,setEdge:a,id:i,edge:d}){const{x:g=0,y:v=0,width:O,height:N,points:G}=d,H=d,ne=gt(),_=t.useRef(null);t.useLayoutEffect(()=>{if(_.current){let{height:Ce,width:Ie}=_.current.getBBox();Ce=Math.round(Ce),Ie=Math.round(Ie),(Ce!==N||Ie!==O)&&a(i,{...d,height:Ce,width:Ie})}},[d,N,O,a,i]);let ve="";if(G){const Ce=G.filter(Ie=>Ae()(Ie.x)&&Ae()(Ie.y));ve=lt(Ce)||""}return t.createElement(t.Fragment,null,ve&&t.createElement("path",{"data-testid":ct,className:ne.path,markerEnd:`url(#${Ke})`,d:ve}),H.label?t.createElement("g",{ref:_,"data-testid":X,className:ne.label,transform:`translate(${g},${v})`},n({edge:H})):null)}const Lt="workspace";function Rt(n){var _n,Ar;const{edges:a,nodes:i,renderNode:d,direction:g=Pe.TOP_BOTTOM,align:v,nodeMargin:O=50,edgeMargin:N=10,rankMargin:G=50,paddingX:H=0,paddingY:ne=0,acyclicer:_,ranker:ve=Ve.NETWORK_SIMPLEX,labelPosition:Ce=ie.RIGHT,labelOffset:Ie=10,edgeRanks:pt=1,edgeWeight:Ut=1,renderLabel:Yt,defs:Jt,zoom:dt="enabled",...Gt}=n,en=(0,Be.Z)(),[Qt,Xn]=t.useState(100),[Nn,wr]=t.useState(100),Mt=t.useRef(new(mt()).graphlib.Graph),[yr,$r]=t.useState(((_n=Mt.current.graph())==null?void 0:_n.width)||0),[Er,ea]=t.useState(((Ar=Mt.current.graph())==null?void 0:Ar.height)||0),[ga,ta]=t.useState([]),[na,pa]=t.useState([]),sn=Math.max(yr,Qt),Sn=Math.max(Er,Nn),ar=t.useMemo(()=>Et()(ln=>{if(!ln)return;const pn=Ue.Z(ln),rn=Ue.Z(ln.getElementById(Lt));function Zn(){pn.call(de.sP().scaleExtent([1,10]).on("zoom",Yn=>{Yn.transform.x=Math.min(0,Math.max(Yn.transform.x,sn-sn*Yn.transform.k)),Yn.transform.y=Math.min(0,Math.max(Yn.transform.y,Sn-Sn*Yn.transform.k)),rn.attr("transform",Yn.transform)}))}dt==="enabled"?Zn():dt==="enable-on-click"&&pn.on("click",()=>Zn());const{width:zn,height:ra}=ln.getBoundingClientRect();Qt!==zn&&Xn(zn),Nn!==ra&&wr(ra)},100),[Nn,Qt,sn,Sn,dt]),qn=t.useCallback(()=>{const ln=Mt.current.nodes(),pn=Mt.current.edges();ln.forEach(rn=>{i.some(zn=>zn.id===rn)||Mt.current.removeNode(rn)}),pn.forEach(rn=>{a.some(zn=>zn.from===rn.v&&zn.to===rn.w)||Mt.current.removeEdge(rn.v,rn.w)}),i.forEach(rn=>{const Zn=Mt.current.nodes().find(zn=>rn.id===zn);if(Zn&&Mt.current.node(Zn)){const{width:zn,height:ra,x:Yn,y:Xi}=Mt.current.node(Zn);Mt.current.setNode(Zn,{...rn,width:zn,height:ra,x:Yn,y:Xi})}else Mt.current.setNode(rn.id,{...rn,width:0,height:0})}),a.forEach(rn=>{Mt.current.setEdge(rn.from,rn.to,{...rn,label:rn.label,width:0,height:0,labelpos:Ce,labeloffset:Ie,weight:Ut,minlen:pt})})},[a,i,Ce,Ie,Ut,pt]),nn=t.useMemo(()=>Et()(()=>{mt().layout(Mt.current);const{height:ln,width:pn}=Mt.current.graph(),rn=Math.max(0,ln||0),Zn=Math.max(0,pn||0);$r(Zn),ea(rn),ta(Mt.current.nodes()),pa(Mt.current.edges())},250,{leading:!0}),[]);t.useEffect(()=>(Mt.current.setGraph({rankdir:g,align:v,nodesep:O,edgesep:N,ranksep:G,marginx:H,marginy:ne,acyclicer:_,ranker:ve}),qn(),nn(),nn.cancel),[_,v,g,N,H,ne,O,G,ve,qn,nn]);function Cn(ln,pn){return Mt.current.setNode(ln,pn),nn(),Mt.current}function vr(ln,pn){return Mt.current.setEdge(ln,pn),nn(),Mt.current}return t.createElement("svg",{ref:ar,...Gt,width:"100%",height:Sn,viewBox:`0 0 ${sn} ${Sn}`},t.createElement("defs",null,t.createElement("marker",{id:Ke,viewBox:"0 0 24 24",markerWidth:"14",markerHeight:"14",refX:"16",refY:"12",orient:"auto",markerUnits:"strokeWidth"},t.createElement("path",{fill:en.palette.textSubtle,d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),Jt),t.createElement("g",{id:Lt},t.createElement("svg",{width:yr,height:Er,y:Sn/2-Er/2,x:sn/2-yr/2,viewBox:`0 0 ${yr} ${Er}`},na.map(ln=>{const pn=Mt.current.edge(ln);return pn?t.createElement(Tt,{key:`${ln.v}-${ln.w}`,id:ln,setEdge:vr,render:Yt,edge:pn}):null}),ga.map(ln=>{const pn=Mt.current.node(ln);return pn?t.createElement(se,{key:ln,setNode:Cn,render:d,node:pn}):null}))))}const Nt=(0,m.Z)(n=>{var a;return{root:{padding:n.spacing(0),marginBottom:n.spacing(0),marginTop:n.spacing(0),display:"flex",flexFlow:"row nowrap"},topPosition:{position:"relative",marginBottom:n.spacing(6),marginTop:-n.spacing(3),zIndex:"unset"},icon:{fontSize:20},content:{width:"100%",maxWidth:"inherit",flexWrap:"nowrap"},message:{display:"flex",alignItems:"center",color:n.palette.banner.text,"& a":{color:n.palette.banner.link}},info:{backgroundColor:n.palette.banner.info},error:{backgroundColor:n.palette.banner.error},warning:{backgroundColor:(a=n.palette.banner.warning)!=null?a:n.palette.banner.error}}},{name:"BackstageDismissableBanner"}),Zt=n=>{var Ce;const{variant:a,message:i,id:d,fixed:g=!1}=n,v=Nt(),N=useApi(storageApiRef).forBucket("notifications"),G=(Ce=N.snapshot("dismissedBanners").value)!=null?Ce:[],[H,ne]=useState(new Set(G)),_=useObservable(N.observe$("dismissedBanners"));useEffect(()=>{var Ie;if(_!=null&&_.value){const pt=(Ie=_==null?void 0:_.value)!=null?Ie:[];ne(new Set(pt))}},[_==null?void 0:_.value]);const ve=()=>{N.set("dismissedBanners",[...H,d])};return React.createElement(Snackbar,{anchorOrigin:g?{vertical:"bottom",horizontal:"center"}:{vertical:"top",horizontal:"center"},open:!H.has(d),classes:{root:classNames(v.root,!g&&v.topPosition)}},React.createElement(SnackbarContent,{classes:{root:classNames(v.content,v[a]),message:v.message},message:i,action:[React.createElement(IconButton,{key:"dismiss",title:"Permanently dismiss this message",color:"inherit",onClick:ve},React.createElement(Close,{className:v.icon}))]}))};var vt=e(60905),at=e(90436),zt=e.p+"static/missingAnnotation.67f79e98..svg",ae=e.p+"static/noInformation.4b426325..svg",V=e.p+"static/createComponent.975d1e1e..svg",ye=e.p+"static/noBuild.1715fa71..svg";const He=(0,m.Z)({generalImg:{width:"95%",zIndex:2,position:"relative",left:"50%",top:"50%",transform:"translate(-50%, 15%)"}},{name:"BackstageEmptyStateImage"}),qe=({missing:n})=>{const a=He();switch(n){case"field":return t.createElement("img",{src:zt,className:a.generalImg,alt:"annotation is missing"});case"info":return t.createElement("img",{src:ae,alt:"no Information",className:a.generalImg});case"content":return t.createElement("img",{src:V,alt:"create Component",className:a.generalImg});case"data":return t.createElement("img",{src:ye,alt:"no Build",className:a.generalImg});default:return null}},ot=(0,m.Z)(n=>({root:{backgroundColor:n.palette.background.default,padding:n.spacing(2,0,0,0)},action:{marginTop:n.spacing(2)},imageContainer:{position:"relative"}}),{name:"BackstageEmptyState"});function bt(n){const{title:a,description:i,missing:d,action:g}=n,v=ot();return t.createElement(vt.Z,{container:!0,direction:"row",justifyContent:"space-around",alignItems:"flex-start",className:v.root,spacing:2},t.createElement(vt.Z,{item:!0,xs:12,md:6},t.createElement(vt.Z,{container:!0,direction:"column"},t.createElement(vt.Z,{item:!0,xs:!0},t.createElement(at.Z,{variant:"h5"},a)),t.createElement(vt.Z,{item:!0,xs:!0},t.createElement(at.Z,{variant:"body1"},i)),t.createElement(vt.Z,{item:!0,xs:!0,className:v.action},g))),t.createElement(vt.Z,{item:!0,xs:12,md:6,className:v.imageContainer},t.createElement(qe,{missing:d})))}const Wt=`apiVersion: backstage.io/v1alpha1
|
|
2
2
|
kind: Component
|
|
3
3
|
metadata:
|
|
4
4
|
name: example
|
|
@@ -484,4 +484,4 @@ ${Ee.href}
|
|
|
484
484
|
|
|
485
485
|
Feedback:`),Ht=(Le==null?void 0:Le.type)==="github"?(0,se.Pb)(Te.href,"blob"):Te.href,Dt=Ae()(Ht),Ft=`/${Dt.organization}/${Dt.name}`,ut=Ee.cloneNode();switch(Le==null?void 0:Le.type){case"gitlab":ut.href=`${Te.origin}${Ft}/issues/new?issue[title]=${it}&issue[description]=${Kt}`;break;case"github":ut.href=`${Te.origin}${Ft}/issues/new?title=${it}&body=${Kt}`;break;default:return re}return be.render(r.createElement(le.Z),ut),ut.style.paddingLeft="5px",ut.title="Leave feedback for this page",ut.id="git-feedback-link",Ee==null||Ee.insertAdjacentElement("beforebegin",ut),re};var We=e(44882);const gt=()=>x=>{const re=x.querySelector('.md-header label[for="__drawer"]'),Ee=x.querySelector("article");if(!re||!Ee)return x;const Te=re.cloneNode();return be.render(r.createElement(We.Z),Te),Te.id="toggle-sidebar",Te.title="Toggle Sidebar",Te.classList.add("md-content__button"),Te.style.setProperty("padding","0 0 0 5px"),Te.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),Ee==null||Ee.prepend(Te),x},It=()=>x=>(((Ee,Te)=>{Array.from(Ee).filter(Le=>Le.hasAttribute(Te)).forEach(Le=>{const Je=Le.getAttribute(Te);if(Je){Je.match(/^https?:\/\//i)&&Le.setAttribute("target","_blank");try{const it=lt(window.location.href);Le.setAttribute(Te,new URL(Je,it).toString())}catch{Le.replaceWith(Le.textContent||Je)}}})})(Array.from(x.getElementsByTagName("a")),"href"),x);function lt(x){const re=new URL(x);return!re.pathname.endsWith("/")&&!re.pathname.endsWith(".html")&&(re.pathname+="/"),re.toString()}const Tt=({baseUrl:x,onClick:re})=>Ee=>(Array.from(Ee.getElementsByTagName("a")).forEach(Te=>{Te.addEventListener("click",Le=>{const it=Te.getAttribute("href");!it||it.startsWith(x)&&!Te.hasAttribute("download")&&(Le.preventDefault(),re(Le,it))})}),Ee);var Lt=e(15459),Rt=e(80030),Nt=e(72379),Zt=e(41547);const vt=(0,Lt.Z)(x=>({tooltip:{fontSize:"inherit",color:x.palette.text.primary,margin:0,padding:x.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Rt.ZP),at=()=>r.createElement(Nt.Z,null,r.createElement("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"})),zt=({text:x})=>{const[re,Ee]=(0,r.useState)(!1),Te=(0,r.useCallback)(()=>{navigator.clipboard.writeText(x),Ee(!0)},[x]),Le=(0,r.useCallback)(()=>{Ee(!1)},[Ee]);return r.createElement(vt,{title:"Copied to clipboard",placement:"left",open:re,onClose:Le,leaveDelay:1e3},r.createElement("button",{className:"md-clipboard md-icon",onClick:Te},r.createElement(at,null)))},ae=x=>re=>{var Te;const Ee=re.querySelectorAll("pre > code");for(const Le of Ee){const Je=Le.textContent||"",it=document.createElement("div");(Te=Le==null?void 0:Le.parentElement)==null||Te.prepend(it),be.render(r.createElement(Zt.Z,{theme:x},r.createElement(zt,{text:Je})),it)}return re},V=()=>x=>{var re;return(re=x.querySelector(".md-header"))==null||re.remove(),x},ye=()=>x=>{var re,Ee;return(re=x.querySelector(".md-footer .md-copyright"))==null||re.remove(),(Ee=x.querySelector(".md-footer-copyright"))==null||Ee.remove(),x},He=({onLoading:x,onLoaded:re})=>Ee=>(x(),Ee.addEventListener(u.Ox,function Te(){re(),Ee.removeEventListener(u.Ox,Te)}),Ee),qe=()=>x=>(setTimeout(()=>{var re;if(window.location.hash){const Ee=window.location.hash.slice(1);(re=x==null?void 0:x.querySelector(`[id="${Ee}"]`))==null||re.scrollIntoView()}},200),x),ot=async(x,re)=>{let Ee;if(typeof x=="string")Ee=new DOMParser().parseFromString(x,"text/html").documentElement;else if(x instanceof Element)Ee=x;else throw new Error("dom is not a recognized type");for(const Te of re)Ee=await Te(Ee);return Ee},bt="screen and (max-width: 76.1875em)",Wt=x=>{const re=(0,te.s0)(),Ee=(0,ue.Z)(),Te=(0,Re.Z)(bt),Le=Ue(),Je=X(),it=(0,b.useApi)(u.Dl),Kt=(0,b.useApi)(we.q3),{state:Ht,path:Dt,content:Ft}=(0,D.DK)(),[ut,kt]=(0,r.useState)(null),tn=(0,u.ux)(ut),jt=(0,r.useCallback)(()=>{if(!ut)return;ut.querySelectorAll(".md-sidebar").forEach($t=>{var hn,yn;if(Te)$t.style.top="0px";else{const an=(hn=ut.getBoundingClientRect().top)!=null?hn:0,fn=ut.querySelector(".md-container > .md-tabs"),Wn=(yn=fn==null?void 0:fn.getBoundingClientRect().height)!=null?yn:0;$t.style.top=`${Math.max(an,0)+Wn}px`}$t.style.setProperty("opacity","1")})},[ut,Te]);(0,r.useEffect)(()=>(window.addEventListener("resize",jt),window.addEventListener("scroll",jt,!0),()=>{window.removeEventListener("resize",jt),window.removeEventListener("scroll",jt,!0)}),[ut,jt]);const Vt=(0,r.useCallback)(()=>{if(!ut)return;const wt=ut.querySelector(".md-footer");wt&&(wt.style.width=`${ut.getBoundingClientRect().width}px`)},[ut]);(0,r.useEffect)(()=>(window.addEventListener("resize",Vt),()=>{window.removeEventListener("resize",Vt)}),[ut,Vt]),(0,r.useEffect)(()=>{tn||(Vt(),jt())},[Ht,tn,Vt,jt]);const cn=(0,r.useCallback)((wt,$t)=>ot(wt,[Le,Q({techdocsStorageApi:it,entityId:x,path:$t}),It(),gt(),V(),ye(),ke(Kt),Je]),[x,Kt,it,Le,Je]),Tn=(0,r.useCallback)(async wt=>ot(wt,[qe(),ae(Ee),Tt({baseUrl:window.location.origin,onClick:($t,hn)=>{var fn;const yn=$t.ctrlKey||$t.metaKey,an=new URL(hn);an.hash?yn?window.open(`${an.pathname}${an.hash}`,"_blank"):(re(`${an.pathname}${an.hash}`),(fn=wt==null?void 0:wt.querySelector(`#${an.hash.slice(1)}`))==null||fn.scrollIntoView()):yn?window.open(an.pathname,"_blank"):re(an.pathname)}}),He({onLoading:()=>{},onLoaded:()=>{var $t;($t=wt.querySelector(".md-nav__title"))==null||$t.removeAttribute("for")}}),He({onLoading:()=>{Array.from(wt.querySelectorAll(".md-sidebar")).forEach(hn=>{hn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[Ee,re]);return(0,r.useEffect)(()=>{if(!Ft)return()=>{};let wt=!0;return cn(Ft,Dt).then(async $t=>{if(!($t!=null&&$t.innerHTML)||!wt)return;window.scroll({top:0});const hn=await Tn($t);kt(hn)}),()=>{wt=!1}},[Ft,Dt,cn,Tn]),ut};var Xt=e(8560);const un=()=>{const x=(0,u.$L)(),{shadowRoot:re}=(0,u.x1)(),Ee=re==null?void 0:re.querySelector('[data-md-component="content"]'),Te=re==null?void 0:re.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Le=Te==null?void 0:Te.querySelector('[data-techdocs-addons-location="primary sidebar"]');Le||(Le=document.createElement("div"),Le.setAttribute("data-techdocs-addons-location","primary sidebar"),Te==null||Te.prepend(Le));const Je=re==null?void 0:re.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let it=Je==null?void 0:Je.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return it||(it=document.createElement("div"),it.setAttribute("data-techdocs-addons-location","secondary sidebar"),Je==null||Je.prepend(it)),r.createElement(r.Fragment,null,r.createElement(Xt.Z,{container:Le},x.renderComponentsByLocation(u.oZ.PrimarySidebar)),r.createElement(Xt.Z,{container:Ee},x.renderComponentsByLocation(u.oZ.Content)),r.createElement(Xt.Z,{container:it},x.renderComponentsByLocation(u.oZ.SecondarySidebar)))},dn=(0,t.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),xt=(0,D.m1)(x=>{var Ft;const{withSearch:re=!0,onReady:Ee}=x,Te=dn(),{entityMetadata:{value:Le,loading:Je},entityRef:it,setShadowRoot:Kt}=(0,u.x1)(),Ht=Wt(it),Dt=(0,r.useCallback)(ut=>{Kt(ut),Ee instanceof Function&&Ee()},[Kt,Ee]);return Je===!1&&!Le?r.createElement(A.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ht?r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(Y,null)),re&&r.createElement(l.Z,{className:Te.search,xs:"auto",item:!0},r.createElement(m.S,{entityId:it,entityTitle:(Ft=Le==null?void 0:Le.metadata)==null?void 0:Ft.title})),r.createElement(l.Z,{xs:12,item:!0},r.createElement(u.VA,{element:Ht,onAppend:Dt},r.createElement(un,null))))):r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(Y,null))))}),qt=null},99954:function(ee,s,e){"use strict";e.d(s,{S:function(){return E}});var r=e(2784),t=e(18671),l=e(98069),u=e(73250),A=e(26136),m=e(53479),o=e(48023),c=e(82339),f=e(36964),y=e(68725);const p=r.createElement(l.Z,{animation:"wave",variant:"text",height:40}),E=T=>{const{children:I}=T,B=(0,A.$L)(),j=(0,f.useApi)(f.configApiRef),{title:M,setTitle:b,subtitle:L,setSubtitle:D,entityRef:U,metadata:{value:Y,loading:te},entityMetadata:{value:ue,loading:Re}}=(0,A.x1)();(0,r.useEffect)(()=>{!Y||(b(Ve=>{const{site_name:ie}=Y;return Ve||ie}),D(Ve=>{let{site_description:ie}=Y;return(!ie||ie==="None")&&(ie="Home"),Ve||ie}))},[Y,b,D]);const we=j.getOptional("app.title")||"Backstage",ge=[M,L,we].filter(Boolean).join(" | "),{locationMetadata:ze,spec:_e}=ue||{},et=_e==null?void 0:_e.lifecycle,st=ue?(0,m.getEntityRelations)(ue,o.S4):[],Ct=(0,f.useRouteRef)(y._Z)(),yt=r.createElement(r.Fragment,null,r.createElement(c.HeaderLabel,{label:"Component",value:r.createElement(m.EntityRefLink,{color:"inherit",entityRef:U,title:ue==null?void 0:ue.metadata.title,defaultKind:"Component"})}),st.length>0&&r.createElement(c.HeaderLabel,{label:"Owner",value:r.createElement(m.EntityRefLinks,{color:"inherit",entityRefs:st,defaultKind:"group"})}),et?r.createElement(c.HeaderLabel,{label:"Lifecycle",value:et}):null,ze&&ze.type!=="dir"&&ze.type!=="file"?r.createElement(c.HeaderLabel,{label:"",value:r.createElement("a",{href:ze.target,target:"_blank",rel:"noopener noreferrer"},r.createElement(u.Z,{style:{marginTop:"-25px",fill:"#fff"}}))}):null);return!Re&&ue===void 0||!te&&Y===void 0?null:r.createElement(c.Header,{type:"Documentation",typeLink:Ct,title:M||p,subtitle:L||p},r.createElement(t.Z,{titleTemplate:"%s"},r.createElement("title",null,ge)),yt,I,B.renderComponentsByLocation(A.oZ.Header))}},16172:function(ee,s,e){"use strict";e.d(s,{b:function(){return p}});var r=e(2784),t=e(79692),l=e(15223),u=e(95544),A=e(80030),m=e(61837),o=e(48348),c=e(47603),f=e(26136);const y=(0,t.Z)(E=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:E.spacing(3,3,0)}})),p=({toolbarProps:E})=>{const T=y(),[I,B]=(0,r.useState)(null),j=(0,r.useCallback)(te=>{B(te.currentTarget)},[]),M=(0,r.useCallback)(()=>{B(null)},[]),{entityMetadata:{value:b,loading:L}}=(0,f.x1)(),D=(0,f.$L)(),U=D.renderComponentsByLocation(f.oZ.Subheader),Y=D.renderComponentsByLocation(f.oZ.Settings);return!U&&!Y||L===!1&&!b?null:r.createElement(l.Z,{classes:T,...E},r.createElement(u.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap"},U,Y?r.createElement(r.Fragment,null,r.createElement(A.ZP,{title:"Settings"},r.createElement(m.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:j},r.createElement(c.Z,null))),r.createElement(o.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:I,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(I),onClose:M,keepMounted:!0},Y)):null))}},2263:function(ee,s,e){"use strict";e.d(s,{DK:function(){return p},m1:function(){return T}});var r=e(2784),t=e(10289),l=e(26136),u=e(36964),A=e(64279),m=e(77446);function o({contentLoading:I,content:B,activeSyncState:j}){return I||j==="BUILD_READY_RELOAD"||!B&&j==="CHECKING"?"CHECKING":!B&&j==="BUILDING"?"INITIAL_BUILD":B?j==="BUILDING"?"CONTENT_STALE_REFRESHING":j==="BUILD_READY"?"CONTENT_STALE_READY":j==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function c(I,B){const j={...I};switch(B.type){case"sync":B.state==="CHECKING"&&(j.buildLog=[]),j.activeSyncState=B.state,j.syncError=B.syncError;break;case"contentLoading":j.contentLoading=!0,j.contentError=void 0;break;case"content":typeof B.path=="string"&&(j.path=B.path),j.contentLoading=!1,j.content=B.content,j.contentError=B.contentError;break;case"buildLog":j.buildLog=j.buildLog.concat(B.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(j.activeSyncState)&&["contentLoading","content"].includes(B.type)&&(j.activeSyncState="UP_TO_DATE",j.buildLog=[]),j}function f(I,B,j,M){var ue,Re;const[b,L]=(0,r.useReducer)(c,{activeSyncState:"CHECKING",path:M,contentLoading:!0,buildLog:[]}),D=(0,u.useApi)(l.Dl),{retry:U}=(0,m.Z)(async()=>{L({type:"contentLoading"});try{const we=await D.getEntityDocs({kind:I,namespace:B,name:j},M);return L({type:"content",content:we,path:M}),we}catch(we){L({type:"content",contentError:we,path:M})}},[D,I,B,j,M]),Y=(0,r.useRef)({content:void 0,reload:()=>{}});return Y.current={content:b.content,reload:U},(0,A.default)(async()=>{L({type:"sync",state:"CHECKING"});const we=setTimeout(()=>{L({type:"sync",state:"BUILDING"})},1e3);try{switch(await D.syncEntityDocs({kind:I,namespace:B,name:j},ze=>{L({type:"buildLog",log:ze})})){case"updated":Y.current.content?L({type:"sync",state:"BUILD_READY"}):(Y.current.reload(),L({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":L({type:"sync",state:"UP_TO_DATE"});break;default:L({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ge){L({type:"sync",state:"ERROR",syncError:ge})}finally{clearTimeout(we)}},[I,j,B,D,L,Y]),{state:(0,r.useMemo)(()=>o({activeSyncState:b.activeSyncState,contentLoading:b.contentLoading,content:b.content}),[b.activeSyncState,b.content,b.contentLoading]),contentReload:U,path:b.path,content:b.content,contentErrorMessage:(ue=b.contentError)==null?void 0:ue.toString(),syncErrorMessage:(Re=b.syncError)==null?void 0:Re.toString(),buildLog:b.buildLog}}const y=(0,r.createContext)({}),p=()=>(0,r.useContext)(y),E=({children:I})=>{const{"*":B=""}=(0,t.UO)(),{entityRef:j}=(0,l.x1)(),{kind:M,namespace:b,name:L}=j,D=f(M,b,L,B);return r.createElement(y.Provider,{value:D},I instanceof Function?I(D):I)},T=I=>B=>r.createElement(E,null,r.createElement(I,{...B}))},96393:function(ee,s,e){"use strict";e.d(s,{Fq:function(){return u.F},SE:function(){return l.S}});var r=e(2263),t=e(26220),l=e(99954),u=e(63126),A=e(16172)},68725:function(ee,s,e){"use strict";e.d(s,{Fw:function(){return l},_Z:function(){return t},pd:function(){return u}});var r=e(36964);const t=(0,r.createRouteRef)({id:"techdocs:index-page"}),l=(0,r.createRouteRef)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),u=(0,r.createRouteRef)({id:"techdocs:catalog-reader-view"})},47861:function(ee,s,e){"use strict";e.d(s,{S:function(){return Y}});var r=e(2784),t=e(79692),l=e(49378),u=e(38402),A=e(86136),m=e(85256),o=e(82339),c=e(36964),f=e(74450);const y=(0,t.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),p=te=>{const{result:ue,highlight:Re,rank:we,lineClamp:ge=5,asListItem:ze=!0,asLink:_e=!0,title:et,icon:st}=te,Ct=y(),yt=(0,c.useAnalytics)(),Pe=()=>{yt.captureEvent("discover",ue.title,{attributes:{to:ue.location},value:we})},ht=()=>{const de=Re!=null&&Re.fields.title?r.createElement(f.FA,{text:Re.fields.title,preTag:Re.preTag,postTag:Re.postTag}):ue.title,Ue=Re!=null&&Re.fields.entityTitle?r.createElement(f.FA,{text:Re.fields.entityTitle,preTag:Re.preTag,postTag:Re.postTag}):ue.entityTitle,Be=Re!=null&&Re.fields.name?r.createElement(f.FA,{text:Re.fields.name,preTag:Re.preTag,postTag:Re.postTag}):ue.name;return r.createElement(l.Z,{className:Ct.itemText,primaryTypographyProps:{variant:"h6"},primary:et||r.createElement(r.Fragment,null,de," | ",Ue!=null?Ue:Be," docs"),secondary:r.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ge,overflow:"hidden"}},Re!=null&&Re.fields.text?r.createElement(f.FA,{text:Re.fields.text,preTag:Re.preTag,postTag:Re.postTag}):ue.text)})},Ve=({children:de})=>_e?r.createElement(o.Link,{noTrack:!0,to:ue.location,onClick:Pe},de):r.createElement(r.Fragment,null,de),ie=({children:de})=>ze?r.createElement(r.Fragment,null,r.createElement(u.Z,{alignItems:"flex-start"},st&&r.createElement(A.Z,null,st),r.createElement("div",{className:Ct.flexContainer},de)),r.createElement(m.Z,{component:"li"})):r.createElement(r.Fragment,null,de);return r.createElement(Ve,null,r.createElement(ie,null,r.createElement(ht,null)))};var E=e(86619),T=e(50581),I=e(61837),B=e(4614),j=e(21853),M=e(88013),b=e(10289),L=e(48760);const D=(0,t.Z)({root:{width:"100%"}}),U=te=>{const{entityId:ue,entityTitle:Re,debounceTime:we=150}=te,[ge,ze]=(0,r.useState)(!1),_e=(0,b.s0)(),{term:et,setTerm:st,setFilters:Ct,result:{loading:yt,value:Pe}}=(0,f.Rx)(),ht=D(),[Ve,ie]=(0,r.useState)([]);(0,r.useEffect)(()=>{let oe=!0;if(oe&&Pe){const fe=Pe.results.slice(0,10);ie(fe)}return()=>{oe=!1}},[yt,Pe]);const[de,Ue]=(0,r.useState)(et);(0,L.Z)(()=>st(de),we,[de]);const{kind:Be,name:Xe,namespace:mt}=ue;(0,r.useEffect)(()=>{Ct(oe=>({...oe,kind:Be,namespace:mt,name:Xe}))},[Be,mt,Xe,Ct]);const Ye=oe=>{ge||ze(!0),Ue(oe.target.value)},Et=(oe,fe)=>{if(fe!=null&&fe.document){const{location:tt}=fe.document;_e(tt)}};return r.createElement(M.ZP,{classes:{root:ht.root},"data-testid":"techdocs-search-bar",size:"small",open:ge,getOptionLabel:()=>"",filterOptions:oe=>oe,onClose:()=>{ze(!1)},onFocus:()=>{ze(!0)},onChange:Et,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ve,renderOption:({document:oe,highlight:fe})=>r.createElement(p,{result:oe,lineClamp:3,asListItem:!1,asLink:!1,title:oe.title,highlight:fe}),loading:yt,renderInput:oe=>r.createElement(E.Z,{...oe,"data-testid":"techdocs-search-bar-input",variant:"outlined",fullWidth:!0,placeholder:`Search ${Re||ue.name} docs`,value:de,onChange:Ye,InputProps:{...oe.InputProps,startAdornment:r.createElement(T.Z,{position:"start"},r.createElement(I.Z,{"aria-label":"Query",disabled:!0},r.createElement(j.Z,null))),endAdornment:r.createElement(r.Fragment,null,yt?r.createElement(B.Z,{color:"inherit",size:20}):null,oe.InputProps.endAdornment)}})})},Y=te=>{const ue={term:"",types:["techdocs"],pageCursor:"",filters:te.entityId};return r.createElement(f.Nd,{initialState:ue},r.createElement(U,{...te}))}},98157:function(){},53260:function(){}},function(ee){var s=function(r){return ee(ee.s=r)};ee.O(0,[2370,6202,9284,2126,7012,9035,4983,3222,6816,5218,4736],function(){return s(88649),s(46054)});var e=ee.O()}]);})();
|
|
486
486
|
|
|
487
|
-
//# sourceMappingURL=main.
|
|
487
|
+
//# sourceMappingURL=main.8810284e.js.map
|