1import{W as e}from"./advanced-inputs.BKUrQSBb.js";import{a as t,c as n,f as r,o as i,u as a}from"./routing.Cb7G0LKm.js";import{Pl as o,ci as s,gu as c,hu as l,lu as u,mi as d,to as f,ui as p,ur as m}from"./hooks.CueFou3h.js";import{a as h,i as g,n as _,r as v,t as y}from"./forms.D_zl9-KT.js";var b=e();function x(){let{skillId:e}=r(),t=n(),a=d(),{user:u,roles:f}=p(),m=s({permissionType:l.SKILLS,permission:c.USE}),h=s({permissionType:l.SKILLS,permission:c.CREATE}),g=t.pathname.endsWith(`/new`),_=t.pathname.endsWith(`/edit`);return u?.role!=null&&f?.[u.role]!=null?m?g&&!h?(0,b.jsx)(i,{to:`/skills`,replace:!0}):g?(0,b.jsx)(S,{}):e?_?(0,b.jsx)(w,{skillId:e}):(0,b.jsx)(C,{skillId:e}):(0,b.jsxs)(`div`,{className:`flex h-full w-full flex-col bg-presentation`,children:[(0,b.jsx)(T,{}),(0,b.jsx)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:(0,b.jsx)(v,{title:a(`com_ui_skill_no_selection`),description:a(`com_ui_skill_no_selection_desc`)})})]}):(0,b.jsx)(i,{to:`/c/new`,replace:!0}):(0,b.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-presentation`,children:(0,b.jsx)(o,{className:`text-text-secondary`,"aria-label":a(`com_ui_loading`)})})}function S(){return(0,b.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-y-auto bg-presentation`,children:[(0,b.jsx)(T,{}),(0,b.jsx)(_,{})]})}function C({skillId:e}){let n=d(),r=a(),[i]=t(),s=i.get(`file`),c=f(e,{enabled:!!e});return s?(0,b.jsxs)(`div`,{className:`flex h-full w-full flex-col bg-presentation`,children:[(0,b.jsx)(T,{}),(0,b.jsx)(g,{skillId:e,relativePath:s})]}):c.isLoading?(0,b.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-presentation`,children:(0,b.jsx)(o,{className:`text-text-secondary`,"aria-label":n(`com_ui_loading`)})}):c.isError||!c.data?(0,b.jsxs)(`div`,{className:`flex h-full w-full flex-col bg-presentation`,children:[(0,b.jsx)(T,{}),(0,b.jsx)(v,{variant:`error`,title:n(`com_ui_skill_not_found`),description:n(`com_ui_skill_not_found_description`)})]}):(0,b.jsxs)(`div`,{className:`flex h-full w-full flex-col bg-presentation`,children:[(0,b.jsx)(T,{}),(0,b.jsx)(h,{skill:c.data,onEdit:()=>r(`/skills/${e}/edit`),onDelete:()=>r(`/skills`,{replace:!0})})]})}function w({skillId:e}){return(0,b.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-y-auto bg-presentation`,children:[(0,b.jsx)(T,{}),(0,b.jsx)(y,{skillId:e})]})}function T(){return u(`(max-width: 768px)`)?(0,b.jsx)(`div`,{className:`flex shrink-0 items-center px-4 pt-3`,children:(0,b.jsx)(m,{})}):null}export{x as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.