1import{Aa as e,Ia as t,Rr as n,Sa as r,_a as i,fi as a,ra as o,ya as s}from"./index-BovpZL4f.js";import{n as c,t as l}from"./RemoveButton-Nghzblu1.js";var u=t(e(),1),d=t(o(),1),f=s(),p=({type:e,postId:t,postStatus:r,postIsPreviewable:o,onChange:s})=>{let[c,l]=(0,u.useState)(!1),p=e=>{e.preventDefault(),l(!0);let t=e.target.checked;s(t).then(()=>l(!1)).catch(()=>l(!1))},m=o!==void 0,h=n(e);return!t||!m||r!==h.Draft?null:(0,f.jsx)(a,{className:(0,d.default)(`post-ispreviewable`,{loading:c}),id:`Post_IsPreviewable`,name:`IsPreviewable`,type:`checkbox`,checked:o,onChange:p,children:(0,f.jsx)(i,{id:`enable_public_preview`})})},m=({post:e,type:t,fixed:a,metapicId:o,onPostChange:s,onPostRemove:u})=>{let{userId:m,roles:h}=r(),g=n(t);if(!e||e.Status===g.Published||e.Status!==g.Draft&&e.Status!==g.Removed)return null;let _=!!m&&(e.UserID===m||h.includes(`Admin`)||h.includes(`Editor`)&&t===`MagazinePost`);return(0,f.jsx)(`div`,{id:`notices`,className:(0,d.default)({fixed:a}),children:(0,f.jsx)(`section`,{className:(0,d.default)(`box`,{notice:e.Status===g.Draft,important:e.Status===g.Removed}),children:(0,f.jsxs)(`header`,{className:`header`,children:[e.Status===g.Draft&&(0,f.jsx)(i,{id:`not_published`,tagName:`h2`}),e.Status===g.Removed&&(0,f.jsx)(i,{id:`recycle_bin`,tagName:`h2`}),_&&(0,f.jsxs)(`div`,{className:`header-actions`,children:[e.Status===g.Draft&&(0,f.jsx)(p,{type:t,postId:e.ID,postStatus:e.Status,postIsPreviewable:e.IsPreviewable,onChange:t=>s({...e,IsPreviewable:t})}),e.Status===g.Removed&&(0,f.jsx)(l,{type:t,postId:e.ID,postStatus:e.Status,onChange:e=>u(e[0])}),e.Status===g.Draft&&(0,f.jsx)(c,{type:t,post:e,onChange:s,metapicId:o})]})]})})})};export{m as t};
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.