"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[967,8662],{61811:function(p,c,t){t.d(c,{O:function(){return _}});var n=t(73557);function _(l){return(0,n.UO)()}},96641:function(p,c,t){t.d(c,{X2:function(){return x},h$:function(){return M}});var n=t(52322),_=t(74314),l=t(72388),v=t(29651),D=t(68993),O=t(2784);const f=(0,v.CT)("entity-context"),M=s=>{const{children:r,entity:m,loading:u,error:g,refresh:E}=s,y={entity:m,loading:u,error:g,refresh:E};return(0,n.jsx)(f.Provider,{value:(0,D.E)({1:y}),children:(0,n.jsx)(l.fC,{attributes:{...m?{entityRef:(0,_.eE)(m)}:void 0},children:r})})},I=s=>_jsx(M,{entity:s.entity,loading:!Boolean(s.entity),error:void 0,refresh:void 0,children:s.children});function x(){const s=(0,v.Vt)("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 j(){const s=useVersionedContext("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:m,loading:u,error:g,refresh:E}=r;return{entity:m,loading:u,error:g,refresh:E}}},80967:function(p,c,t){t.r(c),t.d(c,{EmbeddedDocsRouter:function(){return $},Router:function(){return U},isTechDocsAvailable:function(){return R}});var n=t(52322),_=t(2784),l=t(73557),v=t(74314),D=t(4577),O=t(76922),f=t(24992);const M="backstage.io/techdocs-entity",I=({entity:o})=>{var e;let a=(0,v.iB)(o);if(!((e=o.metadata.annotations)===null||e===void 0)&&e[M])try{var i;a=(0,v.of)((i=o.metadata.annotations)===null||i===void 0?void 0:i[M])}catch{}return(0,n.jsxs)(D.I6,{entityRef:a,children:[(0,n.jsx)(f.b,{}),(0,n.jsx)(O.F,{withSearch:!1})]})};var x=t(62774),j=t(77277),s=t(79692),r=t(90436),m=t(9791),u=t(98864),g=t(70249),E=t(96641);const y=(0,s.Z)(o=>({code:{borderRadius:6,margin:o.spacing(2,0),background:o.palette.type==="dark"?"#444":o.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function C(o,e){var a,i;const d=(e==null?void 0:e.kind)||"Component",W=(e==null?void 0:e.metadata.name)||"example",K=(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",H=`apiVersion: backstage.io/v1alpha1
kind: ${d}
metadata:
  name: ${W}
  annotations:${o.map(b=>`
    ${b}: value`).join("")}
spec:
  type: ${K}
  owner: ${S}`;let N=6;const Z=[];return o.forEach(()=>{Z.push(N),N++}),{yamlText:H,lineNumbers:Z}}function T(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,d)=>(0,n.jsxs)(n.Fragment,{children:[i,", ",d]}))," ",a?"is":"are"," missing. You need to add the"," ",a?"annotation":"annotations"," to your ",e," if you want to enable this tool."]})}function L(o){let e;try{e=(0,E.X2)().entity}catch{}const{annotation:a,readMoreUrl:i}=o,d=Array.isArray(a)?a:[a],W=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",K=y(),S=(e==null?void 0:e.kind)||"Component",{yamlText:H,lineNumbers:N}=C(d,e);return(0,n.jsx)(g.u,{missing:"field",title:"Missing Annotation",description:T(d,S),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(r.Z,{variant:"body1",children:["Add the annotation to your ",S," YAML as shown in the highlighted example below:"]}),(0,n.jsx)(x.Z,{className:K.code,children:(0,n.jsx)(m.O,{text:H,language:"yaml",showLineNumbers:!0,highlightedNumbers:N,customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(j.Z,{color:"primary",component:u.rU,to:W,children:"Read more"})]})})}var B=t(18662),A=t(31685);const P="backstage.io/techdocs-ref",h="backstage.io/techdocs-entity",R=o=>{var e,a,i,d;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||(d=o.metadata)===null||d===void 0||(i=d.annotations)===null||i===void 0?void 0:i[h])},U=()=>(0,n.jsxs)(l.Z5,{children:[(0,n.jsx)(l.AW,{path:"/",element:(0,n.jsx)(B.TechDocsIndexPage,{})}),(0,n.jsx)(l.AW,{path:"/:namespace/:kind/:name/*",element:(0,n.jsx)(A.I,{})})]}),$=o=>{var e,a;const{children:i}=o,{entity:d}=(0,E.X2)(),W=(0,l.V$)([{path:"/*",element:(0,n.jsx)(I,{entity:d}),children:[{path:"*",element:i}]}]);return((e=d.metadata.annotations)===null||e===void 0?void 0:e[P])||((a=d.metadata.annotations)===null||a===void 0?void 0:a[h])?W:(0,n.jsx)(L,{annotation:[P]})}},18662:function(p,c,t){t.r(c),t.d(c,{TechDocsIndexPage:function(){return D}});var n=t(52322),_=t(2784),l=t(73557),v=t(29895);const D=O=>(0,l.pC)()||(0,n.jsx)(v.u,{...O})},31685:function(p,c,t){t.d(c,{I:function(){return m},r:function(){return r}});var n=t(52322),_=t(2784),l=t(73557),v=t(67880),D=t(2296),O=t(68979),f=t(76922),M=t(65386),I=t(24992),x=t(95573),j=t(61811),s=t(62584);const r=u=>{const{withSearch:g,withHeader:E=!0}=u;return(0,n.jsxs)(v.T,{themeId:"documentation",children:[E&&(0,n.jsx)(M.S,{}),(0,n.jsx)(I.b,{}),(0,n.jsx)(f.F,{withSearch:g})]})},m=u=>{const{kind:g,name:E,namespace:y}=(0,j.O)(x.Fw),{children:C,entityRef:T={kind:g,name:E,namespace:y}}=u,L=(0,l.pC)();if(!C){const P=(L?_.Children.toArray(L.props.children):[]).flatMap(h=>{var R,U;return(U=h==null||(R=h.props)===null||R===void 0?void 0:R.children)!==null&&U!==void 0?U:[]}).find(h=>!(0,s.I)(h,D.Zz)&&!(0,s.I)(h,D.jM));return(0,n.jsx)(O.Z,{entityRef:T,children:P||(0,n.jsx)(r,{})})}return(0,n.jsx)(O.Z,{entityRef:T,children:({metadata:B,entityMetadata:A,onReady:P})=>(0,n.jsx)("div",{className:"techdocs-reader-page",children:(0,n.jsx)(v.T,{themeId:"documentation",children:C instanceof Function?C({entityRef:T,techdocsMetadataValue:B.value,entityMetadataValue:A.value,onReady:P}):C})})})}},24992:function(p,c,t){t.d(c,{b:function(){return m}});var n=t(52322),_=t(2784),l=t(79692),v=t(15223),D=t(62774),O=t(80030),f=t(61837),M=t(48348),I=t(47603),x=t(68979),j=t(2296),s=t(57058);const r=(0,l.Z)(u=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:u.spacing(3,3,0),"@media print":{display:"none"}}})),m=u=>{const g=r(),[E,y]=(0,_.useState)(null),C=(0,_.useCallback)(R=>{y(R.currentTarget)},[]),T=(0,_.useCallback)(()=>{y(null)},[]),{entityMetadata:{value:L,loading:B}}=(0,x.x)(),A=(0,j.$L)(),P=A.renderComponentsByLocation(s.o.Subheader),h=A.renderComponentsByLocation(s.o.Settings);return!P&&!h||B===!1&&!L?null:(0,n.jsx)(v.Z,{classes:g,...u.toolbarProps,children:(0,n.jsxs)(D.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(O.ZP,{title:"Settings",children:(0,n.jsx)(f.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:C,children:(0,n.jsx)(I.Z,{})})}),(0,n.jsx)(M.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:E,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(E),onClose:T,keepMounted:!0,children:(0,n.jsx)("div",{children:h})})]}):null]})})}}}]);})();

//# sourceMappingURL=967.00bc7a39.chunk.js.map