1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2810],{94013:function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cms/createNews",function(){return s(39591)}])},5681:function(e,a,s){"use strict";s.d(a,{R:function(){return CmsNavbar}});var l=s(85893),i=s(67294),r=s(41664),t=s.n(r),c=s(40287),n=s(10840),d=s.n(n),o=s(25675),m=s.n(o),h=s(19451),x=s(11163),u=s(24169);let CmsNavbar=()=>{let e=(0,h.v0)(),a=(0,i.useContext)(u.S),s=null==a?void 0:a.user,r=(0,x.useRouter)(),signOut=async()=>{await e.signOut(),await r.push("/")};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("header",{className:"navbar sticky-top flex-md-nowrap p-0 shadow ","data-bs-theme":"dark",children:[(0,l.jsx)(t(),{className:"navbar-brand ".concat(d().brand," col-md-3 col-lg-2 me-0 px-3 "),href:"/cms",children:(0,l.jsx)(m(),{className:d().logo,src:c.Z,alt:"TechShots Logo",height:50,width:230})}),(0,l.jsx)("ul",{className:"navbar-nav flex-row d-lg-none",children:(0,l.jsx)("li",{className:"nav-item text-nowrap",children:(0,l.jsx)("button",{className:"nav-link px-3 btn btn-light",type:"button","data-bs-toggle":"offcanvas","data-bs-target":"#sidebarMenu","aria-controls":"sidebarMenu","aria-expanded":"false","aria-label":"Toggle navigation",children:(0,l.jsx)("span",{className:"navbar-toggler-icon"})})})}),(0,l.jsx)("div",{id:"navbarSearch",className:"navbar-search w-100 collapse",children:(0,l.jsx)("input",{className:"form-control w-100 rounded-0 border-0",type:"text",placeholder:"Search","aria-label":"Search"})})]}),(0,l.jsx)("div",{className:"sidebar border border-right col-lg-2 p-0 bg-body-tertiary",children:(0,l.jsxs)("div",{className:"offcanvas-lg offcanvas-end bg-body-tertiary",tabIndex:-1,id:"sidebarMenu","aria-labelledby":"sidebarMenuLabel",children:[(0,l.jsxs)("div",{className:"offcanvas-header",children:[(0,l.jsx)("h5",{className:"offcanvas-title w-100",id:"offcanvasNavbarLabel",children:s?(0,l.jsx)("div",{className:"border-bottom ",children:(0,l.jsxs)("h4",{children:["Hello, ",s.name]})}):(0,l.jsx)(t(),{className:"navbar-brand ".concat(d().brand," m-0 "),href:"/",children:(0,l.jsx)(m(),{className:d().logo,src:c.Z,alt:"TechShots Logo",height:60,width:250})})}),(0,l.jsx)("button",{type:"button",className:"btn-close","data-bs-dismiss":"offcanvas","data-bs-target":"#sidebarMenu","aria-label":"Close"})]}),(0,l.jsxs)("div",{className:"offcanvas-body d-md-flex flex-column p-0 pt-lg-3 overflow-y-auto",children:[(0,l.jsxs)("ul",{className:"nav flex-column",children:[(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms",children:"CMS Home"})}),(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2",href:"/cms/newsHistory",children:"News History"})}),(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms/createNews",children:"Create News"})}),(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2",href:"/cms/createEditor",children:"Create Editor"})}),(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2",href:"/cms/viewEditors",children:"View Editors/Admins"})}),(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms/category",children:"Category"})}),(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms/newsletter",children:"Newsletter"})}),(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms/archives",children:"Newsletter Archives"})}),(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:" /cms/ugcApproval",children:"UGC Creator Approval"})}),(0,l.jsx)("li",{children:(0,l.jsx)(t(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:" /cms/UGCArticleApproval",children:"UGC Article Approval"})})]}),(0,l.jsx)("hr",{className:"my-3"}),(0,l.jsx)("ul",{className:"nav flex-column mb-auto",children:(0,l.jsx)("li",{className:"nav-item",children:(0,l.jsx)("button",{className:"btn btn-link text-center ",onClick:signOut,children:"Sign Out"})})})]})]})})]})}},39591:function(e,a,s){"use strict";s.r(a);var l=s(85893),i=s(67294),r=s(60283),t=s(46634),c=s(33139),n=s(5681),d=s(87536),o=s(56312),m=s(25675),h=s.n(m),x=s(1764),u=s(30192),v=s(24169),f=s(64759),j=s.n(f),b=s(3421),N=s(16976),g=s(5054);let fetcher=e=>fetch(e).then(e=>e.json());a.default=()=>{let e=(0,i.useContext)(v.S),a=null==e?void 0:e.user,[s,m]=(0,i.useState)(!1),[f,p]=(0,i.useState)([]),[y,_]=(0,i.useState)(),[k,w]=(0,i.useState)([]),[S,T]=(0,i.useState)(void 0),[C,F]=(0,i.useState)([]),[E,L]=(0,i.useState)(!1),[M,U]=(0,i.useState)(""),{data:R}=(0,N.ZP)("/api/tags",fetcher);(0,i.useEffect)(()=>{R&&F(R)},[R]);let{register:H,handleSubmit:I,formState:{errors:O},reset:A}=(0,d.cI)({resolver:(0,o.F)(x.p)}),onSubmit=async e=>{if(!y){T(" Please Select Image or Video ");return}if(0===f.length){T(" Please Select Categories ");return}if(0===k.length){T(" Please Select Tags");return}m(!0);let s=y;if("Image"===y.mediaType&&!1===y.fromSelector){let{URL:a,name:l}=await (0,u.Z)(e.main_title);await fetch(a,{method:"PUT",headers:{"Content-Type":"multipart/form-data"},body:y.media}),s={mediaType:"Image",media:"https://d3vnc3w6v6jm99.cloudfront.net/"+l,fromSelector:!1}}let l={...e,selectedMedia:s,categories:f,tags:k,isLong:!1,long_description:""};
1E&&(l={...l,isLong:!0,long_description:M});try{await fetch("/api/news",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({news:l,user:a})})}catch(e){console.log(e)}A(),p([]),_(void 0),w([]),L(!1),U(""),T(void 0),m(!1)};return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"container-fluid",children:(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)(n.R,{}),(0,l.jsxs)("div",{className:"col-lg-5 col-md-6",children:[S&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:S})}),(0,l.jsxs)("form",{onSubmit:I(onSubmit),children:[(0,l.jsx)("div",{className:"row",children:(0,l.jsx)("div",{className:"col-12",children:(0,l.jsxs)("button",{className:"btn btn-dark w-100 mt-2 mb-2",type:"submit",children:["Create News",s&&(0,l.jsx)("div",{className:"".concat(j().ldsDualRing)})]})})}),(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{htmlFor:"mainTitle",children:"Main Title:"}),(0,l.jsx)("input",{...H("main_title"),type:"text",className:O.main_title?"form-control is-invalid":"form-control",id:"mainTitle","aria-describedby":"emailHelp",placeholder:"Enter Main Title",name:"main_title"}),O.main_title&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:O.main_title.message})})]}),(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{htmlFor:"footerTitle",children:"Footer Title:"}),(0,l.jsx)("input",{...H("redirect_title1"),type:"text",className:O.redirect_title1?"form-control is-invalid":"form-control",id:"footerTitle","aria-describedby":"emailHelp",placeholder:"Swipe Left to Read Full Story",name:"redirect_title1"}),O.redirect_title1&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:O.redirect_title1.message})})]}),(0,l.jsxs)("div",{className:"form-group mt-2",children:[(0,l.jsx)("label",{htmlFor:"footerSubTitle",children:"Footer Sub Title:"}),(0,l.jsx)("input",{...H("redirect_title2"),type:"text",className:O.redirect_title2?"form-control is-invalid":"form-control",id:"footerSubTitle","aria-describedby":"emailHelp",placeholder:"Enter Footer Sub Title",name:"redirect_title2"}),O.redirect_title2&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:O.redirect_title2.message})})]}),(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{htmlFor:"exampleFormControlTextarea1",children:"News Body:"}),(0,l.jsx)("textarea",{...H("short_description"),className:O.short_description?"form-control is-invalid":"form-control",id:"exampleFormControlTextarea1",rows:5,name:"short_description"}),O.short_description&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:O.short_description.message})})]}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsx)(t.K,{selectedMedia:y,setSelectedMedia:_})}),(0,l.jsxs)("div",{className:"col-md-6",children:[(0,l.jsxs)("div",{className:"form-check ",children:[(0,l.jsx)("input",{...H("is_featured"),className:"form-check-input",type:"checkbox",id:"featured",name:"is_featured"}),(0,l.jsx)("label",{className:"form-check-label",htmlFor:"featured",children:"Featured"}),O.is_featured&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:O.is_featured.message})})]}),(0,l.jsxs)("div",{className:"form-check",children:[(0,l.jsx)("input",{...H("notify_user"),className:"form-check-input",type:"checkbox",id:"notify",name:"notify_user"}),(0,l.jsx)("label",{className:"form-check-label",htmlFor:"notify",children:"Notify User"}),O.notify_user&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:O.notify_user.message})})]})]})]}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-4",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{htmlFor:"sourceName",children:"Source Name:"}),(0,l.jsx)("input",{...H("source_name"),type:"text",className:O.source_name?"form-control is-invalid":"form-control",id:"sourceName","aria-describedby":"emailHelp",placeholder:"Enter Source Name",name:"source_name"}
1),O.source_name&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:O.source_name.message})})]})}),(0,l.jsx)("div",{className:"col-md-8",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{htmlFor:"mainTitle",children:"Source URL:"}),(0,l.jsx)("input",{...H("source_url"),type:"text",className:O.source_url?"form-control is-invalid":"form-control",id:"footerTitle","aria-describedby":"emailHelp",placeholder:"Enter Source URL",name:"source_url"}),O.source_url&&(0,l.jsx)("div",{className:"invalid-feedback d-block",children:(0,l.jsx)("small",{children:O.source_url.message})})]})})]})]}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsx)(r.T,{selectedCategories:f,setSelectedCategories:p})}),(0,l.jsx)("div",{className:"col-md-6 mt-2",children:(0,l.jsx)(c.U,{tags:k,setTags:w,serverTags:C,setServerTags:F})})]}),E?(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("div",{className:"col",children:(0,l.jsx)("button",{type:"button",className:"btn btn-outline-dark",onClick:()=>{L(!1),U("")},children:"Make This Short News"})}),(0,l.jsx)(g.b,{longBody:M,setLongBody:U})]}):(0,l.jsx)("button",{type:"button",className:"btn btn-outline-dark",onClick:()=>{L(!0),U("")},children:"Make This Long News"})]}),(0,l.jsxs)("div",{className:"col-lg-5 col-md-6 mt-3",children:[(0,l.jsx)("div",{className:"row mb-3",children:y&&"Image"===y.mediaType&&("string"==typeof y.media?(0,l.jsxs)("div",{className:"row",children:["Selected Image:",(0,l.jsx)("div",{className:"col-4",children:(0,l.jsx)(h(),{src:y.media,alt:"",width:200,height:100,className:"p-0 ".concat(j().smallImage)})})]}):(0,l.jsxs)("div",{className:"row",children:["Selected Image:",(0,l.jsx)("div",{className:"col-4",children:(0,l.jsx)(h(),{src:URL.createObjectURL(y.media),alt:"",width:200,height:100})})]}))}),(0,l.jsx)(b.m,{tags:k,setSelectedMedia:_})]})]})})})}}},function(e){e.O(0,[9774,1664,5675,6976,2734,6312,7369,950,2888,179],function(){return e(e.s=94013)}),_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.