"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[7960,8160],{28576:function(K,d,t){t.d(d,{o:function(){return _}});var n=t(33648);function _(l){return(0,n.W4)()}},49704:function(K,d,t){t.d(d,{Zp:function(){return C},kH:function(){return T},s$:function(){return O}});var n=t(77e3),_=t(83856),l=t(73556),u=t(42772),D=t(68080),M=t(85668);const f=(0,u.IR)("entity-context"),O=s=>{const{children:r,entity:g,loading:E,error:m,refresh:v}=s,y={entity:g,loading:E,error:m,refresh:v};return(0,n.jsx)(f.Provider,{value:(0,D.O)({1:y}),children:(0,n.jsx)(l.cz,{attributes:{...g?{entityRef:(0,_.gH)(g)}:void 0},children:r})})},j=s=>_jsx(O,{entity:s.entity,loading:!Boolean(s.entity),error:void 0,refresh:void 0,children:s.children});function T(){const s=(0,u.eW)("entity-context");if(!s)throw new Error("Entity context is not available");const r=s.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");if(!r.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:r.entity}}function C(){const s=(0,u.eW)("entity-context");if(!s)throw new Error("Entity context is not available");const r=s.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");const{entity:g,loading:E,error:m,refresh:v}=r;return{entity:g,loading:E,error:m,refresh:v}}},77960:function(K,d,t){t.r(d),t.d(d,{EmbeddedDocsRouter:function(){return b},Router:function(){return W},isTechDocsAvailable:function(){return I}});var n=t(77e3),_=t(85668),l=t(33648),u=t(83856),D=t(85216),M=t(60173),f=t(32276);const O="backstage.io/techdocs-entity",j=({entity:o})=>{var e;let a=(0,u.cZ)(o);if(!((e=o.metadata.annotations)===null||e===void 0)&&e[O])try{var i;a=(0,u.WK)((i=o.metadata.annotations)===null||i===void 0?void 0:i[O])}catch{}return(0,n.jsxs)(D.MX,{entityRef:a,children:[(0,n.jsx)(f.I,{}),(0,n.jsx)(M.i,{withSearch:!1})]})};var T=t(38160),C=t(84600),s=t(49704),r=t(33584),g=t(1275),E=t(40476),m=t(94700),v=t(27284),y=t(43932),x=t(38280);const R=(0,E.c)(o=>({code:{borderRadius:6,margin:o.spacing(2,0),background:o.palette.type==="dark"?"#444":o.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function L(o,e){var a,i;const c=(e==null?void 0:e.kind)||"Component",p=(e==null?void 0:e.metadata.name)||"example",U=(e==null||(a=e.spec)===null||a===void 0?void 0:a.type)||"website",S=(e==null||(i=e.spec)===null||i===void 0?void 0:i.owner)||"user:default/guest",$=`apiVersion: backstage.io/v1alpha1
kind: ${c}
metadata:
  name: ${p}
  annotations:${o.map(F=>`
    ${F}: value`).join("")}
spec:
  type: ${U}
  owner: ${S}`;let N=6;const H=[];return o.forEach(()=>{H.push(N),N++}),{yamlText:$,lineNumbers:H}}function B(o,e="Component"){const a=o.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",a?"annotation":"annotations"," ",o.map(i=>(0,n.jsx)("code",{children:i})).reduce((i,c)=>(0,n.jsxs)(n.Fragment,{children:[i,", ",c]}))," ",a?"is":"are"," missing. You need to add the"," ",a?"annotation":"annotations"," to your ",e," if you want to enable this tool."]})}function A(o){let e;try{e=(0,s.kH)().entity}catch{}const{annotation:a,readMoreUrl:i}=o,c=Array.isArray(a)?a:[a],p=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",U=R(),S=(e==null?void 0:e.kind)||"Component",{yamlText:$,lineNumbers:N}=L(c,e);return(0,n.jsx)(v.o,{missing:"field",title:"Missing Annotation",description:B(c,S),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(m.c,{variant:"body1",children:["Add the annotation to your ",S," YAML as shown in the highlighted example below:"]}),(0,n.jsx)(r.c,{className:U.code,children:(0,n.jsx)(y.U,{text:$,language:"yaml",showLineNumbers:!0,highlightedNumbers:N,customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(g.c,{color:"primary",component:x.cH,to:p,children:"Read more"})]})})}const P="backstage.io/techdocs-ref",h="backstage.io/techdocs-entity",I=o=>{var e,a,i,c;return Boolean(o==null||(a=o.metadata)===null||a===void 0||(e=a.annotations)===null||e===void 0?void 0:e[P])||Boolean(o==null||(c=o.metadata)===null||c===void 0||(i=c.annotations)===null||i===void 0?void 0:i[h])},W=()=>(0,n.jsxs)(l.c5,{children:[(0,n.jsx)(l.kX,{path:"/",element:(0,n.jsx)(T.TechDocsIndexPage,{})}),(0,n.jsx)(l.kX,{path:"/:namespace/:kind/:name/*",element:(0,n.jsx)(C.M,{})})]}),b=o=>{var e,a;const{children:i}=o,{entity:c}=(0,s.kH)(),p=(0,l.wh)([{path:"/*",element:(0,n.jsx)(j,{entity:c}),children:[{path:"*",element:i}]}]);return((e=c.metadata.annotations)===null||e===void 0?void 0:e[P])||((a=c.metadata.annotations)===null||a===void 0?void 0:a[h])?p:(0,n.jsx)(A,{annotation:[P]})}},38160:function(K,d,t){t.r(d),t.d(d,{TechDocsIndexPage:function(){return D}});var n=t(77e3),_=t(85668),l=t(33648),u=t(43516);const D=M=>(0,l.ag)()||(0,n.jsx)(u.S,{...M})},84600:function(K,d,t){t.d(d,{M:function(){return g},O:function(){return r}});var n=t(77e3),_=t(85668),l=t(33648),u=t(34536),D=t(21016),M=t(34704),f=t(60173),O=t(88616),j=t(32276),T=t(94388),C=t(28576),s=t(61552);const r=E=>{const{withSearch:m,withHeader:v=!0}=E;return(0,n.jsxs)(u.K,{themeId:"documentation",children:[v&&(0,n.jsx)(O.K,{}),(0,n.jsx)(j.I,{}),(0,n.jsx)(f.i,{withSearch:m})]})},g=E=>{const{kind:m,name:v,namespace:y}=(0,C.o)(T.uE),{children:x,entityRef:R={kind:m,name:v,namespace:y}}=E,L=(0,l.ag)();if(!x){const P=(L?_.Children.toArray(L.props.children):[]).flatMap(h=>{var I,W;return(W=h==null||(I=h.props)===null||I===void 0?void 0:I.children)!==null&&W!==void 0?W:[]}).find(h=>!(0,s.q)(h,D.Mt)&&!(0,s.q)(h,D.WG));return(0,n.jsx)(M.o,{entityRef:R,children:P||(0,n.jsx)(r,{})})}return(0,n.jsx)(M.o,{entityRef:R,children:({metadata:B,entityMetadata:A,onReady:P})=>(0,n.jsx)("div",{className:"techdocs-reader-page",children:(0,n.jsx)(u.K,{themeId:"documentation",children:x instanceof Function?x({entityRef:R,techdocsMetadataValue:B.value,entityMetadataValue:A.value,onReady:P}):x})})})}},32276:function(K,d,t){t.d(d,{I:function(){return g}});var n=t(77e3),_=t(85668),l=t(40476),u=t(86364),D=t(33584),M=t(87648),f=t(67256),O=t(28488),j=t(63712),T=t(34704),C=t(21016),s=t(70124);const r=(0,l.c)(E=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:E.spacing(3,3,0),"@media print":{display:"none"}}})),g=E=>{const m=r(),[v,y]=(0,_.useState)(null),x=(0,_.useCallback)(I=>{y(I.currentTarget)},[]),R=(0,_.useCallback)(()=>{y(null)},[]),{entityMetadata:{value:L,loading:B}}=(0,T.O)(),A=(0,C.K6)(),P=A.renderComponentsByLocation(s.u.Subheader),h=A.renderComponentsByLocation(s.u.Settings);return!P&&!h||B===!1&&!L?null:(0,n.jsx)(u.c,{classes:m,...E.toolbarProps,children:(0,n.jsxs)(D.c,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(M.cp,{title:"Settings",children:(0,n.jsx)(f.c,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:x,children:(0,n.jsx)(j.c,{})})}),(0,n.jsx)(O.c,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:v,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(v),onClose:R,keepMounted:!0,children:(0,n.jsx)("div",{children:h})})]}):null]})})}}}]);})();

//# sourceMappingURL=7960.d12e2654.chunk.js.map