PageSourceSearch

https://effulgent-bombolone-77534e.netlify.app/_next/static/chunks/pages/admin/blog/new-e198b712c65f078b.js

js effulgent-bombolone-77534e.netlify.app collected 2026-10-03 10:41:33 UTC 21,737 bytes, 20 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[299],{67:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/blog/new",function(){return a(1110)}])},6688:function(e,t,a){"use strict";a.d(t,{Hp:function(){return i},ni:function(){return r}});let i="sales-focused",r={educational:{label:"Educational",instructions:"informative, neutral, and helpful"},"sales-focused":{label:"Sales-focused",instructions:"persuasive, benefit-driven, and clear CTA tone"},casual:{label:"Casual",instructions:"conversational, simple, and friendly"}}},2004:function(e,t,a){"use strict";a.d(t,{Fc:function(){return o},ap:function(){return l},jd:function(){return s}});let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")},r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/<[^>]*>/g," ").replace(/&nbsp;/gi," ").replace(/&amp;/gi,"&").replace(/&#39;/gi,"'").replace(/&quot;/gi,'"').replace(/\s+/g," ").trim()},n=e=>{if("string"!=typeof e)return"";let t=e.trim();return t?t=(t=(t=(t=(t=(t=(t=(t=t.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"")).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"")).replace(/\son\w+\s*=\s*"[^"]*"/gi,"")).replace(/\son\w+\s*=\s*'[^']*'/gi,"")).replace(/\son\w+\s*=\s*[^\s>]+/gi,"")).replace(/(href|src)\s*=\s*(['"])\s*javascript:[\s\S]*?\2/gi,'$1="#"')).replace(RegExp("<(?!/?(?:".concat("p|br|strong|b|em|i|u|ul|ol|li|h2|h3|a",")\\b)[^>]+>"),"gi"),"")).replace(/<a\b([^>]*)>/gi,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=t.match(/\bhref\s*=\s*("([^"]*)"|'([^']*)')/i),r=a?a[2]||a[3]||"":"#",n=/^https?:\/\//i.test(r)||r.startsWith("/")||r.startsWith("#")?r:"#";return'<a href="'.concat(i(n),'" rel="noopener noreferrer">')}):""},l=e=>0===r(e).length,s=e=>{if("string"!=typeof e||!e.trim())return"";let t=/<\/?[a-z][\s\S]*>/i.test(e);if(t)return n(e);let a=e.split(/\n{2,}/).map(e=>e.trim()).filter(Boolean);return a.map(e=>"<p>".concat(i(e).replace(/\n/g,"<br>"),"</p>")).join("")},o=e=>r(s(e))},5677:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var a in t)Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}(t,{noSSR:function(){return l},default:function(){return s}});let i=a(8754),r=(a(7294),i._(a(8976)));function n(e){return{default:(null==e?void 0:e.default)||e}}function l(e,t){return delete t.webpack,delete t.modules,e(t)}function s(e,t){let a=r.default,i={loading:e=>{let{error:t,isLoading:a,pastDelay:i}=e;return null}};e instanceof Promise?i.loader=()=>e:"function"==typeof e?i.loader=e:"object"==typeof e&&(i={...i,...e}),i={...i,...t};let s=i.loader;return(i.loadableGenerated&&(i={...i,...i.loadableGenerated},delete i.loadableGenerated),"boolean"!=typeof i.ssr||i.ssr)?a({...i,loader:()=>null!=s?s().then(n):Promise.resolve(n(()=>null))}):(delete i.webpack,delete i.modules,l(a,i))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2254:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let i=a(8754),r=i._(a(7294)),n=r.default.createContext(null)},8976:function(e,t,a){"use strict";/**
2@copyright (c) 2017-present James Kyle <[email protected]>
3 MIT License
4 Permission is hereby granted, free of charge, to any person obtaining
5a copy of this software and associated documentation files (the
6"Software"), to deal in the Software without restriction, including
7without limitation the rights to use, copy, modify, merge, publish,
8distribute, sublicense, and/or sell copies of the Software, and to
9permit persons to whom the Software is furnished to do so, subject to
10the following conditions:
11 The above copyright notice and this permission notice shall be
12included in all copies or substantial portions of the Software.
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
17LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
20*/Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h}});let i=a(8754),r=i._(a(7294)),n=a(2254),l=[],s=[],o=!1;function c(e){let t=e(),a={loading:!0,loaded:null,error:null};return a.promise=t.then(e=>(a.loading=!1,a.loaded=e,e)).catch(e=>{throw a.loading=!1,a.error=e,e}),a}class d{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function u(e){return function(e,t){let a=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),i=null;function l(){if(!i){let t=new d(e,a);i={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return i.promise()}if(!o){let e=a.webpack?a.webpack():a.modules;e&&s.push(t=>{for(let a of e)if(t.includes(a))return l()})}function c(e,t){!function(){l();let e=r.default.useContext(n.LoadableContext);e&&Array.isArray(a.modules)&&a.modules.forEach(t=>{e(t)})}();let s=r.default.useSyncExternalStore(i.subscribe,i.getCurrentValue,i.getCurrentValue);return r.default.useImperativeHandle(t,()=>({retry:i.retry}),[]),r.default.useMemo(()=>{var t;return s.loading||s.error?r.default.createElement(a.loading,{isLoading:s.loading,pastDelay:s.pastDelay,timedOut:s.timedOut,error:s.error,retry:i.retry}):s.loaded?r.default.createElement((t=s.loaded)&&t.default?t.default:t,e):null},[e,s])}return c.preload=()=>l(),c.displayName="LoadableComponent",r.default.forwardRef(c)}(c,e)}function p(e,t){let a=[];for(;e.length;){let i=e.pop();a.push(i(t))}return Promise.all(a).then(()=>{if(e.length)return p(e,t)})}u.preloadAll=()=>new Promise((e,t)=>{p(l).then(e,t)}),u.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let a=()=>(o=!0,t());p(s,e).then(a,a)})),window.__NEXT_PRELOADREADY=u.preloadReady;let h=u},1110:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return m},default:function(){return g}});var i=a(5893),r=a(7294),n=a(5152),l=a.n(n),s=a(1163),o=a(9152),c=a(6688),d=a(2004),u=a(9547),p=a.n(u);let h=l()(()=>Promise.all([a.e(911),a.e(509),a.e(681),a.e(217)]).then(a.bind(a,9217)),{loadableGenerated:{webpack:()=>[9217]},ssr:!1});var m=!0;function g(e){let{user:t}=e,a=(0,s.useRouter)(),[n,l]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[y,b]=(0,r.useState)(""),[j,v]=(0,r.useState)(""),[x,N]=(0,r.useState)(""),[w,_]=(0,r.useState)([]),[S,C]=(0,r.useState)(!0),[k,T]=(0,r.useState)(""),[P,F]=(0,r.useState)(!1),[O,E]=(0,r.useState)(!1),[A,B]=(0,r.useState)(!1),[D,I]=(0,r.useState)(""),[R,L]=(0,r.useState)(c.Hp),[U,G]=(0,r.useState)([]),[M,H]=(0,r.useState)([]),[J,q]=(0,r.useState)(!1),[V,z]=(0,r.useState)(!1),[W,X]=(0,r.useState)(!1),[Z,Y]=(0,r.useState)(!1),[$,K]=(0,r.useState)(!1),[Q,ee]=(0,r.useState)([]),[et,ea]=(0,r.useState)([]),[ei,er]=(0,r.useState)(!1),[en,el]=(0,r.useState)([]),[es,eo]=(0,r.useState)(!0),[ec,ed]=(0,r.useState)(!1),[eu,ep]=(0,r.useState)(!1),eh=(0,r.useRef)(null),em=en.filter(e=>e.publicUrl!==j);(0,r.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await fetch("/api/admin/blog/media"),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Failed to load media library.");e&&el(a.media||[])}catch(t){e&&T(t.message)}finally{e&&eo(!1)}};return t(),()=>{e=!1}},[]),(0,r.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await fetch("/api/admin/blog/ai-history"),a=await t.json().catch(()=>({}));if(!t.ok)return;e&&H(Array.isArray(a.topics)?a.topics:[])}catch(e){}};return t(),()=>{e=!1}},[]),(0,r.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await fetch("/api/admin/categories"),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Failed to load categories.");if(e){let e=a.categories||[];if(_(e),!x){let t=e.find(e=>"uncategorized"===e.slug);t&&N(t.id)}}}catch(t){e&&T(t.message)}finally{e&&C(!1)}};return t(),()=>{e=!1}},[]);let eg=async e=>{if(e.preventDefault(),T(""),(0,d.ap)(y)){T("Body is required.");return}F(!0);try{let e=await fetch("/api/admin/blog/posts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n,slug:u,excerpt:g,body:y,featured_image_url:j,category_id:x||null})}),t=await e.json().catch(()=>({}));if(!e.ok){T(t.error||"Failed to create post.");return}a.push("/admin/blog/".concat(t.post.id,"/edit"))}catch(e){T("Failed to create post. Please try again.")}finally{F(!1)}},ef=async()=>{T(""),B(!0);try{let e=await fetch("/api/admin/blog/ai-topics",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topic:D,tone:R})}
20),t=await e.json().catch(()=>({}));if(!e.ok){T(t.error||"Failed to suggest topics.");return}G(Array.isArray(t.topics)?t.topics:[])}catch(e){T("Failed to suggest topics. Please try again.")}finally{B(!1)}},ey=async()=>{T("");let e=D.trim();if(!e){T("Select or enter a topic before generating.");return}if(e.length>140){T("Topic must be 140 characters or less.");return}let t=!!(n.trim()||g.trim()||!(0,d.ap)(y));if(t){let e=window.confirm("This will overwrite the current title, excerpt, and body. Continue?");if(!e)return}E(!0);try{var a,i;let t=await fetch("/api/admin/blog/ai-generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topic:e,tone:R,generateImage:!1})}),r=await t.json().catch(()=>({}));if(!t.ok){T(r.details?"".concat(r.error," ").concat(r.details):r.error||"Failed to generate blog.");return}l(r.title||""),f(r.excerpt||""),b(r.body||"<p></p>"),r.imageUrl&&v(r.imageUrl),ee([]),ea([]),z(!0);let n=document.getElementById("metaTitle"),s=document.getElementById("metaDescription");n&&"string"==typeof(null===(a=r.seo)||void 0===a?void 0:a.metaTitle)&&(n.value=r.seo.metaTitle,n.dispatchEvent(new Event("input",{bubbles:!0}))),s&&"string"==typeof(null===(i=r.seo)||void 0===i?void 0:i.metaDescription)&&(s.value=r.seo.metaDescription,s.dispatchEvent(new Event("input",{bubbles:!0})));let o=await fetch("/api/admin/blog/ai-history"),c=await o.json().catch(()=>({}));o.ok&&H(Array.isArray(c.topics)?c.topics:[])}catch(e){T("Failed to generate blog. Please try again.")}finally{E(!1)}},eb=async()=>{if(T(""),!D.trim()){T("Select or enter a topic before regenerating image.");return}if(j){let e=window.confirm("Replace the current featured image?");if(!e)return}X(!0);try{let e=await fetch("/api/admin/blog/ai-regenerate-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topic:D.trim(),tone:R,title:n,body:y})}),t=await e.json().catch(()=>({}));if(!e.ok){T(t.details?"".concat(t.error," ").concat(t.details):t.error||"Failed to regenerate image.");return}v(t.imageUrl||"");let a=await fetch("/api/admin/blog/ai-history"),i=await a.json().catch(()=>({}));a.ok&&H(Array.isArray(i.topics)?i.topics:[])}catch(e){T("Failed to regenerate image.")}finally{X(!1)}},ej=async()=>{if(T(""),ee([]),!D.trim()){T("Select or enter a topic before regenerating titles.");return}Y(!0);try{let e=await fetch("/api/admin/blog/ai-regenerate-title",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topic:D.trim(),tone:R})}),t=await e.json().catch(()=>({}));if(!e.ok){T(t.error||"Failed to regenerate titles.");return}ee(Array.isArray(t.titles)?t.titles:[]);let a=await fetch("/api/admin/blog/ai-history"),i=await a.json().catch(()=>({}));a.ok&&H(Array.isArray(i.topics)?i.topics:[])}catch(e){T("Failed to regenerate titles.")}finally{Y(!1)}},ev=async()=>{if(T(""),ea([]),!D.trim()){T("Select or enter a topic before regenerating excerpt.");return}K(!0);try{let e=await fetch("/api/admin/blog/ai-regenerate-excerpt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({topic:D.trim(),tone:R,title:n})}),t=await e.json().catch(()=>({}));if(!e.ok){T(t.error||"Failed to regenerate excerpt.");return}ea(Array.isArray(t.excerpts)?t.excerpts:[]);let a=await fetch("/api/admin/blog/ai-history"),i=await a.json().catch(()=>({}));a.ok&&H(Array.isArray(i.topics)?i.topics:[])}catch(e){T("Failed to regenerate excerpt.")}finally{K(!1)}},ex=async e=>{if(!e)return;T(""),er(!0);let t=new FormData;t.append("image",e);try{let e=await fetch("/api/admin/blog/media",{method:"POST",body:t}),a=await e.json().catch(()=>({}));if(!e.ok){T(a.error||"Image upload failed.");return}let i=a.media;if(!(null==i?void 0:i.id)){T("Image upload failed. Invalid server response.");return}el(e=>[i,...e]),v(i.publicUrl),ed(!1)}catch(e){T("Image upload failed. Please try again.")}finally{er(!1)}},eN=async e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];await ex(a),eh.current&&(eh.current.value="")},ew=async e=>{var t,a;e.preventDefault(),ep(!1);let i=null===(a=e.dataTransfer)||void 0===a?void 0:null===(t=a.files)||void 0===t?void 0:t[0];await ex(i)},e_=async e=>{T("");try{let t=await fetch("/api/admin/blog/media/".concat(e),{method:"DELETE"}),a=await t.json().catch(()=>({}));if(!t.ok){T(a.error||"Failed to delete media.");return}el(t=>{let a=t.filter(t=>t.id!==e);return a.some(e=>e.publicUrl===j)||v(""),a})}catch(e){T("Failed to delete media. Please try again.")}};return(0,i.jsx)(o.L3,{user:t,title:"New Post",children:(0,i.jsxs)("form",{className:p().form,onSubmit:eg,children:[k&&(0,i.jsx)("p",{className:p().error,children:k}),(0,i.jsxs)("div",{className:p().sectionBlock,children:[(0,i.jsx)("h2",{className:p().sectionHeading,children:"AI Blog Generator"}),(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{htmlFor:"tone",children:"Tone"}),(0,i.jsx)("select",{id:"tone",value:R,onChange:e=>L(e.target.value),children:Object.entries(c.ni).map(e=>
20{let[t,a]=e;return(0,i.jsx)("option",{value:t,children:a.label},t)})})]}),(0,i.jsxs)("div",{className:p().actions,children:[(0,i.jsx)("button",{type:"button",className:p().secondaryButton,onClick:ef,disabled:P||ei||O||A,children:A?"Suggesting...":"Suggest Topics"}),M.length>0&&(0,i.jsx)("button",{type:"button",className:p().ghostButton,onClick:()=>q(!0),disabled:P||ei||O||A||W||Z||$,children:"Recent Topics"})]}),U.length>0&&(0,i.jsx)("div",{className:p().inlineActions,children:U.map(e=>(0,i.jsx)("button",{type:"button",className:"".concat(p().ghostButton," ").concat(D===e?p().topicChipActive:""),onClick:()=>I(e),children:e},e))}),(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{htmlFor:"ai-topic",children:"Enter your topic"}),(0,i.jsx)("input",{id:"ai-topic",value:D,onChange:e=>I(e.target.value),maxLength:140,placeholder:"e.g. How to reduce payment processing costs for restaurants"})]}),(0,i.jsxs)("div",{className:p().actions,children:[(0,i.jsx)("button",{type:"button",className:p().button,onClick:ey,disabled:P||ei||O||A||W||Z||$,children:O?"Generating...":"Generate Blog"}),(0,i.jsx)("button",{type:"button",className:p().secondaryButton,onClick:eb,disabled:P||ei||O||A||W||Z||$,children:W?"Generating...":"Generate Image"}),V&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{type:"button",className:p().secondaryButton,onClick:ej,disabled:P||ei||O||A||W||Z||$,children:Z?"Regenerating...":"Regenerate Titles"}),(0,i.jsx)("button",{type:"button",className:p().secondaryButton,onClick:ev,disabled:P||ei||O||A||W||Z||$,children:$?"Regenerating...":"Regenerate Excerpt"})]})]}),Q.length>0&&(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{children:"Pick a title"}),(0,i.jsx)("div",{className:p().inlineActions,children:Q.map(e=>(0,i.jsx)("button",{type:"button",className:p().ghostButton,onClick:()=>l(e),children:e},e))})]}),et.length>0&&(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{children:"Pick an excerpt"}),(0,i.jsx)("div",{className:p().inlineActions,children:et.map(e=>(0,i.jsx)("button",{type:"button",className:p().ghostButton,onClick:()=>f(e),children:e},e))})]})]}),J&&(0,i.jsx)("div",{className:p().modalOverlay,onClick:()=>q(!1),children:(0,i.jsxs)("div",{className:p().modalCard,onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)("div",{className:p().actions,children:[(0,i.jsx)("h3",{className:p().sectionHeading,children:"Recent Topics"}),(0,i.jsx)("button",{type:"button",className:p().ghostButton,onClick:()=>q(!1),children:"Close"})]}),(0,i.jsx)("div",{className:p().inlineActions,children:M.map(e=>(0,i.jsx)("button",{type:"button",className:"".concat(p().ghostButton," ").concat(D===e.topic?p().topicChipActive:""),onClick:()=>{I(e.topic),e.tone&&L(e.tone),q(!1)},children:e.topic},"".concat(e.topic,"-").concat(e.tone,"-").concat(e.createdAt||"")))})]})}),(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{htmlFor:"title",children:"Title"}),(0,i.jsx)("input",{id:"title",value:n,onChange:e=>l(e.target.value),required:!0})]}),(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{htmlFor:"slug",children:"Slug"}),(0,i.jsx)("input",{id:"slug",value:u,onChange:e=>m(e.target.value),placeholder:"auto-generated from title if empty"})]}),(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{htmlFor:"category",children:"Category"}),(0,i.jsxs)("select",{id:"category",value:x,onChange:e=>N(e.target.value),disabled:S,children:[(0,i.jsx)("option",{value:"",children:"Uncategorized"}),w.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{htmlFor:"excerpt",children:"Excerpt"}),(0,i.jsx)("textarea",{id:"excerpt",value:g,onChange:e=>f(e.target.value),style:{minHeight:"110px"},required:!0})]}),(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{children:"Featured Image"}),j&&(0,i.jsxs)("div",{className:p().selectedImagePanel,children:[(0,i.jsx)("p",{className:p().mediaSectionTitle,children:"Selected Image"}),(0,i.jsx)("img",{src:j,alt:"Featured preview",className:p().imagePreview}),(0,i.jsx)("p",{className:p().helper,children:j}),(0,i.jsx)("button",{type:"button",className:p().ghostButton,onClick:()=>v(""),children:"Remove Selected Image"})]}),(0,i.jsx)("div",{className:p().actions,children:(0,i.jsx)("button",{type:"button",className:p().secondaryButton,onClick:()=>ed(e=>!e),children:ec?"Close Media Library":"Set Featured Image"})}),ec&&(0,i.jsxs)("div",{className:p().mediaLibraryPanel,children:[(0,i.jsx)("p",{className:p().mediaSectionTitle,children:"Media Library"}),(0,i.jsxs)("div",{className:"".concat(p().dropZone," ").concat(eu?p().dropZoneActive:""),onDragOver:e=>{e.preventDefault(),ep(!0)},onDragLeave:()=>ep(!1),onDrop:ew,children:[(0,i.jsx)("input",{ref:eh,id:"featuredImage",type:"file",accept:"image/*",onChange:eN,className:p().hiddenFileInput}),(0,i.jsx)("button",{type:"button",className:p().button,onClick:()=>{var e;return null===(e=eh.current)||void 0===e?void 0:e.click()},disabled:ei,children:ei?"Uploading...":"Upload New Image"}),(0,i.jsx)("p",{className:p().helper,children:"Drop an image here or click to upload."})]}),es&&(0,i.jsx)("p",{className:p().helper,children:"Loading media library..."}),!es&&0===em.length&&(0,i.jsx)("p",{className:p().helper,children:"No images uploaded yet."}),!es&&em.length>0&&(0,i.jsx)("div",{className:p().mediaGrid,children:em.map(e=>{var a;return(0,i.jsxs)("div",{className:p().mediaCard,children:[(0,i.jsx)("img",{src:e.publicUrl,alt:e.originalFilename,className:p().mediaThumb}),(0,i.jsx)("p",{className:p().mediaName,children:e.originalFilename}),"admin"===t.role&&(null===(a=e.owner)||void 0===a?void 0:a.email)&&(0,i.jsxs)("p",{className:p().mediaName,children:["Owner: ",e.owner.email]}),(0,i.jsxs)("div",{className:p().actions,children:[(0,i.jsx)("button",{type:"button",className:p().secondaryButton,onClick:()=>{v(e.publicUrl),ed(!1)},children:"Select"}),(0,i.jsx)("button",{type:"button",className:p().dangerButton,onClick:()=>e_(e.id),children:"Delete"})]})]},e.id)})})]})]}),(0,i.jsxs)("div",{className:p().field,children:[(0,i.jsx)("label",{htmlFor:"body",children:"Body"}),(0,i.jsx)(h,{value:y,onChange:b,placeholder:"Write your post..."})]}),(0,i.jsxs)("div",{className:p().actions,children:[(0,i.jsx)("button",{type:"button",className:p().secondaryButton,onClick:ef,disabled:P||ei||O||A||W||Z||$,children:"Refresh Topics"}),(0,i.jsx)("button",{type:"submit",className:p().button,disabled:P||ei||O||W||Z||$,children:P?"Creating...":"Create Draft"})]})]})})}g.noLayout=!0},5152:function(e,t,a){e.exports=a(5677)}},function(e){e.O(0,[774,888,179],function(){return e(e.s=67)}),_N_E=e.O()}]);

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.