import{an as u,ao as l,av as o,cc as d,aH as g,x,k as h,aD as j,a2 as y,j as t,B as v,T as s,r as f,a1 as C,cH as P,a9 as b}from"./main-TIUJvpaR.js";import{D as B}from"./paginated-resources-KKWqbuJW.js";import{A as E}from"./article-editor-page-DS55U5vL.js";import{B as T,a as i}from"./breadcrumb-B7oVkzG6.js";import"./Undo-DcjzOemS.js";import"./Code-BpwipxEt.js";import"./color-picker-dialog-glVXBItR.js";import"./Color-BRshhlzf.js";import"./dialog-footer-yCpPZGPO.js";import"./file-upload-provider-B_bRCnuD.js";import"./uploaded-file-CLeM2EFo.js";import"./pretty-bytes-bO14ePu9.js";import"./get-image-size-iUxUXrDd.js";import"./use-active-upload-DYNfvvrt.js";import"./open-upload-window-DllX9uve.js";import"./shallow-CASQY68G.js";import"./MoreVert-CnEfcu2X.js";import"./select-T49HzTXy.js";import"./Link-Bj7RBZ1-.js";import"./datatable-page-with-header-layout-Bbr3vl7W.js";import"./dashboard-layout-context-DA6Q35rI.js";import"./use-toggle-dashboard-left-sidebar-BuzWlDo2.js";import"./ArrowBack-DJrrk_Fu.js";import"./core-DldQ5tJn.js";import"./Edit-_sVfUVPu.js";import"./dashboard-sidenav-B0ig3ukb.js";import"./useEffectEvent-Bgk8rSJ3.js";import"./ChevronRight-BaJkMP9s.js";import"./MoreHoriz-Cm8ZCxuL.js";function w(r){const a="custom-pages";return u({mutationFn:e=>D(e,a),onError:e=>l(e),onSuccess:async()=>{await o.invalidateQueries({queryKey:d.customPages.invalidateKey}),await o.invalidateQueries({queryKey:B(a)}),g(x("Page created"))}})}function D(r,a){return h.post(`${a}`,r).then(e=>e.data)}function st(){const r=j(),a=w(),e=y(),m=()=>{a.mutate(e.getValues(),{onSuccess:()=>r("../",{relative:"path"})})},n=t.jsx(v,{variant:"flat",color:"primary",size:"xs",onClick:()=>m(),disabled:a.isPending,children:t.jsx(s,{message:"Create"})}),p=t.jsxs(T,{size:"xl",children:[t.jsx(i,{to:"..",relative:"path",children:t.jsx(s,{message:"Custom pages"})}),t.jsx(i,{children:t.jsx(s,{message:"New page"})})]});return t.jsxs(f.Fragment,{children:[t.jsx(C,{children:t.jsx(s,{message:"New custom page"})}),t.jsx(P,{...e,children:t.jsx(E,{imageUploadType:b.articleImages,saveButton:n,title:p,onChange:c=>{e.setValue("body",c,{shouldDirty:!0})}})})]})}export{st as Component};
