PageSourceSearch

https://itk.maynd.ir/assets/Step5-Bq1J8lNB.js

js maynd.ir collected 2026-10-01 04:44:38 UTC 4,300 bytes, 1 lines download raw bytes

1import{u as w,g as $,j as e,h as M,F as n,a as E,I as N,C as b,D as v,B as g,S as X,P as C}from"./index-DTrALj7b.js";import{s as a}from"./CreateCustomer.module-ZDu1kDDy.js";function z({back:f,onSubmit:I,isSubmitting:A}){const{register:D,control:t,formState:{errors:l}}=w(),{fields:P,append:R,remove:H}=$({control:t,name:"upsellsDetails"}),{fields:B,append:G,remove:T}=$({control:t,name:"mau"});return e.jsxs(e.Fragment,{children:[P.map((y,s)=>{var u,o,d,i,p,c,m,x,j,r,U,q,k,F,S;return e.jsxs("div",{className:a.upsellCard,children:[e.jsxs("div",{className:a.upsellCardHeader,children:[e.jsxs("strong",{children:[s+1," Upsell"]}),e.jsx("button",{type:"button",className:a.removeIcon,onClick:()=>H(s),children:e.jsx(M,{})})]}),e.jsxs("div",{className:a.upsellGrid,children:[e.jsx(n,{label:"نوع Upsell",error:(d=(o=(u=l.upsellsDetails)==null?void 0:u[s])==null?void 0:o.type)==null?void 0:d.message,children:e.jsx(E,{options:[{value:"",label:"انتخاب کنید"},{value:"Upgrade",label:"Upgrade"},{value:"Cross-sell",label:"Cross-sell"},{value:"Add-on",label:"Add-on"},{value:"Service",label:"Service"}],...D(`upsellsDetails.${s}.type`,{required:"این فیلد اجباری است."})})}),e.jsx(n,{label:"قیمت",error:(c=(p=(i=l.upsellsDetails)==null?void 0:i[s])==null?void 0:p.amount)==null?void 0:c.message,children:e.jsx(N,{type:"number",...D(`upsellsDetails.${s}.amount`,{required:"این فیلد اجباری است",valueAsNumber:!0})})}),e.jsx(n,{label:"مدت زمان",error:(j=(x=(m=l.upsellsDetails)==null?void 0:m[s])==null?void 0:x.duration)==null?void 0:j.message,children:e.jsx(N,{...D(`upsellsDetails.${s}.duration`,{required:"این فیلد اجباری است"})})}),e.jsx(n,{label:"تاریخ شروع",error:(q=(U=(r=l.upsellsDetails)==null?void 0:r[s])==null?void 0:U.startDate)==null?void 0:q.message,children:e.jsx(b,{name:`upsellsDetails.${s}.startDate`,control:t,rules:{required:"این فیلد اجباری است"},render:({field:h})=>e.jsx(v,{selectedDate:h.value,onDateChange:h.onChange})})}),e.jsx(n,{label:"تاریخ پایان",error:(S=(F=(k=l.upsellsDetails)==null?void 0:k[s])==null?void 0:F.endDate)==null?void 0:S.message,children:e.jsx(b,{name:`upsellsDetails.${s}.endDate`,control:t,rules:{required:"این فیلد اجباری است"},render:({field:h})=>e.jsx(v,{selectedDate:h.value,onDateChange:h.onChange})})})]})]},y.id)}),e.jsx(g,{type:"button",variation:"secondary",className:a.buttonAppend,onClick:()=>R({type:"",amount:0,duration:"",startDate:null,endDate:null}),children:"افزودن Upsell"}),B.map((y,s)=>{var u,o,d,i,p,c,m,x,j;return e.jsxs("div",{className:a.upsellCard,children:[e.jsxs("div",{className:a.upsellCardHeader,children:[e.jsxs("strong",{children:[s+1," MAU"]}),e.jsx("button",{type:"button",className:a.removeIcon,onClick:()=>T(s),children:e.jsx(M,{})})]}),e.jsxs("div",{className:a.upsellGrid,children:[e.jsx(n,{label:"مقدار",error:(d=(o=(u=l.mau)==null?void 0:u[s])==null?void 0:o.amount)==null?void 0:d.message,children:e.jsx(N,{type:"number",...D(`mau.${s}.amount`,{required:"این فیلد اجباری است",valueAsNumber:!0})})}),e.jsx(n,{label:"تاریخ شروع",error:(c=(p=(i=l.mau)==null?void 0:i[s])==null?void 0:p.startDate)==null?void 0:c.message,children:e.jsx(b,{name:`mau.${s}.startDate`,control:t,rules:{required:"این فیلد اجباری است"},render:({field:r})=>e.jsx(v,{selectedDate:r.value,onDateChange:r.onChange})})}),e.jsx(n,{label:"تاریخ پایان",error:(j=(x=(m=l.mau)==null?void 0:m[s])==null?void 0:x.endDate)==null?void 0:j.message,children:e.jsx(b,{name:`mau.${s}.endDate`,control:t,rules:{required:"این فیلد اجباری است"},render:({field:r})=>e.jsx(v,{selectedDate:r.value,onDateChange:r.onChange})})})]})]},y.id)}),e.jsx(g,{type:"button",variation:"secondary",className:a.buttonAppend,onClick:()=>G({amount:0,startDate:null,endDate:null}),children:"افزودن MAU"}),e.jsxs("div",{className:a.nextPrev,style:{display:"flex",gap:8},children:[e.jsx(g,{type:"button",variation:"secondary",onClick:f,children:"قبلی"}),e.jsx(g,{type:"button",disabled:A,onClick:I,children:A?e.jsx(X,{}):"ثبت نهایی"})]})]})}z.propTypes={back:C.func.isRequired,onSubmit:C.func.isRequired,isSubmitting:C.bool,previousFiles:C.array};export{z as default};

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.