1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7025],{21774:function(e,t,n){"use strict";var i=n(62227);t.Z=(0,i.D)("Icon24Delete","delete_24","0 0 24 24",'<symbol viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" id="delete_24"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><path d="M8.5 21h7a2.5 2.5 0 0 0 2.5-2.5V7H6v11.5A2.5 2.5 0 0 0 8.5 21Zm.268-17A2 2 0 0 1 10.5 3h3a2 2 0 0 1 1.732 1H18a1 1 0 0 1 1 1v.75a.25.25 0 0 1-.25.25H5.25A.25.25 0 0 1 5 5.75V5a1 1 0 0 1 1-1h2.768Z" fill="currentColor" fill-rule="nonzero" /></g></symbol>',24,24,!1,void 0)},92564:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/add-campaign",function(){return n(74499)}])},28660:function(e,t,n){"use strict";var i=n(85893),o=n(25425),l=n(67294);let s=(0,l.forwardRef)(function(e,t){return(0,i.jsx)(o.Z,{direction:"up",ref:t,...e})});t.Z=s},84402:function(e,t,n){"use strict";n.d(t,{_:function(){return d},v:function(){return c}});var i=n(85893),o=n(95537),l=n(81719),s=n(1890),r=n(77745),a=n(80562),u=n(76711);let d=(0,l.ZP)(s.Z)(e=>{let{theme:t}=e;return{"& .MuiDialogContent-root":{padding:t.spacing(2),backgroundColor:u.ZP.white},"& .MuiDialogActions-root":{padding:t.spacing(2)}}});function c(e){let{children:t,onClose:n,...l}=e;return(0,i.jsxs)(r.Z,{sx:{m:0,p:0},...l,children:[t,(0,i.jsx)(a.Z,{onClick:null==e?void 0:e.onClose,sx:{border:"0.3px solid ".concat(u.ZP.black3)},children:(0,i.jsx)(o.Z,{})})]})}},53103:function(e,t,n){"use strict";var i=n(85893),o=n(95398),l=n(76779),s=n(26993),r=n(67294),a=n(76711),u=n(58775),d=n(24020),c=n(84402),p=n(28660);let x=()=>{let[e,t]=(0,r.useState)(!1),n=()=>{t(!0)},x=()=>{t(!1)};return(0,r.useEffect)(()=>{d.Z.on(u.z.OPEN_BUY_PREMIUM_PLAN_MODAL,n)},[]),(0,i.jsxs)(c._,{onClose:x,open:e,TransitionComponent:p.Z,PaperProps:{sx:{background:a.ZP.white,width:{xs:"calc(100vw - 32px)",md:"500px"},margin:0}},children:[(0,i.jsx)(c.v,{onClose:x,id:"dialog-title",sx:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:2,fontSize:{xs:"1rem",sm:"1.25rem"},fontWeight:"bold",color:a.ZP.black1},children:'Upgrade to Unlock "Draft with AI"'}),(0,i.jsxs)(o.Z,{sx:{background:a.ZP.white},children:[(0,i.jsx)("p",{children:'We\'re excited to introduce our new "Draft with AI" feature to enhance your experience. This premium feature allows you to leverage advanced AI capabilities for drafting content effortlessly.'}),(0,i.jsxs)("p",{children:[(0,i.jsx)("strong",{children:"Upgrade Now to Unlock:"}),(0,i.jsx)("br",{}),"- AI-assisted drafting",(0,i.jsx)("br",{}),"- Enhanced writing suggestions",(0,i.jsx)("br",{}),"- Priority access to new features"]})]}),(0,i.jsx)(l.Z,{children:(0,i.jsx)(s.Z,{color:"error",onClick:x,children:"Close"})})]})};t.Z=x},89696:function(e,t,n){"use strict";var i=n(85893),o=n(95398),l=n(30120),s=n(22841),r=n(70745),a=n(31538),u=n(54181),d=n(9144),c=n(29630),p=n(80562),x=n(26993),h=n(32631),_=n(76779),f=n(21774),m=n(82175),g=n(67294),v=n(74231),Z=n(76711),j=n(58775),b=n(16295),E=n(24020),w=n(28660),C=n(84402);let y=()=>{let[e,t]=(0,g.useState)(!1),[n,y]=(0,g.useState)(!1),I=(0,m.TA)({initialValues:{id:"",pos:"",question:"",question_type:b.Nb.TEXT,multiple_choice_answer_list_string:"",is_mandatory:!0,options:[]},validationSchema:v.Ry({question:v.Z_().max(1024,"Question should be less than 1024 characters.").required("Enter your question."),question_type:v.Z_().required("Please select question type."),options:v.IX().when("question_type",{is:e=>e===b.Nb.MULTIPLE_CHOICE,then:v.IX().min(2,"Add atleast two options.").max(10,"Cannot add more than 10 options.").required("Please add options."),otherwise:v.IX()})}),async onSubmit(e){if(L===b.Nb.BOOLEAN)e.multiple_choice_answer_list_string=JSON.stringify(["Yes","No"]);else if(L===b.Nb.FILE_UPLOAD||L===b.Nb.TEXT)delete e.multiple_choice_answer_list_string;else if(L===b.Nb.MULTIPLE_CHOICE){let t=!1;if(q.forEach(e=>{(null==e?void 0:e.text)===0&&(t=!0)}),t)return;e.multiple_choice_answer_list_string=JSON.stringify(q.filter(e=>null==e?void 0:e.text)),delete e.options}n?E.Z.emit(j.z.UPDATE_QUESTION_TO_CAMPAIGN_QUESTION_FORM,{formData:e}):E.Z.emit(j.z.ADD_QUESTION_TO_CAMPAIGN_QUESTION_FORM,{formData:e}),R(),P()}}),P=()=>{t(!1),R()},T=e=>{t(!0),void 0!==e?y(!0):y(!1),X("question",(null==e?void 0:e.question)||""),X("is_mandatory",(null==e?void 0:e.is_mandatory)||!0),X("question_type",(null==e?void 0:e.question_type)||b.Nb.TEXT),X("id",null==e?void 0:e.id),X("pos",null==e?void 0:e.pos),(null==e?void 0:e.multiple_choice_answer_list_string)&&X("options",[...JSON.parse(null==e?void 0:e.multiple_choice_answer_list_string)])};(0,g.useEffect)(()=>{E.Z.on(j.z.OPEN_CAMPAIGN_QUESTIONNAIRE_MODAL,T)},[]);let A=()=>{X("options",[...q,{text:""}])},N=e=>()=>
1{X("options",[...q.filter((t,n)=>e!==n)])},{values:{id:O,question:k,question_type:L,options:q,is_mandatory:S},handleBlur:U,handleChange:M,handleSubmit:D,resetForm:R,errors:B,touched:F,setFieldValue:X}=I,H=L===b.Nb.MULTIPLE_CHOICE;return(0,i.jsxs)(C._,{onClose:P,open:e,TransitionComponent:w.Z,PaperProps:{sx:{background:Z.ZP.white,width:{xs:"calc(100vw - 32px)",md:"500px"},margin:0}},children:[(0,i.jsxs)(C.v,{onClose:P,id:"dialog-title",sx:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:2,fontSize:{xs:"1rem",sm:"1.25rem"},fontWeight:"bold",color:Z.ZP.black1},children:[n?"Edit":"Add"," Question"]}),(0,i.jsx)(o.Z,{sx:{background:Z.ZP.white},children:(0,i.jsxs)(l.Z,{component:"form",onSubmit:I.handleSubmit,noValidate:!0,children:[(0,i.jsx)(s.Z,{control:(0,i.jsx)(r.Z,{fullWidth:!0,select:!0,id:"question-type-select",value:L,onChange(e){M(e),X("options",[])},onBlur:U,error:Boolean(F.question_type&&B.question_type),helperText:F.question_type&&B.question_type,variant:"outlined",name:"question_type",children:b.g8.map((e,t)=>(0,i.jsx)(a.Z,{value:e.value,children:e.key},"option-".concat(t)))}),label:"Question Type*",labelPlacement:"top",sx:{alignItems:"flex-start",width:"100%",mx:0,gap:1,mb:2}}),(0,i.jsx)(s.Z,{control:(0,i.jsx)(u.Z,{checked:S,onChange:M,name:"is_mandatory",onBlur:U}),label:"Required*",labelPlacement:"start",sx:{alignItems:"center",justifyContent:"space-between",width:"100%",mx:0,gap:1,mb:2}}),(0,i.jsx)(s.Z,{control:(0,i.jsx)(r.Z,{multiline:!0,minRows:2,placeholder:"Add your question.",sx:{whiteSpace:"pre-line"},variant:"outlined",name:"question",value:k,onChange:M,fullWidth:!0,error:Boolean((null==F?void 0:F.question)&&B.question),helperText:(null==F?void 0:F.question)&&B.question,onBlur:U}),label:"Question Text*",labelPlacement:"top",sx:{alignItems:"flex-start",width:"100%",mx:0,gap:1,mb:2}}),H&&(0,i.jsxs)(d.Z,{children:[(0,i.jsx)(c.Z,{children:"Please add options:"}),(0,i.jsx)(d.Z,{direction:"column",sx:{gap:2},children:q.map((e,t)=>{let n=null==e||!e.text;return(0,i.jsxs)(d.Z,{direction:"row",sx:{justifyContent:"space-between",alignItems:"flex-start",gap:1},children:[(0,i.jsx)(r.Z,{placeholder:"Enter option text",sx:{whiteSpace:"pre-line"},variant:"outlined",name:"optionText",value:null==e?void 0:e.text,onChange(e){X("options",[...q.map((n,i)=>{if(i===t){var o;return{text:null==e?void 0:null===(o=e.target)||void 0===o?void 0:o.value}}return n})])},error:n,helperText:n?"Enter option text":"",fullWidth:!0}),(0,i.jsx)(p.Z,{onClick:N(t),children:(0,i.jsx)(f.Z,{})})]},t)})}),(0,i.jsx)(x.Z,{onClick:A,variant:"outlined",sx:{mt:2,textTransform:"capitalize"},children:"Add row"}),H&&(null==B?void 0:B.options)&&(0,i.jsx)(h.Z,{sx:{color:"#d32f2f"},children:null==B?void 0:B.options})]})]})}),(0,i.jsxs)(_.Z,{children:[(0,i.jsx)(x.Z,{color:"error",onClick:P,children:"Close"}),(0,i.jsx)(x.Z,{type:"submit",variant:"contained",onClick:D,children:"Save"})]})]})};t.Z=y},16295:function(e,t,n){"use strict";var i,o;n.d(t,{GX:function(){return s},Nb:function(){return i},g8:function(){return l}}),(o=i||(i={})).BOOLEAN="BOOLEAN",o.TEXT="TEXT",o.MULTIPLE_CHOICE="MULTIPLE_CHOICE",o.FILE_UPLOAD="FILE_UPLOAD";let l=[{value:"BOOLEAN",key:"Boolean"},{value:"TEXT",key:"Text"},{value:"MULTIPLE_CHOICE",key:"Multiple Choice"},{value:"FILE_UPLOAD",key:"File Upload"}],s={};l.forEach(e=>s[null==e?void 0:e.value]=e.key)},74499:function(e,t,n){"use strict";n.r(t);var i=n(85893),o=n(5152),l=n.n(o),s=n(9008),r=n.n(s),a=n(67294),u=n(76270),d=n(36343),c=n(69972),p=n(89696),x=n(74252),h=n(58620),_=n(83289),f=n(15606),m=n(53103);let g=l()(()=>Promise.all([n.e(9072),n.e(7808),n.e(5292),n.e(7836),n.e(6322),n.e(7660),n.e(1839),n.e(5782),n.e(1215)]).then(n.bind(n,87371)),{loadableGenerated:{webpack:()=>[87371]},loading:()=>(0,i.jsx)(d.Z,{fullScreen:!0})}),v=l()(()=>n.e(9820).then(n.bind(n,79820)),{loadableGenerated:{webpack:()=>[79820]},loading:()=>(0,i.jsx)(d.Z,{fullScreen:!0})}),Z=()=>{let{user_type:e}=(0,a.useContext)(_.V),t=(0,i.jsx)(d.Z,{fullScreen:!0});switch(e){case f.F.ADMIN:case f.F.SUPER_ADMIN:t=(0,i.jsx)(v,{});break;case f.F.ADVERTISER:t=(0,i.jsx)(g,{});break;case f.F.CREATOR:t=(0,i.jsx)(v,{})}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsx)("title",{children:"Add Campaign"})}),t,(0,i.jsx)(p.Z,{}),(0,i.jsx)(m.Z,{})]})};Z.getLayout=e=>(0,i.jsx)(u.Z,{navbar:(0,i.jsx)(x.Z,{}),sidebar:(0,i.jsx)(h.Z,{}),footer:(0,i.jsx)(c.Z,{}),children:e}),t.default=Z}},function(e){e.O(0,[2019,8981,1664,8094,9803,8100,9515,7043,4398,881,3050,7584,3664,1674,844,6945,9774,2888,179],function(){return e(e.s=92564)}),_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.