1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bcd1b20d-001a-4211-9bd9-9355fcf2095b",e._sentryDebugIdIdentifier="sentry-dbid-bcd1b20d-001a-4211-9bd9-9355fcf2095b")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2094],{9171:(e,t,o)=>{"use strict";o.d(t,{IG:()=>r,KZ:()=>i,kB:()=>l,tm:()=>d}),o(68093);var a=o(1950),n=o.n(a);function i(e){return n()(e).format((Number.isInteger(e),"\xa30,0.00"))}function r(e){return n()(e/100).format("0.0%")}function l(e,t){return n()(e).format(t)}function d(e){return n()(e).format("0.0 b")}},24291:(e,t,o)=>{"use strict";o.d(t,{A:()=>b});var a=o(55729),n=o(28203),i=o(24432),r=o(4495),l=o(2498),d=o(74421),s=o(56990),c=o(46522);function u(e){return(0,c.Ay)("MuiCard",e)}(0,s.A)("MuiCard",["root"]);var h=o(6029);let p=(0,r.Ay)(d.A,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),b=a.forwardRef(function(e,t){let o=(0,l.b)({props:e,name:"MuiCard"}),{className:a,raised:r=!1,...d}=o,s={...o,raised:r},c=(e=>{let{classes:t}=e;return(0,i.A)({root:["root"]},u,t)})(s);return(0,h.jsx)(p,{className:(0,n.A)(c.root,a),elevation:r?8:void 0,ref:t,ownerState:s,...d})})},72544:(e,t)=>{t.A={width:24,height:24,body:'<g id="evaTrash2Fill0"><g id="evaTrash2Fill1"><path id="evaTrash2Fill2" fill="currentColor" d="M21 6h-5V4.33A2.42 2.42 0 0 0 13.5 2h-3A2.42 2.42 0 0 0 8 4.33V6H3a1 1 0 0 0 0 2h1v11a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V8h1a1 1 0 0 0 0-2ZM10 16a1 1 0 0 1-2 0v-4a1 1 0 0 1 2 0Zm0-11.67c0-.16.21-.33.5-.33h3c.29 0 .5.17.5.33V6h-4ZM16 16a1 1 0 0 1-2 0v-4a1 1 0 0 1 2 0Z"/></g></g>'}},87126:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>D});var a=o(6029),n=o(75155),i=o(55729),r=o(4495),l=o(43613),d=o(63860),s=o(88713),c=o(72544),u=o(60712),h=o(24291),p=o(77620),b=o(46232),g=o(60260),f=o(74312),m=o.n(f),y=o(82203),A=o.n(y),w=o(81278),v=o(95051),k=o(84473),x=o(46831),P=o(8013),_=o(88768),C=o(66094);let N="GoogleAccounts",I={root:"".concat(N,"-root"),dialog:"".concat(N,"-dialog"),search:"".concat(N,"-search"),searchIcon:"".concat(N,"-searchIcon"),inputRoot:"".concat(N,"-inputRoot"),inputInput:"".concat(N,"-inputInput")},T=(0,r.Ay)(h.A)(e=>{let{theme:t}=e;return{["&.".concat(I.root)]:{},["& .".concat(I.dialog)]:{"& .MuiPaper-root":{maxWidth:891}},["& .".concat(I.search)]:{marginTop:15,borderRadius:t.shape.borderRadius,backgroundColor:(0,p.X4)(t.palette.common.white,.7),"&:hover":{borderColor:"rgba(223,225,229,0)",boxShadow:"0 1px 6px rgb(32 33 36 / 28%)"},width:"98.5%",display:"flex",alignItems:"center",border:1,borderColor:"#dfe1e5",borderStyle:"solid",marginBottom:15,marginLeft:"auto",marginRight:"auto"},["& .".concat(I.searchIcon)]:{pointerEvents:"none",paddingLeft:"10px",paddingTop:"3px"},["& .".concat(I.inputRoot)]:{width:"100%"},["& .".concat(I.inputInput)]:{padding:t.spacing(1.5,0,1.5,0),paddingLeft:"10px"}}}),j=e=>{var t;let{className:o,...n}=e,r=(0,w.useRouter)(),l=(0,P.wA)(),[d,h]=(0,i.useState)(null),[p,f]=(0,i.useState)(null),[y,N]=(0,i.useState)(!1),j=(0,i.useCallback)(()=>{y||f(null)},[y]),M=(0,i.useCallback)(async()=>{if(!(null==p?void 0:p._id))return;let e="https://blog-api.bikebook.co.uk/";if(!e)return void l((0,x.kw)("error","CMS API URL is not configured"));N(!0);try{await _.Ay.delete("".concat(e,"/posts/").concat(p._id)),l((0,x.kw)("success","Blog post deleted")),f(null),h(Date.now())}catch(e){console.error(e),l((0,x.kw)("error",function(e){var t;let o=e&&"object"==typeof e&&"response"in e?null==(t=e.response)?void 0:t.data:void 0;return"string"==typeof o?o:o&&"object"==typeof o&&"message"in o&&"string"==typeof o.message?o.message:"Failed to delete blog post"}(e)))}finally{N(!1)}},[l,p]),R=(0,i.useMemo)(()=>[{type:"button",content:"Cancel",hideOnMobile:!0,buttonProps:{onClick:j,disabled:y},side:"left"},{type:"button",content:"Delete",buttonProps:{onClick:M,loading:y,variant:"contained",color:"error"},side:"right"}],[j,M,y]),S=p?'This will permanently remove "'.concat(null!=(t=p.title)?t:"this post",'". This cannot be undone.'):"";return(0,a.jsxs)(T,{className:(0,g.A)(I.root,o),...n,children:[(0,a.jsx)(v.A,{title:"Delete blog post",subheader:S,open:!!p,actions:R,onClose:j}),(0,a.jsx)(k.A,{objectName:"BlogPost",defaultPageSize:100,tableId:"blog-posts",refreshDataToken:d,columns:[{field:"Title",type:"string",headerName:"Title",numeric:!1,filterable:!1,sortable:!1,disablePadding:!0,minWidth:100,maxWidth:400,getPropValue:e=>e.title},{field:"Url",type:"string",headerName:"Url",filterable:!1,sortable:!1,numeric:!1,disablePadding:!0,minWidth:100,getPropValue:e=>e.url},{field:"Date",type:"string",headerName:"Date",filterable:!1,sortable:!1,numeric:!1,disablePadding:!0,getPropValue:e=>(0,C.Gl)(m()(e.date),C.LN.DATE_SHORT_MONTH)},{field:"Author",type:"string",headerName:"Author",filterable:!1,sortable:!1,numeric:!1,disablePadding:!0,getPropValue:e=>e.author},{field:"Published",type:"boolean",headerName:"Published",filterable:!1,sortable:!1,numeric:!1,disablePadding:!0,getPropValue:e=>e.published},{field:"multi-action",type:"multi-action",headerName:"",width:150,numeric:!1,filterable:!1,disablePadding:!0,options:[{icon:(0,a.jsx)(u.In,{icon:s.A,width:20,height:20}),onClick:e=>{r.push({pathname:"/admin/blog-posts/edit/"+e._id})}},{icon:(0,a.jsx)(u.In,{icon:c.A,width:20,height:20}),onClick:e=>{f(e)}}]}],additionalReqProps:{},title:"Blog Posts",url:"https://blog-api.bikebook.co.uk//posts",headerAction:(0,a.jsx)("div",{children:(0,a.jsx)(b.A,{component:A(),href:"/admin/blog-posts/create",children:"Create Blog Post"})}),defaultSortModel:{field:"GoogleBusinessName",sort:"asc"}})]})};var M=o(35298);let R={root:"".concat("Component","-root")},S=(0,r.Ay)("div")(e=>{let{theme:t}=e;return{["&.".concat(R.root)]:{width:"100%",backgroundColor:t.palette.background.dark,minHeight:"100%",paddingBottom:t.spacing(3)}}}),D=()=>{let e,t,o=(0,n.c)(2);return o[0]===Symbol.for("react.memo_cache_sentinel")?(e={marginTop:0}
1,o[0]=e):e=o[0],o[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)(M.A,{adminAccount:!0,children:(0,a.jsx)(S,{className:R.root,title:"Blog Posts",children:(0,a.jsx)(l.A,{maxWidth:!1,style:e,children:(0,a.jsx)(d.A,{container:!0,spacing:3,children:(0,a.jsx)(d.A,{size:{sm:12,xs:12},children:(0,a.jsx)(j,{})})})})})}),o[1]=t):t=o[1],t}},88713:(e,t)=>{t.A={width:24,height:24,body:'<g id="evaEditFill0"><g id="evaEditFill1"><path id="evaEditFill2" fill="currentColor" d="M19.4 7.34L16.66 4.6A2 2 0 0 0 14 4.53l-9 9a2 2 0 0 0-.57 1.21L4 18.91a1 1 0 0 0 .29.8A1 1 0 0 0 5 20h.09l4.17-.38a2 2 0 0 0 1.21-.57l9-9a1.92 1.92 0 0 0-.07-2.71ZM16 10.68L13.32 8l1.95-2L18 8.73Z"/></g></g>'}},93414:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/blog-posts",function(){return o(87126)}])}},e=>{e.O(0,[1474,8600,9664,3652,7874,3834,4100,6593,636,8792],()=>e(e.s=93414)),_N_E=e.O()}]); 2//# sourceMappingURL=blog-posts-5e42d352a642aabb.js.map
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.