PageSourceSearch

https://www.techshotsapp.com/_next/static/chunks/pages/cms/createNewsletter-3c5d074a6985e4a4.js

js techshotsapp.com collected 2026-10-04 13:25:16 UTC 28,086 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5467],{78884:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cms/createNewsletter",function(){return t(83197)}])},40287:function(e,a){"use strict";a.Z={src:"/_next/static/media/logo.d4ee6930.svg",height:1e3,width:4e3,blurWidth:0,blurHeight:0}},5681:function(e,a,t){"use strict";t.d(a,{R:function(){return CmsNavbar}});var s=t(85893),n=t(67294),l=t(41664),i=t.n(l),r=t(40287),c=t(10840),o=t.n(c),d=t(25675),m=t.n(d),h=t(19451),x=t(11163),u=t(24169);let CmsNavbar=()=>{let e=(0,h.v0)(),a=(0,n.useContext)(u.S),t=null==a?void 0:a.user,l=(0,x.useRouter)(),signOut=async()=>{await e.signOut(),await l.push("/")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("header",{className:"navbar sticky-top flex-md-nowrap p-0 shadow ","data-bs-theme":"dark",children:[(0,s.jsx)(i(),{className:"navbar-brand ".concat(o().brand," col-md-3 col-lg-2 me-0 px-3 "),href:"/cms",children:(0,s.jsx)(m(),{className:o().logo,src:r.Z,alt:"TechShots Logo",height:50,width:230})}),(0,s.jsx)("ul",{className:"navbar-nav flex-row d-lg-none",children:(0,s.jsx)("li",{className:"nav-item text-nowrap",children:(0,s.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,s.jsx)("span",{className:"navbar-toggler-icon"})})})}),(0,s.jsx)("div",{id:"navbarSearch",className:"navbar-search w-100 collapse",children:(0,s.jsx)("input",{className:"form-control w-100 rounded-0 border-0",type:"text",placeholder:"Search","aria-label":"Search"})})]}),(0,s.jsx)("div",{className:"sidebar border border-right col-lg-2 p-0 bg-body-tertiary",children:(0,s.jsxs)("div",{className:"offcanvas-lg offcanvas-end bg-body-tertiary",tabIndex:-1,id:"sidebarMenu","aria-labelledby":"sidebarMenuLabel",children:[(0,s.jsxs)("div",{className:"offcanvas-header",children:[(0,s.jsx)("h5",{className:"offcanvas-title w-100",id:"offcanvasNavbarLabel",children:t?(0,s.jsx)("div",{className:"border-bottom  ",children:(0,s.jsxs)("h4",{children:["Hello, ",t.name]})}):(0,s.jsx)(i(),{className:"navbar-brand ".concat(o().brand," m-0 "),href:"/",children:(0,s.jsx)(m(),{className:o().logo,src:r.Z,alt:"TechShots Logo",height:60,width:250})})}),(0,s.jsx)("button",{type:"button",className:"btn-close","data-bs-dismiss":"offcanvas","data-bs-target":"#sidebarMenu","aria-label":"Close"})]}),(0,s.jsxs)("div",{className:"offcanvas-body d-md-flex flex-column p-0 pt-lg-3 overflow-y-auto",children:[(0,s.jsxs)("ul",{className:"nav flex-column",children:[(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms",children:"CMS Home"})}),(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2",href:"/cms/newsHistory",children:"News History"})}),(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms/createNews",children:"Create News"})}),(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2",href:"/cms/createEditor",children:"Create Editor"})}),(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2",href:"/cms/viewEditors",children:"View Editors/Admins"})}),(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms/category",children:"Category"})}),(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms/newsletter",children:"Newsletter"})}),(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:"/cms/archives",children:"Newsletter Archives"})}),(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:" /cms/ugcApproval",children:"UGC Creator Approval"})}),(0,s.jsx)("li",{children:(0,s.jsx)(i(),{className:"nav-link d-flex align-items-center gap-2 active","aria-current":"page",href:" /cms/UGCArticleApproval",children:"UGC Article Approval"})})]}),(0,s.jsx)("hr",{className:"my-3"}),(0,s.jsx)("ul",{className:"nav flex-column mb-auto",children:(0,s.jsx)("li",{className:"nav-item",children:(0,s.jsx)("button",{className:"btn btn-link text-center ",onClick:signOut,children:"Sign Out"})})})]})]})})]})}},46634:function(e,a,t){"use strict";t.d(a,{K:function(){return MediaPicker}});var s=t(85893),n=t(67294);let MediaPicker=e=>{let{setSelectedMedia:a}
1=e,[t,l]=(0,n.useState)(""),onChangeHandler=e=>{e.preventDefault(),l(e.target.value)},onMediaChange=e=>{if(e.preventDefault(),"Image"===t&&e.target.files){a(void 0);let t=e.target.files[0];if(t&&t.size>4194304){alert("Image size should be less than 4MB"),e.target.value="";return}!function(e){let t=document.createElement("canvas");t.style.display="none";let s=t.getContext("2d"),n=new Image;e&&(n.src=URL.createObjectURL(e),n.onload=()=>{t.width=n.width,t.height=n.height,null==s||s.drawImage(n,0,0),t.toBlob(function(e){let t=URL.createObjectURL(e);a({mediaType:"Image",media:t,fromSelector:!1});let s=new File([e],"file_name.webp",{lastModified:Date.now(),type:"image/webp"});a({mediaType:"Image",media:s,fromSelector:!1})},"image/webp")})}(t)}else if("Video"===t){a(void 0);let s=e.target.value;a({mediaType:t,media:s,fromSelector:!1})}};return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"form-check",children:[(0,s.jsx)("input",{onChange:onChangeHandler,className:"form-check-input",type:"radio",name:"exampleRadios",i
1d:"exampleRadios1",value:"Image"}),(0,s.jsx)("label",{className:"form-check-label",htmlFor:"exampleRadios1",children:"Image"})]}),(0,s.jsxs)("div",{className:"form-check",children:[(0,s.jsx)("input",{onChange:onChangeHandler,className:"form-check-input",type:"radio",name:"exampleRadios",id:"exampleRadios2",value:"Video"}),(0,s.jsx)("label",{className:"form-check-label",htmlFor:"exampleRadios2",children:"Youtube Video"})]}),t&&"Image"===t&&(0,s.jsx)("div",{className:"input-group mb-3",children:(0,s.jsxs)("div",{className:"mb-1",children:[(0,s.jsx)("label",{htmlFor:"formFile",className:"form-label",children:"Upload Image"}),(0,s.jsx)("input",{className:"form-control",type:"file",id:"formFile",accept:"image/*",onChange:onMediaChange})]})}),t&&"Video"===t&&(0,s.jsxs)("div",{className:"form-group",children:[(0,s.jsx)("label",{htmlFor:"VideoUrl",children:"Enter YouTube Link"}),(0,s.jsx)("input",{type:"text",className:"form-control",id:"VideoUrl",placeholder:"Enter YouTube Link",onChange:onMediaChange})]})]})}},35646:function(e,a,t){"use strict";var s=t(85893);t(67294),a.Z=e=>{let{currentPage:a,totalPages:t,onPageChange:n}=e,l=[];for(let e=Math.max(1,a-1);e<=Math.min(t,a+1);e++)l.push(e);return console.log(l),(0,s.jsx)("nav",{"aria-label":"Page navigation example",children:(0,s.jsxs)("ul",{className:"pagination",children:[(0,s.jsx)("li",{className:"page-item ".concat(1===a?"disabled":""),children:(0,s.jsx)("button",{type:"button",className:"page-link",onClick:()=>n(a-1),children:"Previous"})}),a>2&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("li",{className:"page-item",children:(0,s.jsx)("button",{type:"button",className:"page-link",onClick:()=>n(1),children:"1"})}),a>3&&(0,s.jsx)("li",{className:"page-item disabled",children:(0,s.jsx)("span",{className:"page-link",children:"..."})})]}),l.map(e=>(0,s.jsx)("li",{className:"page-item ".concat(a===e?"active":""),children:(0,s.jsx)("button",{className:"page-link",type:"button",onClick:()=>n(e),children:e})},e)),a<t-1&&(0,s.jsxs)(s.Fragment,{children:[a<t-1-1&&(0,s.jsx)("li",{className:"page-item disabled",children:(0,s.jsx)("span",{className:"page-link",children:"..."})}),(0,s.jsx)("li",{className:"page-item",children:(0,s.jsx)("button",{className:"page-link",type:"button",onClick:()=>n(t),children:t})})]}),(0,s.jsx)("li",{className:"page-item ".concat(a===t?"disabled":""),children:(0,s.jsx)("button",{className:"page-link",type:"button",onClick:()=>n(a+1),children:"Next"})})]})})}},94507:function(e,a,t){"use strict";t.d(a,{g:function(){return Loading}});var s=t(85893);t(67294);var n=t(47605),l=t.n(n);let Loading=()=>(0,s.jsxs)("div",{className:l().loadingContainer,children:[(0,s.jsx)("span",{className:l().loader})," ",(0,s.jsx)("h1",{className:l().loadingText,children:"Loading..."})," "]})},83197:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return createNewsletter}});var s=t(85893),n=t(67294),l=t(16976),i=t(60887),r=t(45587),c=t(5681),o=t(94507),d=t(35646),m=t(41664),h=t.n(m),createNewsletterForm=e=>{var a;let{data:t,handlePageChange:n,currentPage:l,onAddHandler:i,emailNews:r,onRemoveHandler:c}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("table",{className:"table d-block table-striped",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{scope:"col",children:"Add To Newsletter"}),(0,s.jsx)("th",{scope:"col",children:"Published"}),(0,s.jsx)("th",{scope:"col",children:"News Title"})]})}),(0,s.jsx)("tbody",{children:null===(a=t.news)||void 0===a?void 0:a.map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:r.some(a=>a.news.id===e.id)?(0,s.jsx)("button",{type:"button",className:"btn btn-outline-dark",onClick:()=>c(r.findIndex(a=>a.news.id===e.id)),children:"Remove"}):(0,s.jsx)("button",{type:"button",className:"btn btn-outline-dark",onClick:()=>i(e,!1),children:"Add"})}),(0,s.jsx)("td",{children:e.published?"Yes":"No"}),(0,s.jsx)("td",{children:(0,s.jsx)(h(),{className:"text-truncate",href:"/cms/editNews?id=".concat(e.id),children:(0,s.jsx)("span",{className:"text-truncate",children:e.main_title})})})]},e.id))})]})}),(0,s.jsx)("div",{className:"row",children:(0,s.jsx)(d.Z,{currentPage:l,totalPages:t.totalPages,onPageChange:n})})]})}
1,x=t(33511),u=t(3921),p=t(54896),g=t(5616),j=t(15861),b=t(46634),v=t(30192),f=t(87536),w=t(56312),N=t(62734);let y=N.Ry({main_title:N.Z_().optional(),url:N.Z_({required_error:"Source Name is required",invalid_type_error:"Source Name must be a string"}).min(1,{message:"Source URL cannot be empty"}).url({message:"Source URL must be a valid URL"})});var cms_CustomNewsForm=e=>{let{onAddHandler:a}=e,[t,l]=(0,n.useState)(),[i,r]=(0,n.useState)(void 0),{register:c,handleSubmit:o,formState:{errors:d},reset:m}=(0,f.cI)({resolver:(0,w.F)(y)}),onSubmit=async e=>{let s=t;if(!t){r(" Please Select Image or Video ");return}if((null==t?void 0:t.mediaType)==="Image"&&(null==t?void 0:t.fromSelector)===!1){let{URL:n,name:i}=await (0,v.Z)(e.main_title||"");await fetch(n,{method:"PUT",headers:{"Content-Type":"multipart/form-data"},body:t.media}),s={mediaType:"Image",media:"https://d3vnc3w6v6jm99.cloudfront.net/"+i,fromSelector:!1};let r={id:Math.random(),main_title:e.main_title||"",published:!0,media_url:s.media,url:e.url,categories:[{id:Math.random(),name:"any",isFeatured:!0,isActive:!0,createdAt:new Date,updatedAt:new Date,url:"any"}],author:{name:"any"}};a(r,!0),m(),l(void 0)}};return(0,s.jsxs)(s.Fragment,{children:[i&&(0,s.jsx)("div",{className:"invalid-feedback d-block",children:(0,s.jsx)("small",{children:i})}),(0,s.jsxs)("form",{onSubmit:o(onSubmit),children:[(0,s.jsxs)("div",{className:"form-group mb-2",children:[(0,s.jsx)("label",{htmlFor:"mainTitle",children:"Main Title:"}),(0,s.jsx)("input",{...c("main_title"),type:"text",className:d.main_title?"form-control is-invalid":"form-control",id:"mainTitle","aria-describedby":"emailHelp",placeholder:"Enter Main Title",name:"main_title"}),d.main_title&&(0,s.jsx)("div",{className:"invalid-feedback d-block",children:(0,s.jsx)("small",{children:d.main_title.message})})]}),(0,s.jsxs)("div",{className:"form-group mb-2",children:[(0,s.jsx)("label",{htmlFor:"url",children:"Url"}),(0,s.jsx)("input",{...c("url"),type:"text",className:d.main_title?"form-control is-invalid":"form-control",id:"url","aria-describedby":"emailHelp",placeholder:"Enter URL",name:"url"}),d.url&&(0,s.jsx)("div",{className:"invalid-feedback d-block",children:(0,s.jsx)("small",{children:d.url.message})})]}),(0,s.jsx)("button",{className:"btn btn-outline-dark",type:"submit",children:"Add Custom News"})]}),(0,s.jsx)(b.K,{selectedMedia:t,setSelectedMedia:l})]})},_=t(15805),C=t(96390),S=t(44137),k=t(12585),T=t(11378),F=t(44726),E=t(61733),L=t(92939),I=t(52660),R=t(39663),A=t(52844),M=t(62595);let appendUtm=e=>{let a=e.includes("?"),t="utm_source=newsletter&utm_medium=email&utm_campaign=techshots_newsletter";return a?"".concat(e,"&").concat(t):"".concat(e,"?").concat(t)},ColumnComponent=e=>{var a;let{item:t,isCustom:n}=e;return n?(0,s.jsxs)(_.s,{style:V.product,align:"center",children:[(0,s.jsx)(C.r,{href:appendUtm(null==t?void 0:t.url),children:(0,s.jsx)(S.E,{src:null==t?void 0:t.media_url,alt:null==t?void 0:t.main_title,width:n?"600px":"290px",height:n?"100%":"200px",style:n?{}:B,className:"news-image"})}),!n&&(0,s.jsx)(C.r,{href:appendUtm(null==t?void 0:t.url),style:V.title,children:null==t?void 0:t.main_title})]}):(0,s.jsxs)(_.s,{style:V.product,align:"center",children:[(0,s.jsx)(S.E,{src:null==t?void 0:t.media_url,alt:null==t?void 0:t.main_title,width:"290px",height:"200px",style:B}),(0,s.jsx)(C.r,{href:appendUtm("https://www.techshotsapp.com/".concat(null==t?void 0:null===(a=t.categories[0])||void 0===a?void 0:a.url,"/").concat(null==t?void 0:t.url,"?id=").concat(null==t?void 0:t.id,"&email={{userEmail}}&newsletterId={{nlId}}")),style:V.title,children:null==t?void 0:t.main_title})]})},Email=e=>{var a;let{news:t}=e,n=function(e,a){let t=[];for(let s=0;s<e.length;s+=a)t.push(e.slice(s,s+a));return t}(t,2);return console.log(n),(0,s.jsxs)(k.V,{children:[(0,s.jsx)(T.F,{}),(0,s.jsx)(F.M,{children:"TechShotsApp Newsletter"}),(0,s.jsx)(E.u,{style:O,children:(0,s.jsxs)(L.W,{style:W,children:[(0,s.jsx)(I.$,{style:D.container,children:(0,s.jsx)(R.X,{children:(0,s.jsx)(_.s,{children:(0,s.jsx)(S.E,{src:"https://d3vnc3w6v6jm99.cloudfront.net/techshotLogoSmall.png",width:"300",height:"50",alt:"TechShots",style:{margin:"auto",width:"300px",height:"auto"}})})})}),(0,s.jsx)(A.Hr,{style:Z.hr}),(0,s.jsxs)(I.$,{style:P,children:[!(null===(a=t[0])||void 0===a?void 0:a.isCustom)&&(0,s.jsx)(R.X,{style:V.container,children:(0,s.jsx)(_.s,{style:V.product,align:"center"})},"poster"),n.map((e,a)=>(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(R.X,{style:V.container,children:e.map(e=>
1(0,s.jsx)(ColumnComponent,{item:e.news,isCustom:e.isCustom},e.news.id))},a)}))]}),(0,s.jsx)(A.Hr,{style:Z.hr}),(0,s.jsx)(I.$,{children:(0,s.jsx)(C.r,{href:"https://www.techshotsapp.com/",style:{color:"#000"},children:(0,s.jsx)(M.x,{style:{...Z.heading,textAlign:"center",borderLeft:"0px"},children:"TechShotsApp.com"})})}),(0,s.jsx)(I.$,{children:(0,s.jsxs)(R.X,{children:[(0,s.jsx)(_.s,{style:{maxWidth:"15px"},align:"center",children:(0,s.jsx)(C.r,{style:{color:"#000"},href:"https://www.twitter.com/techshotsapp",children:"Twitter"})}),(0,s.jsx)(_.s,{style:{maxWidth:"15px"},align:"center",children:(0,s.jsx)(C.r,{style:{color:"#000"},href:"https://www.facebook.com/techshotsapp/",children:"FaceBook"})}),(0,s.jsx)(_.s,{style:{maxWidth:"15px"},align:"center",children:(0,s.jsx)(C.r,{style:{color:"#000"},href:"https://www.youtube.com/@techshotsapp",children:"YouTube"})}),(0,s.jsx)(_.s,{style:{maxWidth:"15px"},align:"center",children:(0,s.jsx)(C.r,{style:{color:"#000"},href:"https://www.instagram.com/techshotsapp/",children:"Instagram"})}),(0,s.jsx)(_.s,{style:{maxWidth:"15px"},align:"center",children:(0,s.jsx)(C.r,{style:{color:"#000"},href:"https://www.linkedin.com/company/techshots/",children:"LinkedIn"})})]})}),(0,s.jsx)(A.Hr,{style:{...Z.hr,marginTop:"12px"}}),(0,s.jsxs)(I.$,{style:P,children:[(0,s.jsxs)(R.X,{style:Y.policy,children:[(0,s.jsx)(_.s,{children:(0,s.jsx)(C.r,{style:{color:"#000"},href:appendUtm("https://www.techshotsapp.com/privacy"),children:(0,s.jsx)(M.x,{style:Y.text,children:"Privacy Policy"})})}),(0,s.jsx)(_.s,{children:(0,s.jsx)(C.r,{href:appendUtm("https://www.techshotsapp.com/newsletterUnsubscribe"),children:(0,s.jsx)(M.x,{children:"Unsubscribe"})})})]}),(0,s.jsx)(M.x,{style:Y.text,children:"\xa9Messy Desk Media Private Ltd. All rights reserved."})]})]})})]})},H={paddingLeft:"40px",paddingRight:"40px"},P={paddingTop:"22px",paddingBottom:"22px"},U={margin:"0",lineHeight:"2"},Z={paddingX:H,paddingY:P,defaultPadding:{...H,...P},paragraphWithBold:{...U,fontWeight:"bold"},heading:{fontSize:"32px",lineHeight:"1.3",fontWeight:"700",marginLeft:"10px",borderLeft:"5px solid #FF914D",paddingLeft:"10px",letterSpacing:"-1px"},text:{...U,color:"#747474",fontWeight:"500"},button:{fontSize:"12px",textDecoration:"none",padding:"10px 0px",width:"220px",display:"block",textAlign:"center",fontWeight:500,color:"#000"},hr:{borderColor:"#E5E5E5",margin:"0"}},O={backgroundColor:"#ffffff",fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif'},W={margin:"10px auto",width:"600px",border:"1px solid #E5E5E5"},D={container:{padding:"22px 40px",backgroundColor:"#F7F7F7"}},B={borderRadius:"10px",marginBottom:"12px"};({...U});let X={margin:"0",fontSize:"15px",lineHeight:"1",paddingRight:"10px",color:"#000"},V={container:{padding:"20px 0px",margin:"3px ",marginTop:"20px"},product:{verticalAlign:"top",textAlign:"left",paddingLeft:"2px",paddingRight:"2px"},title:{...X,paddingTop:"12px",fontWeight:"400"},text:{...X,paddingTop:"4px",color:"#747474"}};({...P});let Y={policy:{width:"166px",margin:"auto"},text:{margin:"0",color:"#AFAFAF",fontSize:"13px",textAlign:"center"}};var z=t(11163),q=t(81886),K=t(34336);let $=q.ZP.object({subject:q.ZP.string().min(1,{message:"Subject is required"})});var cms_NewsletterModal=e=>{let{modalType:a,handleClose:t,onAddHandler:l,emailNews:i}=e,r=(0,z.useRouter)(),[c,o]=(0,n.useState)([""]),{register:d,handleSubmit:m,formState:{errors:h},reset:x}=(0,f.cI)({resolver:(0,w.F)($)}),handleChange=(e,a)=>{let t=[...c];t[e]=a,o(t)},onTestSubmit=async e=>{var a;let t={subject:e.subject,emails:c,isTest:!0,emailText:(0,K.s)((0,s.jsx)(Email,{news:i})),isCustom:null===(a=i[0])||void 0===a?void 0:a.isCustom,emailCount:i.length};try{await fetch("/api/cms/newsletter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){console.log(e)}console.log(t),x(),await r.push("/cms/newsletter")},onSubmit=async e=>{var a;let t={subject:e.subject,emails:c,isTest:!1,emailText:(0,K.s)((0,s.jsx)(Email,{news:i})),isCustom:null===(a=i[0])||void 0===a?void 0:a.isCustom,emailCount:i.length};try{await fetch("/api/cms/newsletter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){console.log(e)}
1console.log(t),x(),await r.push("/cms/newsletter")};switch(a){case"custom":return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(cms_CustomNewsForm,{onAddHandler:l})});case"preview":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.Z,{id:"modal-modal-title",variant:"h6",component:"h2",children:"Preview"}),(0,s.jsx)(Email,{news:i})]});case"test":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.Z,{id:"modal-modal-title",variant:"h6",component:"h2",children:"Test Newsletter"}),(0,s.jsxs)("form",{onSubmit:m(onTestSubmit),children:[(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("div",{className:"col-12",children:[(0,s.jsxs)("div",{className:"input-group mb-3 mt-3",children:[(0,s.jsx)("span",{className:"input-group-text",id:"basic-addon1",children:"Subject"}),(0,s.jsx)("input",{type:"text",className:"form-control",placeholder:"Newsletter Subject","aria-label":"Newsletter Subject","aria-describedby":"basic-addon1",...d("subject")})]}),(0,s.jsx)("h5",{className:"text-danger",children:h.subject&&(0,s.jsx)("small",{children:h.subject.message})}),(0,s.jsxs)("div",{children:[c.map((e,a)=>(0,s.jsxs)("div",{children:[(0,s.jsxs)("h6",{children:["Email ",a+1]}),(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("label",{htmlFor:"emailInput-".concat(a),className:"form-label",children:"Enter Email"}),(0,s.jsx)("input",{type:"email",className:"form-control",id:"emailInput-".concat(a),placeholder:"email",value:e,onChange:e=>handleChange(a,e.target.value)})]})]},a)),(0,s.jsx)("button",{className:"btn btn-outline-dark",type:"button",onClick:()=>o([...c,""]),children:"Add Email"})]})]})}),(0,s.jsx)("div",{className:"d-flex my-4 justify-content-between",children:(0,s.jsx)("div",{className:"d-inline",children:(0,s.jsx)("button",{type:"submit",className:"btn btn-outline-success",children:"Send Newsletter"})})})]}),(0,s.jsx)(Email,{news:i})]});case"newsletter":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.Z,{id:"modal-modal-title",variant:"h6",component:"h2",children:"Send Newsletter to all users"}),(0,s.jsxs)("form",{onSubmit:m(onSubmit),children:[(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("div",{className:"col-12",children:[(0,s.jsxs)("div",{className:"input-group mb-3 mt-3",children:[(0,s.jsx)("span",{className:"input-group-text",id:"basic-addon1",children:"Subject"}),(0,s.jsx)("input",{type:"text",className:"form-control",placeholder:"Newsletter Subject","aria-label":"Newsletter Subject","aria-describedby":"basic-addon1",...d("subject")})]}),(0,s.jsx)("h5",{className:"text-danger",children:h.subject&&(0,s.jsx)("small",{children:h.subject.message})})]})}),(0,s.jsx)("div",{className:"d-flex my-4 justify-content-between",children:(0,s.jsx)("div",{className:"d-inline",children:(0,s.jsx)("button",{type:"submit",className:"btn btn-outline-success",children:"Send Newsletter"})})})]}),(0,s.jsx)(Email,{news:i})]});default:return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.Z,{id:"modal-modal-title",variant:"h6",component:"h2",children:"Some Error Occurred"}),(0,s.jsx)(j.Z,{id:"modal-modal-description",sx:{mt:2},children:"Please try again."})]})}},G=t(24285),cms_SortableListItem=e=>{let{item:a,onNewsRemoveHandler:t,index:n}=e,{attributes:l,listeners:i,setNodeRef:c,transform:o,transition:d}=(0,r.nB)({id:a.news.id}),m={transform:G.ux.Transform.toString(o),transition:d};return(0,s.jsx)("div",{ref:c,style:m,...l,...i,children:(0,s.jsxs)("div",{className:"d-flex justify-content-between my-2 border",children:[(0,s.jsx)("span",{children:a.news.main_title}),(0,s.jsx)("button",{className:"btn btn-outline-danger",onClick:()=>t(n),children:"Remove"})]},n)})},icons_XIcon=e=>(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",className:"bi bi-x",viewBox:"0 0 16 16",...e,children:(0,s.jsx)("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"})});let fetcher=e=>fetch(e).then(e=>e.json());var createNewsletter=()=>{let[e,a]=(0,n.useState)({dateTo:"",dateFrom:""}
1),[t,d]=(0,n.useState)(1),m="/api/cms/news?pageNumber=".concat(t,"&dateTo=").concat(e.dateTo,"&dateFrom=").concat(e.dateFrom),{data:h,isLoading:j,mutate:b}=(0,l.ZP)(m,fetcher),[v,f]=(0,n.useState)(!1),[w,N]=(0,n.useState)(null),[y,_]=(0,n.useState)([]),onAddHandler=(e,a)=>{a?_([...y,{isCustom:!0,news:e}]):_([...y,{isCustom:!1,news:e}]),onModalClose()},onNewsRemoveHandler=e=>{console.log(e),_(a=>{let t=[...a];return t.splice(e,1),t})},onModalClose=()=>{f(!1),N(null)},[C,S]=(0,n.useState)(!1),[k,T]=(0,n.useState)(!1),F=(0,i.Dy)((0,i.VT)(i.we),(0,i.VT)(i.Lg,{coordinateGetter:r.is})),[E,L]=(0,n.useState)(!1);return((0,n.useEffect)(()=>L(!0),[]),E)?(0,s.jsxs)("div",{className:"container-fluid",children:[(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(c.R,{}),(0,s.jsxs)("div",{className:"col-lg-10 col-md-12",children:[(0,s.jsx)("h1",{role:"alert",className:"mb-2 mt-4",children:"Newsletter"}),(0,s.jsx)("div",{className:"row w-100 my-4",children:(0,s.jsxs)("div",{className:"col-12 w-100 d-flex justify-content-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(x.Z,{variant:"outlined",onClick:()=>{f(!0),N("custom")},type:"button",className:"mx-2",children:"Add Custom News"}),(0,s.jsx)(u.Z,{title:y.length<=0?"You need to add atleast 1 news to view this!":"See Preview",children:(0,s.jsx)("span",{children:(0,s.jsx)(x.Z,{onClick:()=>{f(!0),N("preview")},type:"button",variant:"outlined",disabled:y.length<=0,className:"mx-2",children:"See Preview"})})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{title:y.length<=0?"You need to add atleast 1 news to do this action!":"Send Test Newsletter",children:(0,s.jsx)("span",{children:(0,s.jsx)(x.Z,{onClick:()=>{f(!0),N("test")},type:"button",variant:"outlined",className:"mx-2",disabled:y.length<=0,children:"Send Test Newsletter"})})}),(0,s.jsx)(u.Z,{title:y.length<=0?"You need to add atleast 1 news to do this action!":"Send Newsletter",children:(0,s.jsx)("span",{children:(0,s.jsx)(x.Z,{onClick:()=>{f(!0),N("newsletter")},type:"button",className:"mx-2",color:"error",variant:"contained",disabled:y.length<=0,children:"Send Newsletter"})})})]})]})}),(0,s.jsxs)("div",{className:"row justify-content-between",children:[(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("div",{className:"col-6",children:[(0,s.jsx)(i.LB,{sensors:F,collisionDetection:i.pE,onDragEnd:function(e){let{active:a,over:t}=e;t&&a.id!==t.id&&_(e=>{let s=e.findIndex(e=>e.news.id===a.id),n=e.findIndex(e=>e.news.id===t.id);return(0,r.Rp)(e,s,n)})},children:(0,s.jsx)(r.Fo,{items:y.map(e=>e.news.id),strategy:r.qw,children:null==y?void 0:y.map((e,a)=>(0,s.jsx)(cms_SortableListItem,{index:a,item:e,onNewsRemoveHandler:onNewsRemoveHandler},a))})}),j&&(0,s.jsx)(o.g,{})]})}),(0,s.jsx)("div",{className:"row",children:(0,s.jsx)("div",{className:"col-12",children:h&&(0,s.jsx)(createNewsletterForm,{data:h,handlePageChange:e=>{d(e);let temp=async()=>{await b()};temp()},currentPage:t,onAddHandler:onAddHandler,emailNews:y,onRemoveHandler:onNewsRemoveHandler})})})]})]})]}),(0,s.jsx)(p.Z,{open:v,onClose:onModalClose,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,s.jsxs)(g.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"50vw",height:"80vh",overflowY:"auto",bgcolor:"background.paper",border:"2px solid #000",boxShadow:24,p:4},children:[(0,s.jsx)("div",{className:"d-flex justify-content-end",children:(0,s.jsx)("button",{className:"btn btn-light",type:"button",onClick:()=>onModalClose(),children:(0,s.jsx)(icons_XIcon,{})})}),(0,s.jsx)(cms_NewsletterModal,{handleClose:onModalClose,modalType:w,onAddHandler:onAddHandler,emailNews:y})]})})]}):(0,s.jsx)(s.Fragment,{})}},30192:function(e,a){"use strict";let getImageURL=async e=>{e=e.toLowerCase().replace(/[^a-zA-Z0-9]/g," ").split(" ").join("-")+".webp";let{URL:a}=await fetch("/api/aws?key=".concat(e)).then(e=>e.json());return console.log(a),{URL:a,name:e}};a.Z=getImageURL},10840:function(e){e.exports={navbar:"cmsnavbar_navbar__XTb0t",brand:"cmsnavbar_brand__gK64P",logo:"cmsnavbar_logo__IJLqu","navbar-search":"cmsnavbar_navbar-search__56qkO","form-control":"cmsnavbar_form-control___c70X",sidebar:"cmsnavbar_sidebar__7KHM6","nav-link":"cmsnavbar_nav-link__aaBgj",active:"cmsnavbar_active__BBZNW","offcanvas-lg":"cmsnavbar_offcanvas-lg__wIEL0",show:"cmsnavbar_show__TfSDF","offcanvas-header":"cmsnavbar_offcanvas-header__RxWpN","offcanvas-title":"cmsnavbar_offcanvas-title__5nu2A","btn-link":"cmsnavbar_bt
1n-link__7KFzX","navbar-brand":"cmsnavbar_navbar-brand__gDZCu","navbar-nav":"cmsnavbar_navbar-nav__Dnga1","flex-row":"cmsnavbar_flex-row__iK_x7","d-lg-none":"cmsnavbar_d-lg-none__HSvqa"}},47605:function(e){e.exports={loadingContainer:"loading_loadingContainer__dg7Ib",loader:"loading_loader__pJwS6",rotation:"loading_rotation__CEQ5R",loadingText:"loading_loadingText__uOseT",fadeIn:"loading_fadeIn__Ss6hC"}}},function(e){e.O(0,[9774,1664,5675,6976,2734,6312,3511,2692,2888,179],function(){return e(e.s=78884)}),_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.